1.创建项目增加功能:是否启动DTS测试,默认为不启用。根据用户选择,决定左侧DTS测试工具选项是否在该项目内显示

This commit is contained in:
sw 2014-07-15 10:28:49 +08:00
parent bff1319c5e
commit b142953a4b
6 changed files with 28 additions and 6 deletions

View File

@ -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?

View File

@ -15,6 +15,9 @@
<!-- <p style="margin-left:-10px;"><%#= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p> --> <!-- by huang -->
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></em></p>
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :hidden_repo, :style => "margin-left:10px;" %></em></p>
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;">
<%= f.check_box :dts_test, :style => "margin-left:10px;" %>
</em></p>
<p style="display:none;"><%= f.text_field :project_type, :value => 0 %></p>
<%= wikitoolbar_for 'project_description' %>

View File

@ -14,7 +14,9 @@
<li><%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %></li>
</ul>
<ul><h3>其他工具</h3>
<li><%= link_to l(:label_module_share) ,share_show_path(@project) %></li>
<% if @project.dts_test == 1 %>
<li><%= link_to l(:label_module_share) ,share_show_path(@project) %></li>
<% end %>
<li><%= link_to l(:project_module_documents), project_documents_path(@project) %></li>
<li></li>
</ul>

View File

@ -5,17 +5,22 @@
<div class="box tabular">
<%= render :partial => 'course_form', :locals => { :f => f } %>
<span style="padding-left: 60px"><%= submit_tag l(:button_create), :class => "enterprise"%></span>
<!-- <%= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
<span style="padding-left: 60px">
<%= submit_tag l(:button_create), :class => "enterprise"%>
</span>
</div>
<!-- <%#= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
<% else %>
<h3><%=l(:label_project_new)%></h3>
<div class="box tabular" >
<p style="font-weight: bold; color: rgb(237,137,36)"> <%=raw l(:label_project_new_description)%> </p>
<%= render :partial => 'form', :locals => { :f => f } %>
<span style="padding-left: 60px"><%= submit_tag l(:button_create), :class => "enterprise"%></span>
<!-- <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> -->
<span style="padding-left: 60px">
<%= submit_tag l(:button_create), :class => "enterprise"%>
</span>
</div>
<!-- <%#= submit_tag l(:button_create_and_continue), :name => 'continue' %> -->
<% end %>
<%= javascript_tag "$('#project_name').focus();" %>
</div>
<% end %>
<!--Ended by young-->

View File

@ -1901,6 +1901,7 @@ zh:
field_teacher_name: 教 师
field_hidden_repo: 隐藏代码库
field_dts_test: DTS测试工具
label_newbie_faq: '新手指引 & 问答'
label_hot_project: '热门项目'

View File

@ -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