create tags page and made tag filter for projects

This commit is contained in:
Aleksei Kvitinskii 2011-11-05 21:00:05 +02:00
parent 1e5aa0efff
commit 6e08b5cc85
10 changed files with 62 additions and 24 deletions

View file

@ -57,11 +57,8 @@
$(function(){
var tag_field = $('#tag_field').tagify();
tag_field.tagify('inputField').autocomplete({
source: '/tags/autocomplete.json',
position: { of: tag_field.tagify('containerDiv') },
close: function(event, ui) { tag_field.tagify('add'); },
source: '/tags.json'
});
@ -70,6 +67,4 @@
tag_field.val( tag_field.tagify('serialize') );
return true;
});
})

View file

@ -10,7 +10,12 @@
- @projects.each do |project|
%tr{ :class => "project", :url => project_path(project) }
%td= project.name
%td
= project.name
.small-tags
- project.tag_list.each do |tag|
= link_to tag, "/tags/#{tag}"
%td= truncate project.url_to_repo
%td= project.code
%td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled

View file

@ -1,2 +0,0 @@
%h1 Tags#autocomplete
%p Find me in app/views/tags/autocomplete.html.haml

View file

@ -1,2 +1,11 @@
%h1 Tags#index
%p Find me in app/views/tags/index.html.haml
- content_for(:body_class, "projects-page")
- content_for(:page_title) do
.grid_4
%h2
Tags
.tags-list
- @tags.all.each do |tag|
= link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}"