Merge branches 'dev_aliyun' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysm1

dev_sync_trustie
杨树明 5 years ago
commit 857c6bf587

@ -9,6 +9,7 @@
//= require bootstrap-notify
//= require jquery.cookie.min
//= require select2
//= require moment.min
//= require jquery.cxselect
//= require bootstrap-datepicker
//= require bootstrap-datetimepicker

@ -9,7 +9,7 @@ $(document).on('turbolinks:load', function(){
};
var timeOptions = {
autoclose: true,
// autoclose: true,
language: 'zh-CN',
format: 'yyyy-mm-dd hh:ii:ss',
minuteStep: 30
@ -24,17 +24,20 @@ $(document).on('turbolinks:load', function(){
});
};
// var defineTimeRangeSelect = function (element) {
// var options = $.extend({inputs: $(element).find('.start-date, .end-date')}, timeOptions);
// $(element).datetimepicker(options);
//
// $(element).find('.start-date').datetimepicker().on('changeDate', function (e) {
// $(element).find('.end-date').datetimepicker('setStartDate', e.date);
// });
// };
var defineTimeRangeSelect = function (element) {
// var options = $.extend({inputs: $(element).find('.start-date, .end-date')}, timeOptions);
$(".start-date").datetimepicker(timeOptions);
$(element).find('.start-date').datetimepicker().on('changeDate', function (e) {
$(element).find('.end-date').datetimepicker('setStartDate', e.date);
});
};
$(".competition-start-end-date .start-date").datetimepicker();
$(".competition-start-end-date .end-date").datetimepicker();
defineDateRangeSelect('.teaching-mode-date');
defineDateRangeSelect('.competition-start-end-date');
// defineTimeRangeSelect('.competition-start-end-date');
var $basicForm = $('form.basic-setting-form');
@ -133,8 +136,8 @@ $(function () {
//链接
$("#linkForm").on("click",".add_linkBtn",function () {
var length=$("#linkForm").find(".linkFormItem").length + 1;
$(".nav-setting-form").on("click",".add_linkBtn",function () {
var length=$(".nav-setting-form").find(".linkFormItem").length + 1;
var html='<div class="row mt-2 lineFromItem">\n' +
' <div class="col-1 text-right">\n' +
' <label class="checkbox checkbox-primary mt-1">\n' +
@ -147,12 +150,13 @@ $(function () {
' <div class="col-md-3 mt-1"><input type="text" name="link_info_'+length+'" class="form-control"></div>\n' +
' <button class="mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn">+</button>\n' +
' <button class="mt-1 btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_linkBtn">×</button>\n' +
' </div>'
$("#linkForm").append(html)
})
$("#linkForm").on("click",".del_linkBtn",function () {
' </div>';
$(this).parents(".lineFromItem").insertAfter(html);
});
$(".nav-setting-form").on("click",".del_linkBtn",function () {
$(this).parents(".lineFromItem").remove();
})
});
//有关报名要求
$("#addRequireBtn").on("click",function () {
@ -192,9 +196,18 @@ $(function () {
' </div>\n' +
' </div>';
$("#requireForm").append(html);
})
});
$("#requireForm").on("click",".delRequrieBtn",function () {
$(this).parents(".requireForm_item").remove();
});
$('.competition-staff-settings').on('click', '.mutiple-limited-radio', function(){
var radio = $(this);
if (radio.is(':checked')) {
radio.parent().parent().siblings().find('.mutiple-limited-radio').attr('checked', false)
} else {
radio.parent().parent().siblings().find('.mutiple-limited-radio').attr('checked', true)
}
})
})
});

@ -135,7 +135,7 @@ $(document).on('turbolinks:load', function() {
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
return item.real_name;
return $("<span>" + item.real_name + " <span class='font-12'>" + item.school_name + ' ' + item.hidden_phone + "</span></span>");
},
templateSelection: function(item){
if (item.id) {

@ -27,7 +27,7 @@ $(document).on('turbolinks:load', function() {
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
return item.real_name + "--" + item.identity;
return $("<span>" + item.real_name + " <span class='font-12'>" + item.school_name + ' ' + item.hidden_phone + "</span></span>");
},
templateSelection: function(item){
if (item.id) {

File diff suppressed because one or more lines are too long

@ -24,6 +24,6 @@ class Admins::CompetitionSettingsController < Admins::BaseController
end
def nav_form_params
params.permit(:enroll_end_time, competition_staffs: %i[category minimum maximum mutiple_limited], nav_module: %i[module_type name hidden position url])
params.permit(:enroll_end_time, competition_staffs: %i[category minimum maximum mutiple_limited], navbar: %i[module_type name hidden position url])
end
end

@ -59,6 +59,7 @@ class Competitions::CompetitionTeamsController < Competitions::BaseController
end
def index
@competition = current_competition
@personal = current_competition.personal?
if admin_or_business?
all_competition_teams

@ -2,9 +2,14 @@ class Cooperative::UsersController < Cooperative::BaseController
def index
params[:sort_by] = params[:sort_by].presence || 'created_on'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
params[:school_id] = current_laboratory.school_id
users = Admins::UserQuery.call(params)
users = Admins::UserQuery.call(search_params)
@users = paginate users.includes(user_extension: :school)
end
private
def search_params
params.permit(:name, :sort_by, :sort_direction)
end
end

@ -0,0 +1,25 @@
require 'uri'
require 'net/http'
class SyncTrustieJob < ApplicationJob
queue_as :default
def perform(type, count)
Rails.logger.info("#######_________response__sync__start__#########")
configs_content = Rails.application.config_for(:configuration)
token = configs_content["sync_token"]
token_url = configs_content["sync_url"]
url = "#{token_url}/api/v1/homes/sync_count"
sync_json = {
"token": token,
"type": type,
"number": count
}
uri = URI.parse(url)
http = Net::HTTP.new(uri.hostname, uri.port)
http.send_request('PUT', uri.path, sync_json.to_json, {'Content-Type' => 'application/json'})
Rails.logger.info("#######_________response__sync__end_____#########")
end
end

@ -60,7 +60,7 @@ module Util
return if str.blank?
case type
when :phone then "#{str[0..2]}***#{str[-3..-1]}"
when :phone then "#{str[0..2]}****#{str[-4..-1]}"
when :email then "#{str[0]}***#{str[(str.rindex('@')-1)..-1]}"
else "#{str[0..2]}***#{str[-3..-1]}"
end

@ -66,7 +66,7 @@ class Competition < ApplicationRecord
# 是否为个人赛
def personal?
competition_staffs.maximum(:maximum) == 1 || max_num == 1
competition_staffs.maximum(:maximum) == 1 || (competition_staffs.nil? && max_num == 1)
end
# 报名是否结束

@ -8,6 +8,8 @@ class Project < ApplicationRecord
has_many :issues
has_many :user_grades, dependent: :destroy
after_create :sync_project_trustie #同步到trustie
# 创建者
def creator
User.find(user_id).full_name
@ -20,4 +22,8 @@ class Project < ApplicationRecord
def member?(user)
members.exists?(user_id: user.id)
end
def sync_project_trustie
SyncTrustieJob.perform_later("project", 1)
end
end

@ -19,6 +19,8 @@ class School < ApplicationRecord
has_many :apply_add_departments, dependent: :destroy
has_many :user_extensions, dependent: :nullify
after_create :sync_school_trustie #同步到trustie
# 学校管理员
def manager?(user)
ec_school_users.exists?(user_id: user.id)
@ -39,4 +41,8 @@ class School < ApplicationRecord
def manage_permission?(user)
manager?(user) || major_manager?(user) || course_manager?(user)
end
def sync_school_trustie
SyncTrustieJob.perform_later("school", 1)
end
end

@ -75,7 +75,7 @@ class Shixun < ApplicationRecord
scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) }
scope :find_by_ids,lambda{|k| where(id:k)}
after_create :send_tiding
after_create :send_tiding, :sync_shixun_trustie #同步到trustie
# REDO: 
def propaedeutics
@ -290,6 +290,10 @@ class Shixun < ApplicationRecord
subjects.where(hidden: 0).uniq
end
def sync_shixun_trustie
SyncTrustieJob.perform_later("practical_training_project", 1)
end
private
def send_tiding

@ -156,6 +156,7 @@ class User < ApplicationRecord
delegate :gender, :department_id, :school_id, :location, :location_city, :technical_title, to: :user_extension, allow_nil: true
before_save :update_hashed_password
after_create :sync_user_trustie #同步到trustie
#
# validations
@ -313,6 +314,10 @@ class User < ApplicationRecord
shixun.shixun_members.exists?(role: 2, user_id: id)
end
def sync_user_trustie
SyncTrustieJob.perform_later("user", 1)
end
# TPI的创建者
def creator_of_game?(game)
id == game.user_id

@ -13,7 +13,7 @@ class Admins::CompetitionNavSettingService < ApplicationService
# hidden_module_type = competition.all_module_types - params[:module_type]
# competition.competition_modules.where(module_type: hidden_module_type).update_all(hidden: 1)
params[:nav_module].each do |nav|
params[:navbar].each do |nav|
module_type = nav["module_type"]
if competition.all_module_types.include?(module_type)
com_module = competition.competition_modules.find_by(module_type: module_type)
@ -23,6 +23,7 @@ class Admins::CompetitionNavSettingService < ApplicationService
com_module.update_attributes!(hidden: nav["hidden"] ? 0 : 1, position: nav["position"], name: nav["name"], url: nav["url"])
end
competition.update_attributes!(enroll_end_time: params[:enroll_end_time])
if params[:competition_staffs].present?
competition.competition_staffs.delete_all
params[:competition_staffs].each_with_index do |staff_params, index|

@ -32,7 +32,7 @@ class Competitions::SaveTeamService < ApplicationService
private
def update_teacher_team_members!
teacher_ids = Array.wrap(params[:teacher_ids]).map(:to_i)
teacher_ids = Array.wrap(params[:teacher_ids]).map(&:to_i)
old_teacher_ids = team.team_members.where(role: 3).pluck(:user_id)
destroy_teacher_ids = old_teacher_ids - teacher_ids
@ -49,7 +49,7 @@ class Competitions::SaveTeamService < ApplicationService
end
def update_member_team_members!
member_ids = Array.wrap(params[:member_ids]).map(:to_i)
member_ids = Array.wrap(params[:member_ids]).map(&:to_i)
old_member_ids = team.team_members.where(role: 2).pluck(:user_id)
destroy_member_ids = old_member_ids - member_ids

@ -0,0 +1,22 @@
#初始化同步educoder的人数项目数高校数实训数到Trustie平台只需运行一次
class SyncTrustieTask
def sync_format
Rails.logger.info("########________sync_to_trustie_start_________###########")
users_count = User.all.size
projects_count = Project.all.size
shixuns_count = Shixun.all.size
schools_count = School.all.size
SyncTrustieJob.perform_later("user", users_count)
SyncTrustieJob.perform_later("project", projects_count)
SyncTrustieJob.perform_later("practical_training_project", shixuns_count)
SyncTrustieJob.perform_later("school", schools_count)
Rails.logger.info("########________sync_to_trustie_end_________###########")
end
end

@ -35,8 +35,8 @@
起止时间
</div>
<div class="col-5 competition-start-end-date d-flex">
<%= text_field_tag :start_time, @competition.start_time&.strftime('%Y-%m-%d'), autocomplete: 'off', class: 'form-control start-date mx-0 mr-2', placeholder: '竞赛开始时间' %>
<%= text_field_tag :end_time, @competition.end_time&.strftime('%Y-%m-%d'), autocomplete: 'off', class: 'form-control end-date mx-0', placeholder: '竞赛截止时间' %>
<%= text_field_tag :start_time, @competition.start_time&.strftime('%Y-%m-%d %H:%M:%S'), autocomplete: 'off', class: 'form-control start-date mx-0 mr-2', placeholder: '竞赛开始时间' %>
<%= text_field_tag :end_time, @competition.end_time&.strftime('%Y-%m-%d %H:%M:%S'), autocomplete: 'off', class: 'form-control end-date mx-0', placeholder: '竞赛截止时间' %>
</div>
</div>
@ -151,134 +151,161 @@
<span class="flex-1">导航设置</span>
</div>
<div class="card-body row">
<div class="container competition-mode-container">
<% @competition.competition_modules.each do |com_module| %>
<% case com_module.module_type %>
<%= form_tag(nav_setting_admins_competition_competition_settings_path(@competition), method: :post, class: 'nav-setting-form flex-1', remote: true) do %>
<div class="container competition-mode-container">
<% @competition.competition_modules.each do |com_module| %>
<% case com_module.module_type %>
<% when 'home' %>
<div id="MD_typeFrom">
<div class="row MD_type">
<div id="MD_typeFrom">
<div class="row MD_type">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
</label>
</div>
<div class="col-md-4">
<%= text_field_tag('navbar[][name]', com_module.name, id: nil, class: 'form-control', placeholder: '首页') %>
<input type="hidden" value="<%= com_module.module_type %>" name="navbar[][module_type]">
</div>
<div class="col-md-1">
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
</div>
</div>
</div>
<% when 'enroll' %>
<div class="row mt-2">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
</label>
</div>
<div class="col-md-4">
<%= text_field_tag('navbar[][name]', com_module.name, id: nil, class: 'form-control', placeholder: '首页') %>
<div class="col-md-8 color-blue mt-1">
<input type="hidden" value="<%= com_module.module_type %>" name="navbar[][module_type]">
<input type="hidden" value="报名" name="navbar[][name]">
报名
</div>
<div class="col-md-1">
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
</div>
<div class="row mt-2 align-items-center">
<div class="col-1 text-right">&nbsp;&nbsp;</div>
<div class="col-1 text-left" style="max-width: 120px;flex: 0 0 120px;">
报名截止时间
</div>
<div class="col-md-3">
<%= text_field_tag :enroll_end_time, @competition.enroll_end_time&.strftime('%Y-%m-%d'), autocomplete: 'off', class: 'form-control enroll_end_time', placeholder: '报名截止时间' %>
</div>
</div>
<div class="row mt-2">
<div class="col-1 text-right">&nbsp;&nbsp;</div>
<div class="col-1 text-left mt-1">
报名要求
</div>
<div class="col-md-3">
<button class="btn btn-primary waves-effect waves-light btn-xs setBtn_s" id="addRequireBtn">+</button>
</div>
</div>
</div>
<% end %>
<% end %>
<div class="row mt-2">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<input id="checkbox2" type="checkbox">
<label for="checkbox2">&nbsp;</label>
</label>
</div>
<div class="col-md-8 color-blue mt-1">
报名
</div>
</div>
<div class="row mt-2">
<div class="col-1 text-right">&nbsp;&nbsp;</div>
<div class="col-1 text-left" style="max-width: 120px;flex: 0 0 120px;">
报名截止时间
</div>
<div class="col-md-3"><input type="text" class="form-control" /></div>
</div>
<div class="row mt-2">
<div class="col-1 text-right">&nbsp;&nbsp;</div>
<div class="col-1 text-left mt-1">
报名要求
</div>
<div class="col-md-3">
<button class="btn btn-primary waves-effect waves-light btn-xs setBtn_s" id="addRequireBtn">+</button>
</div>
</div>
<div id="requireForm">
<div class="row mt-2 mb-4 requireForm_item">
<div class="col-1 text-right">&nbsp;&nbsp;</div>
<div class="col-1 text-left mt-1">
<input type="text" class="form-control" name="min_1" />
</div>
<span class="mt-2">~</span>
<div class="col-1 mt-1">
<input type="text" class="form-control" name="max_1" />
</div>
<span class="mt-2">人</span>
<div class="col-2 mt-1">
<select class="form-control" name="choice_1" >
<option>不限</option>
<option>教师</option>
<option>学生</option>
<option>专业人士</option>
</select>
</div>
<div class="col-2 mt-1">
<label class="radio checkbox-primary mt-1" value="require_1_1">
<input id="require_1_1" name="require_1" type="radio">
<label for="require_1_1">可多次报名</label>
</label>
</div>
<div class="col-2 mt-1">
<label class="radio checkbox-primary mt-1" value="require_1_2">
<input id="require_1_2" name="require_1" type="radio">
<label for="require_1_2">不可多次报名</label>
</label>
</div>
</div>
<div id="requireForm" class="competition-staff-settings">
<% @competition.competition_staffs.each do |staff| %>
<div class="row mt-2 mb-4 requireForm_item">
<div class="col-1 text-right">&nbsp;&nbsp;</div>
<div class="col-1 text-left mt-1">
<input type="text" class="form-control" name="competition_staffs[][minimum]" value="<%= staff.minimum %>" />
</div>
<span class="mt-2">~</span>
<div class="col-1 mt-1">
<input type="text" class="form-control"name="competition_staffs[][maximum]" value="<%= staff.maximum %>" />
</div>
<span class="mt-2">人</span>
<div class="col-2 mt-1">
<select class="form-control" name="competition_staffs[][category]">
<option value="all" <%= staff.category == "all" ? "selected='selected'" : "" %>>不限</option>
<option value="teacher" <%= staff.category == "teacher" ? "selected='selected'" : "" %>>教师</option>
<option value="student" <%= staff.category == "student" ? "selected='selected'" : "" %>>学生</option>
<option value="profession" <%= staff.category == "profession" ? "selected='selected'" : "" %>>专业人士</option>
</select>
</div>
<div class="col-2 mt-1">
<label class="radio checkbox-primary mt-1" value="require_1_1">
<input id="require_1_<%= staff.id %>" <%= staff.mutiple_limited? ? '' : 'checked="checked"' %> class="mutiple-limited-radio" value="false" name="competition_staffs[][mutiple_limited]" type="checkbox">
<label for="require_1_<%= staff.id %>">可多次报名</label>
</label>
</div>
<div class="col-2 mt-1">
<label class="radio checkbox-primary mt-1" value="require_1_2">
<input id="require_2_<%= staff.id %>" <%= staff.mutiple_limited? ? 'checked="checked"' : '' %> class="mutiple-limited-radio" value="true" name="competition_staffs[][mutiple_limited]" type="checkbox">
<label for="require_2_<%= staff.id %>">不可多次报名</label>
</label>
<a href="javascript:void(0)" class="ml20 delRequrieBtn">
<i class="fa fa-times-circle font-20 color-grey-c"></i>
</a>
</div>
</div>
<% end %>
</div>
</div>
<% when 'inform', 'chart', 'resource' %>
<div class="row mt-2 new_module_div">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
</label>
</div>
<div class="col-md-label mt-2">
<input type="hidden" value="<%= com_module.module_type %>" name="navbar[][module_type]">
<input type="hidden" value="<%= com_module.name %>" name="navbar[][name]">
<%= com_module.name %>
</div>
<div class="col-md-1 mt-1">
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
</div>
<% if com_module.module_type == "resource" %>
<div class="col-md-3 mt-1">
<%= text_field_tag('navbar[][url]', com_module.url, id: nil, class: 'form-control', placeholder: '请输入资料下载地址') %>
</div>
<button class="mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn">+</button>
<% end %>
</div>
<% else %>
<div class="row mt-2 align-items-center linkFormItem">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
</label>
</div>
<div class="col-md-label mt-1">
<input type="hidden" value="<%= com_module.module_type %>" name="navbar[][module_type]">
<%= text_field_tag('navbar[][name]', com_module.name, id: nil, class: 'form-control', placeholder: '请输入模块名称') %>
</div>
<div class="col-md-1 mt-1">
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
</div>
<div class="col-md-3 mt-1">
<%= text_field_tag('navbar[][url]', com_module.url, id: nil, class: 'form-control', placeholder: '请输入资料下载地址') %>
</div>
<button class="mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn">+</button>
<button class="mt-1 btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_linkBtn">×</button>
</div>
<% end %>
<% end %>
<!-- <div class="row mt-2">-->
<!-- <div class="col-1 text-right">-->
<!-- <label class="checkbox checkbox-primary mt-1">-->
<!-- <input id="checkbox2" type="checkbox">-->
<!-- <label for="checkbox2">&nbsp;</label>-->
<!-- </label>-->
<!-- </div>-->
<!-- <div class="col-md-label mt-2">获奖证书</div>-->
<!-- </div>-->
<div class="row mt-2">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<input id="checkbox2" type="checkbox">
<label for="checkbox2">&nbsp;</label>
</label>
</div>
<div class="col-md-label mt-2">排行榜</div>
<div class="col-md-1 mt-1"><input type="text" class="form-control"></div>
</div>
<div id="linkForm">
<div class="row mt-2 linkFormItem">
<div class="row mt-2 mb-4">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<input id="link_1" type="checkbox" name="link_1" />
<label for="link_1">&nbsp;</label>
</label>
</div>
<div class="col-md-label mt-2">资料下载</div>
<div class="col-md-1 mt-1"><input type="text" name="link_index_1" class="form-control"></div>
<div class="col-md-3 mt-1"><input type="text" name="link_info_1" class="form-control"></div>
<button class="mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn">+</button>
</div>
</div>
<div class="row mt-2">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<input id="checkbox2" type="checkbox">
<label for="checkbox2">&nbsp;</label>
</label>
<div class="col-md-label mt-2"><%= javascript_void_link '保存', class: 'btn btn-primary submit-btn' %></div>
</div>
<div class="col-md-label mt-2">获奖证书</div>
</div>
<div class="row mt-2 mb-4">
<div class="col-1 text-right">
</div>
<div class="col-md-label mt-2"><%= javascript_void_link '保存', class: 'btn btn-primary submit-btn' %></div>
</div>
</div>
<% end %>
</div>
</div>

@ -1,6 +1,6 @@
json.count @users.total_count
json.users do
json.array! @users.each do |user|
json.extract! user, :id, :login, :real_name, :identity, :school_name
json.extract! user, :id, :login, :real_name, :identity, :school_name, :hidden_phone
end
end

@ -1,5 +1,6 @@
json.count @all_count
json.personal @personal
json.competition_name @competition.name
json.competition_teams do
json.array! @all_teams&.each do |team|
json.extract! team, :id, :name, :invite_code

@ -1,6 +1,6 @@
json.count @users.total_count
json.users do
json.array! @users.each do |user|
json.extract! user, :id, :login, :real_name, :identity, :school_name
json.extract! user, :id, :login, :real_name, :identity, :school_name, :hidden_phone
end
end

@ -1025,6 +1025,7 @@ Rails.application.routes.draw do
resources :competition_settings, only: [:index] do
post :basic_setting, on: :collection
post :nav_setting, on: :collection
end
resources :enroll_lists, only: [:index] do

@ -16,7 +16,7 @@ class MigrateCompetitionModuleType < ActiveRecord::Migration[5.2]
mod_type = "manual"
when '排行榜'
mod_type = "chart"
when '资料下载 '
when '资料下载'
mod_type = "resource"
else
mod_type = "md"

@ -0,0 +1,26 @@
class MigrateComModuleResource < ActiveRecord::Migration[5.2]
def change
Competition.all.each do |competition|
competition.competition_modules.each do |com_module|
mod_type = ""
case com_module.name.strip
when '首页'
mod_type = "home"
when '报名'
mod_type = "enroll"
when '通知公告'
mod_type = "inform"
when '参赛手册'
mod_type = "manual"
when '排行榜'
mod_type = "chart"
when '资料下载'
mod_type = "resource"
else
mod_type = "md"
end
com_module.update_attributes!(module_type: mod_type)
end
end
end
end

File diff suppressed because one or more lines are too long

@ -24796,68 +24796,93 @@ input.form-control {
}
/* line 37, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 53, app/assets/stylesheets/common.scss */
.show {
display: block;
}
@ -25171,6 +25196,47 @@ input.form-control {
background: #fff;
}
/* line 3, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .competition-mode-container .row {
height: 35px;
}
/* line 7, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .competition-mode-container .des-row {
height: auto;
}
/* line 11, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .competition-mode-container .form-control {
font-size: 14px;
}
/* line 22, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .col-md-label {
-webkit-box-flex: 0;
flex: 0 0 10%;
max-width: 10%;
min-width: 30px;
padding-right: 15px;
padding-left: 15px;
position: relative;
}
/* line 31, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .col-md-label-s {
-webkit-box-flex: 0;
flex: 0 0 30px;
padding-right: 15px;
padding-left: 15px;
position: relative;
}
/* line 38, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .setBtn_s {
height: 35px;
line-height: 5px;
}
/* line 4, app/assets/stylesheets/admins/cooperatives.scss */
.admins-cooperatives-index-page .coo-img-card .coo-img-item > .drag {
cursor: move;

@ -15788,68 +15788,93 @@ input.form-control {
}
/* line 37, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 53, app/assets/stylesheets/common.scss */
.show {
display: block;
}

@ -24796,68 +24796,93 @@ input.form-control {
}
/* line 37, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 53, app/assets/stylesheets/common.scss */
.show {
display: block;
}

@ -134069,7 +134069,7 @@ $(document).on('turbolinks:load', function() {
},
templateResult: function (item) {
if(!item.id || item.id === '') return item.text;
return item.real_name + "--" + item.identity;
return $("<span>" + item.real_name + " <span class='font-12'>" + item.school_name + ' ' + item.hidden_phone + "</span></span>");
},
templateSelection: function(item){
if (item.id) {
Loading…
Cancel
Save