diff --git a/templates/tutorialv2/includes/headline/categories.part.html b/templates/tutorialv2/includes/headline/categories.part.html index b8bd6e7cb4..ea348dcef8 100644 --- a/templates/tutorialv2/includes/headline/categories.part.html +++ b/templates/tutorialv2/includes/headline/categories.part.html @@ -1,9 +1,10 @@ {% load i18n %} {% load pluralize_fr %} +{% load captureas %} +{% captureas categories_list %}

- {% trans "Catégorie" %}{{ content.subcategory.all|pluralize }} : - + {% trans "Dans" %} {% for category in content.subcategory.all %} {% if forloop.first %}{% elif forloop.last %} {% trans "et" %}{% else %},{% endif %} {% if content.is_opinion %} @@ -13,3 +14,22 @@ {% endif %} {% endfor %}

+{% endcaptureas %} + +{% url "content:edit-categories" content.pk as edit_url %} + +{% if show_form %} + {% if content.subcategory.all %} +
+ {{ categories_list }} + + {% if show_form %} + {% trans "Modifier" %} + {% endif %} +
+ {% else %} + {% trans "Choisissez la catégorie !" %} + {% endif %} +{% elif content.subcategory.all %} + {{ categories_list }} +{% endif %} diff --git a/templates/tutorialv2/includes/headline/header.part.html b/templates/tutorialv2/includes/headline/header.part.html index e2d619f58a..4e9beb92b8 100644 --- a/templates/tutorialv2/includes/headline/header.part.html +++ b/templates/tutorialv2/includes/headline/header.part.html @@ -5,7 +5,7 @@ {% include "tutorialv2/includes/headline/authors.part.html" with db_content=db_content edit_authors=display_config.draft_actions.show_authors_management online_mode=display_config.online_config.enable_authors_online_mode %} {% include "tutorialv2/includes/headline/licence.part.html" with licence=content.licence show_form=display_config.draft_actions.show_license_edit form=form_edit_license %} {% include "tutorialv2/includes/headline/contributions.part.html" %} - {% include "tutorialv2/includes/headline/categories.part.html" %} + {% include "tutorialv2/includes/headline/categories.part.html" with content=content show_form=display_config.draft_actions.show_categories_management %} {% include "tutorialv2/includes/headline/goals.part.html" with goals=publishablecontent.goals.all %} {% include "tutorialv2/includes/headline/labels.part.html" with labels=publishablecontent.labels.all %} diff --git a/zds/tutorialv2/views/display/config.py b/zds/tutorialv2/views/display/config.py index 6ce2e8d7d3..a57840e0bc 100644 --- a/zds/tutorialv2/views/display/config.py +++ b/zds/tutorialv2/views/display/config.py @@ -170,6 +170,9 @@ def show_title_edit(self) -> bool: def show_authors_management(self) -> bool: return self.enabled and self.is_allowed + def show_categories_management(self) -> bool: + return self.enabled and self.is_allowed + def show_contributors_management(self) -> bool: return self.enabled and self.is_allowed and self.requires_validation