diff --git a/dashboard/static/css/style.css b/dashboard/static/css/style.css index 6230ac66b..ab341a0b2 100644 --- a/dashboard/static/css/style.css +++ b/dashboard/static/css/style.css @@ -307,3 +307,7 @@ a[href^="https://launchpad"]:after { .importanceUndecided, .importanceUndecided a { color: #999999; } + +.select2-results { + max-height: 300px; +} diff --git a/dashboard/static/js/stackalytics-ui.js b/dashboard/static/js/stackalytics-ui.js index 423a680f6..95a60658c 100644 --- a/dashboard/static/js/stackalytics-ui.js +++ b/dashboard/static/js/stackalytics-ui.js @@ -83,12 +83,12 @@ function renderTimeline(options) { }); } -function renderTableAndChart(url, container_id, table_id, chart_id, link_param, options) { +function renderTableAndChart(url, container_id, table_id, chart_id, link_param, table_column_names) { $(document).ready(function () { $.ajax({ - url: make_uri(url, options), + url: make_uri(url), dataType: "json", success: function (data) { @@ -99,7 +99,6 @@ function renderTableAndChart(url, container_id, table_id, chart_id, link_param, var aggregate = 0; var index = 1; var i; - var hasComment = false; data = data["stats"]; @@ -121,18 +120,15 @@ function renderTableAndChart(url, container_id, table_id, chart_id, link_param, } else { index++; } - var link; - if (data[i].id) { - link = make_link(data[i].id, data[i].name, link_param); - } else { - link = data[i].name + if (!data[i].link) { + if (data[i].id) { + data[i]["link"] = make_link(data[i].id, data[i].name, link_param); + } else { + data[i]["link"] = data[i].name + } } - var rec = {"index": index_label, "link": link, "metric": data[i].metric}; - if (data[i].comment) { - rec["comment"] = data[i].comment; - hasComment = true; - } - tableData.push(rec); + data[i]["index"] = index_label; + tableData.push(data[i]); } if (i == limit) { @@ -141,26 +137,29 @@ function renderTableAndChart(url, container_id, table_id, chart_id, link_param, chartData.push(["others", aggregate]); } - var tableColumns = [ - { "mData": "index" }, - { "mData": "link" }, - { "mData": "metric" } - ]; - if (hasComment) { - tableColumns.push({ "mData": "comment"}) + if (!table_column_names) { + table_column_names = ["index", "link", "metric"]; + } + var tableColumns = []; + var sort_by_column = 0; + for (i = 0; i < table_column_names.length; i++) { + tableColumns.push({"mData": table_column_names[i]}) + if (table_column_names[i] == "metric") { + sort_by_column = i; + } } if (table_id) { $("#" + table_id).dataTable({ "aLengthMenu": [ - [25, 50, -1], - [25, 50, "All"] + [10, 25, 50, -1], + [10, 25, 50, "All"] ], "aaSorting": [ - [ 2, "desc" ] + [ sort_by_column, "desc" ] ], "sPaginationType": "full_numbers", - "iDisplayLength": 25, + "iDisplayLength": 10, "aaData": tableData, "aoColumns": tableColumns }); diff --git a/dashboard/templates/layout.html b/dashboard/templates/layout.html index 76c34c7cf..266d9b209 100644 --- a/dashboard/templates/layout.html +++ b/dashboard/templates/layout.html @@ -19,10 +19,10 @@ - + diff --git a/dashboard/templates/overview.html b/dashboard/templates/overview.html index e2e76a33f..315139370 100644 --- a/dashboard/templates/overview.html +++ b/dashboard/templates/overview.html @@ -2,7 +2,7 @@ {% set show_company_breakdown = (not company) and (not user_id) %} {% set show_engineer_breakdown = (not user_id) %} -{% set show_bp_breakdown = (module) and (not user_id) and (metric == 'bpd!') %} +{% set show_bp_breakdown = (metric in ['bpd', 'bpc']) %} {% set show_module_breakdown = (not module) %} {% set show_user_activity = (user_id) %} {% set show_module_activity = (module) and (not user_id) %} @@ -12,6 +12,7 @@ {% set show_contribution = (show_user_contribution) or (show_module_contribution) %} {% set show_user_profile = (user_id) %} {% set show_top_mentors_options = (metric == 'tm_marks') %} +{% set show_review_ratio = (metric in ['marks', 'tm_marks']) %} {% block scripts %}
- +