2015-04-15 16:34:34 +08:00
|
|
|
|
<%= labelled_fields_for :issue, @issue do |f| %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<ul class="fl pro_new_conbox_left">
|
2015-04-15 16:34:34 +08:00
|
|
|
|
<li>
|
|
|
|
|
<% if @issue.safe_attribute? 'subject' %>
|
|
|
|
|
<label class="label"><span class="c_red f12">*</span> 主题 : </label>
|
2016-10-28 09:43:30 +08:00
|
|
|
|
<%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true %>
|
2015-04-15 16:34:34 +08:00
|
|
|
|
<!--Added by young-->
|
|
|
|
|
<%= javascript_tag do %>
|
|
|
|
|
observeAutocompleteField('issue_subject',
|
2015-04-24 15:20:37 +08:00
|
|
|
|
'<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>',
|
2015-04-15 16:34:34 +08:00
|
|
|
|
{ select: function(event, ui) {
|
|
|
|
|
$('input#issue_subject').val(ui.item.value);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<span ></span>
|
2015-04-15 16:34:34 +08:00
|
|
|
|
</li>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<li class="clear">
|
2015-04-15 16:34:34 +08:00
|
|
|
|
<% if @issue.safe_attribute? 'description' %>
|
2015-04-17 10:37:40 +08:00
|
|
|
|
<label class="label"> 描述 : </label>
|
2015-04-15 16:34:34 +08:00
|
|
|
|
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %>
|
2015-05-27 11:08:05 +08:00
|
|
|
|
<%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
|
|
|
|
|
<%#= content_tag 'span', :id => "issue_description_and_toolbar" do %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'85%', :height =>159, :resizeType => 0, :no_label => true, at_id: @project.id, at_type: @project.class.to_s %>
|
2015-05-27 11:08:05 +08:00
|
|
|
|
<%# end %>
|
2015-05-26 16:30:06 +08:00
|
|
|
|
<%#= wikitoolbar_for 'issue_description' %>
|
2015-04-15 16:34:34 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-11-07 13:28:50 +08:00
|
|
|
|
<li class="fl">
|
|
|
|
|
<% if @issue.safe_attribute? 'tracker_id' %>
|
|
|
|
|
<label class="label mt3"><span class="c_red f12">*</span> 类型 : </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>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
|
|
|
|
|
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
|
2016-11-07 13:28:50 +08:00
|
|
|
|
{:no_label => true},
|
|
|
|
|
:class => "w110" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</li>
|
2016-11-07 13:28:50 +08:00
|
|
|
|
<li class="fl ml41">
|
|
|
|
|
<label class="label mt3"><span class="c_red f12">*</span><%= l(:field_priority) %>:</label>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% if @issue.safe_attribute? 'priority_id' %>
|
|
|
|
|
<%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
|
2016-11-07 13:28:50 +08:00
|
|
|
|
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
|
|
|
|
|
:class => "w110" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="clear">
|
|
|
|
|
<label class="label"><%= l(:label_attachment_plural) %>:</label>
|
|
|
|
|
<%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="clear">
|
2016-10-25 11:23:02 +08:00
|
|
|
|
<% if params[:action] == "new" %>
|
2016-10-28 09:43:30 +08:00
|
|
|
|
<a href="<%= project_issues_path(@project, :remote => true) %>" class="sy_btn_grey mr5 fr"> 取消</a>
|
2016-10-25 11:23:02 +08:00
|
|
|
|
<% else %>
|
2016-10-28 09:43:30 +08:00
|
|
|
|
<a href="javascript:void(0);" onclick="issueDetailShow();" class="sy_btn_grey mr5 fr" > 取消 </a>
|
2016-10-25 11:23:02 +08:00
|
|
|
|
<% end %>
|
2016-10-28 15:55:55 +08:00
|
|
|
|
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
|
2016-11-10 17:16:54 +08:00
|
|
|
|
<!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->
|
2016-11-14 13:28:41 +08:00
|
|
|
|
<input onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue fr mr5" onfocus="this.blur()" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<ul class="fl pro_new_conbox_right ml10 mb10">
|
|
|
|
|
<li class="clear">
|
|
|
|
|
<% if @issue.safe_attribute? 'is_private' %>
|
|
|
|
|
<%= f.check_box :is_private, :no_label => true, :class => "fl pro_newissue_con_check" %>
|
|
|
|
|
<label class="fl ml5" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
|
|
|
|
|
<label class="fl ml5" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_set_private_tips)%></label>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" id="versions_assigned_id">
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% if @issue.safe_attribute? 'assigned_to_id' %>
|
|
|
|
|
<%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to),
|
2016-10-28 15:55:55 +08:00
|
|
|
|
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
|
|
|
|
|
{:onchange => "change_assigned_tip();",:class => "w150"} %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" id="assigned_to_tips">
|
2016-10-25 15:37:49 +08:00
|
|
|
|
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
|
2016-10-25 11:23:02 +08:00
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" >
|
2016-10-28 15:55:55 +08:00
|
|
|
|
<%= 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},
|
2016-11-07 13:28:50 +08:00
|
|
|
|
{:onchange => "change_milestone_tip();", :class => "w150"} %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" id="milestone_option_tips">
|
2016-11-14 16:47:45 +08:00
|
|
|
|
<%= @issue.fixed_version.nil? ? "未选择里程碑" : "已选择里程碑" %>
|
2016-10-27 16:33:00 +08:00
|
|
|
|
<% 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 %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" style="border:1px solid #c8c8c8;">
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% if @issue.safe_attribute? 'start_date' %>
|
|
|
|
|
<%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
2016-11-22 16:51:16 +08:00
|
|
|
|
:required => @issue.required_attribute?('start_date'), :onchange => "issue_start_date_change();",
|
|
|
|
|
:class => "fl calendar_input", :style => "width:170px;" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" id="option_start_date_tips">
|
2016-10-25 15:37:49 +08:00
|
|
|
|
<%= @issue.start_date.nil? ? "未选择开始日期" : "已选择开始日期" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear" style="border:1px solid #c8c8c8;">
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<label class="label02" ></label>
|
|
|
|
|
<% if @issue.safe_attribute? 'due_date' %>
|
|
|
|
|
<%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
2016-11-22 16:51:16 +08:00
|
|
|
|
:required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();",
|
|
|
|
|
:class => "fl calendar_input",:style => "width: 170px;", :placeholder => "请选择结束日期" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear " id="option_end_date_tips">
|
2016-10-25 15:37:49 +08:00
|
|
|
|
<%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear">
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% if @issue.safe_attribute? 'estimated_hours' %>
|
2016-11-07 13:28:50 +08:00
|
|
|
|
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
2016-11-22 16:51:16 +08:00
|
|
|
|
:required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear"><%= l(:field_estimated_hours) %></li>
|
2016-11-07 13:28:50 +08:00
|
|
|
|
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear">
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<% 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] }),
|
|
|
|
|
{:required => @issue.required_attribute?('done_ratio'), :no_label => true},
|
|
|
|
|
:onchange => "PrecentChange(this.value)",
|
|
|
|
|
:class => "w150" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
2016-12-01 14:21:40 +08:00
|
|
|
|
<li class="clear">完成度</li>
|
|
|
|
|
<li class="clear"><span>关联Commit</span><%= link_to "<span class='btn-commit btn-blue mt-2 fr'>+</span>".html_safe, issue_commits_issues_path %></li>
|
2015-04-15 16:34:34 +08:00
|
|
|
|
</ul>
|
2016-09-08 15:38:01 +08:00
|
|
|
|
<% end %>
|
2016-10-25 09:28:09 +08:00
|
|
|
|
<script>
|
|
|
|
|
function change_assigned_tip() {
|
2016-10-28 18:47:23 +08:00
|
|
|
|
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("已指派")};
|
2016-10-25 09:28:09 +08:00
|
|
|
|
}
|
2016-10-28 18:47:23 +08:00
|
|
|
|
function change_milestone_tip(version_id){
|
|
|
|
|
if( document.getElementById('issue_fixed_version_id').options[document.getElementById('issue_fixed_version_id').selectedIndex].value == 0 ){
|
2016-11-14 16:47:45 +08:00
|
|
|
|
$('#milestone_option_tips').html("未选择里程碑")}
|
2016-10-28 18:47:23 +08:00
|
|
|
|
else{
|
2016-11-14 16:47:45 +08:00
|
|
|
|
$('#milestone_option_tips').html("已选择里程碑")
|
2016-10-28 18:47:23 +08:00
|
|
|
|
};
|
2016-10-25 09:28:09 +08:00
|
|
|
|
}
|
|
|
|
|
function issue_start_date_change(){
|
|
|
|
|
$('#option_start_date_tips').html("已选择开始日期");
|
|
|
|
|
}
|
|
|
|
|
function issue_end_date_change() {
|
|
|
|
|
$('#option_end_date_tips').html("已选择结束日期");
|
|
|
|
|
}
|
2016-11-07 13:28:50 +08:00
|
|
|
|
// 里程碑添加默认选项
|
|
|
|
|
$("#issue_fixed_version_id option[value='']").remove();
|
2016-11-22 14:29:03 +08:00
|
|
|
|
|
2016-10-25 09:28:09 +08:00
|
|
|
|
</script>
|