From 59b2c408e71e55013a02eb37a07c36a70a3ed16b Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 12 Dec 2013 10:10:30 +0800 Subject: [PATCH] sa --- app/helpers/welcome_helper.rb | 8 ++++++-- app/views/issues/index.html.erb | 9 +++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index ad409774e..3459ef7fa 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -75,14 +75,18 @@ module WelcomeHelper def show_user_content event str = ' '.html_safe case event.event_type - when 'news' , 'issue' , 'attachment' , 'message' , 'bid' , 'wiki-page' , 'document' + when 'news' , 'issue', 'message' , 'bid' , 'wiki-page' , 'document' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) - when 'reply' ,'Reply','Memo' + when 'reply' ,'Reply', 'Memo' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(strip_tags(event.event_description), length: 30, omission:'...'), event.event_url) + when 'attachment' + str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), project_files_path(event.container)) #<< link_to((' '.html_safe+l(:button_download)), event.event_url) else str << content_tag("span", "更新了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) end str + rescue Exception => e + str << content_tag("span", '未知内容') end def show_event_reply event diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index ed60b1530..3ce726a20 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,10 +1,11 @@
-
+ <% flag = false %> +
<%= link_to l(:label_issue_new), { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %> - <%= link_to l(:label_query), '#', :class => 'icon icon-help', - :onclick => '$("#custom_query").toggle(); ' if User.current.logged? %> + <%= link_to l(:label_query), '#', :class => 'icon icon-help', + :onclick => '$("#custom_query").toggle(); ' if (User.current.logged? && flag) %>
@@ -19,7 +20,7 @@ <%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %> -