Commit 8aaa299b authored by Michal Čihař's avatar Michal Čihař

Move reports to component view

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent a0bae2a8
......@@ -16,6 +16,7 @@
{% can_see_repository_status user object.project as user_can_see_repository_status %}
{% can_commit_translation user object.project as user_can_commit_translation %}
{% can_manage_acl user object.project as user_can_manage_acl %}
{% can_view_reports user object.project as user_can_view_reports %}
{% include "show-lock.html" %}
......@@ -39,6 +40,9 @@
{% if user_can_manage_acl %}
<li><a href="{{ object.project.get_absolute_url }}#acl">{% trans "Manage users" %}</a></li>
{% endif %}
{% if user_can_view_reports %}
<li><a href="#reports" data-toggle="tab">{% trans "Translation reports" %}</a></li>
{% endif %}
</ul>
</li>
{% if enable_sharing %}
......@@ -140,6 +144,43 @@
</div>
{% endif %}
{% if user_can_view_reports %}
<div class="tab-pane" id="reports">
<div class="row">
<div class="col-lg-6">
<form action="{% url 'credits' project=object.project.slug subproject=object.slug %}" method="post" enctype="multipart/form-data">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Credits" %}</h4></div>
<div class="panel-body">
<p>{% trans "Credits list all translators who have contributed to this component in given time period. It can be useful for including in your documentation or application to thanks to translators." %}</p>
{% csrf_token %}
{{ reports_form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans "Generate" %}" class="btn btn-default" />
</div>
</div>
</form>
</div>
<div class="col-lg-6">
<form action="{% url 'counts' project=object.project.slug subproject=object.slug %}" method="post" enctype="multipart/form-data">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Contributor stats" %}</h4></div>
<div class="panel-body">
<p>{% trans "Reports number of strings and words translated by each translator." %}</p>
{% csrf_token %}
{{ reports_form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans "Generate" %}" class="btn btn-default" />
</div>
</div>
</form>
</div>
</div>
</div>
{% endif %}
</div>
......
......@@ -16,7 +16,6 @@
{% block content %}
{% can_see_repository_status user object.subproject.project as user_can_see_repository_status %}
{% can_commit_translation user object.subproject.project as user_can_commit_translation %}
{% can_view_reports user object.subproject.project as user_can_view_reports %}
{% include "show-lock.html" %}
......@@ -56,9 +55,6 @@
{% if autoform %}
<li><a href="#auto" data-toggle="tab">{% trans "Automatic translation" %}</a></li>
{% endif %}
{% if user_can_view_reports %}
<li><a href="#reports" data-toggle="tab">{% trans "Translation reports" %}</a></li>
{% endif %}
</ul>
</li>
{% if enable_sharing %}
......@@ -192,43 +188,6 @@
</div>
{% endif %}
{% if user_can_view_reports %}
<div class="tab-pane" id="reports">
<div class="row">
<div class="col-lg-6">
<form action="{% url 'credits' project=object.subproject.project.slug subproject=object.subproject.slug %}" method="post" enctype="multipart/form-data">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Credits" %}</h4></div>
<div class="panel-body">
<p>{% trans "Credits list all translators who have contributed to this component in given time period. It can be useful for including in your documentation or application to thanks to translators." %}</p>
{% csrf_token %}
{{ reports_form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans "Generate" %}" class="btn btn-default" />
</div>
</div>
</form>
</div>
<div class="col-lg-6">
<form action="{% url 'counts' project=object.subproject.project.slug subproject=object.subproject.slug %}" method="post" enctype="multipart/form-data">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Contributor stats" %}</h4></div>
<div class="panel-body">
<p>{% trans "Reports number of strings and words translated by each translator." %}</p>
{% csrf_token %}
{{ reports_form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans "Generate" %}" class="btn btn-default" />
</div>
</div>
</form>
</div>
</div>
</div>
{% endif %}
{% if perms.trans.upload_translation %}
<div class="tab-pane" id="upload">
<form action="{% url 'upload_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}" method="post" enctype="multipart/form-data">
......
......@@ -263,6 +263,7 @@ def show_subproject(request, project, subproject):
'project': obj.project,
'translations': obj.translation_set.enabled(),
'show_language': 1,
'reports_form': ReportsForm(),
'last_changes': last_changes,
'last_changes_url': urlencode(
{'subproject': obj.slug, 'project': obj.project.slug}
......@@ -314,7 +315,6 @@ def show_translation(request, project, subproject, lang):
'search_form': search_form,
'review_form': review_form,
'last_changes': last_changes,
'reports_form': ReportsForm(),
'last_changes_url': urlencode(obj.get_kwargs()),
'show_only_component': True,
'other_translations': Translation.objects.filter(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment