55 lines
1.0 KiB
Plaintext
55 lines
1.0 KiB
Plaintext
.row{:style => "max-width:inherit;"}
|
|
.col-xs-9
|
|
.right= link_to 'Ajouter un article', new_admin_article_path(), :class => "btn btn-primary", :remote => true
|
|
%h1 Liste des articles
|
|
|
|
#articles_index=render :partial => "index_block"
|
|
|
|
.col-xs-3
|
|
%h3 Tags
|
|
=render :partial => "tags"
|
|
|
|
|
|
:coffeescript
|
|
root = exports ? this
|
|
root.tag_id = []
|
|
|
|
|
|
$(document.body).on "click", "#tags .tag_label", ->
|
|
|
|
if $(this).hasClass("active")
|
|
$(this).removeClass "active"
|
|
|
|
else
|
|
$(this).addClass "active"
|
|
|
|
root.tag_id = []
|
|
|
|
$("#tags .tag_label.active").each ->
|
|
root.tag_id.push $(this).data "tag_id"
|
|
|
|
if root.tag_id.length > 0
|
|
$(".set_tag").show()
|
|
else
|
|
$(".set_tag").hide()
|
|
|
|
|
|
$(document.body).on "click", ".set_tag", ->
|
|
|
|
$.ajax({
|
|
url:$(this).attr("href"),
|
|
type: "PUT",
|
|
data: {
|
|
tag_id : tag_id
|
|
}
|
|
|
|
})
|
|
|
|
return false
|
|
|
|
|
|
|
|
|
|
|
|
|