Commit 09bcebb9 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Add links on hover for list of recipes in panel (not functional now)

parent b156874d
......@@ -128,4 +128,13 @@ form.top-actions {
.user-panel1 .subtitle i {
padding-right: 3px;
}
.actions-a-recipe {
margin-top: 5px;
display: none;
}
.actions-a-recipe .trash {
color: #aa0000;
}
\ No newline at end of file
......@@ -21,6 +21,13 @@ panel.recipes.init_events = function () {
panel.recipes.submit_filter_form();
});
$("button#empty-trash").click(panel.recipes.empty_trash);
let list_recipes = $("div.list-recipes");
list_recipes.find("table").find("tr").mouseover(function() {
$(this).find(".actions-a-recipe").show();
});
list_recipes.find("table").find("tr").mouseout(function() {
$(this).find(".actions-a-recipe").hide();
});
};
panel.recipes.check_all = function (check) {
......
......@@ -99,7 +99,8 @@ class RecipesView(View):
"pub_date": recipe.pub_date,
"nb_comments": recipe.comment_set.count(),
"thumb": thumb_file,
"id": recipe.id
"id": recipe.id,
"slug": recipe.slug
}
show_recipes.append(show_recipe)
all_dates = list(all_dates)
......
......@@ -129,6 +129,18 @@
</td>
<td>
<a class="link-recipe" href="#">{{ recipe.title }}</a>
<div class="actions-a-recipe">
<a href="/{% trans 'recipe' %}/{{ recipe.slug }}">{% trans "Show" %}</a>
{% if staff or recipe.author_id == user.id %}
|
{% if recipe.published %}
<a href="#" class="publish">{% trans "Publish" %}</a>
{% else %}
<a href="#" class="unpublish">{% trans "Unpublish" %}</a>
{% endif %}
| <a href="#" class="trash">{% trans "Move to trash" %}</a>
{% endif %}
</div>
</td>
<td>
{{ recipe.author }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment