From ad95a0ba785cb4122a47affd7b8bcbd6483ff337 Mon Sep 17 00:00:00 2001 From: Vincent Lefoulon Date: Mon, 4 Dec 2023 18:32:57 +0100 Subject: [PATCH 1/3] feat: ajoute des boutons d'edition de l'intro et de la conclusion --- templates/tutorialv2/includes/content/content.part.html | 8 ++++++++ templates/tutorialv2/view/container.html | 8 ++++++++ templates/tutorialv2/view/content.html | 1 + 3 files changed, 17 insertions(+) diff --git a/templates/tutorialv2/includes/content/content.part.html b/templates/tutorialv2/includes/content/content.part.html index 8a491d6ee8..af475bfd4f 100644 --- a/templates/tutorialv2/includes/content/content.part.html +++ b/templates/tutorialv2/includes/content/content.part.html @@ -2,6 +2,10 @@ {% load emarkdown %} {% if content.introduction and content.get_introduction != "" %} + + {% trans "Modifier l'introduction" %} + +
{{ content.get_introduction|emarkdown:is_js }} {% elif display_config.draft_actions.show_empty_section_warnings %}
@@ -97,6 +101,10 @@


{% if content.conclusion and content.get_conclusion != "" %} + + {% trans "Modifier la conclusion" %} + +
{{ content.get_conclusion|emarkdown:is_js }} {% elif display_config.draft_actions.show_empty_section_warnings %}
diff --git a/templates/tutorialv2/view/container.html b/templates/tutorialv2/view/container.html index d6adea87e1..17fd11fd54 100644 --- a/templates/tutorialv2/view/container.html +++ b/templates/tutorialv2/view/container.html @@ -77,6 +77,10 @@ {% include "tutorialv2/includes/chapter_pager.part.html" with position="top" %} {% if container.introduction and container.get_introduction %} + + {% trans "Modifier l'introduction" %} + +
{{ container.get_introduction|emarkdown:is_js }} {% elif display_config.draft_actions.enable_edit %}
@@ -194,6 +198,10 @@


{% if container.conclusion and container.get_conclusion %} + + {% trans "Modifier la conclusion" %} + +
{{ container.get_conclusion|emarkdown:is_js }} {% elif display_config.online_config.enable_edit %}
diff --git a/templates/tutorialv2/view/content.html b/templates/tutorialv2/view/content.html index 17b7527511..6fe965c4ff 100644 --- a/templates/tutorialv2/view/content.html +++ b/templates/tutorialv2/view/content.html @@ -172,6 +172,7 @@ {% if display_config.draft_actions.show_license_edit %}
  • + {{ content }} {% url "content:edit" content.pk content.slug as edit_url %} {% trans "Éditer" %}
  • From a15c397a6f94612fe79e72016477eaa70c57fab9 Mon Sep 17 00:00:00 2001 From: Vincent Lefoulon Date: Fri, 29 Dec 2023 13:38:47 +0100 Subject: [PATCH 2/3] feat: stylise les bouton d'edition de conclusion et introduction --- assets/scss/layout/_main.scss | 9 +++++++++ .../includes/content/content.part.html | 18 ++++++++++-------- templates/tutorialv2/view/container.html | 18 ++++++++++-------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/assets/scss/layout/_main.scss b/assets/scss/layout/_main.scss index d8781aa08c..c5e5915de0 100644 --- a/assets/scss/layout/_main.scss +++ b/assets/scss/layout/_main.scss @@ -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: ''; diff --git a/templates/tutorialv2/includes/content/content.part.html b/templates/tutorialv2/includes/content/content.part.html index af475bfd4f..e0e151e05c 100644 --- a/templates/tutorialv2/includes/content/content.part.html +++ b/templates/tutorialv2/includes/content/content.part.html @@ -2,10 +2,11 @@ {% load emarkdown %} {% if content.introduction and content.get_introduction != "" %} - - {% trans "Modifier l'introduction" %} - -
    + {{ content.get_introduction|emarkdown:is_js }} {% elif display_config.draft_actions.show_empty_section_warnings %}
    @@ -101,10 +102,11 @@


    {% if content.conclusion and content.get_conclusion != "" %} - - {% trans "Modifier la conclusion" %} - -
    + {{ content.get_conclusion|emarkdown:is_js }} {% elif display_config.draft_actions.show_empty_section_warnings %}
    diff --git a/templates/tutorialv2/view/container.html b/templates/tutorialv2/view/container.html index 17fd11fd54..dc1c82a9ec 100644 --- a/templates/tutorialv2/view/container.html +++ b/templates/tutorialv2/view/container.html @@ -77,10 +77,11 @@ {% include "tutorialv2/includes/chapter_pager.part.html" with position="top" %} {% if container.introduction and container.get_introduction %} - - {% trans "Modifier l'introduction" %} - -
    + {{ container.get_introduction|emarkdown:is_js }} {% elif display_config.draft_actions.enable_edit %}
    @@ -198,10 +199,11 @@


    {% if container.conclusion and container.get_conclusion %} - - {% trans "Modifier la conclusion" %} - -
    + {{ container.get_conclusion|emarkdown:is_js }} {% elif display_config.online_config.enable_edit %}
    From ccec9e2d9a7522d593da44c9fbbf67c385fb7ee4 Mon Sep 17 00:00:00 2001 From: Vincent Lefoulon Date: Sun, 31 Dec 2023 16:17:04 +0100 Subject: [PATCH 3/3] fix: restreint l'affichage en fonction des permissions --- .../includes/content/content.part.html | 32 +++++++++------ templates/tutorialv2/view/container.html | 40 +++++++++++-------- templates/tutorialv2/view/content.html | 1 - 3 files changed, 43 insertions(+), 30 deletions(-) diff --git a/templates/tutorialv2/includes/content/content.part.html b/templates/tutorialv2/includes/content/content.part.html index e0e151e05c..3e8ba4e0e0 100644 --- a/templates/tutorialv2/includes/content/content.part.html +++ b/templates/tutorialv2/includes/content/content.part.html @@ -1,18 +1,22 @@ {% load i18n %} {% load emarkdown %} -{% if content.introduction and content.get_introduction != "" %} - +{% if content.get_introduction %} + {% if display_config.draft_actions.enable_edit %} + + {% endif %} {{ content.get_introduction|emarkdown:is_js }} {% elif display_config.draft_actions.show_empty_section_warnings %}

    {% trans "Il n’y a pas d’introduction." %} - {% trans "Vous pouvez " %}{% trans "en ajouter une" %}. + {% if display_config.draft_actions.enable_edit %} + {% trans "Vous pouvez " %}{% trans "en ajouter une" %}. + {% endif %}

    {% endif %} @@ -101,12 +105,14 @@



    -{% if content.conclusion and content.get_conclusion != "" %} - +{% if content.get_conclusion %} + {% if display_config.draft_actions.enable_edit %} + + {% endif %} {{ content.get_conclusion|emarkdown:is_js }} {% elif display_config.draft_actions.show_empty_section_warnings %}
    diff --git a/templates/tutorialv2/view/container.html b/templates/tutorialv2/view/container.html index dc1c82a9ec..d678026dd3 100644 --- a/templates/tutorialv2/view/container.html +++ b/templates/tutorialv2/view/container.html @@ -76,18 +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 %} + + {% endif %} {{ container.get_introduction|emarkdown:is_js }} - {% elif display_config.draft_actions.enable_edit %} + {% elif display_config.draft_actions.show_empty_section_warnings %}

    {% trans "Il n’y a pas d’introduction." %} - {% trans "Vous pouvez " %}{% trans "en ajouter une" %}. + {% if display_config.draft_actions.enable_edit %} + {% trans "Vous pouvez " %}{% trans "en ajouter une" %}. + {% endif %}

    {% endif %} @@ -198,18 +202,22 @@


    - {% if container.conclusion and container.get_conclusion %} - + {% if container.get_conclusion %} + {% if display_config.draft_actions.enable_edit %} + + {% endif %} {{ container.get_conclusion|emarkdown:is_js }} - {% elif display_config.online_config.enable_edit %} + {% elif display_config.draft_actions.show_empty_section_warnings %}

    {% trans "Il n’y a pas de conclusion." %} - {% trans "Vous pouvez " %}{% trans "en ajouter une" %}. + {% if display_config.draft_actions.enable_edit %} + {% trans "Vous pouvez " %}{% trans "en ajouter une" %}. + {% endif %}

    {% endif %} diff --git a/templates/tutorialv2/view/content.html b/templates/tutorialv2/view/content.html index 6fe965c4ff..17b7527511 100644 --- a/templates/tutorialv2/view/content.html +++ b/templates/tutorialv2/view/content.html @@ -172,7 +172,6 @@ {% if display_config.draft_actions.show_license_edit %}
  • - {{ content }} {% url "content:edit" content.pk content.slug as edit_url %} {% trans "Éditer" %}