From c6147347680417e27357d2f3fc01376c7166a86b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 28 Aug 2014 16:18:25 +0800 Subject: [PATCH] =?UTF-8?q?#1508=20=20=20=E4=BF=AE=E5=A4=8D=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E3=80=81=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E6=A0=87=E7=AD=BE=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E6=8C=89=E9=92=AE=EF=BC=8C=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 19 +++++++++++++++++++ app/views/tags/_tag_name.html.erb | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1f6091f12..f70e27de6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1555,6 +1555,25 @@ module ApplicationHelper date = time.strftime("%Y年%m月%d日") end + #当TAG数量过多时,更多链接 + #1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 9代表课程 + def more_tags id,object_flag + a= 1 + case object_flag + when "1" + s = link_to l(:label_more_tags),:controller => "users", :action => "show", :id => id + when "2" + s = link_to l(:label_more_tags),:controller => "projects", :action => "show", :id => id + when "3" + s = link_to l(:label_more_tags),:controller => "issues", :action => "show", :id => id + when "4" + s = link_to l(:label_more_tags),:controller => "bids", :action => "show", :id => id + when "9" + s = link_to l(:label_more_tags),:controller => "courses", :action => "show", :id => id + end + s + end + private def wiki_helper diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb index 01889f1f3..6996e8891 100644 --- a/app/views/tags/_tag_name.html.erb +++ b/app/views/tags/_tag_name.html.erb @@ -22,7 +22,7 @@ <% i += 1 %> <% end %> - <%= link_to l(:label_more_tags),:controller => "tags", :action => "show", :id => obj.id %> + <%= more_tags(obj.id,object_flag)%> <% else %>