From cee205a568656022c423532b2c953c97df808935 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 24 Apr 2014 10:16:18 +0800 Subject: [PATCH] =?UTF-8?q?issues#377=20074e8adf=20=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E7=9A=84issue=E9=A1=B5=E9=9D=A2=E6=9D=83=E9=99=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E9=99=A4=E4=BA=86=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E8=BF=98=E4=BF=AE=E6=94=B9=E8=BF=87views=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=20keyworks:=20@edit=5Fallowed=20issues#379?= =?UTF-8?q?=20tag=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=9F=AD=20issues#380=20tag?= =?UTF-8?q?=20=E6=8F=90=E4=BA=A4=E4=B9=8B=E5=90=8E=20=E4=B8=8D=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E8=BE=93=E5=85=A5=E6=A1=86=20issues#381=20=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 12 +----------- app/views/issues/_edit.html.erb | 2 +- app/views/tags/_tag.html.erb | 2 +- app/views/users/tag_save.js.erb | 4 ++-- config/settings.yml | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 200810c4..2f7d6e60 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -114,22 +114,12 @@ class IssuesController < ApplicationController @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } @allowed_statuses = @issue.new_statuses_allowed_to(User.current) - # @edit_allowed = User.current.allowed_to?(:edit_issues, @project) - if User.current.admin? || User.current.id == @issue.author_id || User.current.id == @issue.assigned_to_id || ProjectInfo.manager?(User.current.id, @project) - @edit_allowed = true - # elsif User.current.id == @issue.author.id - else - @edit_allowed = false - end - # @edit_allowed = User.current.allowed_to?(:edit_issues, @project) + @edit_allowed = User.current.allowed_to?(:edit_issues, @project) @priorities = IssuePriority.active @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young - #by huang - # @change_flag = (@issue.author == User.current) || (User.current.admin?) - #end respond_to do |format| format.html { retrieve_previous_and_next_issue_ids diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index b9322243..4c379ae5 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -2,7 +2,7 @@ <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %>
- <% if @edit_allowed && !@allowed_statuses.empty? %> + <% if @edit_allowed || !@allowed_statuses.empty? %>
<%= l(:label_change_properties) %>
<%= render :partial => 'form', :locals => {:f => f} %> diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 896b6a2c..1cec18b3 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -23,7 +23,7 @@ <%= form_for "tag_for_save",:remote=>true,:url=>tag_path, :update => "tags_show", :complete => '$("#put-tag-form-issue").hide();' do |f| %> - <%= f.text_field :name ,:id => "name-issue",:size=>"30",:require=>true,:maxlength => 25,:minlength=>1 %> + <%= f.text_field :name ,:id => "name-issue",:size=>"30",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>1 %> <%= 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"%> diff --git a/app/views/users/tag_save.js.erb b/app/views/users/tag_save.js.erb index 7e1a5938..c406f32d 100644 --- a/app/views/users/tag_save.js.erb +++ b/app/views/users/tag_save.js.erb @@ -2,7 +2,7 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); -$('#put-tag-form-issue').hide(); +//$('#put-tag-form-issue').hide(); $('#name-issue').val(""); <% elsif @obj_flag == '6'%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); @@ -15,6 +15,6 @@ $('#name-issue').val(""); $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); $('#put-tag-form #name').val(""); -$('#put-tag-form').hide(); +//$('#put-tag-form').hide(); <% end %> diff --git a/config/settings.yml b/config/settings.yml index d43d3699..fbaba502 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -232,7 +232,7 @@ tags_min_length: default: 1 tags_max_length: format: int - default: 13 + default: 30 tags_show_search_results: format: int default: 5