From 2aa025cf32ce0a135b462d38961f3bc3b524ef40 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Sun, 19 Feb 2017 15:17:46 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE=E6=96=B0?=
=?UTF-8?q?=E5=BB=BA=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/training_tasks_controller.rb | 1 +
app/views/training_tasks/_form.html.erb | 93 +++++++++-----------
app/views/training_tasks/new.html.erb | 4 +-
public/stylesheets/css/project.css | 18 ++++
4 files changed, 65 insertions(+), 51 deletions(-)
diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb
index aa716cf5c..50a78566a 100644
--- a/app/controllers/training_tasks_controller.rb
+++ b/app/controllers/training_tasks_controller.rb
@@ -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 {
diff --git a/app/views/training_tasks/_form.html.erb b/app/views/training_tasks/_form.html.erb
index 790c8b17b..0b3245e74 100644
--- a/app/views/training_tasks/_form.html.erb
+++ b/app/views/training_tasks/_form.html.erb
@@ -1,52 +1,47 @@
-<%= labelled_fields_for :training_task, @training_task do |f| %>
-
- -
- 类 型
- <%= 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;" %>
-
- -
-
- <%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true, :id => "training_task_id" %>
- 标题不能为空
-
- <%= 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 %>
-
- -
-
- <%= 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' %>
-
-
-
- -
-
- <%= render :partial => 'attachments/form', :locals => {:container => @training_task} %>
-
- -
- <% if params[:action] == "new" %>
- 取消
- <% else %>
- <%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %>
- <% end %>
-
-
-
-
-
-
-<% end %>
+
+ -
+
+
+
+
+ -
+
+ <%= f.text_field :subject, :class => "input-big", :no_label => true, :id => "training_task_id", :placeholder => "请输入标题" %>
+ 标题不能为空
+ <%= 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 %>
+
+ -
+
+ <%= 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 %>
+
+ -
+
+ <%= render :partial => 'attachments/form', :locals => {:container => @training_task} %>
+
+ -
+ <% if params[:action] == "new" %>
+ 取消
+ <% else %>
+ <%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %>
+ <% end %>
+
+
+
-
-
+
+
<%#= 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| %>
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 92b372bb7..059683919 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -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;}