From b142953a4b10f4209fcab71c0cfacca1439c7a46 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 15 Jul 2014 10:28:49 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8A=9F=E8=83=BD=EF=BC=9A=E6=98=AF=E5=90=A6=E5=90=AF?= =?UTF-8?q?=E5=8A=A8DTS=E6=B5=8B=E8=AF=95=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=E4=B8=8D=E5=90=AF=E7=94=A8=E3=80=82=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=80=89=E6=8B=A9=EF=BC=8C=E5=86=B3=E5=AE=9A?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7DTS=E6=B5=8B=E8=AF=95=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=98=AF=E5=90=A6=E5=9C=A8=E8=AF=A5=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=86=85=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 2 ++ app/views/projects/_form.html.erb | 3 +++ app/views/projects/_tools_expand.html.erb | 4 +++- app/views/projects/new.html.erb | 15 ++++++++++----- config/locales/zh.yml | 1 + db/migrate/20140715015540_dst_test.rb | 9 +++++++++ 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20140715015540_dst_test.rb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 540f0a312..136703c68 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -513,6 +513,7 @@ class ProjectsController < ApplicationController @trackers = Tracker.sorted.all @project = Project.new @project.user_id = User.current.id + @project.dts_test = params[:project][:dts_test] @project.safe_attributes = params[:project] if @course_tag == '1' @project.identifier = @course.extra @@ -845,6 +846,7 @@ class ProjectsController < ApplicationController def update @project.safe_attributes = params[:project] + @project.dts_test = params[:project][:dts_test] if validate_parent_id && @project.save @course = Course.find_by_extra(@project.identifier) unless @course.nil? diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index 420cc5100..f5781b26a 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -15,6 +15,9 @@

<%= f.check_box :is_public, :style => "margin-left:10px;" %>

<%= f.check_box :hidden_repo, :style => "margin-left:10px;" %>

+

+ <%= f.check_box :dts_test, :style => "margin-left:10px;" %> +

<%= f.text_field :project_type, :value => 0 %>

<%= wikitoolbar_for 'project_description' %> diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb index d5aadc419..aec1ad7a2 100644 --- a/app/views/projects/_tools_expand.html.erb +++ b/app/views/projects/_tools_expand.html.erb @@ -14,7 +14,9 @@
  • <%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
  • diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index aa03a1cc1..e1637e94b 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -5,17 +5,22 @@
    <%= render :partial => 'course_form', :locals => { :f => f } %> - <%= submit_tag l(:button_create), :class => "enterprise"%> - + + <%= submit_tag l(:button_create), :class => "enterprise"%> + +
    + <% else %>

    <%=l(:label_project_new)%>

    <%=raw l(:label_project_new_description)%>

    <%= render :partial => 'form', :locals => { :f => f } %> - <%= submit_tag l(:button_create), :class => "enterprise"%> - + + <%= submit_tag l(:button_create), :class => "enterprise"%> + +
    + <% end %> <%= javascript_tag "$('#project_name').focus();" %> - <% end %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 276d09336..04b15bb63 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1901,6 +1901,7 @@ zh: field_teacher_name: 教 师 field_hidden_repo: 隐藏代码库 + field_dts_test: DTS测试工具 label_newbie_faq: '新手指引 & 问答' label_hot_project: '热门项目' diff --git a/db/migrate/20140715015540_dst_test.rb b/db/migrate/20140715015540_dst_test.rb new file mode 100644 index 000000000..46d592d58 --- /dev/null +++ b/db/migrate/20140715015540_dst_test.rb @@ -0,0 +1,9 @@ +class DstTest < ActiveRecord::Migration + def up + add_column :projects, :dts_test, :integer, :default => 0 + end + + def down + remove_column :projects, :dts_test + end +end