Skip to content

Commit

Permalink
Ajoute des boutons pour modifier l'introduction et la conclusion des …
Browse files Browse the repository at this point in the history
…contenus (#6565)

* ajoute des boutons d'édition de l'intro et de la conclusion
* stylise les bouton d'édition de conclusion et introduction
* restreint l'affichage en fonction des permissions
  • Loading branch information
Vayel authored Mar 2, 2024
1 parent 83145f1 commit 6ab0afd
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 9 deletions.
9 changes: 9 additions & 0 deletions assets/scss/layout/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@
color: $primary-300 !important;
}

.simple-edit-button {
text-align: right;

.btn {
display: inline-block;
float: none;
}
}

li.simple-create-button {
list-style-type: '';

Expand Down
22 changes: 19 additions & 3 deletions templates/tutorialv2/includes/content/content.part.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{% load i18n %}
{% load emarkdown %}

{% if content.introduction and content.get_introduction != "" %}
{% 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 %}
Expand Down Expand Up @@ -96,7 +105,14 @@ <h2>
<hr class="clearfix" />
<hr />

{% if content.conclusion and content.get_conclusion != "" %}
{% 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">
Expand Down
30 changes: 24 additions & 6 deletions templates/tutorialv2/view/container.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,22 @@

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

{% if container.introduction and container.get_introduction %}
{% 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 %}
Expand Down Expand Up @@ -193,13 +202,22 @@ <h2 class="force-blue">

<hr />

{% if container.conclusion and container.get_conclusion %}
{% 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 %}
Expand Down

0 comments on commit 6ab0afd

Please sign in to comment.