Commit 7d111e42 authored by okhin's avatar okhin 🚴

Merge branch '49-ajouter-des-flags-sur-le-contenu' into 'rp2'

Resolve "Ajouter des flags sur le contenu"

See merge request !42
parents 9855e893 ade863dc
Pipeline #2609 passed with stages
in 3 minutes and 56 seconds
......@@ -50,6 +50,15 @@
<span class="badge badge-default ml-1">{{t}}</span>
{% endfor %}
</p>
{% if article.archive %}
<span class="badge badge-info ml-1">{{ _("Archived") }}</span>
{% endif %}
{% if article.quote %}
<span class="badge badge-info ml-1">{{ _("Quotes us") }}</span>
{% endif %}
{% if article.speak %}
<span class="badge badge-info ml-1">{{ _("Speaks of us") }}</span>
{% endif %}
<p>{{object.extracts |markdown}}</p>
</div>
......
......@@ -49,7 +49,8 @@ class ArticleList(ListView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
qs = Tag.objects.annotate(num_times=Count('taggit_taggeditem_items')).all()
qs = Tag.objects.annotate(
num_times=Count('taggit_taggeditem_items')).all()
qs = qs.order_by('-num_times')
context["tags"] = qs
context["search"] = self.request.GET.get('q', '')
......@@ -92,7 +93,8 @@ class ArticleEdit(PermissionRequiredMixin, UpdateView):
model = Article
permission_required = 'rp.can_edit'
fields = ['screenshot', 'url', 'lang', 'title', 'tags', 'extracts']
fields = ['screenshot', 'url', 'lang', 'title', 'tags', 'extracts',
'quote', 'speak', 'archive']
success_url = reverse_lazy("rp:article-list")
def get(self, request, **kwargs):
......
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