issues#377 074e8adf 引入的issue页面权限问题,除了控制器还修改过views判断语句 keyworks: @edit_allowed

issues#379 tag字符串短
issues#380 tag 提交之后 不隐藏输入框
issues#381 搜索框有误
This commit is contained in:
yanxd 2014-04-24 10:16:18 +08:00
parent 2052d36abe
commit cee205a568
5 changed files with 6 additions and 16 deletions

View File

@ -114,22 +114,12 @@ class IssuesController < ApplicationController
@relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
@allowed_statuses = @issue.new_statuses_allowed_to(User.current) @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
# @edit_allowed = User.current.allowed_to?(:edit_issues, @project) @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)
@priorities = IssuePriority.active @priorities = IssuePriority.active
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young @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| respond_to do |format|
format.html { format.html {
retrieve_previous_and_next_issue_ids retrieve_previous_and_next_issue_ids

View File

@ -2,7 +2,7 @@
<%= error_messages_for 'issue', 'time_entry' %> <%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %> <%= render :partial => 'conflict' if @conflict %>
<div class="box"> <div class="box">
<% if @edit_allowed && !@allowed_statuses.empty? %> <% if @edit_allowed || !@allowed_statuses.empty? %>
<fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend> <fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
<div id="all_attributes"> <div id="all_attributes">
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>

View File

@ -23,7 +23,7 @@
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path, <%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show", :update => "tags_show",
:complete => '$("#put-tag-form-issue").hide();' do |f| %> :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_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%> <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit l(:button_project_tags_add),:class => "small"%> <%= f.submit l(:button_project_tags_add),:class => "small"%>

View File

@ -2,7 +2,7 @@
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name', $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#put-tag-form-issue').hide(); //$('#put-tag-form-issue').hide();
$('#name-issue').val(""); $('#name-issue').val("");
<% elsif @obj_flag == '6'%> <% elsif @obj_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
@ -15,6 +15,6 @@ $('#name-issue').val("");
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#put-tag-form #name').val(""); $('#put-tag-form #name').val("");
$('#put-tag-form').hide(); //$('#put-tag-form').hide();
<% end %> <% end %>

View File

@ -232,7 +232,7 @@ tags_min_length:
default: 1 default: 1
tags_max_length: tags_max_length:
format: int format: int
default: 13 default: 30
tags_show_search_results: tags_show_search_results:
format: int format: int
default: 5 default: 5