Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de boutons pour modifier l'introduction et la conclusion des contenus #6565

Merged
merged 4 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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