Mercurial > hg > soundsoftware-site
changeset 998:a2660a5eb395 browsing
Some work towards interesting ways of browsing projects
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 09 Nov 2012 14:40:46 +0000 |
parents | c1b8a34d3560 |
children | 6a76bed8aa32 |
files | vendor/plugins/redmine_tags/app/controllers/tags_controller.rb vendor/plugins/redmine_tags/app/helpers/tags_helper.rb vendor/plugins/redmine_tags/app/views/projects/index.html.erb vendor/plugins/redmine_tags/app/views/tags/index.html.erb |
diffstat | 4 files changed, 33 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_tags/app/controllers/tags_controller.rb Fri Nov 09 14:40:46 2012 +0000 @@ -0,0 +1,15 @@ +class TagsController < ApplicationController + + def index + respond_to do |format| + format.html { + render :template => 'tags/index.html.erb', :layout => !request.xhr? + } + format.api { + } + format.atom { + } + end + end + +end
--- a/vendor/plugins/redmine_tags/app/helpers/tags_helper.rb Fri Nov 09 13:58:49 2012 +0000 +++ b/vendor/plugins/redmine_tags/app/helpers/tags_helper.rb Fri Nov 09 14:40:46 2012 +0000 @@ -40,8 +40,11 @@ content_tag('span', content, :class => 'tag-label') end - def render_project_tag_link(tag) + def render_project_tag_link(tag, options = {}) content = link_to tag.name, :controller => :projects, :action => :index, :project => { :tag_list => tag.name } + if options[:show_count] + content << content_tag('span', "(#{tag.count})", :class => 'tag-count') + end content_tag('span', content, :class => 'tag-label') end @@ -73,7 +76,7 @@ end tag_cloud tags, (1..8).to_a do |tag, weight| - content << " " + content_tag(item_el, render_tag_link(tag, options), :class => "tag-nube-#{weight}") + " " + content << " " + content_tag(item_el, render_project_tag_link(tag, options), :class => "tag-nube-#{weight}") + " " end content_tag(list_el, content, :class => 'tags')
--- a/vendor/plugins/redmine_tags/app/views/projects/index.html.erb Fri Nov 09 13:58:49 2012 +0000 +++ b/vendor/plugins/redmine_tags/app/views/projects/index.html.erb Fri Nov 09 14:40:46 2012 +0000 @@ -11,7 +11,6 @@ </div> - <div style="clear:both;"></div> <% if User.current.logged? %> <%= render :partial => 'my_projects' %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_tags/app/views/tags/index.html.erb Fri Nov 09 14:40:46 2012 +0000 @@ -0,0 +1,13 @@ +<% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> + <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> +<% end %> + + +<div style="clear:both;"></div> +<h2> + <%= l("label_project_tags_all") %> +</h2> + +<%= render_tags_list(Project.available_tags, :style => :cloud) %> +