add tag links to project page

This commit is contained in:
Aleksei Kvitinskii 2011-11-07 19:48:58 +02:00
parent 060a2e2257
commit af7bed2aa5
5 changed files with 30 additions and 6 deletions

View file

@ -28,3 +28,17 @@
text-shadow: none; text-shadow: none;
font-weight: bold; font-weight: bold;
} }
.medium-tags a{
font-size: 12px;
display: inline-block;
padding: 3px 4px 2px 4px;
margin: 0px 7px 8px 0px;
border-radius: 3px;
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
}

View file

@ -2,4 +2,14 @@ module TagsHelper
def tag_path tag def tag_path tag
"/tags/#{tag}" "/tags/#{tag}"
end end
def tag_list project
html = ''
project.tag_list.each do |tag|
html += link_to tag, tag_path(tag)
end
html.html_safe
end
end end

View file

@ -40,5 +40,8 @@
- if @commit - if @commit
= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil = link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil
.medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project
.project-content .project-content
= yield = yield

View file

@ -12,9 +12,8 @@
%tr{ :class => "project", :url => project_path(project) } %tr{ :class => "project", :url => project_path(project) }
%td %td
= project.name = project.name
.small-tags .small-tags= tag_list project
- project.tag_list.each do |tag|
= link_to tag, tag_path(tag)
%td= truncate project.url_to_repo %td= truncate project.url_to_repo
%td= project.code %td= project.code

View file

@ -13,9 +13,7 @@
- last_note = project.notes.last - last_note = project.notes.last
= last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never" = last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never"
%p.small-tags %p.small-tags= tag_list project
- project.tag_list.each do |tag|
= link_to tag, "/tags/#{tag}"
.buttons .buttons
%a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code %a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code