Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactorise les urls des Mise en une #6284

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions templates/featured/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@


{% block breadcrumb_base %}
<li><a href="{% url 'featured-resource-list' %}">{% trans "Mise en avant du site" %}</a></li>
<li><a href="{% url "featured:resource-list" %}">{% trans "Mise en avant du site" %}</a></li>
{% endblock %}



{% block sidebar %}
<aside class="sidebar accordeon mobile-menu-bloc" data-title="{% trans 'Action sur les unes' %}">
<a href="{% url 'featured-message-create' %}" class="new-btn ico-after more blue">
<a href="{% url "featured:message-create" %}" class="new-btn ico-after more blue">
{% trans "Éditer le message d’accueil" %}
</a>
<a href="{% url 'featured-resource-create' %}" class="new-btn ico-after more blue">
<a href="{% url "featured:resource-create" %}" class="new-btn ico-after more blue">
{% trans "Nouvelle une" %}
</a>
<a href="{% url 'featured-resource-requests' %}" class="new-btn ico-after star blue">
<a href="{% url "featured:resource-requests" %}" class="new-btn ico-after star blue">
{% trans "Liste des requêtes pour les unes" %}
</a>

Expand Down
4 changes: 2 additions & 2 deletions templates/featured/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<input name="items" type="checkbox" value="{{ featured_resource.pk }}" form="form-delete-featured">
</div>
<div class="topic-description">
<a href="{% url 'featured-resource-update' featured_resource.pk %}" class="topic-title-link navigable-link">
<a href="{% url "featured:resource-update" featured_resource.pk %}" class="topic-title-link navigable-link">
<img src="{{ featured_resource.image_url|remove_url_scheme }}"
data-caption="{{ featured_resource.title }}"
alt="{{ featured_resource.title }}"
Expand Down Expand Up @@ -72,7 +72,7 @@
{% include "misc/paginator.html" with position="bottom" %}

<!-- Confirmation modal for deleting featured -->
<form id="form-delete-featured" name="form" method="post" action="{% url "featured-resource-list-delete" %}" class="modal modal-flex">
<form id="form-delete-featured" name="form" method="post" action="{% url "featured:resource-list-delete" %}" class="modal modal-flex">
{% csrf_token %}
<p>{% trans "Attention, vous vous apprêtez à supprimer toutes les unes sélectionnées." %}</p>
<button type="submit" name="delete_multi" class="btn btn-submit">{% trans "Confirmer" %}</button>
Expand Down
18 changes: 9 additions & 9 deletions templates/featured/list_requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
<td>{{ featured_request.num_vote }}</td>
<td>
{% if featured_request.rejected %}
<button type="button" class="btn btn-grey ico-after cross unpick-action" data-url="{% url 'featured-resource-request-update' featured_request.pk %}"
<button type="button" class="btn btn-grey ico-after cross unpick-action" data-url="{% url "featured:resource-request-update" featured_request.pk %}"
data-operation="CONSIDER">{% trans "Ne plus ignorer" %}</button>
{% else %}
<button type="button" class="btn btn-grey ico-after hide unpick-action" data-url="{% url 'featured-resource-request-update' featured_request.pk %}"
<button type="button" class="btn btn-grey ico-after hide unpick-action" data-url="{% url "featured:resource-request-update" featured_request.pk %}"
data-operation="REJECT">{% trans "Ignorer" %}</button>
{% endif %}

<button type="button" class="btn btn-grey ico-after hide unpick-action" data-url="{% url 'featured-resource-request-update' featured_request.pk %}"
<button type="button" class="btn btn-grey ico-after hide unpick-action" data-url="{% url "featured:resource-request-update" featured_request.pk %}"
data-operation="REJECT_FOR_GOOD">{% trans "Ignorer définitivement" %}</button>

<a href="{% url "featured-resource-create" %}?content_type={% if featured_request.type == 'TOPIC' %}topic{% else %}published_content{% endif %}&amp;content_id={{ featured_request.content_object.pk }}">
<a href="{% url "featured:resource-create" %}?content_type={% if featured_request.type == 'TOPIC' %}topic{% else %}published_content{% endif %}&amp;content_id={{ featured_request.content_object.pk }}">
<button type="button" class="btn btn-grey ico-after star">{% trans "Nouvelle une" %}</button>
</a>
</td>
Expand All @@ -95,28 +95,28 @@
<h3>{% trans "Filtres" %}</h3>
<ul>
<li>
<a href="{% url "featured-resource-requests" %}?type=topic" class="ico-after view {% if request.GET.type == "topic" %}selected{% endif %}">
<a href="{% url "featured:resource-requests" %}?type=topic" class="ico-after view {% if request.GET.type == "topic" %}selected{% endif %}">
{% trans "Sujets proposés" %}
</a>
</li>
<li>
<a href="{% url "featured-resource-requests" %}?type=content" class="ico-after view {% if request.GET.type == "content" %}selected{% endif %}">
<a href="{% url "featured:resource-requests" %}?type=content" class="ico-after view {% if request.GET.type == "content" %}selected{% endif %}">
{% trans "Contenus proposés" %}
</a>
</li>
<li>
<a href="{% url "featured-resource-requests" %}?type=ignored" class="ico-after view {% if request.GET.type == "ignored" %}selected{% endif %}">
<a href="{% url "featured:resource-requests" %}?type=ignored" class="ico-after view {% if request.GET.type == "ignored" %}selected{% endif %}">
{% trans "Requêtes ignorées" %}
</a>
</li>
<li>
<a href="{% url "featured-resource-requests" %}?type=accepted" class="ico-after view {% if request.GET.type == "accepted" %}selected{% endif %}">
<a href="{% url "featured:resource-requests" %}?type=accepted" class="ico-after view {% if request.GET.type == "accepted" %}selected{% endif %}">
{% trans "Requêtes acceptées" %}
</a>
</li>
{% if request.GET.type %}
<li>
<a href="{% url "featured-resource-requests" %}" class="ico-after cross red">
<a href="{% url "featured:resource-requests" %}" class="ico-after cross red">
{% trans "Annuler le filtre" %}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion templates/featured/resource/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3>{% trans "Actions" %}</h3>
<a href="#delete-featured-resource" class="open-modal ico-after cross blue">
{% trans "Supprimer la une" %}
</a>
<form action="{% url "featured-resource-delete" featured_resource.pk %}" method="post" id="delete-featured-resource" class="modal modal-flex">
<form action="{% url "featured:resource-delete" featured_resource.pk %}" method="post" id="delete-featured-resource" class="modal modal-flex">
<p>
{% trans "Attention, vous vous apprêtez à supprimer définitivement cette une." %}
</p>
Expand Down
2 changes: 1 addition & 1 deletion templates/forum/topic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ <h3>{% trans "Modération" %}</h3>
</li>
{% if perms.featured.change_featuredresource %}
<li>
<a href="{% url "featured-resource-create" %}?content_type=topic&amp;content_id={{ topic.pk }}" class="ico-after star blue">
<a href="{% url "featured:resource-create" %}?content_type=topic&amp;content_id={{ topic.pk }}" class="ico-after star blue">
{% trans "Ajouter en une" %}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ <h1 class="dropdown-title">{{ user.username|truncatechars:25 }}</h1>

{% if perms.featured.change_featuredresource %}
<li class="staff-only">
<a href="{% url 'featured-resource-list' %}">{% trans 'Gestion des mises en avant' %}</a>
<a href="{% url "featured:resource-list" %}">{% trans 'Gestion des mises en avant' %}</a>
</li>
{% endif %}
<li>
Expand Down
2 changes: 1 addition & 1 deletion templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h1 class="home-heading heading-white ico-after ico-news" itemprop="name">
<span>{% trans "À la une" %}</span>

{% if perms.featured.change_featuredresource %}
<a href="{% url "featured-resource-list" %}" class="btn btn-grey">{% trans "Gérer les unes" %}</a>
<a href="{% url "featured:resource-list" %}" class="btn btn-grey">{% trans "Gérer les unes" %}</a>
{% endif %}
</h1>

Expand Down
2 changes: 1 addition & 1 deletion templates/tutorialv2/view/content_online.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h3>{% blocktrans %}Admin<span class="wide">istration</span>{% endblocktrans %}<
</li>
{% if perms.featured.change_featuredresource %}
<li>
<a href="{% url "featured-resource-create" %}?content_type=published_content&amp;content_id={{ content.pk }}"
<a href="{% url "featured:resource-create" %}?content_type=published_content&amp;content_id={{ content.pk }}"
class="ico-after star blue">
{% trans "Ajouter en une" %}
</a>
Expand Down
4 changes: 2 additions & 2 deletions zds/featured/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_class = "content-wrapper"
self.helper.form_method = "post"
self.helper.form_action = reverse("featured-resource-create")
self.helper.form_action = reverse("featured:resource-create")

fields = [Field("request"), Field("title"), Field("type"), Field("authors"), Field("image_url"), Field("url")]

Expand Down Expand Up @@ -92,7 +92,7 @@ def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_class = "content-wrapper"
self.helper.form_method = "post"
self.helper.form_action = reverse("featured-message-create")
self.helper.form_action = reverse("featured:message-create")

self.helper.layout = Layout(
Field("hook"),
Expand Down
Loading