Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

This commit is contained in:
huang 2016-11-07 13:52:47 +08:00
commit a7a25a4a2a
3 changed files with 33 additions and 25 deletions

View File

@ -234,8 +234,8 @@ class IssuesController < ApplicationController
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号 # 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1 @issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
@issue.fixed_version_id = nil if @issue.fixed_version_id == 0
if @issue.save if @issue.save
senduser = User.find(params[:issue][:assigned_to_id]) senduser = User.find(params[:issue][:assigned_to_id])
issue_id = @issue.id issue_id = @issue.id
issue_title = params[:issue][:subject] issue_title = params[:issue][:subject]

View File

@ -1,14 +1,5 @@
<%= labelled_fields_for :issue, @issue do |f| %> <%= labelled_fields_for :issue, @issue do |f| %>
<ul class="fl pro_new_conbox_left"> <ul class="fl pro_new_conbox_left">
<li>
<% if @issue.safe_attribute? 'tracker_id' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;类型&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] },
{:required => true, :no_label => true},
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w90" %>
<% end %>
</li>
<li> <li>
<% if @issue.safe_attribute? 'subject' %> <% if @issue.safe_attribute? 'subject' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label> <label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label>
@ -36,19 +27,28 @@
<%#= wikitoolbar_for 'issue_description' %> <%#= wikitoolbar_for 'issue_description' %>
<% end %> <% end %>
</li> </li>
<li> <li class="fl">
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label> <% if @issue.safe_attribute? 'tracker_id' %>
<label class="label mt3"><span class="c_red f12">*</span>&nbsp;类型&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] },
{:required => true, :no_label => true},
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w110" %>
<% end %>
</li>
<li class="fl ml41">
<label class="label mt3"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %> <%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }), <%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
{:no_label => true}, {:no_label => true},
:class => "w150" %> :class => "w110" %>
</li> </li>
<li> <li class="fl ml41">
<label class="label"><span class="c_red f12">*</span><%= l(:field_priority) %></label> <label class="label mt3"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<% if @issue.safe_attribute? 'priority_id' %> <% if @issue.safe_attribute? 'priority_id' %>
<%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }), <%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
{:required => true, :no_label => true}, :disabled => !@issue.leaf?, {:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %> :class => "w110" %>
<% end %> <% end %>
</li> </li>
<li class="clear"> <li class="clear">
@ -86,7 +86,7 @@
<li class=" clear" > <li class=" clear" >
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), <%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true}, {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
{:onchange => "change_milestone_tip();",:class => "w150"} %> {:onchange => "change_milestone_tip();", :class => "w150"} %>
</li> </li>
<li class=" clear" id="milestone_option_tips"> <li class=" clear" id="milestone_option_tips">
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %> <%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
@ -97,7 +97,8 @@
<li class=" clear" style="border:1px solid #c8c8c8;"> <li class=" clear" style="border:1px solid #c8c8c8;">
<% if @issue.safe_attribute? 'start_date' %> <% if @issue.safe_attribute? 'start_date' %>
<%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, <%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('start_date'), :onchange=>"issue_start_date_change();", :class=>"fl calendar_input", :style=>"width:170px;" %> :required => @issue.required_attribute?('start_date'), :onchange=>"issue_start_date_change();",
:class=>"fl calendar_input", :style=>"width:170px;" %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %> <%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %> <% end %>
</li> </li>
@ -108,20 +109,22 @@
<label class="label02" ></label> <label class="label02" ></label>
<% if @issue.safe_attribute? 'due_date' %> <% if @issue.safe_attribute? 'due_date' %>
<%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, <%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('due_date'), :onchange=>"issue_end_date_change();", :class=>"fl calendar_input",:style=>"width: 170px;" %> :required => @issue.required_attribute?('due_date'), :onchange=>"issue_end_date_change();",
:class=>"fl calendar_input",:style=>"width: 170px;", :placeholder=> "请选择结束日期" %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %> <%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %> <% end %>
</li> </li>
<li class=" clear " id="option_end_date_tips"> <li class=" clear " id="option_end_date_tips">
<%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %> <%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
</li> </li>
<li class=" clear"><%= l(:field_estimated_hours) %></li>
<li class=" clear"> <li class=" clear">
<% if @issue.safe_attribute? 'estimated_hours' %> <% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours') %> <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('estimated_hours'), :placeholder=> "请填写预计工时" %>
<% end %> <% end %>
</li> </li>
<li class=" clear">完成度</li> <li class=" clear"><%= l(:field_estimated_hours) %></li>
<li class=" clear"> <li class=" clear">
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %> <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), <%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
@ -129,6 +132,7 @@
:onchange => "PrecentChange(this.value)", :onchange => "PrecentChange(this.value)",
:class => "w150" %> :class => "w150" %>
<% end %> <% end %>
<li class=" clear">完成度</li>
</li> </li>
</ul> </ul>
<% end %> <% end %>
@ -153,4 +157,7 @@
function issue_end_date_change() { function issue_end_date_change() {
$('#option_end_date_tips').html("已选择结束日期"); $('#option_end_date_tips').html("已选择结束日期");
} }
// 里程碑添加默认选项
$("#issue_fixed_version_id option[value='']").remove();
$('#issue_fixed_version_id').prepend("<option value='0' selected='selected'>选择里程碑</option>")
</script> </script>

View File

@ -122,6 +122,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.ml36{ margin-left:36px; } .ml36{ margin-left:36px; }
.ml38{ margin-left:38px;} .ml38{ margin-left:38px;}
.ml40{ margin-left:40px;} .ml40{ margin-left:40px;}
.ml41{ margin-left:41px;}
.ml45{ margin-left:45px;} .ml45{ margin-left:45px;}
.ml48{ margin-left:48px;} .ml48{ margin-left:48px;}
.ml50{ margin-left: 50px;} .ml50{ margin-left: 50px;}
@ -233,7 +234,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w80{ width:80px;} .w80{ width:80px;}
.w90{ width:90px;} .w90{ width:90px;}
.w100 {width: 100px;} .w100 {width: 100px;}
.w110{width:110px;} .w110{width:110px !important;}
.w108 {width:108px;} .w108 {width:108px;}
.w125{width:125px;} .w125{width:125px;}
.w128{ width:128px;} .w128{ width:128px;}