实训项目module中“实训项目”和"issue”不能同时选中,只选中一个

This commit is contained in:
daiao 2017-02-19 10:50:08 +08:00
parent 11ab4da9ef
commit 243062bee2
2 changed files with 49 additions and 64 deletions

View File

@ -2,8 +2,8 @@
<h2 class="pro_newsetting_title">请选择此项目可以使用的模块:</h2> <h2 class="pro_newsetting_title">请选择此项目可以使用的模块:</h2>
<%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %> <%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %>
<% Redmine::AccessControl.available_project_modules.each do |m| %> <% Redmine::AccessControl.available_project_modules.each do |m| %>
<li class="clear "> <li class="clear">
<%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl mt8").html_safe -%> <%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl mt8", :id => 'project_module_'+m.to_s ).html_safe -%>
<p class="fl ml5"><%= l_or_humanize(m, :prefix => "project_module_").html_safe %></p> <p class="fl ml5"><%= l_or_humanize(m, :prefix => "project_module_").html_safe %></p>
</li> </li>
<% end %> <% end %>
@ -16,27 +16,26 @@
</li> </li>
</ul> </ul>
<script>
<!--h2 class="c_blue mb10">请选择此项目可以使用的模块:</h2> $(function(){
<%#= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %> if($("#project_module_issue_tracking").is(":checked")){
<div class="box pl15"> $("#project_module_training_tasks").attr('disabled', 'disabled')
<ul> }else if($("#project_module_training_tasks").is(":checked")){
<%# Redmine::AccessControl.available_project_modules.each do |m| %> $("#project_module_issue_tracking").attr('disabled', 'disabled');
<li> }
<label> $("#project_module_issue_tracking").on('click', function(){
<%#= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m)).html_safe -%> if($("#project_module_issue_tracking").is(":checked")) {
<%#= l_or_humanize(m, :prefix => "project_module_").html_safe %> $("#project_module_training_tasks").attr('disabled', 'disabled');
</label> }else{
</li> $("#project_module_training_tasks").removeAttr('disabled');
<%# end %> }
</ul> });
</div><!--box end--> $("#project_module_training_tasks").on('click', function(){
<!--p class="mb10 c_grey"> if($("#project_module_training_tasks").is(":checked")){
<#%= check_all_links('modules-form').html_safe %> $("#project_module_issue_tracking").attr('disabled', 'disabled');
</p> }else {
<p> $("#project_module_issue_tracking").removeAttr('disabled');
<a href="javascript:void(0)" class="blue_btn" onclick="$('#modules-form').submit();"> }
<%#= l(:button_save) %> });
</a> });
</p> </script>
<%# end %>-->

View File

@ -521,13 +521,6 @@ ActiveRecord::Schema.define(:version => 20170217104309) do
add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id"
add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id"
create_table "contest_notifications", :force => true do |t|
t.text "title"
t.text "content"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "contestant_for_contests", :force => true do |t| create_table "contestant_for_contests", :force => true do |t|
t.integer "student_id" t.integer "student_id"
t.integer "contest_id" t.integer "contest_id"
@ -595,37 +588,6 @@ ActiveRecord::Schema.define(:version => 20170217104309) do
add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id"
add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id"
create_table "contesting_projects", :force => true do |t|
t.integer "project_id"
t.string "contest_id"
t.integer "user_id"
t.string "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "reward"
end
create_table "contesting_softapplications", :force => true do |t|
t.integer "softapplication_id"
t.integer "contest_id"
t.integer "user_id"
t.string "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "reward"
end
create_table "contestnotifications", :force => true do |t|
t.integer "contest_id"
t.string "title"
t.string "summary"
t.text "description"
t.integer "author_id"
t.integer "notificationcomments_count"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "contests", :force => true do |t| create_table "contests", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.string "name" t.string "name"
@ -1192,6 +1154,19 @@ ActiveRecord::Schema.define(:version => 20170217104309) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "ii", :force => true do |t|
t.integer "project_id"
t.string "author_login"
t.string "rep_identifier"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sonar_version", :default => 0
t.string "path"
t.string "branch"
t.string "language"
t.string "sonar_name"
end
create_table "innodb_monitor", :id => false, :force => true do |t| create_table "innodb_monitor", :id => false, :force => true do |t|
t.integer "a" t.integer "a"
end end
@ -2291,6 +2266,17 @@ ActiveRecord::Schema.define(:version => 20170217104309) do
t.integer "fields_bits", :default => 0 t.integer "fields_bits", :default => 0
end end
create_table "training_tasks", :force => true do |t|
t.integer "project_id"
t.integer "tracker_id"
t.string "subject"
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "author_id"
t.integer "status", :limit => 1, :default => 1
end
create_table "user_actions", :force => true do |t| create_table "user_actions", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.string "action_type" t.string "action_type"