diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index ac2a5236b..2c4dbecfe 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -20,6 +20,9 @@ class TagsController < ApplicationController # $selected_tags = Array.new # $related_tags = Array.new NUMBERS = Setting.tags_show_search_results + + # 预设几个可以添加的tag + @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设F | # 接收参数解释: # params[:q]这是在其他页面点击tag,跳转到该页面后的结果显示 ;params[:selected_tags],这是在过滤页面增删tag进行过滤传过来的参数 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1525105cc..cc096e76e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1477,16 +1477,7 @@ module ApplicationHelper user.watcher_users.count end #end - #author : nyan - def stringCut240(str) - (str.length > 240) ? (str[0,240]<<"......") : str - end - #author : xianbo - def objCut12(obj) - for obj1 in obj[0..11] - obj2 = obj1 - end - end + def hadcommittedhomework(cur,curb) @attaches=HomeworkAttach.find_by_sql("select * from homework_attaches where(bid_id = #{curb})") diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index b27a5289a..2d2934cc2 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -261,12 +261,12 @@ module ProjectsHelper def rolesToLanguage rolesArray rolesArray = ([] << rolesArray) unless rolesArray.is_a?(Array) rolesArray.map{ |roleName| - case roleName - when "Manager" + case roleName.to_sym + when :Manager l :default_role_manager - when "Developer" + when :Developer l :default_role_developer - when "Reporter" + when :Reporter l :default_role_reporter else 'Unkown' diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index a6dcc32c1..e2bad8e91 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -215,6 +215,7 @@ div.pagination{
+ <% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %> <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 7eb360d53..0d9467025 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -48,6 +48,22 @@ <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%> <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%> <%= f.submit l(:button_project_tags_add),:class => "small" %> + <%#= link_to_function l(:button_cancel), "$(\"#put-tag-form-#{obj.class}-#{obj.id}\").hide();"%> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2369b25d0..6ce5e2095 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -113,7 +113,7 @@ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> <% end %> -

<%= h stringCut240(act.content) %>

+

<%= h act.content.truncate(240, omission: '...') %>

diff --git a/app/views/welcome/_search_project.html.erb b/app/views/welcome/_search_project.html.erb index c139be6f1..fda9dae7c 100644 --- a/app/views/welcome/_search_project.html.erb +++ b/app/views/welcome/_search_project.html.erb @@ -17,15 +17,19 @@ form #q, form #search_type{ height: 33px; } form #q{ + font-size: 13px; border-top-left-radius: 5px; border-bottom-left-radius: 5px; border-right: none; } form #search_type{ + font-size: 13px; color: #363739; border-top-right-radius: 5px; border-bottom-right-radius: 5px; + border-bottom-left-radius: 0px; + border-top-left-radius: 0px; border-left: 1px outset #83A9A9; margin-left: -4px; -webkit-appearance: none; diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 4ac63b56c..2845c3ce0 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1,6 +1,16 @@ /* Redmine - project management software Copyright (C) 2006-2013 Jean-Philippe Lang */ +function cleanArray (actual){ + var newArray = new Array(); + for (var i = 0; i< actual.length; i++){ + if (actual[i]){ + newArray.push(actual[i]); + } + } + return newArray; +} + function checkAll(id, checked) { if (checked) { $('#'+id).find('input[type=checkbox]').attr('checked', true);