-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP refacto content.html et content_online.html
- Loading branch information
Showing
4 changed files
with
135 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{% load captureas %} | ||
{% load set %} | ||
{% load i18n %} | ||
{% load pluralize_fr %} | ||
|
||
<h3 class="comments-title" id="comments"> | ||
{% if content.get_note_count > 0 %} | ||
<span itemprop="commentCount"> | ||
{{ content.get_note_count }} | ||
</span> | ||
{% trans "commentaire" %}{{ content.get_note_count|pluralize_fr }} | ||
{% else %} | ||
{% trans "Aucun commentaire" %} | ||
{% endif %} | ||
</h3> | ||
|
||
{% include "misc/paginator.html" with position="top" topic=content is_online=True anchor="comments" %} | ||
|
||
{% set perms.tutorialv2.change_contentreaction as is_staff %} | ||
|
||
{% for message in reactions %} | ||
|
||
{% captureas edit_link %} | ||
{% url "content:update-reaction" %}?message={{ message.pk }}&pk={{ content.pk }} | ||
{% endcaptureas %} | ||
|
||
{% captureas cite_link %} | ||
{% url "content:add-reaction" %}?cite={{ message.pk }}&pk={{ content.pk }} | ||
{% endcaptureas %} | ||
|
||
{% captureas karma_link %} | ||
{% url "api:content:reaction-karma" message.pk %} | ||
{% endcaptureas %} | ||
|
||
{% captureas alerts_solve_link %} | ||
{% url "content:resolve-reaction" %} | ||
{% endcaptureas %} | ||
{% captureas alert_link %} | ||
{% url "content:alert-reaction" message.pk %} | ||
{% endcaptureas %} | ||
{% captureas hide_link %} | ||
{% url "content:hide-reaction" message.pk%} | ||
{% endcaptureas %} | ||
|
||
{% captureas show_link %} | ||
{% url "content:show-reaction" message.pk %} | ||
{% endcaptureas %} | ||
|
||
{% if forloop.first and page_obj.number > 1 %} | ||
{% set True as is_repeated_message %} | ||
{% else %} | ||
{% set False as is_repeated_message %} | ||
{% endif %} | ||
|
||
{% if user == message.author or is_staff %} | ||
{% set True as can_view_history %} | ||
{% else %} | ||
{% set False as can_view_history %} | ||
{% endif %} | ||
|
||
{% include "misc/message.part.html" with perms_change=is_staff topic=object %} | ||
{% endfor %} | ||
|
||
|
||
{% include "misc/paginator.html" with position="bottom" topic=content is_online=True anchor="comments" %} | ||
|
||
|
||
|
||
{% captureas form_action %} | ||
{% url 'content:add-reaction' %}?pk={{ content.pk }} | ||
{% endcaptureas %} | ||
|
||
{% if object.last_note %} | ||
{% captureas last_note_pk %} | ||
{{ object.last_note.pk }} | ||
{% endcaptureas %} | ||
{% endif %} | ||
|
||
{% include "misc/message_form.html" with member=user topic=content is_antispam=is_antispam %} |
104 changes: 53 additions & 51 deletions
104
templates/tutorialv2/includes/editorialization.part.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,60 @@ | ||
{% load i18n %} | ||
{% load crispy_forms_tags %} | ||
|
||
<h3>Éditorialisation</h3> | ||
<ul> | ||
<li> | ||
<a href="#edit-tags" class="open-modal ico-after gear blue"> | ||
{% trans "Modifier les tags" %} | ||
</a> | ||
{% crispy form_edit_tags %} | ||
</li> | ||
|
||
{% if is_staff %} | ||
<div class="mobile-menu-bloc mobile-all-links mobile-show-ico" data-title="Éditorialisation"> | ||
<h3>Éditorialisation</h3> | ||
<ul> | ||
<li> | ||
<a href="#edit-goals" class="open-modal ico-after gear blue"> | ||
{% trans "Modifier les objectifs" %} | ||
<a href="#edit-tags" class="open-modal ico-after gear blue"> | ||
{% trans "Modifier les tags" %} | ||
</a> | ||
{% crispy form_edit_goals %} | ||
{% crispy form_edit_tags %} | ||
</li> | ||
{% endif %} | ||
|
||
{% if is_staff and not content.is_opinion %} | ||
<li> | ||
<a href="#add-suggestion" class="open-modal ico-after more blue"> | ||
{% trans "Ajouter une suggestion" %} | ||
</a> | ||
{% crispy formAddSuggestion %} | ||
</li> | ||
<li> | ||
<a href="#manage-suggestion" class="open-modal ico-after gear blue"> | ||
{% trans "Gérer les suggestions" %} | ||
</a> | ||
<form action="{% url "content:remove-suggestion" content.pk %}" method="post" class="modal modal-large" id="manage-suggestion" data-modal-close="Fermer"> | ||
<table class="fullwidth"> | ||
<thead> | ||
<th>{% trans "Contenus suggérés" %}</th> | ||
<th width="15%">{% trans "Actions" %}</th> | ||
</thead> | ||
<tbody> | ||
{% for content_suggestion in content_suggestions %} | ||
<tr> | ||
<td>{{content_suggestion.suggestion.title}}</td> | ||
<td> | ||
<button type="submit" data-value="{{ content_suggestion.pk }}" name="pk_suggestion" value="{{ content_suggestion.pk }}" class="modal-inner"> | ||
{% trans "Supprimer" %} | ||
</button> | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr><td colspan="2">Aucune suggestion de contenu.</td></tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% csrf_token %} | ||
</form> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
{% if is_staff %} | ||
<li> | ||
<a href="#edit-goals" class="open-modal ico-after gear blue"> | ||
{% trans "Modifier les objectifs" %} | ||
</a> | ||
{% crispy form_edit_goals %} | ||
</li> | ||
{% endif %} | ||
|
||
{% if is_staff and not content.is_opinion %} | ||
<li> | ||
<a href="#add-suggestion" class="open-modal ico-after more blue"> | ||
{% trans "Ajouter une suggestion" %} | ||
</a> | ||
{% crispy formAddSuggestion %} | ||
</li> | ||
<li> | ||
<a href="#manage-suggestion" class="open-modal ico-after gear blue"> | ||
{% trans "Gérer les suggestions" %} | ||
</a> | ||
<form action="{% url "content:remove-suggestion" content.pk %}" method="post" class="modal modal-large" id="manage-suggestion" data-modal-close="Fermer"> | ||
<table class="fullwidth"> | ||
<thead> | ||
<th>{% trans "Contenus suggérés" %}</th> | ||
<th width="15%">{% trans "Actions" %}</th> | ||
</thead> | ||
<tbody> | ||
{% for content_suggestion in content_suggestions %} | ||
<tr> | ||
<td>{{content_suggestion.suggestion.title}}</td> | ||
<td> | ||
<button type="submit" data-value="{{ content_suggestion.pk }}" name="pk_suggestion" value="{{ content_suggestion.pk }}" class="modal-inner"> | ||
{% trans "Supprimer" %} | ||
</button> | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr><td colspan="2">Aucune suggestion de contenu.</td></tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% csrf_token %} | ||
</form> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters