Skip to content
Open
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
12 changes: 4 additions & 8 deletions templates/tutorialv2/list_page_elements/call_for_helps.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ <h3>{% trans 'Donnez votre avis' %}</h3>
</div>

<div class="body">
<p>{% trans "Aidez à peaufiner le fond et la forme des contenus presque terminés." %}</p>
<p>{% trans "Aidez à peaufiner le fond et la forme des publications presque terminées." %}</p>
</div>

<a href="{{ beta_forum.get_absolute_url }}" class="tail">
<p>{% trans "Consulter les contenus en bêta" %}</p>
<p>{% trans "Consulter les publications en bêta" %}</p>
</a>
</div>

Expand All @@ -24,15 +24,11 @@ <h3>{% trans 'Partagez votre savoir' %}</h3>
</div>

<div class="body">
<p>{% trans "Vous avez un savoir à partager ? Vous vous sentez pédagogue ? Commencez donc l’écriture d’un contenu !" %}</p>
<p>{% trans "Vous avez un savoir à partager ? Vous vous sentez pédagogue ? Commencez donc l’écriture d’une publication !" %}</p>
</div>

<a href="{% url "content:create-content" created_content_type='TUTORIAL' %}" class="tail">
<p>{% trans 'Écrire un tutoriel' %}</p>
</a>

<a href="{% url "content:create-content" created_content_type='ARTICLE' %}" class="tail">
<p>{% trans 'Écrire un article' %}</p>
<p>{% trans 'Commencer à rédiger' %}</p>
</a>
</div>

Expand Down
3 changes: 0 additions & 3 deletions templates/tutorialv2/view/base_categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ <h2 class="has-separator">Parcourir</h2>
{% if subcategory %}
<span class="has-separator option">{% trans 'Catégorie :' %} <strong><a href="{% url 'publication:subcategory' slug_category=category.slug slug=subcategory.slug %}">{{subcategory}}</a></strong></span>
{% endif %}
{% if type %}
<span class="has-separator option">{% trans 'Type :' %} <strong>{{type}}</strong></span>
{% endif %}
{% if tag %}
<span class="has-separator option">{% trans 'Tag :' %} <strong>{{tag}}</strong></span>
{% endif %}
Expand Down
54 changes: 12 additions & 42 deletions templates/tutorialv2/view/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,6 @@


{% block content_category %}
{% comment %}
First level page
- 2 featured tutorials
- all 4 knownledge domains presentation
- 1 column with last 6 contents
- 1 column with 6 most commented contents
- self investment block

<section>
<h2 itemprop="name">{% trans 'À la une' %}</h2>
<div class="featured-resource-row">
{% for featured_content in featured_contents %}
{% include "featured/includes/featured_resource_item.part.html" with featured_resource=featured_content %}
{% endfor %}
</div>
</section>
{% endcomment %}

<section>
{% captureas url_view_goals %}{% url "content:view-goals" %}{% endcaptureas %}
{% blocktrans %}
Expand All @@ -39,31 +21,19 @@ <h2 class="inline" itemprop="name">{% trans 'Domaines de savoir' %}</h2>
</div>
</section>

<div class="flexpage-column">
<section>
<h2 itemprop="name">
<span>{% trans 'Derniers tutoriels' %}</span>
<a href="{% url "tutorial:feed-rss" %}" class="btn btn-grey">RSS</a>
<a href="{% url "tutorial:feed-atom" %}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_tutorials col_number=1 %}
{% if last_tutorials and more_tutorials %}
<a href="{% url 'publication:list' %}?type=tutorial" class="more-link">Plus de tutoriels</a>
{% endif %}
</section>

<section>
<h2 itemprop="name">
<span>{% trans 'Derniers articles' %}</span>
<a href="{% url "article:feed-rss" %}" class="btn btn-grey">RSS</a>
<a href="{% url "article:feed-atom" %}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_articles col_number=1 %}
{% if last_articles and more_articles %}
<a href="{% url 'publication:list' %}?type=article" class="more-link">Plus d’articles</a>
<section>
<h2 itemprop="name">
<span>{% trans 'Dernières publications' %}</span>
<a href="{% url "content:feed-rss" %}" class="btn btn-grey">RSS</a>
<a href="{% url "content:feed-atom" %}" class="btn btn-grey">Atom</a>
</h2>
<div>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_contents col_number=2 %}
{% if last_contents and more_contents %}
<a href="{% url 'publication:list' %}?type" class="more-link">Plus de publications</a>
{% endif %}
</section>
</div>
</div>
</section>

{% include 'tutorialv2/list_page_elements/call_for_helps.html' %}
{% endblock %}
43 changes: 14 additions & 29 deletions templates/tutorialv2/view/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
{% load i18n %}

{% comment %}
Structure de la page de second level :
- présentation des sous catégories (accessible via {% for subcategory in subcategories %}
- liste des 5 derniers tutos en une colonne
- liste des 5 derniers articles en une colonne
Structure de la page de second niveau :
- présentation des sous catégories
- liste des dernières publications
{% endcomment %}

{% block content_category %}
Expand All @@ -14,29 +13,15 @@ <h2 class="inline" itemprop="name">Catégories dans {{ category.title }}</h2>
{% include 'tutorialv2/list_page_elements/list_subcategories.html' with subcategories=subcategories %}
</section>

<div class="flexpage-column">
<section>
<h2 itemprop="name">
<span>{% trans "Derniers tutoriels" %}</span>
<a href="{% url "tutorial:feed-rss" %}?category={{ category.slug }}" class="btn btn-grey">RSS</a>
<a href="{% url "tutorial:feed-atom" %}?category={{ category.slug }}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_tutorials col_number=1 %}
{% if last_tutorials and more_tutorials %}
<a href="{% url 'publication:list' %}?category={{ category.slug }}&amp;type=tutorial" class="more-link">Plus de tutoriels dans {{ category.title }}</a>
{% endif %}
</section>

<section>
<h2 itemprop="name">
<span>{% trans "Derniers articles" %}</span>
<a href="{% url "article:feed-rss" %}?category={{ category.slug }}" class="btn btn-grey">RSS</a>
<a href="{% url "article:feed-atom" %}?category={{ category.slug }}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_articles col_number=1 %}
{% if last_articles and more_articles %}
<a href="{% url 'publication:list' %}?category={{ category.slug }}&amp;type=article" class="more-link">Plus d’articles dans {{ category.title }}</a>
{% endif %}
</section>
</div>
<section>
<h2 itemprop="name">
<span>{% trans "Dernières publications" %}</span>
<a href="{% url "content:feed-rss" %}?category={{ category.slug }}" class="btn btn-grey">RSS</a>
<a href="{% url "content:feed-atom" %}?category={{ category.slug }}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_contents col_number=1 %}
{% if last_contents and more_contents %}
<a href="{% url 'publication:list' %}?category={{ category.slug }}" class="more-link">Plus de publications dans {{ category.title }}</a>
{% endif %}
</section>
{% endblock %}
35 changes: 11 additions & 24 deletions templates/tutorialv2/view/subcategory.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,16 @@

{% block content_category %}

<div class="flexpage-column">
<section>
<h2 itemprop="name">
<span>{% trans "Derniers tutoriels" %}</span>
<a href="{% url "tutorial:feed-rss" %}?subcategory={{ subcategory.slug }}" class="btn btn-grey">RSS</a>
<a href="{% url "tutorial:feed-atom" %}?subcategory={{ subcategory.slug }}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_tutorials col_number=1 %}
{% if last_tutorials and more_tutorials %}
<a href="{% url 'publication:list' %}?subcategory={{ subcategory.slug }}&amp;type=tutorial" class="more-link">Plus de tutoriels dans {{ subcategory.title }}</a>
{% endif %}
</section>
<section>
<h2 itemprop="name">
<span>{% trans "Dernières publications" %}</span>
<a href="{% url "content:feed-rss" %}?subcategory={{ subcategory.slug }}" class="btn btn-grey">RSS</a>
<a href="{% url "content:feed-atom" %}?subcategory={{ subcategory.slug }}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_contents col_number=2 %}
{% if last_contents and more_contents %}
<a href="{% url 'publication:list' %}?subcategory={{ subcategory.slug }}" class="more-link">Plus de publications dans {{ subcategory.title }}</a>
{% endif %}
</section>

<section>
<h2 itemprop="name">
<span>{% trans "Derniers articles" %}</span>
<a href="{% url "article:feed-rss" %}?subcategory={{ subcategory.slug }}" class="btn btn-grey">RSS</a>
<a href="{% url "article:feed-atom" %}?subcategory={{ subcategory.slug }}" class="btn btn-grey">Atom</a>
</h2>
{% include 'tutorialv2/list_page_elements/list_of_online_contents.html' with public_contents=last_articles col_number=1 %}
{% if last_articles and more_articles %}
<a href="{% url 'publication:list' %}?subcategory={{ subcategory.slug }}&amp;type=article" class="more-link">Plus d’articles dans {{ subcategory.title }}</a>
{% endif %}
</section>
</div>
{% endblock %}
6 changes: 3 additions & 3 deletions zds/settings/abstract_base/zds.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@
"max_tree_depth": 3,
"default_licence_pk": 7,
"content_per_page": 42,
"max_last_publications_level_1": 6,
"max_last_publications_level_2": 12,
"max_last_publications_level_3": 12,
"max_last_publications_level_1": 12,
"max_last_publications_level_2": 24,
"max_last_publications_level_3": 24,
"notes_per_page": 25,
"helps_per_page": 20,
"commits_per_page": 20,
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class PublishedContentFactory(PublishableContentFactory):
"""

@classmethod
def _generate(cls, create, attrs):
def _generate(cls, create, attrs) -> PublishableContent:
# This parameter is only used inside _generate() and won't be saved in the database,
# which is why we use attrs.pop() (it is removed from attrs).
is_major_update = attrs.pop("is_major_update", True)
Expand Down
8 changes: 0 additions & 8 deletions zds/tutorialv2/tests/tests_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ def test_public_lists(self):
article_unpublished = PublishableContentFactory(author_list=[self.user_author], type="ARTICLE")
self.client.logout()

resp = self.client.get(reverse("publication:list") + "?type=tutorial")
self.assertContains(resp, tutorial.title)
self.assertNotContains(resp, tutorial_unpublished.title)

resp = self.client.get(reverse("publication:list") + "?type=article")
self.assertContains(resp, article.title)
self.assertNotContains(resp, article_unpublished.title)

resp = self.client.get(reverse("tutorial:find-tutorial", args=[self.user_author.username]) + "?filter=public")
self.assertContains(resp, tutorial.title)
self.assertNotContains(resp, tutorial_unpublished.title)
Expand Down
Loading