Commit fc9f191c authored by Michal Čihař's avatar Michal Čihař

Use new helper for accessing repository status

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 9052a6fe
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load translations %} {% load translations %}
{% load permissions %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block breadcrumbs %} {% block breadcrumbs %}
...@@ -12,6 +13,9 @@ ...@@ -12,6 +13,9 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% can_see_repository_status user object as user_can_see_repository_status %}
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li class="active"><a href="#overview" data-toggle="tab">{% trans "Overview" %}</a></li> <li class="active"><a href="#overview" data-toggle="tab">{% trans "Overview" %}</a></li>
<li><a href="#history" data-toggle="tab">{% trans "History" %}</a></li> <li><a href="#history" data-toggle="tab">{% trans "History" %}</a></li>
...@@ -25,7 +29,7 @@ ...@@ -25,7 +29,7 @@
{% if perms.trans.commit_translation %} {% if perms.trans.commit_translation %}
<li><a href="{{ object.get_commit_url }}">{% trans "Commit" %}</a></li> <li><a href="{{ object.get_commit_url }}">{% trans "Commit" %}</a></li>
{% endif %} {% endif %}
{% if perms.trans.commit_translation or perms.trans.update_translation %} {% if user_can_see_repository_status %}
<li><a href="#repository" data-toggle="tab" data-href="{% url 'git_status_project' project=object.slug %}">{% trans "Repository maintenance" %}</a></li> <li><a href="#repository" data-toggle="tab" data-href="{% url 'git_status_project' project=object.slug %}">{% trans "Repository maintenance" %}</a></li>
{% endif %} {% endif %}
<li><a href="{% url 'checks' %}?project={{ object.slug }}">{% trans "Failing checks" %}</a></li> <li><a href="{% url 'checks' %}?project={{ object.slug }}">{% trans "Failing checks" %}</a></li>
...@@ -131,7 +135,7 @@ ...@@ -131,7 +135,7 @@
{% include "activity-tab.html" %} {% include "activity-tab.html" %}
{% if perms.trans.commit_translation or perms.trans.update_translation %} {% if user_can_see_repository_status %}
<div class="tab-pane" id="repository"> <div class="tab-pane" id="repository">
<p>{% trans "Loading…" %}</p> <p>{% trans "Loading…" %}</p>
</div> </div>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load permissions %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block breadcrumbs %} {% block breadcrumbs %}
...@@ -12,6 +13,8 @@ ...@@ -12,6 +13,8 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% can_see_repository_status user object.project as user_can_see_repository_status %}
{% include "show-lock.html" %} {% include "show-lock.html" %}
<ul class="nav nav-pills"> <ul class="nav nav-pills">
...@@ -27,7 +30,7 @@ ...@@ -27,7 +30,7 @@
{% if perms.trans.commit_translation %} {% if perms.trans.commit_translation %}
<li><a href="{{ object.get_commit_url }}">{% trans "Commit" %}</a></li> <li><a href="{{ object.get_commit_url }}">{% trans "Commit" %}</a></li>
{% endif %} {% endif %}
{% if perms.trans.commit_translation or perms.trans.update_translation %} {% if user_can_see_repository_status %}
<li><a href="#repository" data-toggle="tab" data-href="{% url 'git_status_subproject' project=object.project.slug subproject=object.slug %}">{% trans "Repository maintenance" %}</a></li> <li><a href="#repository" data-toggle="tab" data-href="{% url 'git_status_subproject' project=object.project.slug subproject=object.slug %}">{% trans "Repository maintenance" %}</a></li>
{% endif %} {% endif %}
<li><a href="{% url 'show_source' project=object.project.slug subproject=object.slug %}">{% trans "Source strings review" %}</a></li> <li><a href="{% url 'show_source' project=object.project.slug subproject=object.slug %}">{% trans "Source strings review" %}</a></li>
...@@ -118,7 +121,7 @@ ...@@ -118,7 +121,7 @@
{% include "activity-tab.html" %} {% include "activity-tab.html" %}
{% if perms.trans.commit_translation or perms.trans.update_translation %} {% if user_can_see_repository_status %}
<div class="tab-pane" id="repository"> <div class="tab-pane" id="repository">
<p>{% trans "Loading…" %}</p> <p>{% trans "Loading…" %}</p>
</div> </div>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load translations %} {% load translations %}
{% load permissions %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% load i18n %} {% load i18n %}
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% can_see_repository_status user object.subproject.project as user_can_see_repository_status %}
{% include "show-lock.html" %} {% include "show-lock.html" %}
...@@ -46,7 +48,7 @@ ...@@ -46,7 +48,7 @@
{% if perms.trans.commit_translation %} {% if perms.trans.commit_translation %}
<li><a href="{{ object.get_commit_url }}">{% trans "Commit" %}</a></li> <li><a href="{{ object.get_commit_url }}">{% trans "Commit" %}</a></li>
{% endif %} {% endif %}
{% if perms.trans.commit_translation or perms.trans.update_translation %} {% if user_can_see_repository_status %}
<li><a href="#repository" data-toggle="tab" data-href="{% url 'git_status_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}">{% trans "Repository maintenance" %}</a></li> <li><a href="#repository" data-toggle="tab" data-href="{% url 'git_status_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}">{% trans "Repository maintenance" %}</a></li>
{% endif %} {% endif %}
{% if autoform %} {% if autoform %}
...@@ -208,7 +210,7 @@ ...@@ -208,7 +210,7 @@
</div> </div>
{% endif %} {% endif %}
{% if perms.trans.commit_translation or perms.trans.update_translation %} {% if user_can_see_repository_status %}
<div class="tab-pane" id="repository"> <div class="tab-pane" id="repository">
<p>{% trans "Loading…" %}</p> <p>{% trans "Loading…" %}</p>
</div> </div>
......
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