Merge branch 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into yslcompetition
commit
062ed74966
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Simplified Chinese translation for bootstrap-datetimepicker
|
||||||
|
* Yuan Cheung <advanimal@gmail.com>
|
||||||
|
*/
|
||||||
|
;(function($){
|
||||||
|
$.fn.datetimepicker.dates['zh-CN'] = {
|
||||||
|
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
|
||||||
|
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
|
||||||
|
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
|
||||||
|
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||||
|
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||||
|
today: "今天",
|
||||||
|
suffix: [],
|
||||||
|
meridiem: ["上午", "下午"]
|
||||||
|
};
|
||||||
|
}(jQuery));
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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
|
@ -1,6 +1,6 @@
|
|||||||
json.count @users.total_count
|
json.count @users.total_count
|
||||||
json.users do
|
json.users do
|
||||||
json.array! @users.each do |user|
|
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
|
||||||
end
|
end
|
@ -1,6 +1,6 @@
|
|||||||
json.count @users.total_count
|
json.count @users.total_count
|
||||||
json.users do
|
json.users do
|
||||||
json.array! @users.each do |user|
|
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
|
||||||
end
|
end
|
@ -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
|
@ -0,0 +1,5 @@
|
|||||||
|
class MigrateCompetitionModuleManual < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
CompetitionModule.where(module_type: "manual").update_all(module_type: "md")
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,17 @@
|
|||||||
|
class MigrateCompetitionModuleContent < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
Competition.all.each do |competition|
|
||||||
|
competition.informs.each do |inform|
|
||||||
|
if inform.status == 1
|
||||||
|
com_module = competition.competition_modules.find_by(module_type: "inform")
|
||||||
|
elsif inform.status == 2
|
||||||
|
com_module = competition.competition_modules.find_by(name: "参赛手册")
|
||||||
|
end
|
||||||
|
if com_module
|
||||||
|
new_md = CompetitionModuleMdContent.create!(competition_module_id: com_module.id, content: inform.description, name: inform.name)
|
||||||
|
Attachment.where(container_id: inform.id, container_type: "Inform").update_all(container_id: new_md.id, container_type: "CompetitionModuleMdContent")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,14 @@
|
|||||||
|
class MigrateCompetitionChartRules < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :competition_module_md_contents, :competition_stage_id, :integer, default: 0
|
||||||
|
|
||||||
|
ChartRule.all.each do |rule|
|
||||||
|
if rule.competition
|
||||||
|
com_module = rule.competition.competition_modules.find_by(module_type: "chart")
|
||||||
|
if com_module
|
||||||
|
CompetitionModuleMdContent.create!(content: rule.content, competition_module_id: com_module.id, competition_stage_id: rule.competition_stage_id ? rule.competition_stage_id : 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,11 @@
|
|||||||
|
class CreateCompetitionSchools < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :competition_schools do |t|
|
||||||
|
t.references :competition, index: true
|
||||||
|
t.references :school, index: true
|
||||||
|
t.string :source
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe CompetitionSchool, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in new issue