Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
7d111e42
Commit
7d111e42
authored
May 15, 2019
by
okhin
🚴
Browse files
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/rp/templates/rp/article_detail.html
View file @
7d111e42
...
...
@@ -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>
...
...
apps/rp/views/articles.py
View file @
7d111e42
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment