Files
stackalytics/dashboard/templates/_macros/contribution_summary.html
pkholkin ceca8a18d3 Added new metrics "bug_filed" and "bug_resolved"
implements bp metric-bugs

Added new metrics 'bugs' by companies and users
Bugs are retrieved using launchpad-api
Bugs are shown in UI as other metrics as commits, emails, etc.

Change-Id: Ia9d9d8ca2fcbbe0fa257d90585ab1c56403f2419
2014-06-13 13:39:40 +04:00

47 lines
1.6 KiB
HTML

{% macro show_contribution_summary(user_id=None, company=None, show_all=True) -%}
<script type="text/javascript">
function load_contribution_summary(extra_options) {
$.ajax({
url: makeURI("/api/1.0/contribution", extra_options),
dataType: "json",
success: function (data) {
$("#contribution_template").tmpl(data["contribution"]).appendTo("#contribution_container");
}
});
}
$(document).ready(function () {
var uri_options = {};
{% if show_all %}
uri_options = {project_type: "all", release: "all", metric: "all"};
{% endif %}
{% if user_id %}
uri_options["user_id"] = "{{ user_id }}";
{% endif %}
{% if company %}
uri_options["company"] = "{{ company|safe }}";
{% endif %}
load_contribution_summary(uri_options);
});
</script>
<script id="contribution_template" type="text/x-jquery-tmpl">
{% raw %}
<div>Total commits: <b>${commit_count}</b></div>
<div>Total LOC: <b>${loc}</b></div>
<div>Review stat (-2, -1, +1, +2, A): <b>${marks["-2"]}, ${marks["-1"]}, ${marks["1"]}, ${marks["2"]}, ${marks["A"]}</b></div>
<div>Draft Blueprints: <b>${drafted_blueprint_count}</b></div>
<div>Completed Blueprints: <b>${completed_blueprint_count}</b></div>
<div>Filed Bugs: <b>${filed_bug_count}</b></div>
<div>Resolved Bugs: <b>${resolved_bug_count}</b></div>
<div>Emails: <b>${email_count}</b></div>
{% endraw %}
</script>
<h2>Contribution Summary</h2>
<div id="contribution_container"></div>
{%- endmacro %}