调整新建项目issue页面

This commit is contained in:
daiao 2016-11-07 13:28:50 +08:00
parent 34bcfd14b1
commit 8b5879217d
4 changed files with 36 additions and 28 deletions

View File

@ -234,8 +234,8 @@ class IssuesController < ApplicationController
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@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
senduser = User.find(params[:issue][:assigned_to_id])
issue_id = @issue.id
issue_title = params[:issue][:subject]

View File

@ -1,14 +1,5 @@
<%= labelled_fields_for :issue, @issue do |f| %>
<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>
<% if @issue.safe_attribute? 'subject' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label>
@ -36,19 +27,28 @@
<%#= wikitoolbar_for 'issue_description' %>
<% end %>
</li>
<li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<li class="fl">
<% 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? %>
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
{:no_label => true},
:class => "w150" %>
{:no_label => true},
:class => "w110" %>
</li>
<li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<li class="fl ml41">
<label class="label mt3"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<% if @issue.safe_attribute? 'priority_id' %>
<%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %>
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w110" %>
<% end %>
</li>
<li class="clear">
@ -86,7 +86,7 @@
<li class=" clear" >
<%= 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},
{:onchange => "change_milestone_tip();",:class => "w150"} %>
{:onchange => "change_milestone_tip();", :class => "w150"} %>
</li>
<li class=" clear" id="milestone_option_tips">
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
@ -97,7 +97,8 @@
<li class=" clear" style="border:1px solid #c8c8c8;">
<% if @issue.safe_attribute? 'start_date' %>
<%= 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? %>
<% end %>
</li>
@ -108,20 +109,22 @@
<label class="label02" ></label>
<% if @issue.safe_attribute? 'due_date' %>
<%= 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? %>
<% end %>
</li>
<li class=" clear " id="option_end_date_tips">
<%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
</li>
<li class=" clear"><%= l(:field_estimated_hours) %></li>
<li class=" clear">
<% 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 %>
</li>
<li class=" clear">完成度</li>
<li class=" clear"><%= l(:field_estimated_hours) %></li>
<li class=" clear">
<% 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] }),
@ -129,6 +132,7 @@
:onchange => "PrecentChange(this.value)",
:class => "w150" %>
<% end %>
<li class=" clear">完成度</li>
</li>
</ul>
<% end %>
@ -153,4 +157,7 @@
function issue_end_date_change() {
$('#option_end_date_tips').html("已选择结束日期");
}
// 里程碑添加默认选项
$("#issue_fixed_version_id option[value='']").remove();
$('#issue_fixed_version_id').prepend("<option value='0' selected='selected'>选择里程碑</option>")
</script>

View File

@ -47,10 +47,10 @@
<div class="homepagePostSubmitContainer">
<div class="homepagePostAssignTo"><span class="fontGrey3">指派给</span>&nbsp;&nbsp;
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
<%= link_to activity.try(:assigned_to) ? activity.try(:assigned_to) : "未指派", user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% if activity.try(:assigned_to) == ' ' %>
<%= link_to "未指派", "", :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:assigned_to) ? activity.try(:assigned_to).try(:realname) : "未指派", user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:assigned_to).try(:realname) ? activity.try(:assigned_to).try(:realname) : activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% end %>
<% end %>
</div>

View File

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