diff --git a/dashboard/templates/_macros/user_profile.html b/dashboard/templates/_macros/user_profile.html new file mode 100644 index 000000000..159706b75 --- /dev/null +++ b/dashboard/templates/_macros/user_profile.html @@ -0,0 +1,47 @@ +{% macro show_user_profile(user_id) -%} + + + + + +
+ +{%- endmacro %} diff --git a/dashboard/templates/overview.html b/dashboard/templates/overview.html index af77af705..d5dea874e 100644 --- a/dashboard/templates/overview.html +++ b/dashboard/templates/overview.html @@ -1,6 +1,7 @@ {% extends "layout.html" %} {% import '_macros/activity_log.html' as activity_log %} {% import '_macros/contribution_summary.html' as contribution_summary %} +{% import '_macros/user_profile.html' as user_profile %} {% set show_company_breakdown = (not company) and (not user_id) %} {% set show_engineer_breakdown = (not user_id) %} @@ -53,37 +54,6 @@ renderTableAndChart("/api/1.0/stats/modules", "module_container", "module_table", "module_chart", "module"); {% endif %} - {% if show_user_profile %} - $(document).ready(function () { - $.ajax({ - url: make_uri("/api/1.0/users/{{ user_id }}"), - dataType: "json", - success: function (data) { - $("#user_profile_template").tmpl(data["user"]).appendTo("#user_profile_container"); - } - }); - }); - {% endif %} - - - -{# Templates #} - {% endblock %} @@ -175,7 +145,7 @@ {% endif %} {% if show_user_profile %} -
+ {{ user_profile.show_user_profile(user_id=user_id) }} {% endif %} {% if show_user_activity %} {{ activity_log.show_activity_log(gravatar_size=32, show_all=False) }} diff --git a/dashboard/templates/reports/user_activity.html b/dashboard/templates/reports/user_activity.html index b117376b7..cb6b60e6a 100644 --- a/dashboard/templates/reports/user_activity.html +++ b/dashboard/templates/reports/user_activity.html @@ -1,6 +1,7 @@ {% extends "reports/base_report.html" %} {% import '_macros/activity_log.html' as activity_log %} {% import '_macros/contribution_summary.html' as contribution_summary %} +{% import '_macros/user_profile.html' as user_profile %} {% block title %} {{ user.user_name }} activity in OpenStack @@ -17,20 +18,7 @@ {% block content %}

{{ user.user_name }} activity report

-

Profile

- - +{{ user_profile.show_user_profile(user_id=user.user_id) }} {{ contribution_summary.show_contribution_summary(user_id=user.user_id) }}