move buttons, add descriptions for states etc
This commit is contained in:
parent
01e9c40b60
commit
64a6bdf69c
1 changed files with 57 additions and 31 deletions
|
@ -27,24 +27,57 @@
|
|||
{% blocktrans %}last update at {{ datetime }}{% endblocktrans %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
<p>
|
||||
{% if not active and not changeset.closed %}
|
||||
<button type="submit" class="btn btn-xs btn-default" name="activate" value="1">{% trans 'Activate' %}</button>
|
||||
{% endif %}
|
||||
{% if can_edit %}
|
||||
<a href="{% url 'editor.changesets.edit' pk=changeset.pk %}" class="btn btn-xs btn-default">{% trans 'Edit' %}</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% bootstrap_messages %}
|
||||
{% if changeset.last_state_update and changeset.state != 'unproposed' %}
|
||||
<div class="panel panel-{{ changeset.style }}">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{{ changeset.get_state_display }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% if changeset.state == 'proposed' or changeset.state == 'reproposed' %}
|
||||
<p>{% blocktrans %}These changes are currently pending review.{% endblocktrans %}</p>
|
||||
{% if changeset.author == request.user %}
|
||||
<p>{% blocktrans %}As long as the review is pending you can unpropose them to edit them again.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
{% elif changeset.state == 'review' %}
|
||||
{% with user=changeset.assigned_to %}
|
||||
{% url 'editor.users.detail' pk=changeset.assigned_to.pk as user_url %}
|
||||
<p>{% blocktrans %}These changes are currently being reviewed by <a href="{{ user_url }}">{{ user }}</a>{% endblocktrans %}</p>
|
||||
{% endwith %}
|
||||
{% elif changeset.state == 'rejected' or changeset.state == 'finallyrejected' %}
|
||||
{% with user=changeset.last_state_update.user comment=changeset.last_state_update.comment %}
|
||||
{% url 'editor.users.detail' pk=changeset.last_state_update.user.pk as user_url %}
|
||||
<p>{% blocktrans %}Your changes were rejected by <a href="{{ user_url }}">{{ user }}</a>:{% endblocktrans %}</p>
|
||||
<p>{% blocktrans %}“{{ comment }}”{% endblocktrans %}</p>
|
||||
{% if changeset.author == request.user %}
|
||||
{% if changeset.state == 'rejected' %}
|
||||
<p>{% blocktrans %}You can now edit your changes and propose them again.{% endblocktrans %}</p>
|
||||
{% else %}
|
||||
<p>{% blocktrans %}This rejection is final.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% elif changeset.state == 'applied' %}
|
||||
{% with user=changeset.last_state_update.user %}
|
||||
{% url 'editor.users.detail' pk=changeset.last_state_update.user.pk as user_url %}
|
||||
<p>{% blocktrans %}Your changes were applied by <a href="{{ user_url }}">{{ user }}</a>.{% endblocktrans %}</p>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
<em class="text-muted">{{ changeset.last_state_update.datetime|date:"DATETIME_FORMAT" }}</em>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if changeset.description %}
|
||||
<p>{{ changeset.description }}</p>
|
||||
{% endif %}
|
||||
{% if changeset.author == request.user %}
|
||||
{% if changeset.proposed and not changeset.applied %}
|
||||
{% if not changeset.assigned_to %}
|
||||
<p class="text-success">
|
||||
{% blocktrans %}Your changes are currently waiting for review. As long as no reviewer has been assigned to your changes, you can still unpropose and edit them.{% endblocktrans %}
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="text-success">
|
||||
{% blocktrans %}Your changes are currently being reviewed.{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% for obj in changed_objects %}
|
||||
<table class="table table-condensed table-h-bordered change-group">
|
||||
<thead>
|
||||
|
@ -82,23 +115,16 @@
|
|||
{% endfor %}
|
||||
|
||||
{% buttons %}
|
||||
{% if active %}
|
||||
{% if can_delete %}
|
||||
<button type="submit" class="btn btn-danger" name="delete" value="1">{% trans 'Delete' %}</button>
|
||||
{% endif %}
|
||||
<div class="pull-right">
|
||||
{% if can_edit %}
|
||||
<a href="{% url 'editor.changesets.edit' pk=changeset.pk %}" class="btn btn-default">{% trans 'Edit' %}</a>
|
||||
{% endif %}
|
||||
{% if can_edit and not changeset.proposed %}
|
||||
<button type="submit" class="btn btn-primary" name="propose" value="1">{% trans 'Propose' %}</button>
|
||||
{% endif %}
|
||||
{% if can_unpropose %}
|
||||
<button type="submit" class="btn btn-default" name="unpropose" value="1">{% trans 'Unpropose' %}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% elif not changeset.closed %}
|
||||
<button type="submit" class="btn btn-primary pull-right" name="activate" value="1">{% trans 'Activate' %}</button>
|
||||
{% if can_delete %}
|
||||
<button type="submit" class="btn btn-danger" name="delete" value="1">{% trans 'Delete' %}</button>
|
||||
{% endif %}
|
||||
<div class="pull-right">
|
||||
{% if can_edit and not changeset.proposed %}
|
||||
<button type="submit" class="btn btn-primary" name="propose" value="1">{% trans 'Propose' %}</button>
|
||||
{% endif %}
|
||||
{% if can_unpropose %}
|
||||
<button type="submit" class="btn btn-default" name="unpropose" value="1">{% trans 'Unpropose' %}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endbuttons %}
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue