Commit 50c29aa4 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Add trash + a lot of improvements on recipes in user panel

parent c9bf2ec7
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-05 15:16+0100\n"
"PO-Revision-Date: 2017-11-05 15:16+0100\n"
"POT-Creation-Date: 2017-11-05 19:26+0100\n"
"PO-Revision-Date: 2017-11-05 19:27+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
......@@ -113,7 +113,7 @@ msgid "Category"
msgstr "Catégorie"
#: main/models/Category.py:16 templates/panel/base.html:222
#: templates/panel/recipes.html:81 templates/panel/recipes.html:147
#: templates/panel/recipes.html:94 templates/panel/recipes.html:160
#: templates/website/sidebar.html:9
msgid "Categories"
msgstr "Catégories"
......@@ -189,17 +189,21 @@ msgstr "activer les commentaires"
msgid "published"
msgstr "publié"
#: main/models/Recipe.py:38
#: main/models/Recipe.py:38 panel/urls.py:14 templates/panel/recipes.html:34
msgid "trash"
msgstr "corbeille"
#: main/models/Recipe.py:39
msgid "slug"
msgstr "slug"
#: main/models/Recipe.py:55
#: main/models/Recipe.py:56
msgid "Recipe"
msgstr "Recette"
#: main/models/Recipe.py:56 templates/panel/base.html:221
#: templates/panel/index.html:23 templates/panel/recipes.html:16
#: templates/panel/recipes.html:20
#: main/models/Recipe.py:57 templates/panel/base.html:221
#: templates/panel/index.html:23 templates/panel/recipes.html:17
#: templates/panel/recipes.html:21
msgid "Recipes"
msgstr "Recettes"
......@@ -207,7 +211,17 @@ msgstr "Recettes"
msgid "page"
msgstr "page"
#: panel/views/IndexView.py:34 panel/views/RecipesView.py:98
#: panel/urls.py:15 templates/panel/recipes.html:29
msgctxt "url"
msgid "mine"
msgstr "moi"
#: panel/urls.py:17 templates/panel/recipes.html:31
msgctxt "url"
msgid "published"
msgstr "publie"
#: panel/views/IndexView.py:34 panel/views/RecipesView.py:112
#: templates/website/header.html:20
msgid "User panel"
msgstr "Panel utilisateur"
......@@ -237,7 +251,7 @@ msgid "Editor"
msgstr "Éditeur"
#: templates/panel/base.html:220 templates/panel/index.html:11
#: templates/panel/recipes.html:19
#: templates/panel/recipes.html:20
msgid "Home"
msgstr "Accueil"
......@@ -294,80 +308,96 @@ msgstr "Dernières recettes"
msgid "Latest comments"
msgstr "Derniers commentaires"
#: templates/panel/recipes.html:26
#: templates/panel/recipes.html:27
msgctxt "filter-recipes"
msgid "All"
msgstr "Toutes"
#: templates/panel/recipes.html:29
#: templates/panel/recipes.html:30
msgctxt "filter-recipes"
msgid "Mines"
msgid "Mine"
msgstr "Les miennes"
#: templates/panel/recipes.html:31
#: templates/panel/recipes.html:32
msgctxt "filter-recipes"
msgid "Published"
msgstr "Publiées"
#: templates/panel/recipes.html:37 templates/panel/recipes.html:166
#: templates/panel/recipes.html:35
msgid "Trash"
msgstr "Corbeille"
#: templates/panel/recipes.html:41 templates/panel/recipes.html:179
msgid "Grouped actions"
msgstr "Actions groupées"
#: templates/panel/recipes.html:38 templates/panel/recipes.html:167
#: templates/panel/recipes.html:43 templates/panel/recipes.html:181
msgid "Publish"
msgstr "Publier"
#: templates/panel/recipes.html:39 templates/panel/recipes.html:168
#: templates/panel/recipes.html:44 templates/panel/recipes.html:182
msgid "Unpublish"
msgstr "Ne plus publier"
#: templates/panel/recipes.html:40 templates/panel/recipes.html:169
#: templates/panel/recipes.html:45 templates/panel/recipes.html:183
msgid "Move to trash"
msgstr "Mettre à la corbeille"
#: templates/panel/recipes.html:42 templates/panel/recipes.html:171
#: templates/panel/recipes.html:47 templates/panel/recipes.html:185
msgid "Restore"
msgstr "Rétablir"
#: templates/panel/recipes.html:48 templates/panel/recipes.html:186
msgid "Delete definitively"
msgstr "Supprimer définitivement"
#: templates/panel/recipes.html:51 templates/panel/recipes.html:189
msgid "Apply"
msgstr "Appliquer"
#: templates/panel/recipes.html:47
#: templates/panel/recipes.html:57
msgid "All dates"
msgstr "Toutes les dates"
#: templates/panel/recipes.html:53
#: templates/panel/recipes.html:63
msgctxt "categories"
msgid "All"
msgstr "Toutes"
#: templates/panel/recipes.html:58
#: templates/panel/recipes.html:68
msgctxt "verb"
msgid "Filter"
msgstr "Filtrer"
#: templates/panel/recipes.html:75 templates/panel/recipes.html:141
#: templates/panel/recipes.html:71
msgid "Empty trash"
msgstr "Vider la corbeille"
#: templates/panel/recipes.html:88 templates/panel/recipes.html:154
msgid "Title"
msgstr "Titre"
#: templates/panel/recipes.html:78 templates/panel/recipes.html:144
#: templates/panel/recipes.html:91 templates/panel/recipes.html:157
msgid "Author"
msgstr "Auteur"
#: templates/panel/recipes.html:87 templates/panel/recipes.html:153
#: templates/panel/recipes.html:100 templates/panel/recipes.html:166
msgid "Date"
msgstr "Date"
#: templates/panel/recipes.html:90 templates/panel/recipes.html:156
#: templates/panel/recipes.html:103 templates/panel/recipes.html:169
msgid "Thumb"
msgstr "Thumb"
#: templates/panel/recipes.html:98
#: templates/panel/recipes.html:111
msgid "There is no recipes!"
msgstr "Aucune recette trouvée !"
#: templates/panel/recipes.html:123
#: templates/panel/recipes.html:136
msgid "Published"
msgstr "Publiée"
#: templates/panel/recipes.html:125
#: templates/panel/recipes.html:138
msgid "Draft"
msgstr "Brouillon"
......
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-05 15:39+0100\n"
"PO-Revision-Date: 2017-11-05 15:39+0100\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.7.1\n"
#: panel/static/js/jquery-ui.min.js:8
msgid "'"
msgstr ""
#: panel/static/js/panel.recipes.js:28
msgid "Please select an action to do!"
msgstr "Veuillez sélectionner une action à effectuer !"
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-05 18:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0016_auto_20171014_1441'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='trash',
field=models.BooleanField(default=False, verbose_name='trash'),
),
]
......@@ -35,6 +35,7 @@ class Recipe(models.Model):
excerpt = models.TextField(verbose_name=_("excerpt"))
enable_comments = models.BooleanField(default=True, verbose_name=_("enable comments"))
published = models.BooleanField(default=True, verbose_name=_("published"))
trash = models.BooleanField(default=False, verbose_name=_("trash"))
slug = models.CharField(max_length=255, verbose_name=_("slug"), unique=True)
html = models.TextField(null=True, default=None)
coup_de_coeur = models.IntegerField(choices=((0, __("coup_de_coeur", "Not favorite")),
......
......@@ -22,6 +22,10 @@ div.powered-by {
width: 168px;
}
#sel-action.trash {
width: 205px;
}
#sel-filter-month {
width: 150px;
}
......@@ -60,11 +64,16 @@ form.top-actions select {
height: 32px;
}
form.top-actions button {
form.top-actions button, button.top-actions {
height: 31px;
line-height: 15px;
}
button#empty-trash {
vertical-align: middle;
margin-left: 10px;
}
form.top-actions {
display: inline-block;
margin-right: 10px;
......
panel = {};
\ No newline at end of file
panel = {};
panel.init = function(csrftoken) {
panel.csrftoken = csrftoken;
};
\ No newline at end of file
......@@ -12,9 +12,68 @@ panel.recipes.init_events = function () {
$("div.list-recipes table thead tr th:first-child input[type=checkbox], div.list-recipes table tfoot tr th:first-child input[type=checkbox]").click(function () {
panel.recipes.check_all(this.checked);
});
$("div.form-apply-recipes form.grouped-actions").submit(function(e) {
e.preventDefault();
panel.recipes.submit_grouped_actions(parseInt($(this).find("select").val()));
});
$("div.form-apply-recipes form#sel-filters").submit(function(e) {
e.preventDefault();
panel.recipes.submit_filter_form();
});
$("button#empty-trash").click(panel.recipes.empty_trash);
};
panel.recipes.check_all = function (check) {
$("div.list-recipes table tr td:first-child input[type=checkbox]," +
"div.list-recipes table tr th:first-child input[type=checkbox]").prop("checked", check);
};
panel.recipes.submit_grouped_actions = function (action) {
if (action === 0) {
alert(django.gettext("Please select an action to do!"))
}
else {
// Get selected recipes:
let selection = $("div.list-recipes table tbody tr td:first-child input[type=checkbox]:checked");
let selected = [];
selection.each(function () {
selected.push(parseInt(this.value));
});
$.post("/panel/recipes/change/",
{
selection: selected,
action: action,
csrfmiddlewaretoken: panel.csrftoken
},
function(data, status) {
if (data["success"]) {
location.reload();
}
else {
alert("message" in data ? data["message"] : "An error has occurred!")
}
})
}
};
panel.recipes.submit_filter_form = function() {
let filter_month = $("#sel-filter-month").val();
let filter_cat = $("#sel-filter-cats").val();
window.location.href = `?filter-month=${filter_month}&filter-cat=${filter_cat}`
};
panel.recipes.empty_trash = function () {
$.post("/panel/recipes/change/",
{
action: "empty_trash",
csrfmiddlewaretoken: panel.csrftoken
},
function (data, status) {
if (data["success"]) {
window.location.href = "/panel/recipes/"
}
else {
alert("message" in data ? data["message"] : "An error has occurred!")
}
});
};
\ No newline at end of file
......@@ -3,12 +3,38 @@ from django.utils.translation import ugettext as _
from django.utils.translation import pgettext
from django.views.generic.base import RedirectView
from .views import IndexView, RecipesView
from .views import IndexView, RecipesView, RecipesChangeView
favicon_view = RedirectView.as_view(url='/static/favicon.ico', permanent=True)
urlpatterns = [
url(r'^$', IndexView.as_view(), name='index'),
#####################
# Recipes view URLs #
#####################
# Main recipes URL:
url(r'^recipes/$', RecipesView.as_view(), name='recipes'),
url(r'^recipes/' + _("page") + '/(?P<page>\d+)$', RecipesView.as_view(), name='recipes_page'),
# Trash:
url(r'^recipes/' + _("trash") + '/$', RecipesView.as_view(), name='recipes_trash', kwargs={"trash": True}),
url(r'^recipes/' + _("trash") + '/' + _("page") + '/(?P<page>\d+)$', RecipesView.as_view(),
name='recipes_trash_page', kwargs={"trash": True}),
# Mine:
url(r'^recipes/' + pgettext("url", "mine") + '/$', RecipesView.as_view(), name='recipes_mine',
kwargs={"mine": True}),
url(r'^recipes/' + pgettext("url", "mine") + '/' + _("page") + '/(?P<page>\d+)$', RecipesView.as_view(),
name='recipes_mine_page', kwargs={"mine": True}),
# Published
url(r'^recipes/' + pgettext("url", "published") + '/$', RecipesView.as_view(), name='recipes_published',
kwargs={"published": True}),
url(r'^recipes/' + pgettext("url", "published") + '/' + _("page") + '/(?P<page>\d+)$', RecipesView.as_view(),
name='recipes_published_page', kwargs={"published": True}),
# Change:
url(r'^recipes/change/', RecipesChangeView.as_view(), name='recipes_change')
]
from django.views.generic import View
from django.http import JsonResponse, Http404
from main.models import Recipe
class RecipesChangeView(View):
def get(self, request):
raise Http404
def post(self, request):
# Check data:
print(request.POST)
allowed_actions = ['1', '2', '3', '4', '5', 'empty_trash']
if "action" not in request.POST or ("action" in request.POST and request.POST["action"] not in allowed_actions)\
or ("selection[]" not in request.POST and request.POST["action"] != "empty_trash"):
return JsonResponse({
"success": False,
"message": "Incorrect data!"
})
# Get recipes:
action = request.POST["action"]
recipes_id = list(map(int, request.POST.getlist("selection[]")))
# Check data (2):
if action != "empty_trash":
if len(recipes_id) == 0:
return JsonResponse({
"success": False,
"message": "No recipe provided!"
})
recipes = Recipe.objects.filter(pk__in=recipes_id)
# Check rights:
allowed = True
if not request.user.is_staff:
for recipe in recipes:
if recipe.author.user != request.user:
allowed = False
if not allowed:
return JsonResponse({
"success": False,
"message": "Not allowed!"
})
# Do action:
if len(recipes) == len(recipes_id):
if action == "1": # Publish
recipes.update(published=True)
elif action == "2": # unpublish
recipes.update(published=False)
elif action == "3": # Trash
recipes.update(trash=True)
elif action == "4": # Restore
recipes.update(trash=False)
elif action == "5": # Delete definitively
recipes.delete()
else:
return JsonResponse({
"success": False,
"message": "Unknown action!"
})
return JsonResponse({
"success": True
})
else:
return JsonResponse({
"success": False,
"message": "Unable to get all recipes selected. Please contact us to report the bug."
})
else:
recipes_trash = Recipe.objects.filter(trash=True)
if request.user.is_staff:
recipes_trash.delete()
else:
for recipe in recipes_trash:
if recipe.author.user == request.user:
recipe.delete()
return JsonResponse({
"success": True
})
......@@ -19,42 +19,53 @@ class RecipesView(View):
def __sort_dates(a):
return a[0] + a[2]
def post(self, request, page=1):
post_params = ["filter-month", "filter-cat"]
args = dict(request.GET)
post_args = dict(request.POST)
for post_param in post_params:
if post_param in post_args:
args[post_param] = post_args[post_param]
params = urllib.parse.urlencode(args, doseq=1)
url = reverse("recipes")
return HttpResponseRedirect(url + "?%s" % params)
def get(self, request, page=1):
def get(self, request, page=1, mine=False, published=False, trash=False):
"""
Rendre list of recipes
:param request: request object
:param page: page to show
:param mines: if True, show only my recipes
:param published: if True, show only published recipes
:param trash: if True, show trash
:return:
"""
print(page)
if not self.request.user.is_authenticated:
return redirect('%s?next=%s' % (settings.LOGIN_URL, request.path))
recipes = Recipe.objects.all().order_by("pub_date").reverse()
nb_recipes = recipes.count()
recipes_user = Recipe.objects.filter(author__user=self.request.user)
nb_my_recipes = recipes_user.count()
nb_recipes_published = recipes.filter(published=True).count()
select = "all"
nb_recipes = recipes.filter(trash=False).count()
nb_my_recipes = recipes.filter(author__user=self.request.user, trash=False).count()
nb_recipes_published = recipes.filter(published=True, trash=False).count()
if not request.user.is_staff:
nb_trash = recipes.filter(trash=True, author__user=request.user).count()
else:
nb_trash = recipes.filter(trash=True).count()
if not trash:
recipes = recipes.filter(trash=False)
else:
select = "trash"
recipes = recipes.filter(trash=True)
if not request.user.is_staff:
recipes = recipes.filter(author__user=request.user)
if len(recipes) == 0:
return HttpResponseRedirect(reverse("recipes"))
if not trash: # Must be done here to not affect previous counts
if mine:
recipes = recipes.filter(author__user=request.user)
select = "mine"
elif published:
recipes = recipes.filter(published=True)
select = "published"
locale.setlocale(locale.LC_TIME, LOCALE)
user_slug = UserProfile.objects.get(user=request.user).url
kwargs = {}
select = "all"
all_dates = set()
for recipe in recipes:
month_int = recipe.pub_date.month
month = recipe.pub_date.strftime("%B")
year = recipe.pub_date.year
all_dates.add((month_int, month, year))
if "user" in request.GET:
recipes = recipes.filter(author__url=request.GET["user"])
if request.GET["user"] == user_slug:
select = "mines"
elif "published" in request.GET and request.GET["published"] == "1":
recipes = recipes.filter(published=True)
select = "published"
filter_date = ["all", "all"]
filter_cat = "all"
if "filter-month" in request.GET and request.GET["filter-month"] != "0":
......@@ -66,7 +77,7 @@ class RecipesView(View):
recipes = recipes.filter(category__name=filter_cat)
show_recipes = []
paginator = Paginator(recipes, 15)
paginator = Paginator(recipes, 25)
try:
page_recipe = paginator.page(page)
except (PageNotAnInteger, EmptyPage):
......@@ -89,6 +100,7 @@ class RecipesView(View):
"pub_date": recipe.pub_date,
"nb_comments": recipe.comment_set.count(),
"thumb": thumb_file,
"id": recipe.id
}
show_recipes.append(show_recipe)
all_dates = list(all_dates)
......@@ -105,6 +117,7 @@ class RecipesView(View):
"nb_recipes": nb_recipes,
"nb_my_recipes": nb_my_recipes,
"nb_recipes_published": nb_recipes_published,
"nb_trash": nb_trash,
"all_dates": all_dates,
"categories": GenericView.categories(),
"recipes": show_recipes,
......
from .IndexView import IndexView
from .RecipesView import RecipesView
from .RecipesChangeView import RecipesChangeView
......@@ -15,6 +15,7 @@ Including another URLconf
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.views.i18n import JavaScriptCatalog
from django.views.static import serve
urlpatterns = [
......@@ -22,6 +23,7 @@ urlpatterns = [
url(r'^api/', include('api.urls')),
url(r'^captcha/', include('captcha.urls')),
url(r'^panel/', include('panel.urls')),
url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
url(r'^', include('website.urls'))
]
......
......@@ -26,7 +26,7 @@
<!-- main style -->
<link rel="stylesheet" type="text/css" href="{% static 'css/style_panel.css' %}">
</head>
<body class="hold-transition skin-red sidebar-mini" onload="{% block onload %}{% endblock %}">
<body class="hold-transition skin-red sidebar-mini" onload='{% block onload %}panel.init("{{ csrf_token }}");{% endblock %}'>
<div class="wrapper">
<!-- Main Header -->
<header class="main-header">
......@@ -250,6 +250,7 @@
</div>
{% block scripts %}
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
<!--jQuery 3 -->
<script src="{% static 'js/jquery-3.2.1.min.js' %}" type="text/javascript"></script>
<!--jQuery UI 1.11.4 -->
......
......@@ -8,6 +8,7 @@
<script src="{% static 'js/panel.recipes.js' %}" defer></script>
{% endblock %}
{% block onload %}
{{ block.super }}
panel.recipes.init();
{% endblock %}
{% block content %}
......@@ -25,41 +26,61 @@
<p><a href="/panel/recipes/" class="show-all {% if select == "all" %}filter-active{% endif %}">
{% trans "All" context "filter-recipes" %}</a> ({{ nb_recipes }})
|
<a href="?user={{ user_slug }}" class="show-mines {% if select == "mines" %}filter-active{% endif %}">
{% trans "Mines" context "filter-recipes" %}</a> ({{ nb_my_recipes }}) |
<a href="?published=1" class="show-published {% if select == "published" %}filter-active{% endif %}">
{% trans "Published" context "filter-recipes" %}</a>
({{ nb_recipes_published }})
<a href="/panel/recipes/{% trans 'mine' context 'url' %}/" class="show-mines {% if select == "mine" %}filter-active{% endif %}">
{% trans "Mine" context "filter-recipes" %}</a> ({{ nb_my_recipes }}) |
<a href="/panel/recipes/{% trans 'published' context 'url' %}/" class="show-published {% if select == "published" %}filter-active{% endif %}">
{% trans "Published" context "filter-recipes" %}</a> ({{ nb_recipes_published }})
{% if nb_trash > 0 %}
| <a href="/panel/recipes/{% trans 'trash' %}/" class="show-trash {% if select == "trash" %}filter-active{% endif %}">
{% trans "Trash" %}</a> ({{ nb_trash }})
{% endif %}
</p>
<div class="form-apply-recipes">
<form class="grouped-actions top-actions" action="#">
<select class="form-control" id="sel-action">
<option>{% trans "Grouped actions" %}</option>
<option>{% trans "Publish" %}</option>
<option>{% trans "Unpublish" %}</option>
<option>{% trans "Move to trash" %}</option>
<select class="form-control {% if select == 'trash' %}trash{% endif %}" id="sel-action">
<option value="0">{% trans "Grouped actions" %}</option>
{% if select != "trash" %}
<option value="1">{% trans "Publish" %}</option>
<option value="2">{% trans "Unpublish" %}</option>
<option value="3">{% trans "Move to trash" %}</option>
{% else %}
<option value="4">{% trans "Restore" %}</option>
<option value="5">{% trans "Delete definitively" %}</option>
{% endif %}
</select>
<button>{% trans "Apply" %}</button>
</form>
<form class="filter-actions top-actions" id="sel-filters" action="" method="POST">
{% csrf_token %}
<select class="form-control" id="sel-filter-month" name="filter-month">
<option value="0">{% trans "All dates" %}</option>
{% for date in all_dates %}
<option value="{{ date.0 }}-{{ date.2 }}" {% if filter_date.0 == date.0 and filter_date.1 == date.2 %}selected{% endif %}>{{ date.1 }} {{ date.2 }}</option>
{% endfor %}
</select>
<select class="form-control" id="sel-filter-cats", name="filter-cat">
<option value="0">{% trans "All" context "categories" %}</option>
{% for categorie in categories %}
<option {% if filter_cat == categorie.name %}selected{% endif %}>{{ categorie.name }}</option>
{% endfor %}
</select>
<button type="submit">{% trans "Filter" context "verb" %}</button>
</form>
{% if select != "trash" %}
<form class="filter-actions top-actions" id="sel-filters" action="#">
{% csrf_token %}
<select class="form-control" id="sel-filter-month" name="filter-month">
<option value="0">{% trans "All dates" %}</option>
{% for date in all_dates %}
<option value="{{ date.0 }}-{{ date.2 }}" {% if filter_date.0 == date.0 and filter_date.1 == date.2 %}selected{% endif %}>{{ date.1 }} {{ date.2 }}</option>
{% endfor %}
</select>
<select class="form-control" id="sel-filter-cats", name="filter-cat">
<option value="0">{% trans "All" context "categories" %}</option>
{% for categorie in categories %}
<option {% if filter_cat == categorie.name %}selected{% endif %}>{{ categorie.name }}</option>
{% endfor %}
</select>
<button type="submit">{% trans "Filter" context "verb" %}</button>
</form>
{% else %}
<button class="top-actions" id="empty-trash">{% trans "Empty trash" %}</button>
{% endif %}
<div class="pagination top">
{% bootstrap_paginate page_recipe url_view_name="recipes_page" url_extra_kwargs=additionnal_kwargs range=4 %}
{% if select == "mine" %}
{% bootstrap_paginate page_recipe url_view_name="recipes_mine_page" url_extra_kwargs=additionnal_kwargs range=4 %}
{% elif select == "published" %}
{% bootstrap_paginate page_recipe url_view_name="recipes_published_page" url_extra_kwargs=additionnal_kwargs range=4 %}
{% elif select == "trash" %}
{% bootstrap_paginate page_recipe url_view_name="recipes_trash_page" url_extra_kwargs=additionnal_kwargs range=4 %}
{% else %}
{% bootstrap_paginate page_recipe url_view_name="recipes_page" url_extra_kwargs=additionnal_kwargs range=4 %}
{% endif %}
</div>
</div>
......@@ -103,7 +124,7 @@
<tr>
<td>
{% if staff or recipe.author_id == user.id %}
<input type="checkbox" class="select-recipe">
<input type="checkbox" class="select-recipe" value="{{ recipe.id }}">
{% endif %}
</td>
<td>
......@@ -162,11 +183,16 @@
<div class="form-apply-recipes">
<form class="grouped-actions top-actions" action="#">
<select class="form-control" id="sel-action">
<select class="form-control {% if select == 'trash' %}trash{% endif %}" id="sel-action">
<option>{% trans "Grouped actions" %}</option>
<option>{% trans "Publish" %}</option>
<option>{% trans "Unpublish" %}</option>