From 9a464daf2ab072b7e897e50ce5dffceb44dc2217 Mon Sep 17 00:00:00 2001 From: Arnaud-D <35631001+Arnaud-D@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:43:20 +0100 Subject: [PATCH] Refactorise les templates des publications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mise à jour de l'organisation des différentes actions possibles * fusion des variantes en ligne et pas en ligne * configuration définie dans la vue pour adapter l'affichage * vues bien séparées pour bêta, brouillon, en ligne * nouvelle vue spécifique pour voir une version par son commit --- templates/base.html | 3 - .../includes/featured_request.part.html | 22 +- templates/tutorialv2/base.html | 9 - templates/tutorialv2/events/list.html | 8 - templates/tutorialv2/includes/child.part.html | 59 +- .../includes/child_online.part.html | 2 +- .../tutorialv2/includes/comments.part.html | 78 ++ .../includes/content/content.part.html | 112 +++ .../{ => content}/content_pager.part.html | 0 .../includes/content/online_content.part.html | 27 + .../{ => content}/warn_typo.part.html | 2 +- .../includes/editorialization.part.html | 58 -- .../includes/headline/authors.part.html | 31 + .../includes/headline/beta_info.part.html | 28 + .../includes/headline/categories.part.html | 15 + .../includes/headline/contributions.part.html | 21 + .../includes/{ => headline}/goals.part.html | 0 .../includes/headline/header.part.html | 33 + .../includes/headline/help_info.part.html | 22 + .../includes/headline/licence.part.html | 21 + .../headline/obsolescence_warning.part.html | 11 + .../opinion_moderation_warning.part.html | 7 + .../headline/opinion_promotion_info.part.html | 19 + .../includes/headline/reading_time.part.html | 8 + .../includes/headline/tags.part.html | 17 + .../includes/headline/update_date.part.html | 25 + .../headline/validation_info.part.html | 46 + .../includes/meta/dcmi_cards.part.html | 18 + .../includes/{ => meta}/image_illu.part.html | 0 .../includes/{ => meta}/opengraph.part.html | 0 .../sidebar/administration_actions.part.html | 71 ++ .../sidebar/authors_management.part.html | 42 + .../includes/sidebar/beta_actions.part.html | 100 ++ .../sidebar/contributors_management.part.html | 39 + .../includes/{ => sidebar}/delete.part.html | 0 .../includes/sidebar/delete_content.part.html | 45 + .../sidebar/editorialization.part.html | 86 ++ .../includes/{ => sidebar}/exports.part.html | 0 .../includes/sidebar/follow_links.part.html | 31 + .../includes/sidebar/helps.part.html | 51 + .../{ => sidebar}/list_of_exports.html | 1 + .../includes/sidebar/public_actions.part.html | 67 ++ .../includes/{ => sidebar}/summary.part.html | 0 .../includes/sidebar/validation.part.html | 179 ++++ .../includes/tags_authors.part.html | 108 --- templates/tutorialv2/validation/history.html | 6 - templates/tutorialv2/view/container.html | 484 +++++----- .../tutorialv2/view/container_online.html | 135 --- templates/tutorialv2/view/content.html | 904 +++--------------- templates/tutorialv2/view/content_online.html | 435 --------- templates/tutorialv2/view/diff.html | 2 - templates/tutorialv2/view/history.html | 9 +- zds/tutorialv2/mixins.py | 41 +- zds/tutorialv2/models/database.py | 39 +- zds/tutorialv2/models/versioned.py | 8 +- zds/tutorialv2/urls/urls_articles.py | 4 +- zds/tutorialv2/urls/urls_contents.py | 25 +- zds/tutorialv2/urls/urls_opinions.py | 4 +- zds/tutorialv2/urls/urls_tutorials.py | 8 +- zds/tutorialv2/views/alerts.py | 1 + zds/tutorialv2/views/archives.py | 1 - zds/tutorialv2/views/authors.py | 2 - zds/tutorialv2/views/beta.py | 1 - zds/tutorialv2/views/containers_extracts.py | 62 +- zds/tutorialv2/views/contents.py | 92 +- zds/tutorialv2/views/contributors.py | 2 - zds/tutorialv2/views/display.py | 894 ++++++++++++++--- zds/tutorialv2/views/editorialization.py | 2 - zds/tutorialv2/views/history.py | 1 - zds/tutorialv2/views/misc.py | 1 - zds/tutorialv2/views/validations_contents.py | 1 - 71 files changed, 2495 insertions(+), 2191 deletions(-) create mode 100644 templates/tutorialv2/includes/comments.part.html create mode 100644 templates/tutorialv2/includes/content/content.part.html rename templates/tutorialv2/includes/{ => content}/content_pager.part.html (100%) create mode 100644 templates/tutorialv2/includes/content/online_content.part.html rename templates/tutorialv2/includes/{ => content}/warn_typo.part.html (96%) delete mode 100644 templates/tutorialv2/includes/editorialization.part.html create mode 100644 templates/tutorialv2/includes/headline/authors.part.html create mode 100644 templates/tutorialv2/includes/headline/beta_info.part.html create mode 100644 templates/tutorialv2/includes/headline/categories.part.html create mode 100644 templates/tutorialv2/includes/headline/contributions.part.html rename templates/tutorialv2/includes/{ => headline}/goals.part.html (100%) create mode 100644 templates/tutorialv2/includes/headline/header.part.html create mode 100644 templates/tutorialv2/includes/headline/help_info.part.html create mode 100644 templates/tutorialv2/includes/headline/licence.part.html create mode 100644 templates/tutorialv2/includes/headline/obsolescence_warning.part.html create mode 100644 templates/tutorialv2/includes/headline/opinion_moderation_warning.part.html create mode 100644 templates/tutorialv2/includes/headline/opinion_promotion_info.part.html create mode 100644 templates/tutorialv2/includes/headline/reading_time.part.html create mode 100644 templates/tutorialv2/includes/headline/tags.part.html create mode 100644 templates/tutorialv2/includes/headline/update_date.part.html create mode 100644 templates/tutorialv2/includes/headline/validation_info.part.html create mode 100644 templates/tutorialv2/includes/meta/dcmi_cards.part.html rename templates/tutorialv2/includes/{ => meta}/image_illu.part.html (100%) rename templates/tutorialv2/includes/{ => meta}/opengraph.part.html (100%) create mode 100644 templates/tutorialv2/includes/sidebar/administration_actions.part.html create mode 100644 templates/tutorialv2/includes/sidebar/authors_management.part.html create mode 100644 templates/tutorialv2/includes/sidebar/beta_actions.part.html create mode 100644 templates/tutorialv2/includes/sidebar/contributors_management.part.html rename templates/tutorialv2/includes/{ => sidebar}/delete.part.html (100%) create mode 100644 templates/tutorialv2/includes/sidebar/delete_content.part.html create mode 100644 templates/tutorialv2/includes/sidebar/editorialization.part.html rename templates/tutorialv2/includes/{ => sidebar}/exports.part.html (100%) create mode 100644 templates/tutorialv2/includes/sidebar/follow_links.part.html create mode 100644 templates/tutorialv2/includes/sidebar/helps.part.html rename templates/tutorialv2/includes/{ => sidebar}/list_of_exports.html (99%) create mode 100644 templates/tutorialv2/includes/sidebar/public_actions.part.html rename templates/tutorialv2/includes/{ => sidebar}/summary.part.html (100%) create mode 100644 templates/tutorialv2/includes/sidebar/validation.part.html delete mode 100644 templates/tutorialv2/includes/tags_authors.part.html delete mode 100644 templates/tutorialv2/view/container_online.html delete mode 100644 templates/tutorialv2/view/content_online.html diff --git a/templates/base.html b/templates/base.html index 2759a79caa..670922f3c1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -82,11 +82,8 @@ - - {# DCMI cards #} {% block DCMI_cards %}{% endblock %} - {# Stylesheets #} - - {% csrf_token %} +
+ + {% csrf_token %} - -
-{% endif %} + + diff --git a/templates/tutorialv2/base.html b/templates/tutorialv2/base.html index 365b0b4b7f..429239775e 100644 --- a/templates/tutorialv2/base.html +++ b/templates/tutorialv2/base.html @@ -83,14 +83,5 @@

{% trans "Actions" %}

{% endif %} {% block sidebar_blocks %}{% endblock %} - {% if content %} - {% if content.is_public or content.in_beta or can_edit or is_staff %} - - {% endif %} - {% endif %} {% endblock %} diff --git a/templates/tutorialv2/events/list.html b/templates/tutorialv2/events/list.html index 13ebfeb6d5..1239b967e5 100644 --- a/templates/tutorialv2/events/list.html +++ b/templates/tutorialv2/events/list.html @@ -21,12 +21,6 @@ {% block headline %} - {% if content.licence %} -

- {{ content.licence }} -

- {% endif %} -

{% if content.image %} @@ -41,8 +35,6 @@

{{ content.description }}

{% endif %} - - {% include 'tutorialv2/includes/tags_authors.part.html' with content=content online=False %} {% endblock %} diff --git a/templates/tutorialv2/includes/child.part.html b/templates/tutorialv2/includes/child.part.html index 44727bed6e..f472e83d7b 100644 --- a/templates/tutorialv2/includes/child.part.html +++ b/templates/tutorialv2/includes/child.part.html @@ -22,7 +22,7 @@ {{ child.title }} - {% if can_add_something %} + {% if display_config.draft_actions.enable_edit %}
{% trans "Éditer" %} @@ -67,7 +67,8 @@ {% trans "Déplacer" %} - {% include "tutorialv2/includes/delete.part.html" with object=child additional_classes="ico-after cross btn btn-grey" %} + + {% include "tutorialv2/includes/sidebar/delete.part.html" with object=child additional_classes="ico-after cross btn btn-grey" %}
{% endif %} @@ -77,7 +78,7 @@ {% if child.get_text.strip|length == 0 %}

- {% trans "Cette section est actuellement vide." %} + {% trans "Cette section est vide." %}

{% else %} @@ -152,7 +153,7 @@

{% endfor %} - {% if can_add_something and child.can_add_container %} + {% if child.can_add_container %}
  • {% endif %} {% else %} - {% if not can_add_something or not child.is_chapter %} -
    -

    - {{ "Ce"|feminize:child.get_level_as_string }} {{ child.get_level_as_string|lower }} {% trans "est actuellement vide." %} -

    - {% if can_add_something and not child.is_chapter %} -
    + {% endif %} -
    - {% elif can_add_something and child.can_add_extract and child.is_chapter %} -
      -
    1. - - {% trans "Ajouter une section" %} - -
    2. -
    {% endif %} {% endif %} {% endif %} diff --git a/templates/tutorialv2/includes/child_online.part.html b/templates/tutorialv2/includes/child_online.part.html index c20dee9582..55af486ce7 100644 --- a/templates/tutorialv2/includes/child_online.part.html +++ b/templates/tutorialv2/includes/child_online.part.html @@ -20,7 +20,7 @@

    {# child is an extract #} {% if child.get_text.strip|length == 0 %}

    - {% trans "Cette section est actuellement vide." %} + {% trans "Cette section est vide." %}

    {% else %}
    diff --git a/templates/tutorialv2/includes/comments.part.html b/templates/tutorialv2/includes/comments.part.html new file mode 100644 index 0000000000..07ba7b40db --- /dev/null +++ b/templates/tutorialv2/includes/comments.part.html @@ -0,0 +1,78 @@ +{% load i18n %} +{% load pluralize_fr %} +{% load captureas %} +{% load set %} + +

    + {% if content.get_note_count > 0 %} + + {{ content.get_note_count }} + + {% trans "commentaire" %}{{ content.get_note_count|pluralize_fr }} + {% else %} + {% trans "Aucun commentaire" %} + {% endif %} +

    + + +{% include "misc/paginator.html" with position="top" topic=content is_online=True anchor="comments" %} + +{% for message in reactions %} + + {% captureas edit_link %} + {% url "content:update-reaction" %}?message={{ message.pk }}&pk={{ content.pk }} + {% endcaptureas %} + + {% captureas cite_link %} + {% url "content:add-reaction" %}?cite={{ message.pk }}&pk={{ content.pk }} + {% endcaptureas %} + + {% captureas karma_link %} + {% url "api:content:reaction-karma" message.pk %} + {% endcaptureas %} + + {% captureas alerts_solve_link %} + {% url "content:resolve-reaction" %} + {% endcaptureas %} + {% captureas alert_link %} + {% url "content:alert-reaction" message.pk %} + {% endcaptureas %} + {% captureas hide_link %} + {% url "content:hide-reaction" message.pk%} + {% endcaptureas %} + + {% captureas show_link %} + {% url "content:show-reaction" message.pk %} + {% endcaptureas %} + + {% if forloop.first and page_obj.number > 1 %} + {% set True as is_repeated_message %} + {% else %} + {% set False as is_repeated_message %} + {% endif %} + + {% if user == message.author or perms.tutorialv2.change_contentreaction %} + {% set True as can_view_history %} + {% else %} + {% set False as can_view_history %} + {% endif %} + + {% include "misc/message.part.html" with perms_change=perms.tutorialv2.change_contentreaction topic=object %} +{% endfor %} + + +{% include "misc/paginator.html" with position="bottom" topic=content is_online=True anchor="comments" %} + + + +{% captureas form_action %} + {% url 'content:add-reaction' %}?pk={{ content.pk }} +{% endcaptureas %} + +{% if object.last_note %} + {% captureas last_note_pk %} + {{ object.last_note.pk }} + {% endcaptureas %} +{% endif %} + +{% include "misc/message_form.html" with member=user topic=content is_antispam=is_antispam %} diff --git a/templates/tutorialv2/includes/content/content.part.html b/templates/tutorialv2/includes/content/content.part.html new file mode 100644 index 0000000000..f5a67baf6c --- /dev/null +++ b/templates/tutorialv2/includes/content/content.part.html @@ -0,0 +1,112 @@ +{% load i18n %} +{% load emarkdown %} + +{% if content.introduction and content.get_introduction != "" %} + {{ content.get_introduction|emarkdown:is_js }} +{% elif display_config.draft_actions.show_empty_section_warnings %} +
    +

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

    +
    +{% endif %} + +{% if content.has_extracts or content.can_add_extract %} + +{% endif %} + +{% for child in content.children %} + {% include "tutorialv2/includes/child.part.html" with child=child %} +{% empty %} + {% if content.can_add_extract and content.can_add_container and display_config.draft_actions.enable_edit %} +
    +

    + {% trans "Ce contenu est vide." %} {% trans "Vous pouvez :" %} +

    + +
    + {% elif not display_config.draft_actions.enable_edit or not content.can_add_extract and not content.can_add_container %} +
    +

    + {% trans "Ce contenu est vide." %} +

    +
    + {% endif %} +{% endfor %} + +{% if display_config.draft_actions.enable_edit %} + {% if content.can_add_container and not content.can_add_extract %} +

    + {% url "content:create-container" content.pk content.slug as create_container_url %} + + {% trans "Ajouter une nouvelle partie" %} + + +

    + {% endif %} + + {% if not content.can_add_container and content.can_add_extract %} +

    + {% url "content:create-extract" content.pk content.slug as create_extract_url %} + + {% trans "Ajouter une section" %} + + +

    +
    +

    {% trans "Cliquer sur ajouter pour rédiger une nouvelle section." %}

    +
    + {% endif %} +{% endif %} + + +
    +
    + +{% if content.conclusion and content.get_conclusion != "" %} + {{ content.get_conclusion|emarkdown:is_js }} +{% elif display_config.draft_actions.show_empty_section_warnings %} +
    +

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

    +
    +{% endif %} diff --git a/templates/tutorialv2/includes/content_pager.part.html b/templates/tutorialv2/includes/content/content_pager.part.html similarity index 100% rename from templates/tutorialv2/includes/content_pager.part.html rename to templates/tutorialv2/includes/content/content_pager.part.html diff --git a/templates/tutorialv2/includes/content/online_content.part.html b/templates/tutorialv2/includes/content/online_content.part.html new file mode 100644 index 0000000000..cc34493e89 --- /dev/null +++ b/templates/tutorialv2/includes/content/online_content.part.html @@ -0,0 +1,27 @@ +{% if content.has_extracts %} + {{ content.get_content_online|safe }} +{% else %} + {% if content.introduction %} + {{ content.get_introduction_online|default:""|safe }} + {% endif %} + + {% if not content.has_sub_containers %} +
      + {% endif %} + + {% for child in content.children %} + {% include "tutorialv2/includes/child_online.part.html" with child=child %} + {% endfor %} + + {% if not content.has_sub_containers %} +
    + {% endif %} + +
    +
    + + {% if content.conclusion %} + {{ content.get_conclusion_online|default:""|safe }} + {% endif %} + +{% endif %} diff --git a/templates/tutorialv2/includes/warn_typo.part.html b/templates/tutorialv2/includes/content/warn_typo.part.html similarity index 96% rename from templates/tutorialv2/includes/warn_typo.part.html rename to templates/tutorialv2/includes/content/warn_typo.part.html index 9f58d8ec4d..9fce837ee7 100644 --- a/templates/tutorialv2/includes/warn_typo.part.html +++ b/templates/tutorialv2/includes/content/warn_typo.part.html @@ -22,7 +22,7 @@ {% endif %} - {% crispy formWarnTypo %} + {% crispy form_warn_typo %}
    {% endif %} diff --git a/templates/tutorialv2/includes/editorialization.part.html b/templates/tutorialv2/includes/editorialization.part.html deleted file mode 100644 index c3636daa84..0000000000 --- a/templates/tutorialv2/includes/editorialization.part.html +++ /dev/null @@ -1,58 +0,0 @@ -{% load i18n %} -{% load crispy_forms_tags %} - -

    Éditorialisation

    - diff --git a/templates/tutorialv2/includes/headline/authors.part.html b/templates/tutorialv2/includes/headline/authors.part.html new file mode 100644 index 0000000000..14040552e3 --- /dev/null +++ b/templates/tutorialv2/includes/headline/authors.part.html @@ -0,0 +1,31 @@ +{% load i18n %} +{% load pluralize_fr %} +{% load displayable_authors %} + +
    + + {% trans "Auteur" %}{{ db_content|displayable_authors:online_mode|pluralize }} : + +
      + {% for member in db_content|displayable_authors:online_mode %} +
    • + {% include "misc/member_item.part.html" with avatar=True %} +
    • + {% endfor %} + + {% if add_author %} +
    • + + {% trans "Ajouter un auteur" %} + + +
    • + {% endif %} +
    +
    diff --git a/templates/tutorialv2/includes/headline/beta_info.part.html b/templates/tutorialv2/includes/headline/beta_info.part.html new file mode 100644 index 0000000000..01b1678bf7 --- /dev/null +++ b/templates/tutorialv2/includes/headline/beta_info.part.html @@ -0,0 +1,28 @@ +{% load i18n %} + +{% if state.current_version %} +
    +
    + {% blocktrans %} + Cette version est en BÊTA ! + {% endblocktrans %} + + {% if beta_topic %} + {% blocktrans with url=beta_topic.get_absolute_url %} + Vous pouvez y réagir sur ce sujet. + {% endblocktrans %} + {% endif %} +
    +
    +{% endif %} + +{% if state.other_version %} +
    +
    + {% url "content:beta-view" content.pk content.slug as beta_url %} + {% blocktrans with beta_url=beta_url %} + Une autre version de cette publication est en bêta. + {% endblocktrans %} +
    +
    +{% endif %} diff --git a/templates/tutorialv2/includes/headline/categories.part.html b/templates/tutorialv2/includes/headline/categories.part.html new file mode 100644 index 0000000000..b8bd6e7cb4 --- /dev/null +++ b/templates/tutorialv2/includes/headline/categories.part.html @@ -0,0 +1,15 @@ +{% load i18n %} +{% load pluralize_fr %} + +

    + {% trans "Catégorie" %}{{ content.subcategory.all|pluralize }} : + + {% for category in content.subcategory.all %} + {% if forloop.first %}{% elif forloop.last %} {% trans "et" %}{% else %},{% endif %} + {% if content.is_opinion %} + {{ category.title }} + {% else %} + {{ category.title }} + {% endif %} + {% endfor %} +

    diff --git a/templates/tutorialv2/includes/headline/contributions.part.html b/templates/tutorialv2/includes/headline/contributions.part.html new file mode 100644 index 0000000000..e81e93a469 --- /dev/null +++ b/templates/tutorialv2/includes/headline/contributions.part.html @@ -0,0 +1,21 @@ +{% load i18n %} +{% load pluralize_fr %} + +{% with count_contributions=contributions|length %} + {% if count_contributions > 0 %} +

    + {% trans "Ce contenu a bénéficié des apports de" %} + {{ count_contributions }} {% trans "contributeur" %}{{ count_contributions|pluralize }} + +

    +

    + {% endif %} +{% endwith %} diff --git a/templates/tutorialv2/includes/goals.part.html b/templates/tutorialv2/includes/headline/goals.part.html similarity index 100% rename from templates/tutorialv2/includes/goals.part.html rename to templates/tutorialv2/includes/headline/goals.part.html diff --git a/templates/tutorialv2/includes/headline/header.part.html b/templates/tutorialv2/includes/headline/header.part.html new file mode 100644 index 0000000000..4572ce4cd7 --- /dev/null +++ b/templates/tutorialv2/includes/headline/header.part.html @@ -0,0 +1,33 @@ +{% include "tutorialv2/includes/headline/licence.part.html" with licence=content.licence show_form=display_config.draft_actions.show_license_edit form=form_edit_license %} + +

    + {% if show_thumbnail and content.image %} + + {% endif %} + {{ title }} +

    + +{% if subtitle %} +

    + {{ subtitle }} +

    +{% endif %} + + diff --git a/templates/tutorialv2/includes/headline/help_info.part.html b/templates/tutorialv2/includes/headline/help_info.part.html new file mode 100644 index 0000000000..49ae4cfa80 --- /dev/null +++ b/templates/tutorialv2/includes/headline/help_info.part.html @@ -0,0 +1,22 @@ +{% load i18n %} +{% load pluralize_fr %} + +{% if content_helps %} +
    +
    + {% if content.authors.count > 1 %} + {% trans "Les auteurs de ce contenu recherchent" %} + {% else %} + {% trans "L’auteur de ce contenu recherche" %} + {% endif %} + + {% for help in content_helps %}{% if not forloop.first %}{% if forloop.last %}{% trans ' et ' %}{% else %}{% trans ', ' %}{% endif %}{% endif %}un {{ help.title|lower }}{% if forloop.last %}{% trans '.' %}{% endif %}{% endfor %} + + {% if not can_edit %} + {% blocktrans with plural=content.authors.count|pluralize_fr %} + N’hésitez pas à le{{ plural }} contacter par MP pour proposer votre aide ! + {% endblocktrans %} + {% endif %} +
    +
    +{% endif %} diff --git a/templates/tutorialv2/includes/headline/licence.part.html b/templates/tutorialv2/includes/headline/licence.part.html new file mode 100644 index 0000000000..8426f450a5 --- /dev/null +++ b/templates/tutorialv2/includes/headline/licence.part.html @@ -0,0 +1,21 @@ +{% load i18n %} +{% load crispy_forms_tags %} + +{% if show_form %} + {% if licence %} + + {% else %} +

    + Choisissez la licence de votre publication ! +

    + {% endif %} + + {% crispy form %} +{% elif licence %} + {{ licence }} +{% endif %} diff --git a/templates/tutorialv2/includes/headline/obsolescence_warning.part.html b/templates/tutorialv2/includes/headline/obsolescence_warning.part.html new file mode 100644 index 0000000000..26ed1623bc --- /dev/null +++ b/templates/tutorialv2/includes/headline/obsolescence_warning.part.html @@ -0,0 +1,11 @@ +{% load i18n %} + +{% if is_obsolete %} +
    +
    + {% blocktrans %} + Ce contenu est obsolète. Il peut contenir des informations intéressantes mais soyez prudent avec celles-ci. + {% endblocktrans %} +
    +
    +{% endif %} diff --git a/templates/tutorialv2/includes/headline/opinion_moderation_warning.part.html b/templates/tutorialv2/includes/headline/opinion_moderation_warning.part.html new file mode 100644 index 0000000000..f083aed9a2 --- /dev/null +++ b/templates/tutorialv2/includes/headline/opinion_moderation_warning.part.html @@ -0,0 +1,7 @@ +{% load i18n %} + +
    +
    + {% trans "Ce contenu a été modéré. Il ne peut pas faire l'objet d'une nouvelle publication." %} +
    +
    diff --git a/templates/tutorialv2/includes/headline/opinion_promotion_info.part.html b/templates/tutorialv2/includes/headline/opinion_promotion_info.part.html new file mode 100644 index 0000000000..4cb0a7d8ca --- /dev/null +++ b/templates/tutorialv2/includes/headline/opinion_promotion_info.part.html @@ -0,0 +1,19 @@ +{% load i18n %} + +{% if content.is_opinion %} + {% if content.converted_to %} + {% if content.converted_to.get_absolute_url_online %} +
    + {% blocktrans with url_article=content.converted_to.get_absolute_url_online %} + Ce billet a été promu en article. + {% endblocktrans %} +
    + {% elif is_staff %} +
    + {% blocktrans with url_article=content.converted_to.get_absolute_url %} + Ce billet a fait l’objet d’une demande de publication en tant qu’article. Il est donc présent dans la zone de validation en attente de prise en charge par un validateur. + {% endblocktrans %} +
    + {% endif %} + {% endif %} +{% endif %} diff --git a/templates/tutorialv2/includes/headline/reading_time.part.html b/templates/tutorialv2/includes/headline/reading_time.part.html new file mode 100644 index 0000000000..d8a117e00a --- /dev/null +++ b/templates/tutorialv2/includes/headline/reading_time.part.html @@ -0,0 +1,8 @@ +{% load i18n %} +{% load humanize_duration %} + +{% if reading_time and not is_part_or_chapter %} +

    {% trans "Temps de lecture estimé : " %}{{ reading_time|humanize_duration }}

    +{% elif not is_part_or_chapter %} +

    {% trans "Temps de lecture estimé à moins d’une minute." %}

    +{% endif %} diff --git a/templates/tutorialv2/includes/headline/tags.part.html b/templates/tutorialv2/includes/headline/tags.part.html new file mode 100644 index 0000000000..ce88293c26 --- /dev/null +++ b/templates/tutorialv2/includes/headline/tags.part.html @@ -0,0 +1,17 @@ +{% load captureas %} + +{% captureas tag_list_url %} + {% if content.is_opinion %} + {% url 'opinion:list' %} + {% else %} + {% url 'publication:list' %} + {% endif %} +{% endcaptureas %} + +{% if db_content.tags.all|length > 0 %} + +{% endif %} diff --git a/templates/tutorialv2/includes/headline/update_date.part.html b/templates/tutorialv2/includes/headline/update_date.part.html new file mode 100644 index 0000000000..e30f5c9572 --- /dev/null +++ b/templates/tutorialv2/includes/headline/update_date.part.html @@ -0,0 +1,25 @@ +{% load set %} +{% load i18n %} +{% load date %} + +{% if online_mode %} + {% set public_object.last_publication_date as update_date %} +{% else %} + {% set content.update_date as update_date %} +{% endif %} + +{% if update_date %} +

    + {% if online_mode and update_date == public_object.publication_date %} + {% trans "Publié" %} + + {% else %} + {% trans "Dernière mise à jour" %} + + {% endif %} +

    +{% endif %} diff --git a/templates/tutorialv2/includes/headline/validation_info.part.html b/templates/tutorialv2/includes/headline/validation_info.part.html new file mode 100644 index 0000000000..dd05864de8 --- /dev/null +++ b/templates/tutorialv2/includes/headline/validation_info.part.html @@ -0,0 +1,46 @@ +{% load i18n %} +{% load emarkdown %} +{% load captureas %} + +{% captureas validation_comment_from_authors %} + {% if validation.comment_authors %} +
    +

    {% trans "Le message suivant a été laissé à destination des validateurs" %} :

    +
    {{ validation.comment_authors|emarkdown }}
    +
    + {% endif %} +{% endcaptureas %} + +{% if state.current_version_and_reserved %} +

    + {% trans "Cette version est en cours de validation par" %} + {% include "misc/member_item.part.html" with member=validation.validator %}. +

    + {{ validation_comment_from_authors }} +{% endif %} + +{% if state.current_version_and_waiting_validator %} +

    {% trans "Cette version est en attente d’un validateur." %}

    + {{ validation_comment_from_authors }} +{% endif %} + +{% url "content:view-version" content.pk content.slug content.sha_validation as validation_version_url %} + +{% if state.other_version_and_reserved %} +

    + + {% trans "Une autre version de cette publication" %} + + {% trans "est en cours de validation par" %} + {% include "misc/member_item.part.html" with member=validation.validator %}. +

    +{% endif %} + +{% if state.other_version_and_waiting_validator %} +

    + + {% trans "Une autre version de cette publication" %} + + {% trans "est en attente d’un validateur." %} +

    +{% endif %} diff --git a/templates/tutorialv2/includes/meta/dcmi_cards.part.html b/templates/tutorialv2/includes/meta/dcmi_cards.part.html new file mode 100644 index 0000000000..d32427b56b --- /dev/null +++ b/templates/tutorialv2/includes/meta/dcmi_cards.part.html @@ -0,0 +1,18 @@ +{% load displayable_authors %} +{% load joinby %} + + + +{% for author in db_content|displayable_authors:is_online %} + +{% endfor %} + + + + +{% if content.meta_description %}{% endif %} + + +{% if content.source %}{% endif %} + + diff --git a/templates/tutorialv2/includes/image_illu.part.html b/templates/tutorialv2/includes/meta/image_illu.part.html similarity index 100% rename from templates/tutorialv2/includes/image_illu.part.html rename to templates/tutorialv2/includes/meta/image_illu.part.html diff --git a/templates/tutorialv2/includes/opengraph.part.html b/templates/tutorialv2/includes/meta/opengraph.part.html similarity index 100% rename from templates/tutorialv2/includes/opengraph.part.html rename to templates/tutorialv2/includes/meta/opengraph.part.html diff --git a/templates/tutorialv2/includes/sidebar/administration_actions.part.html b/templates/tutorialv2/includes/sidebar/administration_actions.part.html new file mode 100644 index 0000000000..2ae5450331 --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/administration_actions.part.html @@ -0,0 +1,71 @@ +{% load i18n %} +{% load captureas %} +{% load crispy_forms_tags %} + +{% if administration_actions.show_block %} + +{% endif %} diff --git a/templates/tutorialv2/includes/sidebar/authors_management.part.html b/templates/tutorialv2/includes/sidebar/authors_management.part.html new file mode 100644 index 0000000000..32154d3345 --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/authors_management.part.html @@ -0,0 +1,42 @@ +{% load i18n %} + + +
  • + {% trans "Ajouter un auteur" %} + {% url "content:add-author" content.pk as add_author_url %} + +
  • + +
  • + {% trans "Gérer les auteurs" %} + {% url "content:remove-author" content.pk as remove_author_url %} + +
  • diff --git a/templates/tutorialv2/includes/sidebar/beta_actions.part.html b/templates/tutorialv2/includes/sidebar/beta_actions.part.html new file mode 100644 index 0000000000..6c89299747 --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/beta_actions.part.html @@ -0,0 +1,100 @@ +{% load i18n %} +{% load captureas %} + + +{% url "content:set-beta" content.pk content.slug as set_beta_url %} + + +{% captureas version %} + {% if version %}{{ version }}{% else %}{{ content.sha_draft }}{% endif %} +{% endcaptureas %} + + +{% if beta_actions.show_block %} + +{% endif %} diff --git a/templates/tutorialv2/includes/sidebar/contributors_management.part.html b/templates/tutorialv2/includes/sidebar/contributors_management.part.html new file mode 100644 index 0000000000..27aa45ca3d --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/contributors_management.part.html @@ -0,0 +1,39 @@ +{% load i18n %} +{% load crispy_forms_tags %} + +
  • + {% trans "Ajouter un contributeur" %} + {% crispy form_add_contributor %} +
  • + +
  • + {% trans "Gérer les contributeurs" %} + {% url "content:remove-contributor" content.pk as delete_contributor_url %} + +
  • diff --git a/templates/tutorialv2/includes/delete.part.html b/templates/tutorialv2/includes/sidebar/delete.part.html similarity index 100% rename from templates/tutorialv2/includes/delete.part.html rename to templates/tutorialv2/includes/sidebar/delete.part.html diff --git a/templates/tutorialv2/includes/sidebar/delete_content.part.html b/templates/tutorialv2/includes/sidebar/delete_content.part.html new file mode 100644 index 0000000000..fa11b0e978 --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/delete_content.part.html @@ -0,0 +1,45 @@ +{% load i18n %} +{% load crispy_forms_tags %} +{% load captureas %} + + + diff --git a/templates/tutorialv2/includes/sidebar/editorialization.part.html b/templates/tutorialv2/includes/sidebar/editorialization.part.html new file mode 100644 index 0000000000..d5a5dd5991 --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/editorialization.part.html @@ -0,0 +1,86 @@ +{% load i18n %} +{% load crispy_forms_tags %} + +{% if display_config.enable_editorialization %} + +{% endif %} diff --git a/templates/tutorialv2/includes/exports.part.html b/templates/tutorialv2/includes/sidebar/exports.part.html similarity index 100% rename from templates/tutorialv2/includes/exports.part.html rename to templates/tutorialv2/includes/sidebar/exports.part.html diff --git a/templates/tutorialv2/includes/sidebar/follow_links.part.html b/templates/tutorialv2/includes/sidebar/follow_links.part.html new file mode 100644 index 0000000000..5cfd95b035 --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/follow_links.part.html @@ -0,0 +1,31 @@ +{% load i18n %} +{% load interventions %} + + +
  • + {% with content_is_followed=object|is_content_followed %} + {% url "content:follow-reactions" object.pk as link_follow %} + {% if content_is_followed %} + {% trans "Suivre ce contenu" as data_onclick %} + {% trans "Ne plus suivre ce contenu" as button_text %} + {% else %} + {% trans "Suivre ce contenu" as button_text %} + {% trans "Ne plus suivre ce contenu" as data_onclick %} + {% endif %} + {% include "notification/follow_template.html" with link=link_follow is_followed=content_is_followed data_onclick=data_onclick button_text=button_text subscriber_count=subscriber_count %} + {% endwith %} +
  • + +
  • + {% with content_is_followed=object|is_content_email_followed %} + {% url "content:follow-reactions" object.pk as link_follow %} + {% if content_is_followed %} + {% trans "Être notifié par courriel" as data_onclick %} + {% trans "Ne plus être notifié par courriel" as button_text %} + {% else %} + {% trans "Être notifié par courriel" as button_text %} + {% trans "Ne plus être notifié par courriel" as data_onclick %} + {% endif %} + {% include "notification/follow_by_email_template.html" with link=link_follow is_followed=content_is_followed data_onclick=data_onclick button_text=button_text %} + {% endwith %} +
  • diff --git a/templates/tutorialv2/includes/sidebar/helps.part.html b/templates/tutorialv2/includes/sidebar/helps.part.html new file mode 100644 index 0000000000..c70ad453de --- /dev/null +++ b/templates/tutorialv2/includes/sidebar/helps.part.html @@ -0,0 +1,51 @@ +{% load i18n %} +{% load captureas %} + +{% if can_edit and not content.is_opinion %} +
    +

    + {% trans "Demander de l'aide" %} + ? +

    + + +
    +{% endif %} diff --git a/templates/tutorialv2/includes/list_of_exports.html b/templates/tutorialv2/includes/sidebar/list_of_exports.html similarity index 99% rename from templates/tutorialv2/includes/list_of_exports.html rename to templates/tutorialv2/includes/sidebar/list_of_exports.html index 1cf63de476..cce3954fde 100644 --- a/templates/tutorialv2/includes/list_of_exports.html +++ b/templates/tutorialv2/includes/sidebar/list_of_exports.html @@ -1,4 +1,5 @@ {% load i18n %} +

    {% trans "Télécharger" %}

    + {% endif %} + + {% for child in container.children %} + {% include "tutorialv2/includes/child.part.html" with child=child %} + {% empty %} + {% if not can_add_something or not container.is_chapter %} +
    +

    + {{ "Ce"|feminize:container.get_level_as_string }} {{ container.get_level_as_string|lower }} {% trans " est vide." %} +

    + {% if container.can_add_extract and container.can_add_container and can_add_something %} + + {% endif %} +
    + {% endif %} + {% endfor %} + {% if display_config.draft_actions.enable_edit %} + {% if container.can_add_container and not container.can_add_extract %} +

    + - {% trans "Ajouter" %} + {% endif %}"> + {% trans "Ajouter un chapitre" %} +
    + + {% trans "Ajouter" %} + +
    +

    +
    +

    {% trans "Cliquer sur ajouter pour ajouter un nouveau chapitre." %}

    - -
    -

    {% trans "Cliquer sur ajouter pour ajouter un nouveau chapitre." %}

    -
    - {% endif %} - {% if not container.can_add_container and container.can_add_extract %} -

    - - {% trans "Ajouter une section" %} - -
    + {% endif %} + {% if not container.can_add_container and container.can_add_extract %} +

    - {% trans "Ajouter" %} + {% endif %}"> + {% trans "Ajouter une section" %} + +

    +
    +

    {% trans "Cliquer sur ajouter pour rédiger une nouvelle section." %}

    -

    -
    -

    {% trans "Cliquer sur ajouter pour rédiger une nouvelle section." %}

    -
    + {% endif %} {% endif %} - {% endif %} -
    +
    - {% if container.conclusion and container.get_conclusion %} - {{ container.get_conclusion|emarkdown:is_js }} - {% elif not content.is_beta %} -
    -

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

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

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

    +
    + {% endif %} - {% include "tutorialv2/includes/chapter_pager.part.html" with position="bottom" %} + {% include "tutorialv2/includes/chapter_pager.part.html" with position="bottom" %} - {% if content.is_beta and container.has_extracts %} - {% include "tutorialv2/includes/warn_typo.part.html" with content=content %} - {% endif %} -{% endblock %} + {% else %} + {% include "tutorialv2/includes/chapter_pager.part.html" with position="top" online=True %} + {% if container.has_extracts %} + {{ container.get_content_online|safe }} + {% else %} + {% if container.introduction %} + {{ container.get_introduction_online|safe }} +
    + {% endif %} + {% include "tutorialv2/includes/child_online.part.html" with child=container hide_title=True %} -{% block sidebar_new %} - {% if can_add_something %} - - {% trans "Éditer" %} - +
    +
    + {% if container.conclusion %} + {{ container.get_conclusion_online|safe }} + {% endif %} - {% if container.can_add_container %} - - {% trans "Ajouter " %} {{ "un"|feminize:container.get_next_level_as_string }} {{ container.get_next_level_as_string|lower }} - {% endif %} - {% if container.can_add_extract %} - - {% trans "Ajouter une section" %} - - {% elif not version or version != content.sha_draft %} - - {% trans "Version brouillon" %} - - {% endif %} + {% include "tutorialv2/includes/chapter_pager.part.html" with position="bottom" online=True %} {% endif %} -{% endblock %} - + {% if display_config.info_config.show_warn_typo and container.has_extracts %} + {% include "tutorialv2/includes/content/warn_typo.part.html" with content=content %} + {% endif %} +{% endblock %} {% block sidebar_actions %} - {% if can_add_something %} + {% if display_config.draft_actions.show_edit_content_link %}
  • - - {% blocktrans with prev="le"|feminize:container.get_level_as_string name=container.get_level_as_string|lower %} - Déplacer {{ prev }} {{ name }} - {% endblocktrans %} - - + {% trans "Éditer" %}
  • {% endif %} - {% if can_edit or is_staff %} + + {% if display_config.draft_actions.show_ready_to_publish %}
  • {% endif %} -{% endblock %} - + {% if display_config.online_config.show_contact_authors %} + {% if not user in content.authors.all %} +
  • + + {% blocktrans count counter=content.authors.all|length %} + Contacter l’auteur par MP + {% plural %} + Contacter les auteurs par MP + {% endblocktrans %} + +
  • + {% endif %} + {% endif %} +{% endblock %} {% block sidebar_blocks %} - {% include "tutorialv2/includes/summary.part.html" with current_container=container %} + {% include "tutorialv2/includes/sidebar/summary.part.html" with current_container=container online=display_config.online_config.enable_summary_online_mode %} - {% if can_add_something %} + {% if display_config.draft_actions.show_deletion_link %} {% endif %} + + {% if display_config.online_config.show_social_buttons %} + {% include "misc/social_buttons.part.html" with link=container.get_absolute_url_online text=container.title %} + {% endif %} +{% endblock %} + +{% block sidebar_new %} + {% if display_config.draft_actions.show_draft_link %} + + {% trans "Version brouillon" %} + + {% endif %} {% endblock %} diff --git a/templates/tutorialv2/view/container_online.html b/templates/tutorialv2/view/container_online.html deleted file mode 100644 index ab6ff983eb..0000000000 --- a/templates/tutorialv2/view/container_online.html +++ /dev/null @@ -1,135 +0,0 @@ -{% extends "tutorialv2/base_online.html" %} -{% load set %} -{% load thumbnail %} -{% load emarkdown %} -{% load i18n %} -{% load times %} -{% load crispy_forms_tags %} - - -{% block title %} - {{ container.title }} - {{ content.title }} -{% endblock %} - -{% block description %} - {% if content.description %} - {{ content.description }} - {% else %} - Site et association de partage de connaissances animé par sa communauté. Vous y trouverez des tutoriels et des articles de tous niveaux et des forums. - {% endif %} -{% endblock %} - -{% block opengraph %} - {% include "tutorialv2/includes/opengraph.part.html" %} -{% endblock %} - -{% block meta_image %}{% spaceless %} - {% include "tutorialv2/includes/image_illu.part.html" with content=content %} -{% endspaceless %}{% endblock %} - -{% block breadcrumb %} - {% if container.parent.parent %} -
  • - {{ container.parent.parent.title }} -
  • - {% endif %} - - {% if container.parent %} -
  • - {{ container.parent.title }} -
  • - {% endif %} - -
  • {{ container.title }}
  • -{% endblock %} - - - -{% block headline %} - {% if content.licence %} -

    - {{ content.licence }} -

    - {% endif %} - -

    - {{ container.title }} -

    - - {% include 'tutorialv2/includes/tags_authors.part.html' with content=content online=True is_part_or_chapter=True %} - - {% if is_obsolete %} -
    -
    - {% blocktrans %} - Ce contenu est obsolète. Il peut contenir des informations intéressantes mais soyez prudent avec celles-ci. - {% endblocktrans %} -
    -
    - {% endif %} -{% endblock %} - - - -{% block content %} - {% if content.is_tutorial %} - {% include "tutorialv2/includes/chapter_pager.part.html" with position="top" online=True %} - {% endif %} - {% if container.has_extracts %} - {{ container.get_content_online|safe }} - {% else %} - - {% if container.introduction %} - {{ container.get_introduction_online|safe }} -
    - {% endif %} - - {% include "tutorialv2/includes/child_online.part.html" with child=container hide_title=True %} - -
    -
    - - {% if container.conclusion %} - {{ container.get_conclusion_online|safe }} - {% endif %} - - {% endif %} - {% if content.is_tutorial %} - {% include "tutorialv2/includes/chapter_pager.part.html" with position="bottom" online=True %} - {% endif %} - - {% include "tutorialv2/includes/warn_typo.part.html" with content=content %} -{% endblock %} - -{% block sidebar_actions %} - - {% if not user in content.authors.all and user.is_authenticated %} -
  • - - {% blocktrans count counter=content.authors.all|length %} - Contacter l’auteur par MP - {% plural %} - Contacter les auteurs par MP - {% endblocktrans %} - -
  • - {% endif %} - -{% endblock %} - -{% block sidebar_blocks %} - {% if is_staff or is_author %} - - {% endif %} - - {% include "tutorialv2/includes/summary.part.html" with current_container=container online=True %} - - {% include "misc/social_buttons.part.html" with link=container.get_absolute_url_online text=container.title %} -{% endblock %} diff --git a/templates/tutorialv2/view/content.html b/templates/tutorialv2/view/content.html index 25e133d74a..a625f61e76 100644 --- a/templates/tutorialv2/view/content.html +++ b/templates/tutorialv2/view/content.html @@ -7,6 +7,22 @@ {% load feminize %} {% load captureas %} {% load pluralize_fr %} +{% load set %} +{% load date %} + + +{% if display_config.online_config.show_dcmi_card %} + {% block DCMI_cards %} + {% include "tutorialv2/includes/meta/dcmi_cards.part.html" with db_content=db_content content=content is_online=db_content.public_version %} + {% endblock %} +{% endif %} + + +{% if display_config.show_meta_image %} + {% block meta_image %}{% spaceless %} + {% include "tutorialv2/includes/meta/image_illu.part.html" with content=content %} + {% endspaceless %}{% endblock %} +{% endif %} {% block title %} @@ -14,832 +30,214 @@ {% endblock %} +{% if display_config.online_config.show_meta_description %} + {% block description %} + {% if content.description %} + {{ content.description }} + {% else %} + Site et association de partage de connaissances animé par sa communauté. Vous y trouverez des tutoriels et des articles de tous niveaux et des forums. + {% endif %} + {% endblock %} +{% endif %} + + +{% if display_config.online_config.show_head_extra %} + {% block head_extra %} + {{ block.super }} + {% if content.converted_to.get_absolute_url_online %} + + {% endif %} + {% endblock %} +{% endif %} + + +{% if display_config.online_config.show_opengraph %} + {% block opengraph %} + {% include "tutorialv2/includes/meta/opengraph.part.html" %} + {% endblock %} +{% endif %} + + {% block breadcrumb %}
  • {{ content.title }}
  • {% endblock %} - {% block headline %} - {% if is_staff or can_edit %} - {% if content.licence %} -
    -

    {{ content.licence }}

    - - {% trans "Modifier la licence" %} - -
    - {% else %} -

    - Choisissez la licence de votre publication ! -

    - {% endif %} + {% include "tutorialv2/includes/headline/header.part.html" with show_thumbnail=True content=content title=content.title subtitle=content.description %} - {% crispy form_edit_license %} - {% elif content.licence %} - {{ content.licence }} - {% endif %} + {% include "tutorialv2/includes/headline/validation_info.part.html" with state=display_config.validation_info %} -

    - {% if content.image %} - - {% endif %} - {{ content.title }} -

    + {% include "tutorialv2/includes/headline/beta_info.part.html" with state=display_config.beta_info beta_topic=beta_topic %} - {% if content.description %} -

    - {{ content.description }} -

    + {% if display_config.info_config.show_help_info %} + {% include "tutorialv2/includes/headline/help_info.part.html" %} {% endif %} - {% if can_edit %} - {% include 'tutorialv2/includes/tags_authors.part.html' with content=content add_author=True online=False %} - {% else %} - {% include 'tutorialv2/includes/tags_authors.part.html' with content=content online=False %} + {% if display_config.info_config.show_opinion_moderation_warning %} + {% include "tutorialv2/includes/headline/opinion_moderation_warning.part.html" %} {% endif %} - {% if is_staff or can_edit %} - {% if content.in_validation %} - {% if validation.version == content.current_version %} - {% if validation.is_pending %} -

    - {% trans "Ce contenu est en attente d’un validateur." %} -

    - {% elif validation.is_pending_valid %} -

    - {% trans "Ce contenu est en cours de validation par" %} - {% include "misc/member_item.part.html" with member=validation.validator %} -

    - {% endif %} - {% if validation.comment_authors %} -
    -

    - {% trans "Le message suivant a été laissé à destination des validateurs" %} : -

    - -
    - {{ validation.comment_authors|emarkdown }} -
    -
    - {% endif %} - {% else %} - {% if validation.is_pending %} -

    - - {% trans "Une autre version de ce contenu" %} - - {% trans "est en attente d’un validateur" %} -

    - {% elif validation.is_pending_valid %} -

    - - {% trans "Une autre version de ce contenu" %} - - {% trans "est en cours de validation par" %} - {% include "misc/member_item.part.html" with member=validation.validator %} -

    - {% endif %} - {% endif %} - {% endif %} + {% if display_config.online_config.show_obsolescence_warning %} + {% include "tutorialv2/includes/headline/obsolescence_warning.part.html" with is_obsolete=is_obsolete %} {% endif %} - {% if content.is_beta %} -
    -
    - {% blocktrans %} - Cette version est en "BÊTA" ! - {% endblocktrans %} - - {% if beta_topic %} - {% blocktrans with url=beta_topic.get_absolute_url %} - Vous pouvez y réagir sur ce sujet. - {% endblocktrans %} - {% endif %} -
    + {% if display_config.alerts_config.show_alerts %} +
    + {% include "misc/alerts.part.html" with alerts=alerts alerts_solve_url='content:resolve-content' %}
    - - {% if content_helps %} -
    -
    - {% if content.authors.count > 1 %} - {% trans "Les auteurs de ce contenu recherchent" %} - {% else %} - {% trans "L’auteur de ce contenu recherche" %} - {% endif %} - - {% for help in content_helps %}{% if not forloop.first %}{% if forloop.last %}{% trans ' et ' %}{% else %}{% trans ', ' %}{% endif %}{% endif %}un {{ help.title|lower }}{% if forloop.last %}{% trans '.' %}{% endif %}{% endfor %} - - {% if not can_edit %} - {% blocktrans with plural=content.authors.count|pluralize_fr %} - N’hésitez pas à le{{ plural }} contacter par MP pour proposer votre aide ! - {% endblocktrans %} - {% endif %} -
    -
    - {% endif %} {% endif %} - {% if not can_publish and content.is_opinion %} -
    -
    - {% trans "Ce contenu a été modéré. Il ne peut pas faire l'objet d'une nouvelle publication." %} -
    -
    + {% if display_config.info_config.show_opinion_promotion %} + {% include "tutorialv2/includes/headline/opinion_promotion_info.part.html" with content=content is_staff=is_staff %} {% endif %} {% endblock %} {% block content %} - {% if content.introduction and content.get_introduction != "" %} - {{ content.get_introduction|emarkdown:is_js }} - {% elif not content.is_beta %} -
    -

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

    -
    + {% if display_config.online_config.show_content_pager %} + {% include "tutorialv2/includes/content/content_pager.part.html" with content=content %} {% endif %} - {% if content.has_extracts or content.can_add_extract %} - + {% if display_config.online_config.show_rendered_source %} + {% include "tutorialv2/includes/content/online_content.part.html" %} + {% else %} + {% include "tutorialv2/includes/content/content.part.html" %} {% endif %} - {% for child in content.children %} - {% include "tutorialv2/includes/child.part.html" with child=child %} - {% empty %} - {% if content.can_add_extract and content.can_add_container and can_add_something %} -
    -

    - {% trans "Ce contenu est actuellement vide." %} {% trans "Vous pouvez :" %} -

    - -
    - {% elif not can_add_something or not content.can_add_extract and not content.can_add_container %} -
    -

    - {% trans "Ce contenu est actuellement vide." %} -

    -
    - {% endif %} - {% endfor %} - {% if can_add_something %} - {% if content.can_add_container and not content.can_add_extract %} -

    - - {% trans "Ajouter une nouvelle partie" %} - - -

    -
    -

    {% trans "Cette partie n'est pas encore créée. Vous devez la créer avant de pouvoir y ajouter un élément." %}

    -
    - {% endif %} - {% if not content.can_add_container and content.can_add_extract %} -

    - - {% trans "Ajouter une section" %} - - -

    -
    -

    {% trans "Cliquer sur ajouter pour rédiger une nouvelle section." %}

    -
    - {% endif %} + {% if display_config.online_config.show_content_pager %} + {% include "tutorialv2/includes/content/content_pager.part.html" with content=content %} {% endif %} - -
    -
    - - {% if content.conclusion and content.get_conclusion != "" %} - {{ content.get_conclusion|emarkdown:is_js }} - {% elif not content.is_beta %} -
    -

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

    -
    + {% if display_config.info_config.show_warn_typo %} + {% include "tutorialv2/includes/content/warn_typo.part.html" with content=content %} {% endif %} - {% if content.is_beta %} - {% include "tutorialv2/includes/warn_typo.part.html" with content=content %} + {% if display_config.alerts_config.show_alert_button %} + {% include "tutorialv2/includes/alert.html" with content=content current_content_type=current_content_type %} {% endif %} {% endblock %} - {% block sidebar_new %} - {% if can_add_something %} - - {% trans "Éditer" %} - - - {% if content.can_add_container %} - - {% trans "Ajouter " %} {{ "un"|feminize:content.get_next_level_as_string }} {{ content.get_next_level_as_string|lower }} - - {% endif %} - - {% if content.can_add_extract %} - - {% trans "Ajouter une section" %} - - {% endif %} - - - {% trans "Importer une nouvelle version" %} + {% if display_config.draft_actions.show_draft_link %} + + {% trans "Voir la page brouillon" %} - {% elif not version or version != content.sha_draft %} - {% if is_staff or can_edit %} - - {% trans "Version brouillon" %} - - {% endif %} {% endif %} {% endblock %} - {% block sidebar_actions %} - {# AUTHORS #} - {% if can_add_something %} -
  • - - {% trans "Ajouter un auteur" %} - - -
  • -
  • - - {% trans "Gérer les auteurs" %} - - -
  • + {% if display_config.online_config.show_follow_actions %} + {% include "tutorialv2/includes/sidebar/follow_links.part.html" %} {% endif %} - {# END AUTHORS #} - {# CONTRIBUTORS #} - {% if can_add_something and formAddReviewer %} + + {% if display_config.online_config.show_propose_feature %}
  • - - {% trans "Ajouter un contributeur" %} - - {% crispy formAddReviewer %} + {% url 'content:request-featured' object.pk as link_request %} + {% if is_requesting %} + {% trans "Proposer la mise en une" as data_onclick %} + {% trans "Ne plus proposer la mise en une" as button_text %} + {% else %} + {% trans "Proposer la mise en une" as button_text %} + {% trans "Ne plus proposer la mise en une" as data_onclick %} + {% endif %} + {% include "featured/includes/featured_request.part.html" with link=link_request is_requesting=is_requesting data_onclick=data_onclick button_text=button_text featured_request_count=featured_request_count %}
  • + {% endif %} + + {% if display_config.online_config.show_contact_authors %}
  • - - {% trans "Gérer les contributeurs" %} + + {% blocktrans count counter=content.authors.all|length %} + Contacter l’auteur par MP + {% plural %} + Contacter les auteurs par MP + {% endblocktrans %} -
  • {% endif %} - {# END CONTRIBUTORS #} - {% if can_edit or is_staff %} - {# BETA #} - {% if content.can_be_in_beta %} - {% if not content.in_beta %} -
  • - - {% trans "Mettre cette version en bêta" %} - - -
  • - {% else %} - {% if not content.is_beta %} -
  • - - {% blocktrans %} - Voir la version en bêta - {% endblocktrans %} - -
  • -
  • - - {% trans "Mettre à jour la bêta avec cette version" %} - - -
  • - {% else %} -
  • - - {% trans "Cette version est déjà en bêta" %} - -
  • - {% endif %} -
  • - - {% trans "Désactiver la bêta" %} - - -
  • - {% endif %} - {% if beta_topic %} -
  • - - {% trans "Voir le sujet de bêta" %} - -
  • - {% endif %} - {% endif %} - {# END BETA #} - {# ONLINE VERSION #} - {% if public_content_object %} -
  • - - {% trans "Voir la version en ligne" %} - -
  • + + {% if display_config.online_config.show_opinion_list_links %} + {% for author in public_object.authors.all %}
  • - - {% trans "Voir les statistiques" %} + {% url "opinion:find-opinion" author.username as opinion_url %} + + {% blocktrans %}Voir la tribune de {{ author }} {% endblocktrans %}
  • -
  • - {% include "tutorialv2/includes/exports.part.html" %} -
  • - {% endif %} - {# END ONLINE VERSION #} - - {% if content.sha_public %} - {# interpreted as: (version and (content.sha_public != version)) or ((not version) and (content.sha_public != content.sha_draft)) #} - {% if version and content.sha_public != version or not version and content.sha_public != content.sha_draft %} -
  • - - {% trans "Comparer avec la version en ligne" %} - -
  • - {% else %} -
  • - - {% trans "Comparer avec la version en ligne (identique)" %} - -
  • - {% endif %} - {% endif %} - - {% if content.sha_beta %} - {# interpreted as: (version and (content.sha_beta != version)) or ((not version) and (content.sha_beta != content.sha_draft)) #} - {% if version and content.sha_beta != version or not version and content.sha_beta != content.sha_draft %} -
  • - - {% trans "Comparer avec la bêta" %} - -
  • - {% else %} -
  • - - {% trans "Comparer avec la bêta (identique)" %} - -
  • - {% endif %} - {% endif %} - - {% if content.in_validation %} - {# interpreted as: (version and (validation.version != version)) or ((not version) and (validation.version != content.sha_draft)) #} - {% if version and validation.version != version or not version and validation.version != content.sha_draft %} -
  • - - {% trans "Comparer avec la version en validation" %} - -
  • - {% else %} -
  • - - {% trans "Comparer avec la version en validation (identique)" %} - -
  • - {% endif %} - {% endif %} + {% endfor %} + {% endif %} - {# HISTORY #} + {% if display_config.draft_actions.show_license_edit %}
  • - - {% trans "Historique des versions" %} - + {% url "content:edit" content.pk content.slug as edit_url %} + {% trans "Éditer" %}
  • - {# END HISTORY #} + {% endif %} - {# EVENTS #} + {% if display_config.draft_actions.show_import_link %}
  • - - {% trans "Journal des événements" %} - + {% url "content:import" content.pk content.slug as import_url %} + {% trans "Importer une nouvelle version" %}
  • - {# END EVENTS #} - - {# VALIDATION OR PUBLICATION (NO VALIDATION BEFORE) #} - {% if content.requires_validation %} - {# Validation (require validation before publication) #} - {% if not content.in_validation %} - {% if content.current_version != content.sha_public %} -
  • - - {% trans "Demander la validation" %} - -
  • - {% endif %} - {% else %} -
  • - {% trans "Annuler la validation" %} - {% crispy formCancel %} -
  • - {% if not content.is_validation %} -
  • - - {% trans "Mettre à jour la version en validation" %} - -
  • - {% endif %} -
  • - {% trans "En attente de validation" %} -
  • - {% endif %} - {% crispy formAskValidation %} - {% else %} - {% if content.is_public %} -
  • - - {% trans "Dépublier" %} - - {% crispy formUnpublication %} -
  • - {% elif can_publish %} -
  • - - {% trans "Publier" %} - - {% crispy formPublication %} -
  • - {% else %} -
  • - - {% trans "Billet modéré" %} - -
  • - {% endif %} - {% endif %} - {# END VALIDATION OR PUBLICATION #} + {% endif %} + {% if display_config.draft_actions.show_authors_management %} + {% include "tutorialv2/includes/sidebar/authors_management.part.html" %} {% endif %} - {# GALERY #} - {% if can_edit %} -
  • - - {% trans "Aller à la galerie liée" %} - -
  • + {% if display_config.draft_actions.show_contributors_management %} + {% include "tutorialv2/includes/sidebar/contributors_management.part.html" %} {% endif %} - {# END GALERY #} {% endblock %} {% block sidebar_blocks %} - {% if is_staff %} - - + {% include "tutorialv2/includes/sidebar/public_actions.part.html" with public_actions=display_config.public_actions %} + + {% include "tutorialv2/includes/sidebar/administration_actions.part.html" with administration_actions=display_config.administration_actions %} + + {% include "tutorialv2/includes/sidebar/beta_actions.part.html" with beta_actions=display_config.beta_actions %} + + {% include "tutorialv2/includes/sidebar/validation.part.html" %} + + {% if display_config.draft_actions.show_helps %} + {% include "tutorialv2/includes/sidebar/helps.part.html" %} {% endif %} - {% if is_staff or can_edit %} - + {% include "tutorialv2/includes/sidebar/editorialization.part.html" %} + + {% if display_config.draft_actions.show_deletion_link %} + {% include "tutorialv2/includes/sidebar/delete_content.part.html" %} {% endif %} - {% if can_edit and not content.is_opinion %} -
    -

    - {% trans "Demander de l'aide" %} - ? -

    - - + {% include "tutorialv2/includes/sidebar/summary.part.html" with online=display_config.online_config.enable_summary_online_mode %} + + {% if display_config.online_config.show_social_buttons %} + {% include "misc/social_buttons.part.html" with link=content.get_absolute_url_online text=content.title %} + {% endif %} + + {% if display_config.online_config.show_exports %} + {% endif %} - {% include "tutorialv2/includes/summary.part.html" %} - - {% if can_edit %} - {% if not version or content.sha_draft == version %} - - {% endif %} +{% endblock %} + + + +{% block content_after %} + {% if display_config.online_config.show_suggestions %} + {% include "tutorialv2/includes/content_suggestion.part.html" with content=content content_suggestions=content_suggestions_random %} + {% endif %} + + {% if display_config.online_config.show_comments %} + {% include "tutorialv2/includes/comments.part.html" with content=content reactions=reactions %} {% endif %} {% endblock %} diff --git a/templates/tutorialv2/view/content_online.html b/templates/tutorialv2/view/content_online.html deleted file mode 100644 index a5175aeb6b..0000000000 --- a/templates/tutorialv2/view/content_online.html +++ /dev/null @@ -1,435 +0,0 @@ -{% extends "tutorialv2/base_online.html" %} -{% load emarkdown %} -{% load profile %} -{% load date %} -{% load captureas %} -{% load set %} -{% load thumbnail %} -{% load i18n %} -{% load crispy_forms_tags %} -{% load interventions %} -{% load pluralize_fr %} -{% load displayable_authors %} -{% load joinby %} - - -{% block title %} - {{ content.title }} -{% endblock %} - -{% block DCMI_cards %} - - - {% for author in publishablecontent|displayable_authors:True %} - - {% endfor %} - - - - - {% if content.meta_description %}{% endif %} - - - {% if content.source %}{% endif %} - - -{% endblock %} - -{% block description %} - {% if content.description %} - {{ content.description }} - {% else %} - Site et association de partage de connaissances animé par sa communauté. Vous y trouverez des tutoriels et des articles de tous niveaux et des forums. - {% endif %} -{% endblock %} - - - -{% block meta_image %}{% spaceless %} - {% include "tutorialv2/includes/image_illu.part.html" with content=content %} -{% endspaceless %}{% endblock %} - - -{% block head_extra %} - {{ block.super }} - {% if content.converted_to.get_absolute_url_online %} - - {% endif %} -{% endblock %} - - -{% block opengraph %} - {% include "tutorialv2/includes/opengraph.part.html" %} -{% endblock %} - - - -{% block breadcrumb %} -
  • {{ content.title }}
  • -{% endblock %} - - - -{% block headline %} - {% if content.licence %} - - {{ content.licence }} - - {% endif %} - -

    - {% if content.image %} - - {% endif %} - {{ content.title }} -

    - - {% if content.description %} -

    - {{ content.description }} -

    - {% endif %} - - {% include 'tutorialv2/includes/tags_authors.part.html' with content=content online=True %} - - {% if is_obsolete %} -
    -
    - {% blocktrans %} - Ce contenu est obsolète. Il peut contenir des informations intéressantes mais soyez prudent avec celles-ci. - {% endblocktrans %} -
    -
    - {% endif %} -{% endblock %} - - - -{% block content %} - {% if is_staff %} -
    - {% include "misc/alerts.part.html" with alerts=alerts alerts_solve_url='content:resolve-content' %} -
    - {% endif %} - - {% if content.is_opinion %} - {% if content.converted_to %} - {% if content.converted_to.get_absolute_url_online %} -
    - {% blocktrans with url_article=content.converted_to.get_absolute_url_online %} - Ce billet a été promu en article. - {% endblocktrans %} -
    - {% elif is_staff %} -
    - {% blocktrans with url_article=content.converted_to.get_absolute_url %} - Ce billet a fait l’objet d’une demande de publication en tant qu’article. Il est donc présent dans la zone de validation en attente de prise en charge par un validateur. - {% endblocktrans %} -
    - {% endif %} - {% endif %} - {% endif %} - - {% captureas content_pager %} - {% include "tutorialv2/includes/content_pager.part.html" with content=content %} - {% endcaptureas %} - - {{ content_pager }} - - {% if content.has_extracts %} - {{ content.get_content_online|safe }} - {% else %} - {% if content.introduction %} - {{ content.get_introduction_online|default:""|safe }} - {% endif %} - - {% if not content.has_sub_containers %} -
      - {% endif %} - - {% for child in content.children %} - {% include "tutorialv2/includes/child_online.part.html" with child=child %} - {% endfor %} - - {% if not content.has_sub_containers %} -
    - {% endif %} - -
    -
    - - {% if content.conclusion %} - {{ content.get_conclusion_online|default:""|safe }} - {% endif %} - - {% endif %} - {{ content_pager }} - {% include "tutorialv2/includes/alert.html" with content=content current_content_type=current_content_type %} - {% include "tutorialv2/includes/warn_typo.part.html" with content=content %} - -{% endblock %} - -{% block sidebar_actions %} - {% if user.is_authenticated %} -
  • - {% with content_is_followed=object|is_content_followed %} - {% url 'content:follow-reactions' object.pk as link_follow %} - {% if content_is_followed %} - {% trans "Suivre ce contenu" as data_onclick %} - {% trans "Ne plus suivre ce contenu" as button_text %} - {% else %} - {% trans "Suivre ce contenu" as button_text %} - {% trans "Ne plus suivre ce contenu" as data_onclick %} - {% endif %} - {% include 'notification/follow_template.html' with link=link_follow is_followed=content_is_followed data_onclick=data_onclick button_text=button_text subscriber_count=subscriber_count %} - {% endwith %} -
  • -
  • - {% with content_is_followed=object|is_content_email_followed %} - {% url 'content:follow-reactions' object.pk as link_follow %} - {% if content_is_followed %} - {% trans "Être notifié par courriel" as data_onclick %} - {% trans "Ne plus être notifié par courriel" as button_text %} - {% else %} - {% trans "Être notifié par courriel" as button_text %} - {% trans "Ne plus être notifié par courriel" as data_onclick %} - {% endif %} - {% include 'notification/follow_by_email_template.html' with link=link_follow is_followed=content_is_followed data_onclick=data_onclick button_text=button_text %} - {% endwith %} -
  • -
  • - {% url 'content:request-featured' object.pk as link_request %} - {% if is_requesting %} - {% trans "Proposer la mise en une" as data_onclick %} - {% trans "Ne plus proposer la mise en une" as button_text %} - {% else %} - {% trans "Proposer la mise en une" as button_text %} - {% trans "Ne plus proposer la mise en une" as data_onclick %} - {% endif %} - {% include 'featured/includes/featured_request.part.html' with link=link_request is_requesting=is_requesting data_onclick=data_onclick button_text=button_text featured_request_count=featured_request_count %} - -
  • - {% if not user in content.authors.all %} -
  • - - {% blocktrans count counter=content.authors.all|length %} - Contacter l’auteur par MP - {% plural %} - Contacter les auteurs par MP - {% endblocktrans %} - -
  • - {% endif %} - {% endif %} - {% if public_object.is_opinion %} - {% for author in public_object.authors.all %} -
  • - - {% blocktrans %} - Voir la tribune de {{ author }} - {% endblocktrans %} - -
  • - {% endfor %} - {% endif %} -{% endblock %} - -{% block sidebar_blocks %} - {% include "tutorialv2/includes/summary.part.html" with online=True %} - - {% if is_staff or is_author %} - - {% endif %} - {% if is_staff or is_author %} - - {% endif %} - {% include "misc/social_buttons.part.html" with link=content.get_absolute_url_online text=content.title %} -{% endblock %} - -{% block content_after %} - {% include "tutorialv2/includes/content_suggestion.part.html" with content=content content_suggestions=content_suggestions_random %} -

    - {% if content.get_note_count > 0 %} - - {{ content.get_note_count }} - - {% trans "commentaire" %}{{ content.get_note_count|pluralize_fr }} - {% else %} - {% trans "Aucun commentaire" %} - {% endif %} -

    - - - {% include "misc/paginator.html" with position="top" topic=content is_online=True anchor="comments" %} - - {% set perms.tutorialv2.change_contentreaction as is_staff %} - - {% for message in reactions %} - - {% captureas edit_link %} - {% url "content:update-reaction" %}?message={{ message.pk }}&pk={{ content.pk }} - {% endcaptureas %} - - {% captureas cite_link %} - {% url "content:add-reaction" %}?cite={{ message.pk }}&pk={{ content.pk }} - {% endcaptureas %} - - {% captureas karma_link %} - {% url "api:content:reaction-karma" message.pk %} - {% endcaptureas %} - - {% captureas alerts_solve_link %} - {% url "content:resolve-reaction" %} - {% endcaptureas %} - {% captureas alert_link %} - {% url "content:alert-reaction" message.pk %} - {% endcaptureas %} - {% captureas hide_link %} - {% url "content:hide-reaction" message.pk%} - {% endcaptureas %} - - {% captureas show_link %} - {% url "content:show-reaction" message.pk %} - {% endcaptureas %} - - {% if forloop.first and page_obj.number > 1 %} - {% set True as is_repeated_message %} - {% else %} - {% set False as is_repeated_message %} - {% endif %} - - {% if user == message.author or is_staff %} - {% set True as can_view_history %} - {% else %} - {% set False as can_view_history %} - {% endif %} - - {% include "misc/message.part.html" with perms_change=is_staff topic=object %} - {% endfor %} - - - {% include "misc/paginator.html" with position="bottom" topic=content is_online=True anchor="comments" %} - - - - {% captureas form_action %} - {% url 'content:add-reaction' %}?pk={{ content.pk }} - {% endcaptureas %} - - {% if object.last_note %} - {% captureas last_note_pk %} - {{ object.last_note.pk }} - {% endcaptureas %} - {% endif %} - - {% include "misc/message_form.html" with member=user topic=content is_antispam=is_antispam %} -{% endblock %} diff --git a/templates/tutorialv2/view/diff.html b/templates/tutorialv2/view/diff.html index eaddb93f30..699515051a 100644 --- a/templates/tutorialv2/view/diff.html +++ b/templates/tutorialv2/view/diff.html @@ -33,8 +33,6 @@

    {{ content.title }}

    - {% include 'tutorialv2/includes/tags_authors.part.html' with online=False%} - Retour