From e8cfd2a52777f0a93c7e5930e4ec03b695de0613 Mon Sep 17 00:00:00 2001 From: Ilya Shakhat Date: Thu, 15 Aug 2013 15:25:27 +0400 Subject: [PATCH] Added more details into review record Change-Id: I0ea99bf132869d9a827d377411c9e2548d52aa12 --- dashboard/static/css/style.css | 4 ++++ dashboard/templates/layout.html | 7 ++++++- dashboard/templates/overview.html | 27 ++++++++++++++++++--------- dashboard/web.py | 4 ++-- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/dashboard/static/css/style.css b/dashboard/static/css/style.css index a503c963e..9b31da065 100644 --- a/dashboard/static/css/style.css +++ b/dashboard/static/css/style.css @@ -208,6 +208,10 @@ a[href^="https://launchpad"]:after { font-size: 9pt; } +.review_mark { + font-weight: bold; +} + /* MIRANTIS CSS*/ #miraheader { diff --git a/dashboard/templates/layout.html b/dashboard/templates/layout.html index 27fa7068f..b74e0ac97 100644 --- a/dashboard/templates/layout.html +++ b/dashboard/templates/layout.html @@ -101,7 +101,7 @@ }); } - function chartAndTableRenderer(url, table_id, chart_id, link_param, options) { + function chartAndTableRenderer(url, container_id, table_id, chart_id, link_param, options) { $(document).ready(function () { @@ -119,6 +119,11 @@ var i; var hasComment = false; + if (data.length == 0) { + $("#" + container_id).hide(); + return; + } + for (i = 0; i < data.length; i++) { if (i < limit - 1) { chartData.push([data[i].name, data[i].metric]); diff --git a/dashboard/templates/overview.html b/dashboard/templates/overview.html index d1a53aaa6..5b01db0ef 100644 --- a/dashboard/templates/overview.html +++ b/dashboard/templates/overview.html @@ -15,13 +15,13 @@ timelineRenderer(); {% if show_company_breakdown %} - chartAndTableRenderer("/data/companies", "company_table", "company_chart", "company"); + chartAndTableRenderer("/data/companies", "company_container", "company_table", "company_chart", "company"); {% endif %} {% if show_engineer_breakdown %} - chartAndTableRenderer("/data/engineers", "engineer_table", "engineer_chart", "user_id", {company: "{{ company|encode }}" }); + chartAndTableRenderer("/data/engineers", "engineer_container", "engineer_table", "engineer_chart", "user_id", {company: "{{ company|encode }}" }); {% endif %} {% if show_module_breakdown %} - chartAndTableRenderer("/data/modules", "module_table", "module_chart", "module"); + chartAndTableRenderer("/data/modules", "module_container", "module_table", "module_chart", "module"); {% endif %} {% if show_activity %} @@ -37,6 +37,9 @@ if (data["activity"].length < page_size) { $('#activity_more').hide(); } + if ((start_record == 0) && (data["activity"].length == 0)) { + $('#activity_header').hide(); + } {% if metric == 'marks' %} $("#review_activity_template").tmpl(data["activity"]).appendTo("#activity_container"); {% else %} @@ -99,7 +102,7 @@
${subject}
{%html message %}
+${lines_added} - - ${lines_deleted}
+ - ${lines_deleted} {% endraw %} @@ -111,12 +114,13 @@
{%html author_link %} ({%html company_link %})
-
${date_str} to ${module}
+
${date_str} in ${module}
+
Patch submitted by {%html parent_author_link %}
${subject}
Change Id: ${review_id}
-
Review mark: ${value}
+
${description}: ${value}
{% endraw %} @@ -167,6 +171,7 @@
Total commits: ${commit_count}
Total LOC: ${loc}
+
Review stat (-2, -1, +1, +2): ${marks["-2"]}, ${marks["-1"]}, ${marks["1"]}, ${marks["2"]}
{% endraw %} @@ -175,6 +180,7 @@ {% block left_frame %} {% if show_company_breakdown %} +

Contribution by companies

@@ -191,10 +197,11 @@
+
{% endif %} {% if show_engineer_breakdown %} - +

Contribution by engineers

@@ -214,14 +221,14 @@
- +
{% endif %} {% if show_user_profile %}
{% endif %} {% if show_user_activity %} -

Activity log

+

Activity log

@@ -236,6 +243,7 @@ {% block right_frame %} {% if show_module_breakdown %} +

Contribution by modules

@@ -252,6 +260,7 @@
+
{% endif %} {% if show_user_activity %} diff --git a/dashboard/web.py b/dashboard/web.py index 484ce4a94..e2a0f1453 100644 --- a/dashboard/web.py +++ b/dashboard/web.py @@ -584,12 +584,12 @@ def get_activity_json(records): if parent: review['subject'] = parent['subject'] review['url'] = parent['url'] + review['parent_author_link'] = make_link( + parent['author_name'], '/', {'user_id': parent['user_id']}) extend_record(review) result.append(review) result.sort(key=lambda x: x['date'], reverse=True) - if start_record < 0: - start_record += len(result) return json.dumps({'activity': result[start_record:start_record + page_size]})