Skip to content

Commit

Permalink
Améliore l'ergo version validation/draft articles
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Jul 27, 2014
1 parent d9113f1 commit 6c70521
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 23 deletions.
12 changes: 9 additions & 3 deletions templates/article/includes/sidebar_actions.part.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{% if user in authors.all or perms.article.change_article %}
<a href="{% url "zds.article.views.edit" %}?article={{ article.pk }}" class="ico-after edit blue new-btn">
Éditer
</a>
{% if article.sha_draft = version %}
<a href="{% url "zds.article.views.edit" %}?article={{ article.pk }}" class="ico-after edit blue new-btn">
Éditer
</a>
{% else %}
<a href="{{ article.get_absolute_url }}" class="ico-after arrow-right blue new-btn">
Version brouillon
</a>
{% endif %}

<div class="mobile-menu-bloc mobile-all-links mobile-show-ico" data-title="Gestion">
<h3>Gestion</h3>
Expand Down
53 changes: 35 additions & 18 deletions templates/article/member/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,43 @@ <h2 class="subtitle">

{% if user in authors.all or perms.article.change_article %}
{% if article.sha_validation != None %}
{% if validation.validator == None %}
<p class="content-wrapper alert-box alert">
Cet article est en attente d'un validateur
</p>
{% if validation.version == version %}
{% if validation.validator == None %}
<p class="content-wrapper alert-box alert">
Cet article est en attente d'un validateur
</p>
{% else %}
<p class="content-wrapper alert-box info">
L'article est en cours de validation par
{% include "misc/member_item.part.html" with member=validation.validator %}
</p>
{% endif %}
{% if validation.comment_authors %}
<div class="content-wrapper comment-author">
<p>
Le message suivant a été laissé à destination des validateurs :
</p>

<blockquote>
{{ validation.comment_authors }}
</blockquote>
</div>
{% endif %}
{% else %}
<p class="content-wrapper alert-box info">
L'article est en cours de validation par
{% include "misc/member_item.part.html" with member=validation.validator %}
</p>
{% endif %}
{% if validation.comment_authors %}
<div class="content-wrapper comment-author">
<p>
Le message suivant a été laissé à destination des validateurs :
{% if validation.validator == None %}
<p class="content-wrapper alert-box alert">
<a href="{{ article.get_absolute_url }}?version={{ validation.version }}">
Une autre version de cet article</a>
est en attente d'un validateur
</p>

<blockquote>
{{ validation.comment_authors }}
</blockquote>
</div>
{% else %}
<p class="content-wrapper alert-box info">
<a href="{{ article.get_absolute_url }}?version={{ validation.version }}">
Une autre version de cet article</a>
est en cours de validation par
{% include "misc/member_item.part.html" with member=validation.validator %}
</p>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
Expand Down
3 changes: 1 addition & 2 deletions zds/article/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def view(request, article_pk, article_slug):
article_version['txt'] = get_blob(repo.commit(sha).tree, article_version['text'])
article_version = article.load_dic(article_version)

validation = Validation.objects.filter(article__pk=article.pk,
version=sha)\
validation = Validation.objects.filter(article__pk=article.pk)\
.order_by("-date_proposition")\
.first()

Expand Down

0 comments on commit 6c70521

Please sign in to comment.