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

Conflicts:
	app/views/projects/settings/_new_modules.html.erb
This commit is contained in:
Linda 2017-02-19 15:30:38 +08:00
commit dae19d7be6
6 changed files with 66 additions and 52 deletions

View File

@ -106,6 +106,7 @@ class TrainingTasksController < ApplicationController
@training_task.subject = params[:training_task][:subject]
@training_task.description = params[:training_task][:description]
@training_task.tracker_id = params[:training_task][:tracker_id]
@training_task.position = params[:training_sequence].to_i
if @training_task.save
respond_to do |format|
format.html {

View File

@ -30,7 +30,6 @@
<div class="<%= show_memu == 'edit_project' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_01">
<%= render :partial=>"projects/settings/new_edit" if User.current.allowed_to?(:edit_project, @project)%>
</div><!--tbc_01 end-->
<div class="<%= show_memu == 'select_project_modules' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_02">
<%= render :partial=>"projects/settings/new_modules" if User.current.allowed_to?(:select_project_modules, @project)%>
</div><!--tbc_02 end-->

View File

@ -1,3 +1,4 @@
<div class="pro_new_prompt ml15 mr15 mb10"><p>问题跟踪模块与实训模块不能同时选择</p><p>一旦选定并保存后,将不能修改</p></div>
<ul class="pro_newsetting_con ml30 mb15">
<h2 class="pro_newsetting_title">请选择此项目可以使用的模块:</h2>
<%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %>

View File

@ -1,52 +1,47 @@
<%= labelled_fields_for :training_task, @training_task do |f| %>
<ul class="fl pro_new_conbox_left">
<li class="clear">
<span class="fl mt6 mr12">类&nbsp;&nbsp;&nbsp;型</span>
<%= f.select :tracker_id, Tracker.all.collect{ |t| [t.name, t.id] },{:required => true, :no_label => true},
:class => "fl", :style => "width:160px;padding-left:0px;" %>
</li>
<li>
<label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true, :id => "training_task_id" %>
<span style="display: none">标题不能为空</span>
<!--Added by young-->
<%= javascript_tag do %>
observeAutocompleteField('issue_subject',
'<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>',
{ select: function(event, ui) {
$('input#issue_subject').val(ui.item.value);
}
});
<% end %>
</li>
<li class="clear">
<label class="label">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.label_for_field :description, :no_label => true, :class => "label" %>
<%#= 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 %>
<%= f.kindeditor :description,:editor_id => "training_task_desc_editor", :width=>'85%', :height =>159, :resizeType => 0, :no_label => true, at_id: @project.id, at_type: @project.class.to_s %>
<%# end %>
<%#= wikitoolbar_for 'issue_description' %>
</li>
<li class="clear">
<label class="label"><%= l(:label_attachment_plural) %></label>
<%= render :partial => 'attachments/form', :locals => {:container => @training_task} %>
</li>
<li class="clear">
<% if params[:action] == "new" %>
<a href="<%= project_training_tasks_url(@project, :remote => true) %>" class="sy_btn_grey mr5 fr"> 取消</a>
<% else %>
<%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %>
<% end %>
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
<!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->
<input onclick="issue_create();" class="sy_btn_blue fr mr5" onfocus="this.blur()" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
</li>
</ul>
<% end %>
<ul>
<li class="clear">
<label class="label"><span class="c_red f12">*</span>&nbsp;序号&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="training_sequence" placeholder="请输入序号(整数)" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" />
<span ></span>
</li>
<li class="clear">
<label class="label"><span class="c_red f12">*</span>&nbsp;标题&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :subject, :class => "input-big", :no_label => true, :id => "training_task_id", :placeholder => "请输入标题" %>
<span style="display: none">标题不能为空</span>
<%= javascript_tag do %>
observeAutocompleteField('issue_subject',
'<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>',
{ select: function(event, ui) {
$('input#issue_subject').val(ui.item.value);
}
});
<% end %>
</li>
<li class="clear">
<label class="label fl">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.label_for_field :description, :no_label => true, :class => "fl" %>
<%= f.kindeditor :description,
:editor_id => "training_task_desc_editor",
:width=>'885px',
:height =>192,
:resizeType => 0,
:no_label => true,
:at_id => @project.id,
:at_type => @project.class.to_s %>
</li>
<li class="clear">
<label class="label"><%= l(:label_attachment_plural) %></label>
<%= render :partial => 'attachments/form', :locals => {:container => @training_task} %>
</li>
<li class="clear">
<% if params[:action] == "new" %>
<a href="<%= project_training_tasks_url(@project, :remote => true) %>" class="sy_btn_grey mr5 fr"> 取消</a>
<% else %>
<%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %>
<% end %>
<input onclick="issue_create();" class="sy_btn_blue mr5 fr" onfocus="this.blur()" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
</li>
</ul>
<script>
function issue_create(){
training_task_desc_editor.sync();

View File

@ -9,8 +9,8 @@
</script>
<!--新建缺陷开始-->
<div class="pro_new_con ">
<div class="pro_newissue_con clear">
<div class="pro_new_con mb10">
<div class="pro-task-new-con clear">
<%#= call_hook(:view_issues_new_top, {:training_task => @training_task}) %>
<%= labelled_form_for @training_task, :url => project_training_tasks_url(@project),
:html => {:id => 'project_training_form', :multipart => true} do |f| %>

View File

@ -654,3 +654,21 @@ a.pro-fenzhi-a{height:25px; line-height: 25px; border: 1px solid #dddddd; bac
border-bottom-right-radius: 0; display: inline-block; text-align: center; padding:0 5px; border-left: none;}
a:hover.pro-fenzhi-a{color:#3b94d6;}
/*实训项目*/
.pro-task-new-con{ padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; width:968px;}
.pro-task-new-con ul li{ margin-bottom:10px; line-height: 28px;}
.pro-task-new-con ul li:last-child{margin-bottom:0px;}
.pro-task-new-con input{ border:1px solid #c8c8c8; height: 28px; width: 200px; color: #888;}
.pro-task-new-con textarea{ width: 881px;border:1px solid #c8c8c8;}
.pro-task-new-con input.input-big{ width: 881px;}
.issues-table{ width: 100%;}
.issues-table select{ border: none; width: 100px; color:#888; font-weight: bold;appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;}
.issues-table tr th{ height: 40px; border-bottom:1px solid #e5e5e5; color: #888;}
.issues-table p.text-left{ text-align: left; color: #333; border-bottom: 3px solid #3498db; display: block; width: 100px; height:40px; line-height: 40px; padding-left:15px;}
.issues-table tr td{ padding:10px 0; border-bottom: 1px dashed #c8c8c8; text-align: center; color:#888;}
.issues-table tr td.w50{ width: 60px;}
.issues-table tbody tr:hover{ background:#f2f2f2;}
.issues-table tr td span.w100{ display: inline-block; width: 100px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis; }
span.task-linebtn-green{color:#59af48; border: 1px solid #59af48;font-size: 12px; padding: 0 5px; border-radius: 3px;line-height: 14px;}
.issues-table select.select-w50{ width: 50px;}
span.task-step{ color:#ee4a20;font-style: italic; font-weight:bold; font-size:14px;}