Ilya Shakhat b0c0791e73 Track abandon actions as reviews
Record of type 'mark' is created when reviewer abandons someone else's
change requests. The stats on such marks is included into review stats

Change-Id: I44955c72326c95bbf421ea47b177972e06aa6ca2
Closes-Bug: #1498769
2015-10-12 17:52:00 +03:00

58 lines
1.9 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>Commits: <b>${commit_count}</b></div>
<div>LOCs: <b>${loc}</b></div>
<div>Do not merge (-2): <b>${marks["-2"]}</b>
<div>Patch needs further work (-1): <b>${marks["-1"]}</b>
<div>Looks good (+1): <b>${marks["1"]}</b>
<div>Looks good for core (+2): <b>${marks["2"]}</b>
<div>Approve: <b>${marks["A"]}</b>
<div>Abandon: <b>${marks["x"]}</b>
<div>Change Requests: <b>${change_request_count}</b>
{%if abandoned_change_requests_count > 0 %}
<span>(${abandoned_change_requests_count} of them abandoned)</span>
{%/if%}
</div>
<div>Patch Sets: <b>${patch_set_count}</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 %}