Commit 7a186e40 authored by Michal Čihař's avatar Michal Čihař

Show last merge failure on repository status

This gives user better overview what is current state (rather than just
showing there are changes to merge in both directions).

Fixes #554
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 87b360f1
......@@ -15,6 +15,7 @@ Released on ? 2015.
* Simplified workflow for accepting suggestions.
* Added project owners who always receive important notifications.
* Allow to disable editing of monolingual template.
* More detailed repository status view.
weblate 2.2
-----------
......
......@@ -9,16 +9,24 @@
<div class="panel-heading"><h4 class="panel-title">{% trans "Repository status" %}</h4></div>
<div class="panel-body">
{% if needs_commit %}
<p>{% trans "There are some not committed changes!" %}</p>
<div class="alert alert-info" role="alert">{% trans "There are some not committed changes!" %}</div>
{% endif %}
{% if changes.0.is_merge_failure %}
<div class="alert alert-danger" role="alert">
<p>{% trans "There has been a merge failure on the repository:" %}</p>
<pre>{{ changes.0.target }}</pre>
<p><a href="{% documentation "faq" "merge" %}">{% trans "Check our FAQ for information how to resolve this." %}</a></p>
</div>
{% else %}
{% if object.git_needs_merge %}
<p>{% trans "The remote repository needs to be merged!" %}</p>
<div class="alert alert-warning" role="alert">{% trans "The remote repository needs to be merged!" %}</div>
{% endif %}
{% if object.git_needs_push %}
<p>{% trans "There are some new commits in the local repository!" %}</p>
<div class="alert alert-warning" role="alert">{% trans "There are some new commits in the local repository!" %}</div>
{% endif %}
{% if not needs_commit and not object.git_needs_merge and not object.git_needs_push %}
<p>{% trans "The local repository is up to date." %}</p>
<div class="alert alert-success" role="alert">{% trans "The local repository is up to date." %}</div>
{% endif %}
{% endif %}
{% if object.subproject_set %}
......
......@@ -216,6 +216,11 @@ class Change(models.Model):
ACTION_FAILED_REBASE,
))
ACTIONS_MERGE_FAILURE = set((
ACTION_FAILED_MERGE,
ACTION_FAILED_REBASE,
))
unit = models.ForeignKey('Unit', null=True)
subproject = models.ForeignKey('SubProject', null=True)
translation = models.ForeignKey('Translation', null=True)
......@@ -243,6 +248,9 @@ class Change(models.Model):
'user': self.get_user_display(False),
}
def is_merge_failure(self):
return self.action in self.ACTIONS_MERGE_FAILURE
def get_user_display(self, icon=True):
return get_user_display(self.user, icon, link=True)
......
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