Skip to content

Commit

Permalink
fix: restreint l'affichage en fonction des permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lefoulon committed Dec 31, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent a15c397 commit ccec9e2
Showing 3 changed files with 43 additions and 30 deletions.
32 changes: 19 additions & 13 deletions templates/tutorialv2/includes/content/content.part.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{% load i18n %}
{% load emarkdown %}

{% if content.introduction and content.get_introduction != "" %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{% url "content:edit" content.pk content.slug %}#div_id_introduction">
{% trans "Modifier l'introduction" %}
</a>
</div>
{% if content.get_introduction %}
{% if display_config.draft_actions.enable_edit %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{% url "content:edit" content.pk content.slug %}#div_id_introduction">
{% trans "Modifier l'introduction" %}
</a>
</div>
{% endif %}
{{ content.get_introduction|emarkdown:is_js }}
{% elif display_config.draft_actions.show_empty_section_warnings %}
<div class="ico-after warning">
<p>
{% trans "Il n’y a pas d’introduction." %}
{% trans "Vous pouvez " %}<a href="{% url "content:edit" content.pk content.slug %}">{% trans "en ajouter une" %}</a>.
{% if display_config.draft_actions.enable_edit %}
{% trans "Vous pouvez " %}<a href="{% url "content:edit" content.pk content.slug %}">{% trans "en ajouter une" %}</a>.
{% endif %}
</p>
</div>
{% endif %}
@@ -101,12 +105,14 @@ <h2>
<hr class="clearfix" />
<hr />

{% if content.conclusion and content.get_conclusion != "" %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{% url "content:edit" content.pk content.slug %}#div_id_conclusion">
{% trans "Modifier la conclusion" %}
</a>
</div>
{% if content.get_conclusion %}
{% if display_config.draft_actions.enable_edit %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{% url "content:edit" content.pk content.slug %}#div_id_conclusion">
{% trans "Modifier la conclusion" %}
</a>
</div>
{% endif %}
{{ content.get_conclusion|emarkdown:is_js }}
{% elif display_config.draft_actions.show_empty_section_warnings %}
<div class="ico-after warning">
40 changes: 24 additions & 16 deletions templates/tutorialv2/view/container.html
Original file line number Diff line number Diff line change
@@ -76,18 +76,22 @@

{% include "tutorialv2/includes/chapter_pager.part.html" with position="top" %}

{% if container.introduction and container.get_introduction %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{{ container.get_edit_url }}#div_id_introduction">
{% trans "Modifier l'introduction" %}
</a>
</div>
{% if container.get_introduction %}
{% if display_config.draft_actions.enable_edit %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{{ container.get_edit_url }}#div_id_introduction">
{% trans "Modifier l'introduction" %}
</a>
</div>
{% endif %}
{{ container.get_introduction|emarkdown:is_js }}
{% elif display_config.draft_actions.enable_edit %}
{% elif display_config.draft_actions.show_empty_section_warnings %}
<div class="ico-after warning">
<p>
{% trans "Il n’y a pas d’introduction." %}
{% trans "Vous pouvez " %}<a href="{{ container.get_edit_url }}">{% trans "en ajouter une" %}</a>.
{% if display_config.draft_actions.enable_edit %}
{% trans "Vous pouvez " %}<a href="{{ container.get_edit_url }}">{% trans "en ajouter une" %}</a>.
{% endif %}
</p>
</div>
{% endif %}
@@ -198,18 +202,22 @@ <h2 class="force-blue">

<hr />

{% if container.conclusion and container.get_conclusion %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{{ container.get_edit_url }}#div_id_conclusion">
{% trans "Modifier la conclusion" %}
</a>
</div>
{% if container.get_conclusion %}
{% if display_config.draft_actions.enable_edit %}
<div class="simple-edit-button">
<a class="ico-after edit btn btn-grey" href="{{ container.get_edit_url }}#div_id_conclusion">
{% trans "Modifier la conclusion" %}
</a>
</div>
{% endif %}
{{ container.get_conclusion|emarkdown:is_js }}
{% elif display_config.online_config.enable_edit %}
{% elif display_config.draft_actions.show_empty_section_warnings %}
<div class="ico-after warning">
<p>
{% trans "Il n’y a pas de conclusion." %}
{% trans "Vous pouvez " %}<a href="{{ container.get_edit_url }}">{% trans "en ajouter une" %}</a>.
{% if display_config.draft_actions.enable_edit %}
{% trans "Vous pouvez " %}<a href="{{ container.get_edit_url }}">{% trans "en ajouter une" %}</a>.
{% endif %}
</p>
</div>
{% endif %}
1 change: 0 additions & 1 deletion templates/tutorialv2/view/content.html
Original file line number Diff line number Diff line change
@@ -172,7 +172,6 @@

{% if display_config.draft_actions.show_license_edit %}
<li>
{{ content }}
{% url "content:edit" content.pk content.slug as edit_url %}
<a href="{{ edit_url }}" class="ico-after edit blue">{% trans "Éditer" %}</a>
</li>

0 comments on commit ccec9e2

Please sign in to comment.