issue新建和编辑样式调整

This commit is contained in:
huang 2016-12-15 12:24:57 +08:00
parent 9b2781999c
commit 5facd08af6
2 changed files with 91 additions and 86 deletions

View File

@ -27,30 +27,7 @@
<%#= wikitoolbar_for 'issue_description' %> <%#= wikitoolbar_for 'issue_description' %>
<% end %> <% end %>
</li> </li>
<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 => "w110" %>
</li>
<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 => "w110" %>
<% end %>
</li>
<li class="clear"> <li class="clear">
<label class="label"><%= l(:label_attachment_plural) %></label> <label class="label"><%= l(:label_attachment_plural) %></label>
<%= render :partial => 'attachments/form', :locals => {:container => @issue} %> <%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
@ -75,66 +52,90 @@
<% end %> <% end %>
</li> </li>
<li class="clear" id="versions_assigned_id"> <li class="clear" id="versions_assigned_id">
<span class="fl mt6 mr10">指派给</span>
<% if @issue.safe_attribute? 'assigned_to_id' %> <% if @issue.safe_attribute? 'assigned_to_id' %>
<%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to), <%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to),
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true}, {:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
{:onchange => "change_assigned_tip();",:class => "w150"} %> {:onchange => "change_assigned_tip();",:class => "w160 fl"} %>
<% end %> <% end %>
</li> </li>
<li class="clear" id="assigned_to_tips">
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
</li>
<li class="clear"> <li class="clear">
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), <span class="fl mt6 mr12">类&nbsp;&nbsp;&nbsp;型</span>
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true}, <% if @issue.safe_attribute? 'tracker_id' %>
{:onchange => "change_milestone_tip();", :class => "w150"} %> <%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] },{:required => true, :no_label => true},
</li> #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
<li class="clear" id="milestone_option_tips"> :class => "fl", :style => "width:160px;padding-left:0px;" %>
<%= @issue.fixed_version.nil? ? "未选择里程碑" : "已选择里程碑" %>
<% if params[:action] == "new" %>
<%= link_to "", new_project_version_path(@project, :is_issue => true, :issue_project_id => @project.id), :class => "pic_add mt5 ml5 fr", :remote => true %>
<% end %> <% end %>
</li> </li>
<li class="clear" style="border:1px solid #c8c8c8;"> <li class="clear">
<span class="fl mt6 mr12">状&nbsp;&nbsp;&nbsp;态</span>
<%# 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 => "fl", :style => "width:160px;padding-left:0px;" %>
</li>
<li class="clear">
<span class="fl mt6 mr10"><%= l(:field_priority) %></span>
<% 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 => "w160 fl" %>
<% end %>
</li>
<li class="clear" >
<span class="fl mt6 mr10">里程碑</span>
<%= 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 => "w160 fl"} %>
</li>
<li class="clear">
<label class="fl mt6 mr12">开&nbsp;&nbsp;&nbsp;始</label>
<label class=" fl" style="border:1px solid #c8c8c8;display: inline-block;">
<% 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();", :required => @issue.required_attribute?('start_date'), :onchange => "issue_start_date_change();",
:class => "fl calendar_input", :style => "width:170px;" %> :class => "fl issues_calendar_input",
:style => "height:28px;border-left:none;border-top:none;border-bottom:none;width:124px;",
:placeholder => "请选择开始日期" %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %> <%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %> <% end %>
</label>
</li> </li>
<li class="clear" id="option_start_date_tips">
<%= @issue.start_date.nil? ? "未选择开始日期" : "已选择开始日期" %>
</li>
<li class="clear" style="border:1px solid #c8c8c8;">
<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;", :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">
<% 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'), :placeholder => "请填写预计工时" %>
<% end %>
</li>
<li class="clear"><%= l(:field_estimated_hours) %></li>
<li class="clear"> <li class="clear">
<!--<label class="label02" ></label>-->
<label class="fl mt6 mr12">结&nbsp;&nbsp;&nbsp;束</label>
<label class=" fl" style="border:1px solid #c8c8c8;display: inline-block;">
<% if @issue.safe_attribute? 'due_date' %>
<%= f.text_field :due_date, :size => 10, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();",
:class => "issues_calendar_input fl",
:style => "height:28px;border-left:none;border-top:none;border-bottom:none;width:124px;",
:placeholder => "请选择结束日期" %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %>
</label>
</li>
<li class="clear">
<span class="fl mt6 mr12">工&nbsp;&nbsp;&nbsp;时</span>
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时",
:class => "fl", :style => "width:153px;" %>
<% end %>
</li>
<li class="clear">
<span class="fl mt6 mr10">完成度</span>
<% 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] }),
{:required => @issue.required_attribute?('done_ratio'), :no_label => true}, {:required => @issue.required_attribute?('done_ratio'), :no_label => true},
:onchange => "PrecentChange(this.value)", :onchange => "PrecentChange(this.value)",
:class => "w150" %> :class => "w160 fl" %>
<% end %> <% end %>
</li> </li>
<li class="clear">完成度</li>
<% if @project.gpid %> <% if @project.gpid %>
<%#= hidden_field_tag @issue_commit_ids %> <%#= hidden_field_tag @issue_commit_ids %>
<input value="" name="commit_ids" id="commit_ids" type="hidden"> <input value="" name="commit_ids" id="commit_ids" type="hidden">
@ -162,6 +163,28 @@
</ul> </ul>
<% end %> <% end %>
<script> <script>
function change_assigned_tip() {
if( document.getElementById('issue_assigned_to_id').options[document.getElementById('issue_assigned_to_id').selectedIndex].value == 0 ){
$('#assigned_to_tips').html("未指派");
}
else{
$('#assigned_to_tips').html("已指派")};
}
function change_milestone_tip(version_id){
if( document.getElementById('issue_fixed_version_id').options[document.getElementById('issue_fixed_version_id').selectedIndex].value == 0 ){
$('#milestone_option_tips').html("未选择里程碑")}
else{
$('#milestone_option_tips').html("已选择里程碑")
};
}
function issue_start_date_change(){
$('#option_start_date_tips').html("已选择开始日期");
}
function issue_end_date_change() {
$('#option_end_date_tips').html("已选择结束日期");
}
function issue_create(){ function issue_create(){
var issue_commit_ids = $("#issue_commit_ids .commit_id_value"); var issue_commit_ids = $("#issue_commit_ids .commit_id_value");
var str = ""; var str = "";
@ -195,26 +218,6 @@
}) })
} }
function change_assigned_tip() {
if( document.getElementById('issue_assigned_to_id').options[document.getElementById('issue_assigned_to_id').selectedIndex].value == 0 ){
$('#assigned_to_tips').html("未指派");
}
else{
$('#assigned_to_tips').html("已指派")};
}
function change_milestone_tip(version_id){
if( document.getElementById('issue_fixed_version_id').options[document.getElementById('issue_fixed_version_id').selectedIndex].value == 0 ){
$('#milestone_option_tips').html("未选择里程碑")}
else{
$('#milestone_option_tips').html("已选择里程碑")
};
}
function issue_start_date_change(){
$('#option_start_date_tips').html("已选择开始日期");
}
function issue_end_date_change() {
$('#option_end_date_tips').html("已选择结束日期");
}
// 里程碑添加默认选项 // 里程碑添加默认选项
$("#issue_fixed_version_id option[value='']").remove(); $("#issue_fixed_version_id option[value='']").remove();

View File

@ -153,6 +153,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr5{ margin-right:5px;} .mr5{ margin-right:5px;}
.mr8{ margin-right:8px;} .mr8{ margin-right:8px;}
.mr10{ margin-right:10px;} .mr10{ margin-right:10px;}
.mr12{ margin-right:12px;}
.mr15 {margin-right:15px;} .mr15 {margin-right:15px;}
.mr18 {margin-right:18px;} .mr18 {margin-right:18px;}
.mr20{ margin-right:20px;} .mr20{ margin-right:20px;}
@ -253,6 +254,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w140{ width:140px;} .w140{ width:140px;}
.w145{ width:145px;} .w145{ width:145px;}
.w150{ width:150px;} .w150{ width:150px;}
.w160{width:160px !important;}
.w170{width:170px;} .w170{width:170px;}
.w180{width:180px;} .w180{width:180px;}
.w186{ width:186px;} .w186{ width:186px;}