排行榜设置

dev_sync_trustie
caishi 5 years ago
commit 992a1a0326

@ -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: 1,
language: 'zh-CN',
format: 'yyyy-mm-dd hh:ii:ss',
minuteStep: 30
@ -23,18 +23,12 @@ $(document).on('turbolinks:load', function(){
$(element).find('.end-date').datepicker('setStartDate', e.date);
});
};
$(".competition-start-end-date .start-date").datetimepicker(timeOptions);
// 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);
// });
// };
$(".competition-start-end-date .end-date").datetimepicker(timeOptions);
defineDateRangeSelect('.teaching-mode-date');
defineDateRangeSelect('.competition-start-end-date');
// defineTimeRangeSelect('.competition-start-end-date');
var $basicForm = $('form.basic-setting-form');
@ -59,13 +53,13 @@ $(document).on('turbolinks:load', function(){
if ($("input[name='mode']:checked").val() == 2) {
var $courseId = $("input[name='course_id'");
if ($courseId.val() === undefined || $course_id.val().length === 0) {
if ($courseId.val() === undefined || $courseId.val().length === 0) {
$courseId.addClass('danger text-danger');
valid = false;
} else {
$courseId.removeClass('danger text-danger');
}
} else if ($("input[name='mode']:checked").val() == 4) {
} else if ($("input[name='mode']:checked").val() == 3) {
var $techStartTime = $("input[name='teach_start_time'");
var $techEndTime = $("input[name='teach_end_time'");
if ($techStartTime.val() === undefined || $techStartTime.val().length === 0) {
@ -81,6 +75,10 @@ $(document).on('turbolinks:load', function(){
} else {
$techEndTime.removeClass('danger text-danger');
}
} else {
$("input[name='course_id'").removeClass('danger text-danger');
$("input[name='teach_start_time'").removeClass('danger text-danger');
$("input[name='teach_end_time'").removeClass('danger text-danger');
}
if (!valid) return;
@ -110,80 +108,80 @@ $(document).on('turbolinks:load', function(){
$(function () {
//MD编辑
$("#MD_typeFrom").on("click",".add_MD_type",function () {
var length=$(".MD_type").find(".add_MD_type").length + 1;
var html='<div class="row MD_type mt-2">\n' +
' <div class="col-1 text-right">\n' +
' <label class="checkbox checkbox-primary mt-1">\n' +
' <input id="checkbox_MD_'+length+'" type="checkbox" name="checkbox_MD_'+length+'">\n' +
' <label for="checkbox_MD_'+length+'">&nbsp;</label>\n' +
' </label>\n' +
' </div>\n' +
' <div class="col-md-4"><input type="text" class="form-control" name="MD_type_value_'+length+'" placeholder="导航名称"></div>\n' +
' <div class="col-md-1"><input type="text" class="form-control" name="MD_type_index_'+length+'" /></div>\n' +
' <button class="btn btn-primary waves-effect waves-light btn-xs setBtn_s add_MD_type">+</button>\n' +
' <button class="btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_MD_type">×</button>\n' +
' </div>';
$("#MD_typeFrom").append(html);
})
$("#MD_typeFrom").on("click",".del_MD_type",function () {
$(this).parents(".MD_type").remove();
})
// $("#MD_typeFrom").on("click",".add_MD_type",function () {
//
// var length=$(".MD_type").find(".add_MD_type").length + 1;
// var html='<div class="row MD_type mt-2">\n' +
// ' <div class="col-1 text-right">\n' +
// ' <label class="checkbox checkbox-primary mt-1">\n' +
// ' <input id="checkbox_MD_'+length+'" type="checkbox" name="checkbox_MD_'+length+'">\n' +
// ' <label for="checkbox_MD_'+length+'">&nbsp;</label>\n' +
// ' </label>\n' +
// ' </div>\n' +
// ' <div class="col-md-4"><input type="text" class="form-control" name="MD_type_value_'+length+'" placeholder="导航名称"></div>\n' +
// ' <div class="col-md-1"><input type="text" class="form-control" name="MD_type_index_'+length+'" /></div>\n' +
// ' <button class="btn btn-primary waves-effect waves-light btn-xs setBtn_s add_MD_type">+</button>\n' +
// ' <button class="btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_MD_type">×</button>\n' +
// ' </div>';
// $("#MD_typeFrom").append(html);
// })
// $("#MD_typeFrom").on("click",".del_MD_type",function () {
// $(this).parents(".MD_type").remove();
// })
//链接
$("#linkForm").on("click",".add_linkBtn",function () {
var length=$("#linkForm").find(".linkFormItem").length + 1;
var html='<div class="row mt-2 lineFromItem">\n' +
$(".nav-setting-form").on("click",".add_linkBtn",function () {
var length=$(".nav-setting-form").find(".linkFormItem").length + 1;
var html='<div class="row mt-2 align-items-center linkFormItem">\n' +
' <div class="col-1 text-right">\n' +
' <label class="checkbox checkbox-primary mt-1">\n' +
' <input id="link_'+length+'" type="checkbox" name="link_'+length+'" />\n' +
' <label for="link_'+length+'">&nbsp;</label>\n' +
' <input type="checkbox" name="navbar[][hidden]" value="0" class="font-16" checked="checked">\n' +
' </label>\n' +
' </div>\n' +
' <div class="col-md-label mt-1"><input type="text" name="link_name_'+length+'" class="form-control"></div>\n' +
' <div class="col-md-1 mt-1"><input type="text" name="link_index_'+length+'" class="form-control"></div>\n' +
' <div class="col-md-3 mt-1"><input type="text" name="link_info_'+length+'" class="form-control"></div>\n' +
' <button class="btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn">+</button>\n' +
' <button class="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 () {
$(this).parents(".lineFromItem").remove();
})
' <div class="col-md-label mt-1"><input type="hidden" value="md" name="navbar[][module_type]">\n' +
' <input type="text" name="navbar[][name]" value="" class="form-control" placeholder="模块名称"></div>\n' +
' <div class="col-md-1 mt-1"><input type="text" name="navbar[][position]" value="" class="form-control" placeholder="位置"></div>\n' +
' <div class="col-md-3 mt-1"><input type="text" name="navbar[][url]" value="" class="form-control" placeholder="请输入资料下载地址"></div>\n' +
' <a class="mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn" href="javascript:void(0)">+</a>\n' +
' <a class="mt-1 btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_linkBtn" href="javascript:void(0)">×</a>\n' +
' </div>';
$(this).parents(".linkFormItem").after(html);
});
$(".nav-setting-form").on("click", ".del_linkBtn", function () {
$(this).parents(".linkFormItem").remove();
});
//有关报名要求
$("#addRequireBtn").on("click",function () {
$(".addRequireBtn").on("click",function () {
var length=$("#requireForm").find(".requireForm_item").length + 1;
var html='<div class="row mt-2 mb-4 requireForm_item">\n' +
' <div class="col-1 text-right">&nbsp;&nbsp;</div>\n' +
' <div class="col-1 text-left mt-1">\n' +
' <input type="text" class="form-control" name="min_'+length+'" />\n' +
' <input type="text" class="form-control" name="competition_staffs[][minimum]" value="0">\n' +
' </div>\n' +
' <span class="mt-2">~</span>\n' +
' <div class="col-1 mt-1">\n' +
' <input type="text" class="form-control" name="max_'+length+'" />\n' +
' <input type="text" class="form-control" name="competition_staffs[][maximum]" value="1">\n' +
' </div>\n' +
' <span class="mt-2">人</span>\n' +
' <div class="col-2 mt-1">\n' +
' <select class="form-control" name="choice_'+length+'" >\n' +
' <option>不限</option>\n' +
' <option>教师</option>\n' +
' <option>学生</option>\n' +
' <option>专业人士</option>\n' +
' <select class="form-control" name="competition_staffs[][category]">\n' +
' <option value="all">不限</option>\n' +
' <option value="teacher">教师</option>\n' +
' <option value="student">学生</option>\n' +
' <option value="profession">专业人士</option>\n' +
' </select>\n' +
' </div>\n' +
' <div class="col-2 mt-1">\n' +
' <label class="radio checkbox-primary mt-1" value="require_'+length+'_1">\n' +
' <input id="require_'+length+'_1" name="require_1" type="radio">\n' +
' <input id="require_'+length+'_1" class="mutiple-limited-radio" value="false" checked name="competition_staffs[][mutiple_limited]" type="checkbox">\n' +
' <label for="require_'+length+'_1">可多次报名</label>\n' +
' </label>\n' +
' </div>\n' +
' <div class="col-2 mt-1">\n' +
' <label class="radio checkbox-primary mt-1" value="require_'+length+'_2">\n' +
' <input id="require_'+length+'_2" name="require_1" type="radio">\n' +
' <input id="require_'+length+'_2" class="mutiple-limited-radio" value="true" name="competition_staffs[][mutiple_limited]" type="checkbox">\n' +
' <label for="require_'+length+'_2">不可多次报名</label>\n' +
' </label>\n' +
' <a href="javascript:void(0)" class="ml20 delRequrieBtn">\n' +
@ -192,12 +190,49 @@ $(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)
}
});
var $navForm = $('form.nav-setting-form');
$navForm.on('click', ".submit-btn", function () {
$navForm.find('.submit-btn').attr('disabled', 'disabled');
$navForm.find('.error').html('');
var valid = $navForm.valid();
if (!valid) return;
$.ajax({
method: 'POST',
dataType: 'json',
url: $navForm.attr('action'),
data: new FormData($navForm[0]),
processData: false,
contentType: false,
success: function (data) {
$.notify({message: '保存成功'});
// window.location.reload();
},
error: function (res) {
var data = res.responseJSON;
$navForm.find('.error').html(data.message);
},
complete: function () {
$navForm.find('.submit-btn').attr('disabled', false);
}
});
});
// 排行榜设置
@ -340,4 +375,4 @@ function addNewTab() {
' <div id="small_panel_'+count+'" class="small_panel"></div></div>';
$("#large_panel").append(html);
}
}

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

@ -15,15 +15,19 @@ $(document).on('turbolinks:load', function(){
var $unlockAction = $lockAction.siblings('.unlock-action');
var userId = $lockAction.data('id');
$.ajax({
url: '/admins/users/' + userId + '/lock',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$lockAction.hide();
$unlockAction.show();
customConfirm({
content: '确认加锁吗?',
ok: function(){
$.ajax({
url: '/admins/users/' + userId + '/lock',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$lockAction.hide();
$unlockAction.show();
}
});
}
});
});
@ -34,17 +38,21 @@ $(document).on('turbolinks:load', function(){
var $lockAction = $unlockAction.siblings('.lock-action');
var userId = $unlockAction.data('id');
$.ajax({
url: '/admins/users/' + userId + '/unlock',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$lockAction.show();
$unlockAction.hide();
customConfirm({
content: '确认解锁吗?',
ok: function () {
$.ajax({
url: '/admins/users/' + userId + '/unlock',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$lockAction.show();
$unlockAction.hide();
}
});
}
});
})
});
// active user
@ -54,18 +62,22 @@ $(document).on('turbolinks:load', function(){
var $lockAction = $activeAction.siblings('.lock-action');
var userId = $activeAction.data('id');
$.ajax({
url: '/admins/users/' + userId + '/unlock',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$activeAction.hide();
$lockAction.show();
$unlockAction.hide();
customConfirm({
content: '确认激活吗?',
ok: function () {
$.ajax({
url: '/admins/users/' + userId + '/unlock',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$activeAction.hide();
$lockAction.show();
$unlockAction.hide();
}
});
}
});
})
});
// ***************** reward grade modal *****************

File diff suppressed because it is too large Load Diff

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

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

@ -7,6 +7,7 @@
@import "bootstrap-datepicker.standalone";
@import "jquery.mloading";
@import "jquery-confirm.min";
@import "bootstrap-datetimepicker.min";
@import "codemirror/lib/codemirror";
@import "editormd/css/editormd.min";

@ -37,7 +37,7 @@
}
.setBtn_s{
height: 35px;
line-height: 5px;
line-height: 20px;
}
.large_panel{

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

@ -67,6 +67,10 @@ class Admins::CompetitionStagesController < Admins::BaseController
render_ok
end
def calculate_stage_score
end
private
def current_competition

@ -32,13 +32,13 @@ class Admins::UsersController < Admins::BaseController
end
def lock
User.find(params[:user_id]).lock!
User.find(params[:id]).lock!
render_ok
end
def unlock
User.find(params[:user_id]).activate!
User.find(params[:id]).activate!
render_ok
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

@ -70,12 +70,15 @@ class Competitions::CompetitionsController < Competitions::BaseController
def update_md_content
tip_exception("标题和内容不能为空") if params[:name].blank? || params[:content].blank?
tip_exception("缺少competition_module_id") if params[:competition_module_id].blank?
ActiveRecord::Base.transaction do
com_module = current_competition.competition_modules.find_by!(id: params[:competition_module_id])
if params[:md_content_id]
md_content = CompetitionModuleMdContent.find_by!(id: params[:md_content_id])
md_content = CompetitionModuleMdContent.find_by!(id: params[:md_content_id], competition_module_id: com_module.id)
md_content.update_attributes!(name: params[:name], content: params[:content])
else
md_content = CompetitionModuleMdContent.create!(name: params[:name], content: params[:content])
stage = current_competition.competition_stages.find_by(id: params[:stage_id]) if params[:stage_id]
md_content = CompetitionModuleMdContent.create!(name: params[:name], content: params[:content], competition_module_id: com_module.id, competition_stage_id: stage&.id.to_i)
end
Attachment.associate_container(params[:attachment_ids], md_content.id, md_content.class) if params[:attachment_ids]
normal_status("更新成功")
@ -84,8 +87,8 @@ class Competitions::CompetitionsController < Competitions::BaseController
def chart_rules
@competition = current_competition
@stages = @competition.competition_stages
@rule_contents = @competition.chart_rules
com_module = @competition.competition_modules.find_by(module_type: "chart")
@rule_contents = com_module&.competition_module_md_contents
end
def update_chart_rules

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

@ -30,7 +30,7 @@ class Weapps::CodeSessionsController < Weapps::BaseController
set_session_openid(result['openid'])
set_weapp_session_key(result['session_key']) # weapp session_key写入缓存 后续解密需要
render_ok(openid: result['openid'], logged: logged)
render_ok(openid: result['openid'], logged: logged) unless logged
rescue Wechat::Error => ex
render_error(ex.message)
end

@ -19,6 +19,5 @@ class Weapps::SessionsController < Weapps::BaseController
OpenUsers::Wechat.create!(user: user, uid: session_unionid) if user.wechat_open_user.blank?
successful_authentication(user)
render_ok
end
end

@ -86,6 +86,7 @@ class Competitions::SaveTeamForm
# 创建者是否能多次报名
def check_creator_multiple_enrollable
return unless team.new_record? # 编辑战队时不需要校验
return unless competition.enrolled?(creator)
if (creator.is_teacher? && competition.teacher_multiple_limited?) || (!creator.is_teacher? && competition.member_multiple_limited?)

@ -37,7 +37,7 @@ module CompetitionsHelper
def chart_stages competition
stages = []
statistic_stages = competition.competition_stages.where("rate > 0")
statistic_stages = competition.competition_stages.where("score_rate > 0")
if competition.end_time && competition.end_time < Time.now && statistic_stages.size > 1
stages << {id: nil, name: "总排行榜", rate: 1.0, start_time: competition.start_time, end_time: competition.end_time}
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
# 报名是否结束

@ -3,22 +3,16 @@ class CompetitionModule < ApplicationRecord
belongs_to :competition
has_one :competition_module_md_content, dependent: :destroy
has_many :competition_module_md_contents, dependent: :destroy
def module_url
case module_type
when "home"
"/competitions/#{competition.identifier}"
when "inform"
"/competitions/#{competition.identifier}/informs?status=1"
when "manual"
"/competitions/#{competition.identifier}/informs?status=2"
when "chart"
"/competitions/#{competition.identifier}/charts"
when "enroll"
"/competitions/#{competition.identifier}/competition_teams"
else
url || "/competitions/#{competition.identifier}/md_content?md_content_id=#{competition_module_md_content&.id}"
end
result_url = url.present? ? url : case module_type
when "chart"
"/competitions/#{competition.identifier}/charts.json"
when "enroll"
"/competitions/#{competition.identifier}/competition_teams.json"
else
"/competitions/#{competition.identifier}/competition_modules/#{id}.json"
end
end
end

@ -3,6 +3,6 @@ class CompetitionModuleMdContent < ApplicationRecord
has_many :attachments, as: :container, dependent: :destroy
validates :name, presence: true
# validates :name, presence: true
validates :content, presence: true
end

@ -28,7 +28,7 @@ class CompetitionTeam < ApplicationRecord
while self.class.exists?(invite_code: code)
code = CODE_CHARS.sample(6).join
end
self.code = code
self.invite_code = code
code
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
@ -661,6 +666,10 @@ class User < ApplicationRecord
if password.present? && password.size < MIX_PASSWORD_LIMIT && !User.current.admin?
raise("密码长度不能低于#{MIX_PASSWORD_LIMIT}")
end
if password.present? && password.size > 16
raise('密码长度不能超过16位')
end
end
end

@ -21,7 +21,7 @@ class Admins::CompetitionBasicSettingService < ApplicationService
competition.save!
if competition.mode == 1 || competition.mode == 4
competition.competition_mode_setting.destroy
competition.competition_mode_setting&.destroy
else
setting = competition.competition_mode_setting || CompetitionModeSetting.create!(competition_id: competition.id)
if competition.mode == 2

@ -13,16 +13,17 @@ 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)
else
com_module = CompetitionModule.create!(competition_id: competition.id, module_type: 'md')
end
com_module.update_attributes!(hidden: nav["hidden"] ? 0 : 1, position: nav["position"], name: nav["name"], url: nav["url"])
com_module.update_attributes!(hidden: nav["hidden"] ? 0 : 1, position: nav["position"] ? nav["position"] : com_module.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|

@ -21,7 +21,7 @@ class Competitions::CreatePersonalTeamService < ApplicationService
ActiveRecord::Base.transaction do
team = competition.competition_teams.create!(name: user.real_name, user_id: user.id)
team.team_members.create!(competition_id: competition, user_id: user.id, role: 1, is_teacher: is_teacher)
team.team_members.create!(competition_id: competition.id, user_id: user.id, role: 1, is_teacher: is_teacher)
end
end
end

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

@ -16,7 +16,7 @@ class Oauth::CreateOrFindQqAccountService < ApplicationService
if user.blank? || !user.logged?
new_user = true
# 新用户
login = User.generate_login('q')
login = User.generate_login('Q')
@user = User.new(login: login, nickname: params.dig('info', 'nickname'), type: 'User', status: User::STATUS_ACTIVE)
end
@ -26,6 +26,9 @@ class Oauth::CreateOrFindQqAccountService < ApplicationService
gender = params.dig('extra', 'raw_info', 'gender') == '女' ? 1 : 0
user.create_user_extension!(gender: gender)
# 下载头像
avatar_path = Util::FileManage.source_disk_filename(user)
Util.download_file(params.dig('info', 'figureurl_qq_1'), avatar_path)
end
new_open_user = OpenUsers::QQ.create!(user: user, uid: params['uid'], extra: params.dig('extra', 'raw_info'))

@ -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,125 +151,163 @@
<span class="flex-1">导航设置</span>
</div>
<div class="card-body row">
<div class="container competition-mode-container">
<div id="MD_typeFrom">
<div class="row MD_type">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<input id="checkbox_MD_1" name="checkbox_MD_1" type="checkbox">
<label for="checkbox_MD_1">&nbsp;</label>
</label>
</div>
<div class="col-md-4"><input type="text" class="form-control" name="MD_type_value_1" placeholder="导航名称"></div>
<div class="col-md-1"><input type="text" class="form-control" name="MD_type_index_1"></div>
<button class="btn btn-primary waves-effect waves-light btn-xs setBtn_s add_MD_type">+</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>
<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>
<%= 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 class="mt-3" id="MD_typeFrom">
<div class="row MD_type">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<input type="checkbox" name="navbar[][hidden]" value="0" hidden class="font-16" checked="checked">
<input type="checkbox" disabled="disabled" class="font-16" checked="checked">
</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-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>
<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">
<%= javascript_void_link '+', class: 'btn btn-primary waves-effect waves-light btn-xs setBtn_s addRequireBtn' %>
</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 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-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>
<%= javascript_void_link '+', class: 'mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn' %>
<% 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>
<%= javascript_void_link '+', class: 'mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn' %>
<%= javascript_void_link '×', class: 'mt-1 btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_linkBtn' %>
</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="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="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>
<div class="col-md-label mt-2">获奖证书</div>
</div>
<div class="error my-2 danger text-danger"></div>
<div class="row mt-2 mb-4">
<div class="col-1 text-right">
<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 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

@ -33,14 +33,14 @@
<%= javascript_void_link('奖励', class: 'action reward-grade-action', data: { toggle: 'modal', target: '.admin-users-reward-grade-modal', id: user.id }) %>
<%= javascript_void_link '解锁', class: 'action unlock-action', data: { id: user.id, confirm: '确认解锁吗?' }, style: user.locked? ? '' : 'display: none;' %>
<%= javascript_void_link '解锁', class: 'action unlock-action', data: { id: user.id }, style: user.locked? ? '' : 'display: none;' %>
<% if user.registered? %>
<%= javascript_void_link '激活', class: 'action active-action', data: { id: user.id, confirm: '确认激活吗?' } %>
<%= javascript_void_link '激活', class: 'action active-action', data: { id: user.id } %>
<% end %>
<% if user.id != current_user.id %>
<%= javascript_void_link '加锁', class: 'action lock-action', data: { id: user.id, confirm: '确认加锁吗?' }, style: user.locked? || user.registered? ? 'display: none;' : '' %>
<%= javascript_void_link '加锁', class: 'action lock-action', data: { id: user.id }, style: user.locked? || user.registered? ? 'display: none;' : '' %>
<% end %>
<%= delete_link '删除', admins_user_path(user, element: ".user-item-#{user.id}"), class: 'delete-user-action' %>

@ -1,7 +1,7 @@
json.extract! @module, :id, :name, :position, :url, :md_edit
json.extract! @module, :id, :name, :position, :url
md = @module.competition_module_md_content
if md.present?
mds = @module.competition_module_md_contents
json.md_contents mds.each do |md|
json.md_name md.name
json.md_content md.content
json.created_at md.created_at.strftime('%Y-%m-%d %H:%M:%S')

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

@ -9,6 +9,7 @@ json.enroll_end_time @competition.enroll_end_time&.strftime("%Y-%m-%d %H:%M:%S")
json.published @competition.published?
json.nearly_published @competition.published_at.present?
json.competition_status @competition.competition_status
json.competition_modules @competition_modules do |com_module|
json.(com_module, :id, :name, :position, :module_type)

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

@ -4,6 +4,7 @@ json.login @user.login
json.user_id @user.id
json.image_url url_to_avatar(@user)
json.admin @user.admin?
json.business @user.business?
json.is_teacher @user.user_extension&.teacher?
json.user_identity @user.identity
json.tidding_count 0

@ -0,0 +1,3 @@
json.user do
json.partial! 'weapps/shared/user', locals: { user: current_user }
end

@ -0,0 +1,3 @@
json.user do
json.partial! 'weapps/shared/user', locals: { user: current_user }
end

@ -0,0 +1,14 @@
json.username user.full_name
json.real_name user.real_name
json.login user.login
json.user_id user.id
json.image_url url_to_avatar(user)
json.admin user.admin?
json.business user.business?
json.is_teacher user.user_extension&.teacher?
json.user_identity user.identity
json.tidding_count 0
json.user_phone_binded user.phone.present?
json.phone user.phone
json.profile_completed user.profile_completed?
json.professional_certification user.professional_certification

@ -12,14 +12,15 @@
competitions/save_team_form:
attributes:
creator:
enrolled: "您已经报名过该竞赛了"
teacher_enroll_forbidden: "本竞赛的参赛者限定为:学生"
member_enroll_forbidden: "本竞赛的参赛者限定为:教师"
teacher_ids:
enroll_forbidden: "本竞赛的参赛者限定为:学生"
invalid_count: "教师数量应为%{minimum}~%{maximum}人"
enrolled: "教师 ${names} 已加入其它战队了"
enrolled: "教师 %{names} 已加入其它战队了"
member_ids:
enroll_forbidden: "本竞赛的参赛者限定为:教师"
invalid_count: "队员数量应为%{minimum}~%{maximum}人"
enrolled: "队员 ${names} 已加入其它战队了"
enrolled: "队员 %{names} 已加入其它战队了"

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

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

File diff suppressed because one or more lines are too long

@ -19161,6 +19161,362 @@ body[class*=jconfirm-no-scroll-] {
transform: scale(1);
}
/*!
* Datetimepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker {
padding: 4px;
margin-top: 1px;
border-radius: 4px;
direction: ltr;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-inline {
width: 220px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.datetimepicker-rtl {
direction: rtl;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.datetimepicker-rtl table tr td span {
float: right;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown, .datetimepicker-dropdown-left {
top: 0;
left: 0;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
[class*=" datetimepicker-dropdown"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
[class*=" datetimepicker-dropdown"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
position: absolute;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
[class*=" datetimepicker-dropdown-top"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
[class*=" datetimepicker-dropdown-top"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #fff;
border-bottom: 0;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-bottom-left:before {
top: -7px;
right: 6px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-bottom-left:after {
top: -6px;
right: 7px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-bottom-right:before {
top: -7px;
left: 6px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-bottom-right:after {
top: -6px;
left: 7px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-top-left:before {
bottom: -7px;
right: 6px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-top-left:after {
bottom: -6px;
right: 7px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-top-right:before {
bottom: -7px;
left: 6px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker-dropdown-top-right:after {
bottom: -6px;
left: 7px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker > div {
display: none;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.minutes div.datetimepicker-minutes {
display: block;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.hours div.datetimepicker-hours {
display: block;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.days div.datetimepicker-days {
display: block;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.months div.datetimepicker-months {
display: block;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker.years div.datetimepicker-years {
display: block;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table {
margin: 0;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker td, .datetimepicker th {
text-align: center;
width: 20px;
height: 20px;
border-radius: 4px;
border: 0;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.table-striped .datetimepicker table tr td, .table-striped .datetimepicker table tr th {
background-color: transparent;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.minute:hover {
background: #eee;
cursor: pointer;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.hour:hover {
background: #eee;
cursor: pointer;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.day:hover {
background: #eee;
cursor: pointer;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.old, .datetimepicker table tr td.new {
color: #999;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.disabled, .datetimepicker table tr td.disabled:hover {
background: 0;
color: #999;
cursor: default;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.today, .datetimepicker table tr td.today:hover, .datetimepicker table tr td.today.disabled, .datetimepicker table tr td.today.disabled:hover {
background-color: #fde19a;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fdd49a), to(#fdf59a));
background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a',endColorstr='#fdf59a',GradientType=0);
border-color: #fdf59a #fdf59a #fbed50;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.today:hover, .datetimepicker table tr td.today:hover:hover, .datetimepicker table tr td.today.disabled:hover, .datetimepicker table tr td.today.disabled:hover:hover, .datetimepicker table tr td.today:active, .datetimepicker table tr td.today:hover:active, .datetimepicker table tr td.today.disabled:active, .datetimepicker table tr td.today.disabled:hover:active, .datetimepicker table tr td.today.active, .datetimepicker table tr td.today:hover.active, .datetimepicker table tr td.today.disabled.active, .datetimepicker table tr td.today.disabled:hover.active, .datetimepicker table tr td.today.disabled, .datetimepicker table tr td.today:hover.disabled, .datetimepicker table tr td.today.disabled.disabled, .datetimepicker table tr td.today.disabled:hover.disabled, .datetimepicker table tr td.today[disabled], .datetimepicker table tr td.today:hover[disabled], .datetimepicker table tr td.today.disabled[disabled], .datetimepicker table tr td.today.disabled:hover[disabled] {
background-color: #fdf59a;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.today:active, .datetimepicker table tr td.today:hover:active, .datetimepicker table tr td.today.disabled:active, .datetimepicker table tr td.today.disabled:hover:active, .datetimepicker table tr td.today.active, .datetimepicker table tr td.today:hover.active, .datetimepicker table tr td.today.disabled.active, .datetimepicker table tr td.today.disabled:hover.active {
background-color: #fbf069;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.active, .datetimepicker table tr td.active:hover, .datetimepicker table tr td.active.disabled, .datetimepicker table tr td.active.disabled:hover {
background-color: #006dcc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#08c), to(#04c));
background-image: linear-gradient(to bottom, #08c, #04c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc',endColorstr='#0044cc',GradientType=0);
border-color: #04c #04c #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.active:hover, .datetimepicker table tr td.active:hover:hover, .datetimepicker table tr td.active.disabled:hover, .datetimepicker table tr td.active.disabled:hover:hover, .datetimepicker table tr td.active:active, .datetimepicker table tr td.active:hover:active, .datetimepicker table tr td.active.disabled:active, .datetimepicker table tr td.active.disabled:hover:active, .datetimepicker table tr td.active.active, .datetimepicker table tr td.active:hover.active, .datetimepicker table tr td.active.disabled.active, .datetimepicker table tr td.active.disabled:hover.active, .datetimepicker table tr td.active.disabled, .datetimepicker table tr td.active:hover.disabled, .datetimepicker table tr td.active.disabled.disabled, .datetimepicker table tr td.active.disabled:hover.disabled, .datetimepicker table tr td.active[disabled], .datetimepicker table tr td.active:hover[disabled], .datetimepicker table tr td.active.disabled[disabled], .datetimepicker table tr td.active.disabled:hover[disabled] {
background-color: #04c;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td.active:active, .datetimepicker table tr td.active:hover:active, .datetimepicker table tr td.active.disabled:active, .datetimepicker table tr td.active.disabled:hover:active, .datetimepicker table tr td.active.active, .datetimepicker table tr td.active:hover.active, .datetimepicker table tr td.active.disabled.active, .datetimepicker table tr td.active.disabled:hover.active {
background-color: #039;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
border-radius: 4px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker .datetimepicker-hours span {
height: 26px;
line-height: 26px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker .datetimepicker-hours table tr td span.hour_am, .datetimepicker .datetimepicker-hours table tr td span.hour_pm {
width: 14.6%;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker .datetimepicker-hours fieldset legend, .datetimepicker .datetimepicker-minutes fieldset legend {
margin-bottom: inherit;
line-height: 30px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker .datetimepicker-minutes span {
height: 26px;
line-height: 26px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span:hover {
background: #eee;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span.disabled, .datetimepicker table tr td span.disabled:hover {
background: 0;
color: #999;
cursor: default;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span.active, .datetimepicker table tr td span.active:hover, .datetimepicker table tr td span.active.disabled, .datetimepicker table tr td span.active.disabled:hover {
background-color: #006dcc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#08c), to(#04c));
background-image: linear-gradient(to bottom, #08c, #04c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc',endColorstr='#0044cc',GradientType=0);
border-color: #04c #04c #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span.active:hover, .datetimepicker table tr td span.active:hover:hover, .datetimepicker table tr td span.active.disabled:hover, .datetimepicker table tr td span.active.disabled:hover:hover, .datetimepicker table tr td span.active:active, .datetimepicker table tr td span.active:hover:active, .datetimepicker table tr td span.active.disabled:active, .datetimepicker table tr td span.active.disabled:hover:active, .datetimepicker table tr td span.active.active, .datetimepicker table tr td span.active:hover.active, .datetimepicker table tr td span.active.disabled.active, .datetimepicker table tr td span.active.disabled:hover.active, .datetimepicker table tr td span.active.disabled, .datetimepicker table tr td span.active:hover.disabled, .datetimepicker table tr td span.active.disabled.disabled, .datetimepicker table tr td span.active.disabled:hover.disabled, .datetimepicker table tr td span.active[disabled], .datetimepicker table tr td span.active:hover[disabled], .datetimepicker table tr td span.active.disabled[disabled], .datetimepicker table tr td span.active.disabled:hover[disabled] {
background-color: #04c;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span.active:active, .datetimepicker table tr td span.active:hover:active, .datetimepicker table tr td span.active.disabled:active, .datetimepicker table tr td span.active.disabled:hover:active, .datetimepicker table tr td span.active.active, .datetimepicker table tr td span.active:hover.active, .datetimepicker table tr td span.active.disabled.active, .datetimepicker table tr td span.active.disabled:hover.active {
background-color: #039;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker table tr td span.old {
color: #999;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker th.switch {
width: 145px;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker th span.glyphicon {
pointer-events: none;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker thead tr:first-child th, .datetimepicker tfoot th {
cursor: pointer;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.datetimepicker thead tr:first-child th:hover, .datetimepicker tfoot th:hover {
background: #eee;
}
/* line 9, app/assets/stylesheets/bootstrap-datetimepicker.min.css */
.input-append.date .add-on i, .input-prepend.date .add-on i, .input-group.date .input-group-addon span {
cursor: pointer;
width: 14px;
height: 14px;
}
/* BASICS */
/* line 3, vendor/assets/codemirror/lib/codemirror.css */
.CodeMirror {
@ -24796,68 +25152,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 +25552,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;
@ -26059,7 +26481,7 @@ input.form-control {
flex: 3;
}
/* line 18, app/assets/stylesheets/admin.scss */
/* line 19, app/assets/stylesheets/admin.scss */
body {
width: 100vw;
height: 100vh;
@ -26074,28 +26496,28 @@ body {
overflow: hidden;
}
/* line 32, app/assets/stylesheets/admin.scss */
/* line 33, app/assets/stylesheets/admin.scss */
.simple_form .form-group .collection_radio_buttons {
margin-bottom: 0px;
}
/* line 36, app/assets/stylesheets/admin.scss */
/* line 37, app/assets/stylesheets/admin.scss */
.simple_form .form-group .form-check-inline {
height: calc(1.5em + 0.75rem + 2px);
}
/* line 42, app/assets/stylesheets/admin.scss */
/* line 43, app/assets/stylesheets/admin.scss */
input.form-control {
font-size: 14px;
}
/* line 46, app/assets/stylesheets/admin.scss */
/* line 47, app/assets/stylesheets/admin.scss */
.btn-default {
color: #666;
background: #e1e1e1 !important;
}
/* line 50, app/assets/stylesheets/admin.scss */
/* line 51, app/assets/stylesheets/admin.scss */
.export-absolute {
right: 20px;
position: absolute;

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

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

@ -285,16 +285,12 @@ const Ecs = Loadable({
loading: Loading,
})
//团队竞赛报名
const Registration = Loadable({
loader: () => import('./modules/competition/Registration'),
loading: Loading,
});
//个人竞赛报名
const PersonalCompetit = Loadable({
loader: () => import('./modules/competition/personal/PersonalCompetit.js'),
loading: Loading,
});
// //个人竞赛报名
// const PersonalCompetit = Loadable({
// loader: () => import('./modules/competition/personal/PersonalCompetit.js'),
// loading: Loading,
// });
class App extends Component {
constructor(props) {
super(props)
@ -490,7 +486,14 @@ class App extends Component {
{/*/!*众包创新*!/*/}
{/*<Route path={"/crowdsourcing"} component={ProjectPackages}/>*/}
{/*竞赛*/}
<Route path={"/newcompetitions"} component={NewCompetitions}/>
<Route path={"/newcompetitions"}
render={
(props) => {
return (<NewCompetitions {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*认证*/}
<Route path="/account" component={AccountPage}/>
@ -541,12 +544,12 @@ class App extends Component {
return (<BanksIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
<Route
path="/personalcompetit"
render={
(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)
}
/>
{/*<Route*/}
{/*path="/personalcompetit"*/}
{/*render={*/}
{/*(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)*/}
{/*}*/}
{/*/>*/}
<Route
path="/changepassword"
render={
@ -603,12 +606,12 @@ class App extends Component {
{/*<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>*/}
{/*<Route path="/testRCComponent" component={TestComponent}/>*/}
{/*<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>*/}
<Route
path="/registration"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)
}
/>
{/*<Route*/}
{/*path="/registration"*/}
{/*render={*/}
{/*(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)*/}
{/*}*/}
{/*/>*/}
<Route path="/messages"
render={

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import competition from './comcss/competition.css';
import {getImageUrl} from 'educoder';
// 团队竞赛报名大图
class CompetitionMaxImg extends React.Component {
constructor(props) {
@ -16,9 +16,9 @@ class CompetitionMaxImg extends React.Component {
componentDidUpdate = (prevProps) => {
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
// console.log("团队竞赛报名大图componentDidUpdate");
// console.log(this.props);
// console.log(this.props.GetenrollmentAPI);
// ////console.log("团队竞赛报名大图componentDidUpdate");
// ////console.log(this.props);
// ////console.log(this.props.GetenrollmentAPI);
this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI,
})
@ -29,9 +29,18 @@ class CompetitionMaxImg extends React.Component {
let {type, pint} = this.props;
return (
<div>
<style>
{
`
`
}
</style>
{
type === 1 || type === 2 ?
<div className="registrationback">
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
@ -47,7 +56,8 @@ class CompetitionMaxImg extends React.Component {
</div>
:
type === 3 ?
<div className="registrationback">
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp4">高校智能课堂与综合实训平台</p>
<div className="registrationbackp2button2">
@ -62,7 +72,8 @@ class CompetitionMaxImg extends React.Component {
</div>
:
type === 4 || type === 5 ?
<div className="registrationback1">
<div className="registrationback1"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
<p className="registrationbackp11">Educoder竞赛平台</p>
<p className="registrationbackp22">高校智能课堂与综合实训平台</p>
<div className="registrationbackp2button3">
@ -76,15 +87,16 @@ class CompetitionMaxImg extends React.Component {
</div>
</div>
: type === 6 ?
<div className="registrationback">
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
{
pint === 1 ?
<div className="registbut1">
<p>立即报名</p>
<div className="registbut1" onClick={() => this.props.Personalregistration()}>
<p onClick={() => this.props.Personalregistration()}>立即报名</p>
</div>
: pint === 2 ?
<div className="personreg1">
@ -99,7 +111,9 @@ class CompetitionMaxImg extends React.Component {
</div>
</div>
:
""
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
</div>
}

@ -8,8 +8,8 @@ import axios from 'axios';
import moment from 'moment';
import competition from './comcss/competition.css';
import {Checkbox, Table, Pagination, Menu, Icon} from "antd";
import {getImageUrl} from 'educoder';
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
import Rectanglex from "../../modules/competition/Rectanglex.png";
class RegisListview extends React.Component {
constructor(props) {
super(props)
@ -25,20 +25,20 @@ class RegisListview extends React.Component {
display: "flex",
justifyContent: " space-around",
alignItems: "center",
background: `url(${Rectanglex})`,
background: `url(${getImageUrl(`images/educoder/competitions/Rectanglex.png`)})`,
height: "50px",
backgroundPosition: "center",
backgroundSize: "110% 100%",
}}>
<p className="borders"
<p className=" "
style={{fontSize: "16px", color: "#05101A", width: "79px", textAlign: "center"}}>创建者</p>
<p className="borders"
<p className=" "
style={{fontSize: "16px", color: "#05101A", width: "160px", textAlign: "center"}}>战队名称</p>
<p className="borders"
<p className=" "
style={{fontSize: "16px", color: "#05101A", width: "487px", textAlign: "center"}}>战队成员</p>
<p className="borders"
<p className=" "
style={{fontSize: "16px", color: "#05101A", width: "134px", textAlign: "center"}}>学校</p>
<p className="borders"
<p className=" "
style={{fontSize: "16px", color: "#05101A", width: "151px", textAlign: "center"}}>时间</p>
</div>
</div>

@ -6,7 +6,7 @@ import {
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
@ -15,86 +15,124 @@ import {Button} from 'antd';
class RegisListviewdata extends React.Component {
constructor(props) {
super(props)
this.state = {
item: undefined
}
}
componentDidMount() {
////console.log("RegisListviewdata");
////console.log(this.props.item)
this.setState({
item: this.props.item
})
}
render() {
const {item} = this.props;
return (
<div className="regitem">
<div className="regitemimg1 borders">
<div className="regitemimg2">
</div>
<p>小猫头像</p>
</div>
<div className="borders" style={{
marginTop: "29px",
marginLeft: "37px"
}}>
<p style={{
border: "1px solid",
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>重庆邮电大学</p>
</div>
<div className="borders" style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "487px"
}}>
<div className="regitemimgs">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs22">
</div>
</div>
<div className="borders" style={{
marginLeft: "37px",
width: "134px",
marginTop: "29px",
}}>
<p style={{
color: "#05101A",
fontSize: "16px",
textAlign: "center"
}}>重庆邮电大学</p>
</div>
<div className="borders" style={{
marginLeft: "37px",
width: "151px",
marginTop: "29px",
}}>
<p style={{
color: "#999999",
fontSize: "16px",
textAlign: "center"
}}>2019-09-07 08:33</p>
</div>
<div>
{
item !== undefined ?
<div className={"yslborderbottom"}>
<div className="regitem22">
<div className="regitemimg1 ">
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
</img>
<p style={{
color: "#999999", fontSize: "14px",
width: "78px",
textAlign: "center"
}}>{item.creator.name}</p>
</div>
<div style={{
marginTop: "29px",
marginLeft: "37px"
}}>
<p className="maxnamewidth160" style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>{item.name}</p>
</div>
<div style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "487px"
}}>
{
item && item.team_members.map((item, index) => {
return (
index === 0 ?
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 3 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 4 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs22"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})
}
</div>
<div style={{
marginLeft: "41px",
width: "134px",
marginTop: "29px",
}}>
<p className="maxnamewidth134" style={{
color: "#05101A",
fontSize: "16px",
textAlign: "center"
}}>{item.school_name}</p>
</div>
<div style={{
marginLeft: "37px",
width: "151px",
marginTop: "29px",
}}>
<p style={{
color: "#999999",
fontSize: "16px",
textAlign: "center"
}}>{item.created_at}</p>
</div>
</div>
</div>
: ""
}
</div>

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import competition from './comcss/competition.css';
import Noentry from './Noentry.jpg';
import {getImageUrl} from 'educoder';
// 团队竞赛报名无报名子组件
class RegisNodata extends React.Component {
constructor(props) {
@ -17,7 +17,7 @@ class RegisNodata extends React.Component {
height: "80px",
width: "125px",
marginTop: "107px",
background: `url(${Noentry})`,
background: `url(${getImageUrl(`images/educoder/competitions/Noentry.jpg`)})`,
backgroundPosition: "center",
backgroundSize: "110% 100%",
}}>

@ -9,7 +9,7 @@ import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button, Pagination, message} from 'antd';
import {Button, Pagination, message, Spin, Breadcrumb} from 'antd';
import Registrationitem from './Registrationitem';
import RegisNodata from './RegisNodata';
import CompetitionMaxImg from './CompetitionMaxImg';
@ -19,7 +19,8 @@ import RegisListviewdata from './RegisListviewdata';
import PersonModal from './competmodal/PersonModal';
import MessagePersonModal from './competmodal/MessagePersonModal';
import PersonalModalteam from './competmodal/PersonalModalteam';
import PersonalCompetititem from './personal/PersonalCompetititem'
import PersonalCompetititem from './personal/PersonalCompetititem';
import ExittheteamModel from './competmodal/ExittheteamModel';
// 团队竞赛报名无报名
class Registration extends React.Component {
/***
@ -28,15 +29,15 @@ class Registration extends React.Component {
*"enrolled: false, // 是否已经报名
*"teacher_staff": { // 为空表示不支持老师报名
*"member_staff": { // 为空表示不支持学生报名
* personal// 是否是个人赛
* **/
constructor(props) {
super(props)
this.state = {
test: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
loadingstate: false,
pages: 1,
limit: 20,
type: 1,
type: 7,
tmodalsType: false,
tmodalsTypes: false,
Newtit: true,
@ -44,6 +45,7 @@ class Registration extends React.Component {
page: 1,
per_page: 20,
data: [],
competition_teams: [],
count: 0,
GetenrollmentAPI: undefined,
personal: false,
@ -53,29 +55,58 @@ class Registration extends React.Component {
member_staff: null,
messagePer: "提示",
messagePerbool: false,
intpermessages: "确认"
intpermessages: "确认",
messageexit: "提示",
messageexitol: false,
exitintpermessages: "是否确认退出战队?",
itemid: undefined,
itemiddata: [],
pint: 0,
}
}
componentDidMount() {
//console.log("componentDidMount Registration");
// ////console.log("调用子组件 ");
//console.log(this.props.isAdmin());
// ////console.log(this.props.isAdmin())
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page);
this.GetenrollmentAPI();
console.log(this.props);
// //////console.log("componentDidMount Registration");
// //// //////console.log("调用子组件 ");
// //////console.log(this.props.isAdmin());
// //// //////console.log(this.props.isAdmin())
try {
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
} catch (e) {
// const {keyword, page, per_page} = this.state;
// this.Getdata(keyword, page, per_page, this.props.isAdmin());
// this.GetenrollmentAPI();
}
}
componentDidUpdate = (prevProps) => {
if (prevProps.user != this.props.user) {
console.log("componentDidUpdate");
console.log(this.props);
////console.log("Registration");
////console.log("componentDidUpdate");
////console.log(this.props.user.admin);
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
}
}
//获取报名配置API
GetenrollmentAPI = () => {
const url = `/competitions/${"gcc-course-2019"}/competition_staff.json`;
const url = `/competitions/${this.props.match.params.identifier}/competition_staff.json`;
axios.get((url)).then((result) => {
if (result) {
if (result.data) {
////console.log("获取报名配置API");
////console.log(result);
//// //////console.log("获取报名配置API");
//// //////console.log(result);
this.setState({
GetenrollmentAPI: result.data,
personal: result.data.personal,
@ -84,14 +115,27 @@ class Registration extends React.Component {
teacher_staff: result.data.teacher_staff,
member_staff: result.data.member_staff,
})
if (result.data.enroll_ended === true) {
this.setState({
pint: 0
})
} else if (result.data.enrolled === true) {
this.setState({
pint: 2
})
} else if (result.data.enrolled === false) {
this.setState({
pint: 1
})
}
}
}
}).catch((error) => {
////console.log(error);
//// //////console.log(error);
})
}
Getdata = (keyword, page, per_page) => {
Getdata = (keyword, page, per_page, admin) => {
//搜索关键字 keyword
//页数 page
//分页 per_page
@ -100,66 +144,234 @@ class Registration extends React.Component {
page: page,
per_page: per_page,
};
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
if (result) {
if (result.data) {
////console.log(result);
if (result.data.count === 0) {
// 没有创建数据的
if (this.props.isAdmin() === true) {
//管理员
this.setState({
type: 4,
count: result.data.count,
})
//// //////console.log(result);\
if (result.data.personal === false) {
//不是个人赛
if (result.data.my_teams.length === 0) {
// 没有创建数据的
if (admin === true) {
//管理员
this.setState({
type: 4,
count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
//普通账号
this.setState({
type: 1,
count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
} else {
//普通人
this.setState({
type: 1,
count: result.data.count,
})
//有数据的
if (admin === true) {
if (result.data.my_teams[0].manage_permission === true) {
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
this.setState({
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
} else {
if (result.data.my_teams[0].manage_permission === true) {
//普通账号true 为创建了竞赛
this.setState({
type: 2,
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
})
} else {
//普通账号true 加入了竞赛
this.setState({
type: 3,
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
})
}
}
}
} else {
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
}
this.setState({
loadingstate: false,
})
}).catch((error) => {
if (admin === true) {
//管理员
this.setState({
type: 4,
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
} else {
//普通账号
this.setState({
type: 1,
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
}
})
}
Getdatatype5 = (keyword, page, per_page, admin) => {
//搜索关键字 keyword
//页数 page
//分页 per_page
const datas = {
keyword: keyword,
page: page,
per_page: per_page,
};
let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
this.setState({
loadingstate: false,
})
if (result) {
if (result.data) {
//// //////console.log(result);
if (result.data.personal === false) {
//不是个人赛
////console.log("Getdatatype5");
////console.log(result.data.my_teams.length);
if (result.data.my_teams.length === 0) {
// 没有创建数据的
//管理员
////console.log("a");
////console.log(this.state.competition_teams);
////console.log(result.data.competition_teams);
this.setState({
type: 4,
count: result.data.count,
competition_teams: result.data.competition_teams,
data: result.data.my_teams,
personal: result.data.personal,
})
} else {
//有数据的
if (this.props.isAdmin() === true) {
////console.log("b");
if (result.data.my_teams[0].manage_permission === true) {
this.setState({
type: 5,
data: result.data.competition_teams,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
if (result.data.competition_teams[0].manage_permission === true) {
//学生true 为创建了竞赛
this.setState({
type: 2,
data: result.data.competition_teams,
count: result.data.count,
})
} else {
//学生true 加入了竞赛
////console.log("c");
this.setState({
type: 3,
data: result.data.competition_teams,
count: result.data.count,
})
}
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
} else {
//团队赛
//////console.log("d");
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
}
}).catch((error) => {
////console.log("k");
////console.log(error);
////console.log("报错了");
if (admin === true) {
//管理员
this.setState({
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
} else {
//普通账号
this.setState({
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
}
})
}
//团队竞赛翻页
paginationonChangestwo = (pageNumber) => {
this.setState({
pages: pageNumber,
loadingstate: true,
})
const {keyword, per_page} = this.state;
this.Getdatatype5(keyword, pageNumber, per_page, this.props.user.admin);
};
/**
* 加入战队
@ -181,7 +393,7 @@ class Registration extends React.Component {
})
return
}
if (this.props.isAdmin() === true) {
if (this.props.user.admin === true) {
//老师
if (this.state.teacher_staff === null) {
//禁止老师
@ -235,7 +447,7 @@ class Registration extends React.Component {
})
return
}
if (this.props.isAdmin() === true) {
if (this.props.user.admin === true) {
//老师
if (this.state.teacher_staff === null) {
//禁止老师
@ -246,7 +458,8 @@ class Registration extends React.Component {
return;
}
this.setState({
tmodalsType: true
tmodalsType: true,
Newtit: true,
})
} else {
//学生
@ -259,16 +472,20 @@ class Registration extends React.Component {
return;
}
this.setState({
tmodalsType: true
tmodalsType: true,
Newtit: true,
})
}
// this.setState({
// tmodalsType: true
// })
}
//编辑战队
Createateamedit = (data) => {
this.setState({
tmodalsType: true,
Newtit: false,
itemiddata: data
})
}
Tmoconfirm = (bool) => {
//boolfalse 取消 true 确认
this.setState({
@ -285,7 +502,7 @@ class Registration extends React.Component {
}
}
//创建战队确认
Tmoconfirm1 = (bool) => {
//boolfalse 取消 true 确认
this.setState({
@ -293,8 +510,7 @@ class Registration extends React.Component {
})
if (bool) {
//确认
this.Refreshteam();
} else {
//取消
@ -308,12 +524,101 @@ class Registration extends React.Component {
messagePerbool: false
})
}
//显示退出战队弹框
Exittheteamshow = (itemid, bool) => {
if (bool === true) {
this.setState({
messageexitol: true,
itemid: itemid,
exitintpermessages: "是否确认删除战队",
})
} else {
this.setState({
messageexitol: true,
itemid: itemid,
exitintpermessages: "是否确认退出战队",
})
}
};
//刷新战队
Refreshteam = () => {
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
}
//退出战队
Exittheteam = (bool) => {
// //////console.log(this.state.itemid);
if (bool) {
this.setState({
messageexitol: true
})
let url = `/competitions/${"gcc-task-2020"}/competition_teams/${this.state.itemid}/leave.json`;
axios.post(url).then((response) => {
if (response) {
if (response.data) {
//////console.log("退出战队");
//////console.log(response);
this.Refreshteam();
this.setState({
messageexitol: false
})
}
}
}).catch((error) => {
//////console.log(error)
});
} else {
this.setState({
messageexitol: false
})
}
}
//搜索战队
RegistrationSearchvalue = (value) => {
////console.log("RegistrationSearchvalue");
////console.log(this.props.user.admin);
this.setState({
pages: 1,
limit: 20,
})
this.Getdatatype5(value, 1, 20, this.props.user.admin);
}
//个人竞赛
// /competitions/:identifier/competition_teams.json
Personalregistration = () => {
let {teacher_staff, member_staff, data, enroll_ended, enrolled} = this.state;
if (enroll_ended === true) {
//已截止
this.props.showNotification(`报名已截止`);
return;
}
if (enrolled === true) {
this.props.showNotification(`你已经报名,不能重复报名!`);
return;
}
const url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.post(url).then((response) => {
if (response) {
if (response.data) {
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
this.Refreshteam();
}
}
}).catch((error) => {
});
}
render() {
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data} = this.state;
const listItems = test.map((item, index) =>
<RegisListviewdata></RegisListviewdata>
);
const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
return (
<div className="newMain clearfix ">
@ -329,43 +634,112 @@ class Registration extends React.Component {
`
}
</style>
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
messagePerboolbuton={() => this.messagePerboolbuton()}></MessagePersonModal>
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={true}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}></PersonModal>
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
<div className="educontent mb20 ">
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a
className=" btn colorgrey fl hovercolorblue ">全国高校计算机大赛-项目挑战</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">报名</WordsBtn>
</p>
{
messagePerbool === true ?
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
messagePerboolbuton={() => this.messagePerboolbuton()}
GetenrollmentAPI={GetenrollmentAPI}></MessagePersonModal>
: ""
}
{/*编辑创建战队*/}
{
tmodalsType === true ?
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={Newtit}
itemiddata={itemiddata} GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}></PersonModal>
:
""
}
{
tmodalsTypes === true ?
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
: ""
}
{
messageexitol === true ?
<ExittheteamModel {...this.props} {...this.state} GetenrollmentAPI={GetenrollmentAPI}
Exittheteam={(bool) => this.Exittheteam(bool)}></ExittheteamModel>
: ""
}
{/*<div className="educontent mb20 ">*/}
{/* <p className="clearfix mb20 mt10">*/}
{/* <a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <a*/}
{/* className=" btn colorgrey fl hovercolorblue ">全国高校计算机大赛-项目挑战</a>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <WordsBtn className="fl">报名</WordsBtn>*/}
{/* </p>*/}
{/*</div>*/}
<div style={{marginBottom: '12px'}}>
<Breadcrumb separator=">">
<Breadcrumb.Item href="/newcompetitions">在线竞赛</Breadcrumb.Item>
<Breadcrumb.Item href="">全国高校计算机大赛</Breadcrumb.Item>
<Breadcrumb.Item href="">报名</Breadcrumb.Item>
</Breadcrumb>
</div>
{/*大图*/}
<CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()}
pint={pint}
{...this.props} {...this.state}
Createateam={() => this.Createateam()}></CompetitionMaxImg>
Createateam={() => this.Createateam()}
Personalregistration={() => this.Personalregistration()}
></CompetitionMaxImg>
{/*大图结尾*/}
{/*没数据*/}
{
pint === 1 || pint === 3 ?
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>{data === null || data === undefined ? 0 : data.length}</span><span
style={{marginLeft: "5px"}}></span>
</p>
</div>
: ""}
{/*列表*/}
{
type === 6 ?
<div
style={{
marginTop: "31px"
}}
>
<Spin spinning={loadingstate}>
{
data && data.map((item, index) => {
return (
<Registrationitem key={index} item={item}></Registrationitem>
)
})
}
</Spin>
</div>
: ""}
{
type === 1 ?
<RegisNodata></RegisNodata>
:
""
}
{/*普通账号出现单人 战队弹框*/}
{
type === 2 || type === 3 || type === 5 ?
<PersonalCompetititem type={type} data={data}></PersonalCompetititem>
<PersonalCompetititem type={type} data={data}
Exittheteamshow={(itemid) => this.Exittheteamshow(itemid)}
Createateamedit={(itemid) => this.Createateamedit(itemid)}></PersonalCompetititem>
: ""
}
{
type === 4 || type === 5 ?
<RegistrationSearch></RegistrationSearch>
<RegistrationSearch count={count}
RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
: ""
}
{/*<Registrationitem></Registrationitem>*/}
@ -378,19 +752,38 @@ class Registration extends React.Component {
{type === 4 || type === 5 ?
listItems
<Spin spinning={loadingstate}>
{
competition_teams && competition_teams.map((item, index) => {
return (
<RegisListviewdata key={index} item={item}></RegisListviewdata>
)
})
}
</Spin>
:
""
}
{
type === 4 || type === 5 ?
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
<Pagination showQuickJumper current={pages}
onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination>
</div>
: ""
(
count < 20 ? <div style={{
height: "20px",
minHeight: "20px"
}}></div> :
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
<Pagination showQuickJumper current={pages}
onChange={this.paginationonChangestwo} pageSize={limit}
total={count}></Pagination>
</div>
)
: <div style={{
height: "20px",
minHeight: "20px"
}}></div>
}
</div>
@ -401,4 +794,4 @@ class Registration extends React.Component {
}
export default SnackbarHOC()(TPMIndexHOC(Registration));
export default Registration;

@ -24,15 +24,22 @@ class RegistrationSearch extends React.Component {
this.setState({
keywords: e.target.value
})
};
setdatafuns = (value) => {
console.log("点击了搜索");
//console.log("setdatafuns点击了搜索");
//console.log(value);
this.setState({
keywords: value
})
this.props.RegistrationSearchvalue(value);
};
myonPressEnter = (e) => {
//console.log("点击了回车setdatafunsval点击了搜索");
//console.log(e.target.value);
this.props.RegistrationSearchvalue(e.target.value);
}
render() {
return (
<div className="searchhead">
@ -42,10 +49,21 @@ class RegistrationSearch extends React.Component {
value={this.state.keywords}
enterButton={<span>搜索</span>}
onInput={(e) => this.setdatafunsval(e)}
onSearch={(value) => this.setdatafuns(value)}/>
onSearch={(value) => this.setdatafuns(value)}
onPressEnter={(e) => this.myonPressEnter(e)}
/>
<p style={{color: "#07140E", fontSize: "16px", marginTop: "7px", marginLeft: "760px"}}>战队总数<span
style={{color: "#459BE5", fontSize: "16px"}}>271</span></p>
<p style={{
width: "300px",
color: "#07140E",
fontSize: '16px',
marginTop: " 7px",
marginLeft: "583px",
textAlign: "right",
lineHeight: " 24px"
}}>战队总数<span
style={{color: "#459BE5", fontSize: "16px"}}>{this.props.count}</span><span
style={{marginLeft: "5px",}}></span></p>
</div>
)
}

@ -6,7 +6,7 @@ import {
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
@ -22,14 +22,16 @@ class Registrationitem extends React.Component {
render() {
let {item} = this.props;
return (
<div className="yslborderbottom">
{
item !== undefined ?
<div className="regitem2">
<div className="perregitemimg1 ">
<div className="personregitemimg">
<img className="personregitemimg" src={getImageUrl("images/" + item.creator.image_url)}>
</div>
</img>
</div>
<div className="" style={{
marginTop: "19px",
@ -42,14 +44,19 @@ class Registrationitem extends React.Component {
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>小猫头像</p>
}}>{item.creator.name}</p>
{
item.manage_permission === true ?
<p className="" style={{
color: "#459BE5",
fontSize: "16px",
textAlign: "center",
marginLeft: "25px",
}}>已报名</p>
:
""
}
<p className="" style={{
color: "#459BE5",
fontSize: "16px",
textAlign: "center",
marginLeft: "25px",
}}>已报名</p>
</div>
<div className="" style={{
@ -62,12 +69,13 @@ class Registrationitem extends React.Component {
color: "#999999",
fontSize: "16px",
textAlign: "center",
}}>2019-09-07 08:33</p>
}}>{item.created_at}</p>
</div>
</div>
: ""
}
</div>
)
}

@ -8,16 +8,17 @@
}
/*All*/
/*Registration.js*/
.registrationback {
height: 368px;
width: 1200px;
border: 0.5px solid;
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
background: #0dcecb;
}
/*.registrationback {*/
/* height: 368px;*/
/* width: 1200px;*/
/* border: 0.5px solid;*/
/* display: flex;*/
/* display: -webkit-flex;*/
/* flex-direction: column;*/
/* align-items: center;*/
/* background:url(../../../../../images/regis/tipregistit.jpg)*/
/*}*/
.registrationbackcenter {
display: flex;
@ -26,14 +27,14 @@
align-items: center;
}
.registrationback1 {
height: 368px;
width: 1200px;
border: 0.5px solid;
display: flex;
flex-direction: column;
background: #0dcecb;
}
/*.registrationback1 {*/
/* height: 368px;*/
/* width: 1200px;*/
/* border: 0.5px solid;*/
/* display: flex;*/
/* flex-direction: column;*/
/* background:url(../../../../../images/regis/tipregistit.jpg)*/
/*}*/
.registrationbackp1 {
color: #ffffff;
@ -301,14 +302,40 @@
.regitem {
display: flex;
flex-direction: initial;
border-bottom: 1px solid #EDEDED;
margin-top: 44px;
}
.regitem2 {
.regitem22 {
display: flex;
flex-direction: initial;
margin-top: 27px;
margin-bottom: 19px;
}
.yslborderbottom {
border-bottom: 1px solid #EDEDED;
}
.registrationback {
height: 368px;
width: 1200px;
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
.registrationback1 {
height: 368px;
width: 1200px;
display: flex;
flex-direction: column;
}
.regitem2 {
display: flex;
flex-direction: initial;
padding-bottom: 18px;
margin-top: 19px;
}
@ -328,18 +355,21 @@
align-items: center;
justify-content: center;
margin-left: 26px;
padding-bottom: 18px;
}
.regitemimg2 {
height: 78px;
width: 78px;
background-color: transparent;
margin-bottom: 9px;
border-radius: 50%;
}
.personregitemimg {
border: 0.5px solid;
height: 64px;
width: 64px;
border-radius: 50%;
}
@ -353,6 +383,8 @@
width: 69px;
height: 69px;
margin-top: 3px;
background-color: transparent;
border-radius: 50%;
}
@ -360,7 +392,9 @@
margin-top: 16px;
width: 49px;
height: 51px;
margin-left: 25px
margin-left: 25px;
border-radius: 50%;
}
.regitemimgs22 {
@ -368,6 +402,8 @@
width: 28px;
height: 28px;
margin-left: 20px;
border-radius: 50%;
}
.regitemimgs3 {
@ -375,7 +411,7 @@
height: 22px;
width: 22px;
font-size: 21px !important;
margin-top: 22px;
margin-top: 21px;
color: #1C91E8;
}
@ -714,4 +750,32 @@ reglistviewdivs2 {
line-height: 30px;
border-radius: 2px;
}
/*PersonalModalteam.js*/
/*PersonalModalteam.js*/
/*文字长度限制*/
.maxnamewidth100 {
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth160 {
max-width: 160px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth134 {
max-width: 134px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
/*文字长度限制?*/

@ -0,0 +1,59 @@
import React, {Component} from 'react';
import {getImageUrl} from 'educoder';
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
import axios from 'axios';
import competition from '../comcss/competition.css';
import Registrationitem from "../Registrationitem";
import InfiniteScroll from 'react-infinite-scroller';
// import PersonModaltion from "./PersonModaltion";
const {Search} = Input;
//退出战队
class ExittheteamModel extends React.Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
const {
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
} = this.state;
//Modal
//keyboard是否支持键盘 esc 关闭
//closable 是否显示右上角的关闭按钮
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
//destroyOnClose 关闭时销毁 Modal 里的子元素
//centered 垂直居中展示 Modal
//visible 弹出框是否显示
return (
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title={this.props.messageexit}
centered={true}
visible={this.props.messageexitol === undefined ? false : this.props.messageexitol}
width="480px"
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{this.props.exitintpermessages}</div>
</div>
<div className="task-popup-submit clearfix">
<a className="pop_close task-btn mb10 mr40 colorFFF"
onClick={() => this.props.Exittheteam(false)}>取消</a>
<a className="task-btn task-btn-orange fr" onClick={() => this.props.Exittheteam(true)}>确定</a>
</div>
</Modal>
)
}
}
export default ExittheteamModel;

@ -56,14 +56,64 @@ class PersonModal extends Component {
}
}
componentDidMount() {
var data = [];
var polls_nametests = "";
var datas = {
enrollable: false,
id: this.props.user.user_id,
name: this.props.user.real_name,
school_name: this.props.user.user_school,
student_id: null,
identity: this.props.user.user_identity,
type: "导师",
};
data.push(datas);
// console.log("itemiddata");
// console.log("编辑战队")
// console.log(this.props.itemiddata);
try {
if (this.props.Newtit === false) {
for (var i = 0; i < this.props.itemiddata.team_members.length; i++) {
if (i === 0) {
///因为第一个位置是创建者 所以要过滤掉
} else {
var datasy = {
enrollable: false,
id: this.props.itemiddata.team_members[i].user_id,
name: this.props.itemiddata.team_members[i].name,
school_name: this.props.itemiddata.team_members[i].school_name,
student_id: null,
identity: this.props.itemiddata.team_members[i].identity,
type: this.props.itemiddata.team_members[i].role === "teacher" ? "导师" : "队员",
};
data.push(datasy);
}
}
if (this.props.itemiddata) {
polls_nametests = this.props.itemiddata.name;
}
}
} catch (e) {
}
this.setState({
myuser: this.props.user,
mydatas: data,
polls_nametest: polls_nametests
})
this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI,
})
}
componentDidUpdate = (prevProps) => {
if (prevProps.user != this.props.user) {
console.log("Registration.js componentDidUpdate");
console.log(this.props);
//console.log(prevProps);
////console.log("Registration.js componentDidUpdate");
////console.log(this.props);
// ////console.log(prevProps);
//identity职场称
//user_school学校
//real_name姓名
@ -76,7 +126,7 @@ class PersonModal extends Component {
school_name: this.props.user.user_school,
student_id: null,
identity: this.props.user.user_identity,
type: "创建者",
type: "导师",
};
data.push(datas);
this.setState({
@ -86,8 +136,8 @@ class PersonModal extends Component {
}
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
console.log("Registration.js GetenrollmentAPIcomponentDidUpdate");
console.log(this.props);
////console.log("Registration.js GetenrollmentAPIcomponentDidUpdate");
////console.log(this.props);
this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI,
})
@ -95,6 +145,8 @@ class PersonModal extends Component {
};
//创建战队
Createateam = () => {
const {polls_nametest, mydatas, GetenrollmentAPI} = this.state;
var myteaherdata = [];
var myshtudentdata = [];
@ -102,85 +154,93 @@ class PersonModal extends Component {
for (var a = 0; a < mydatas.length; a++) {
if (mydatas[a].type === "导师") {
i++;
var objectt = {
enrollable: mydatas[a].enrollable,
id: mydatas[a].id,
identity: mydatas[a].identity,
name: mydatas[a].name,
school_name: mydatas[a].school_name,
}
myteaherdata.push(objectt);
// var objectt = {
// enrollable: mydatas[a].enrollable,
// id: mydatas[a].id,
// identity: mydatas[a].identity,
// name: mydatas[a].name,
// school_name: mydatas[a].school_name,
// }
myteaherdata.push(mydatas[a].id);
} else if (mydatas[a].type === "队员") {
var objectts = {
enrollable: mydatas[a].enrollable,
id: mydatas[a].id,
name: mydatas[a].name,
school_name: mydatas[a].school_name,
student_id: mydatas[a].student_id,
}
myshtudentdata.push(objectts);
// var objectts = {
// enrollable: mydatas[a].enrollable,
// id: mydatas[a].id,
// name: mydatas[a].name,
// school_name: mydatas[a].school_name,
// student_id: mydatas[a].student_id,
// }
myshtudentdata.push(mydatas[a].id);
}
}
if (GetenrollmentAPI !== undefined || GetenrollmentAPI !== null) {
if (GetenrollmentAPI.teacher_staff !== undefined || GetenrollmentAPI.teacher_staff !== null) {
if (GetenrollmentAPI.teacher_staff.minimum > i) {
this.setState({
Thecurrentnumberbool: true,
Thecurrentnumber: i,
booltech: false,
boolstud: false
})
return
} else if (GetenrollmentAPI.teacher_staff.maximum < i) {
this.setState({
Thecurrentnumberbool: true,
Thecurrentnumber: i,
booltech: false,
boolstud: false
})
return
}
}
}
// Thecurrentnumber
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
axios.post(url, {
name: polls_nametest,
teacher_ids: myteaherdata,
member_ids: myshtudentdata,
}).then((result) => {
//console.log("获取到创建战队的数据");
//console.log(result);
if (result) {
if (result.data) {
this.props.Tmoconfirm1(true);
try {
if (GetenrollmentAPI) {
if (GetenrollmentAPI.teacher_staff) {
if (GetenrollmentAPI.teacher_staff.minimum > i) {
this.setState({
Thecurrentnumberbool: true,
Thecurrentnumber: i,
booltech: false,
boolstud: false
})
return
} else if (GetenrollmentAPI.teacher_staff.maximum < i) {
this.setState({
Thecurrentnumberbool: true,
Thecurrentnumber: i,
booltech: false,
boolstud: false
})
return
}
}
}
}).catch((error) => {
//console.log(error)
});
}
creident = (name, teacher_ids, member_ids) => {
let collaborators = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
axios.post(collaborators, {
name: name,
teacher_ids: teacher_ids,
member_ids: member_ids,
}).then((result) => {
if (result) {
if (result.data) {
} catch (e) {
}
// Thecurrentnumber
if (this.props.Newtit === true) {
//创建新的战队
let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.post(url, {
name: polls_nametest,
teacher_ids: myteaherdata,
member_ids: myshtudentdata,
}).then((result) => {
// ////console.log("获取到创建战队的数据");
// ////console.log(result);
if (result) {
if (result.data) {
this.props.Tmoconfirm1(true);
}
}
}
}).catch((error) => {
//console.log(error)
});
}).catch((error) => {
// ////console.log(error)
});
} else {
//编辑战队
let url = `/competitions/${this.props.match.params.identifier}/competition_teams/${this.props.itemiddata.id}.json`;
axios.put(url, {
name: polls_nametest,
teacher_ids: myteaherdata,
member_ids: myshtudentdata,
}).then((result) => {
// ////console.log("获取到编辑战队的数据");
// ////console.log(result);
if (result) {
if (result.data) {
this.props.Tmoconfirm1(true);
}
}
}).catch((error) => {
// ////console.log(error)
});
}
}
Getteacherdata = (keywordteachers, team_idteachers, teacher_ids) => {
this.setState({
person1: true,
@ -189,24 +249,24 @@ class PersonModal extends Component {
//老师姓名 keyword
//当前战队ID team_id
//当前老师ID数组 teacher_ids
//console.log("搜索的老师");
// ////console.log("搜索的老师");
const datas = {
keyword: keywordteachers,
team_id: team_idteachers,
teacher_ids: teacher_ids,
};
let url = `/competitions/${"gcc-course-2019"}/teachers.json`;
let url = `/competitions/${this.props.match.params.identifier}/teachers.json`;
axios.get((url), {params: datas}).then((result) => {
if (result) {
if (result.data) {
//console.log(result);
// ////console.log(result);
this.setState({
teacher_ids: result.data.teachers
})
}
}
}).catch((error) => {
//console.log(error);
// ////console.log(error);
})
};
Getstudentsdata = (keywordstudents, team_idstudents, student_ids) => {
@ -217,17 +277,17 @@ class PersonModal extends Component {
//学生姓名 keyword
//当前战队ID team_id
//当前队员ID数组 student_ids
//console.log("搜索的学生");
// ////console.log("搜索的学生");
const datas = {
keyword: keywordstudents,
team_id: team_idstudents,
student_ids: student_ids,
};
let url = `/competitions/${"gcc-course-2019"}/students.json`;
let url = `/competitions/${this.props.match.params.identifier}/students.json`;
axios.get((url), {params: datas}).then((result) => {
if (result) {
if (result.data) {
//console.log(result);
// ////console.log(result);
this.setState({
member_ids: result.data.teachers
})
@ -235,14 +295,14 @@ class PersonModal extends Component {
}
}
}).catch((error) => {
//console.log(error);
// ////console.log(error);
})
};
//老师输入框事件
teacheronChange = (e) => {
//console.log(e.target.value);
//console.log("老师输入框事件|||||||||||123123123");
// ////console.log(e.target.value);
// ////console.log("老师输入框事件|||||||||||123123123");
this.setState({
keywordteachers: e.target.value,
booltech: false,
@ -280,8 +340,8 @@ class PersonModal extends Component {
//学生输入框事件
studentsonChange = (e) => {
//console.log("学生输入框事件");
//console.log(e);
// ////console.log("学生输入框事件");
// ////console.log(e);
this.setState({
keywordstudents: e.target.value,
boolstud: false,
@ -331,9 +391,9 @@ class PersonModal extends Component {
};
var fordabool = false;
var forda = this.state.mydatas;
//console.log("点击获取老师数据");
//console.log(object);
//console.log(forda);
// ////console.log("点击获取老师数据");
// ////console.log(object);
// ////console.log(forda);
for (var i = 0; i < forda.length; i++) {
if (forda[i].id) {
if (forda[i].id === object.id) {
@ -372,14 +432,14 @@ class PersonModal extends Component {
};
var fordabool = false;
var forda = this.state.mydatas;
//console.log("点击获取学生数据2");
//console.log(object);
//console.log(forda);
// ////console.log("点击获取学生数据2");
// ////console.log(object);
// ////console.log(forda);
for (var i = 0; i < forda.length; i++) {
if (forda[i].id) {
// //console.log(true);
// //console.log(forda[i].id);
// //console.log(object.id);
// // ////console.log(true);
// // ////console.log(forda[i].id);
// // ////console.log(object.id);
if (forda[i].id === object.id) {
fordabool = true;
break
@ -407,7 +467,7 @@ class PersonModal extends Component {
}
//输入框事件
changeTopicName = (e) => {
// //console.log("调用了changeTopicName");
// // ////console.log("调用了changeTopicName");
let num = parseInt(e.target.value.length);
if (num > 60) {
return;
@ -422,7 +482,7 @@ class PersonModal extends Component {
//onSearchsou
onSearch = (value) => {
//console.log("搜索的数据" + value);
// ////console.log("搜索的数据" + value);
};
handleInfiniteOnLoad = () => {
// this.setState({
@ -442,12 +502,12 @@ class PersonModal extends Component {
}
handleInfiniteOnLoad1 = () => {
// //console.log("调用了方法1111");
// // ////console.log("调用了方法1111");
// this.setState({
// loading1: true,
// })
// setTimeout(() => {
// //console.log("调用了方法11112");
// // ////console.log("调用了方法11112");
// this.setState({
// loading1: false,
// hasMore: true,
@ -456,13 +516,13 @@ class PersonModal extends Component {
}
handleInfiniteOnLoad2 = () => {
// //console.log("调用了方法1111");
// // ////console.log("调用了方法1111");
// this.setState({
// loading2: true,
//
// })
// setTimeout(() => {
// //console.log("调用了方法11113");
// // ////console.log("调用了方法11113");
// this.setState({
// hasMore: true,
// loading2: false,
@ -471,23 +531,23 @@ class PersonModal extends Component {
}
inputOnBlur = (e) => {
//console.log("inputOnBlur");
//console.log(e);
// ////console.log("inputOnBlur");
// ////console.log(e);
this.setState({
person1: false
})
}
inputOnBlur2 = (e) => {
//console.log("inputOnBlur");
//console.log(e);
// ////console.log("inputOnBlur");
// ////console.log(e);
this.setState({
person2: false
})
}
startSearch = (e) => {
//console.log("startSearch");
//console.log(e);
// ////console.log("startSearch");
// ////console.log(e);
this.setState({
person1: true,
person2: false,
@ -497,8 +557,8 @@ class PersonModal extends Component {
}
startSearch2 = (e) => {
//console.log("startSearch2");
//console.log(e);
// ////console.log("startSearch2");
// ////console.log(e);
this.setState({
person1: false,
person2: true,
@ -508,8 +568,8 @@ class PersonModal extends Component {
}
inputOnFocus = (e) => {
//console.log("inputOnFocus");
//console.log(e);
// ////console.log("inputOnFocus");
// ////console.log(e);
try {
if (this.state.keywordteachers && this.state.keywordteachers.length > 0) {
this.setState({
@ -533,8 +593,8 @@ class PersonModal extends Component {
}
inputOnFocus2 = (e) => {
//console.log("inputOnFocus2");
//console.log(e);
// ////console.log("inputOnFocus2");
// ////console.log(e);
try {
if (this.state.keywordstudents && this.state.keywordstudents.length > 0) {
this.setState({
@ -559,8 +619,8 @@ class PersonModal extends Component {
}
inputOnFocus3 = (e) => {
//console.log("inputOnFocus3");
//console.log(e);
// ////console.log("inputOnFocus3");
// ////console.log(e);
this.setState({
person2: false,
person1: false,
@ -570,13 +630,13 @@ class PersonModal extends Component {
var {mydatas} = this.state;
if (item) {
var pos = mydatas.indexOf(item);
// console.log("deletedata");
// console.log(pos);
// ////console.log("deletedata");
// ////console.log(pos);
var removedItem = mydatas.splice(pos, 1);
// console.log("deletedata22222");
// console.log(removedItem)
// ////console.log("deletedata22222");
// ////console.log(removedItem)
//removedItem 是被删除的元素
// console.log(mydatas)
// ////console.log(mydatas)
this.setState({
mydatas: mydatas,
})
@ -610,11 +670,21 @@ class PersonModal extends Component {
textAlign: "center",
}}
>{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}</p>
<p className=" reglistviewdivss4p"
style={{
textAlign: "center",
}}
>{item.type === undefined || item.type === null || item.type === "" ? "--" : item.type}</p>
{
index === 0 ?
<p className=" reglistviewdivss4p"
style={{
textAlign: "center",
}}
>创建者</p>
:
<p className=" reglistviewdivss4p"
style={{
textAlign: "center",
}}
>{item.type === undefined || item.type === null || item.type === "" ? "--" : item.type}</p>
}
<p className=" reglistviewdivss5p"
style={{
textAlign: "center",
@ -625,12 +695,20 @@ class PersonModal extends Component {
textAlign: "center",
}}
>{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}</p>
<p className=" reglistviewdivss33p"
style={{
textAlign: "center",
}}
>{item.type && item.type === "创建者" ? "" :
<i className="iconfont icon-guanbi font-12" onClick={() => this.deletedata(item)}/>}</p>
{
index === 0 ?
<p className=" reglistviewdivss33p"
style={{
textAlign: "center",
}}
></p>
:
<p className=" reglistviewdivss33p"
style={{
textAlign: "center",
}}
><i className="iconfont icon-guanbi font-12" onClick={() => this.deletedata(item)}/></p>
}
</div>
);
var cpersondiv1Items = [];
@ -764,6 +842,8 @@ class PersonModal extends Component {
</Spin>
</div>
);
//console.log("PersonModal");
//console.log(this.props);
return (
<Modal
@ -780,7 +860,7 @@ class PersonModal extends Component {
<style>
{
`
.reglistviewdivss2 a:hover
a:hover
{
background-color:#F6F4F4;
}
@ -841,6 +921,7 @@ class PersonModal extends Component {
</p>
<Input className="yslzxueshiskmc" onInput={this.changeTopicName} onFocus={this.inputOnFocus3}
value={this.state.polls_nametest}
placeholder="请输入您的战队名称最多不超过60个字符"
addonAfter={String(addonAfter) + "/60"} maxLength={60}/>

@ -9,7 +9,6 @@ import moment from 'moment';
import competition from './comcss/competition.css';
import {Checkbox, Table, Pagination, Menu, Icon} from "antd";
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
import Rectanglex from "../../modules/competition/Rectanglex.png";
class PersonModaltion extends React.Component {
constructor(props) {

@ -20,7 +20,7 @@ class PersonalModalteam extends Component {
Tmoconfirmto = () => {
let url = `/competitions/${"gcc-course-2019"}/competition_teams/join.json`;
let url = `/competitions/${this.props.match.params.identifier}/competition_teams/join.json`;
axios.post(url, {
invite_code: this.state.yslzxueshiskmcdm1
}).then((result) => {

@ -58,7 +58,7 @@ class PersonalCompetit extends React.Component {
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>132</span></p>
<p>参赛总人数<span style={{color: "#459BE5"}}>132</span><span style={{marginLeft: "5px"}}></span></p>
</div>
: ""}

@ -9,8 +9,18 @@ import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css';
import {Button} from 'antd';
import {Button, message} from 'antd';
// 点击按钮复制功能
function jsCopy() {
var e = document.getElementById("copy_invite_code");
e.select();
document.execCommand("Copy");
codesuccess()
}
function codesuccess() {
message.success('复制成功');
};
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class PersonalCompetititem extends React.Component {
constructor(props) {
@ -22,7 +32,7 @@ class PersonalCompetititem extends React.Component {
}
componentDidMount() {
// //console.log(this.props.data)
// // ////console.log(this.props.data)
this.setState({
data: this.props.data,
})
@ -37,21 +47,24 @@ class PersonalCompetititem extends React.Component {
}
render() {
const {data} = this.state;
//console.log("PersonalCompetititem");
//console.log(data);
//console.log(data[0]);
//console.log(data&&data[0].creator.image_url);
const {data} = this.props;
// ////console.log("PersonalCompetititem");
// ////console.log(data);
// ////console.log(data[0]);
// ////console.log(data&&data[0].creator.image_url);
// const listItems = mydatas.map((item, index) =>
//
// );
// console.log("PersonalCompetititem");
// console.log(data);
return (
<div>
{
data && data[0] ? <div className="regitem">
<div className="regitemimg1 " style={{
marginBottom: "16px",
data && data[0] ? <div className={"yslborderbottom"}>
<div className="regitem" style={{
marginBottom: "19px",
}}>
<div className="regitemimg1 ">
<img className="regitemimg2" src={getImageUrl("images/" + data[0].creator.image_url)}>
</img>
@ -61,7 +74,7 @@ class PersonalCompetititem extends React.Component {
width: "78px",
textAlign: "center"
}}>{data && data[0].name}</p>
}}>{data[0].creator.name}</p>
</div>
<div className=" " style={{
marginTop: "29px",
@ -73,7 +86,7 @@ class PersonalCompetititem extends React.Component {
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>{data && data[0].school_name}</p>
}}>{data[0].name}</p>
</div>
<div className=" " style={{
marginLeft: "37px",
@ -90,30 +103,33 @@ class PersonalCompetititem extends React.Component {
</img>
: index === 1 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
</img>
: index === 2 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
</img>
: index === 3 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
</img>
: index === 4 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
</div>
:
<div className="regitemimgs22" src={getImageUrl("images/" + item.image_url)}>
<img className="regitemimgs22"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})
}
@ -122,19 +138,46 @@ class PersonalCompetititem extends React.Component {
<div className=" " style={{
marginLeft: "37px",
}}>
<p style={{
marginTop: "30px",
<div style={{marginTop: "23px",}}>
<span style={{
color: "#05101A",
fontSize: "16px",
}}>邀请码</span>
<span
style={{
color: "#05101A",
fontSize: "16px",
}}>邀请码yngh5</p>
}}>{data[0].invite_code === null || data[0].invite_code === undefined ? "" : data[0].invite_code}</span>
</div>
<div style={{
overflow: 'hidden',
height: "0px",
width: "0px"
}}>
<input id="copy_invite_code"
value={data[0].invite_code === null || data[0].invite_code === undefined ? "" : data[0].invite_code}/>
</div>
</div>
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
>
</i>
{data[0].invite_code === null || data[0].invite_code === undefined ?
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
>
</i>
:
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
onClick={() => {
jsCopy()
}}
>
</i>
}
{
this.props.type === 5 ?
<div className="regitemimgs4"
@ -142,25 +185,30 @@ class PersonalCompetititem extends React.Component {
marginLeft: "32px",
}}
>
<div className="regitemimgs5">
<p>删除战队</p>
<div className="regitemimgs5" onClick={() => this.props.Exittheteamshow(data[0].id, true)}>
<p onClick={() => this.props.Exittheteamshow(data[0].id, true)}>删除战队</p>
</div>
<div className="regitemimgs6">
<p>编辑战队</p>
<div className="regitemimgs6" onClick={() => this.props.Createateamedit(data[0])}>
<p onClick={() => this.props.Createateamedit(data[0])}>编辑战队</p>
</div>
</div>
: this.props.type === 2 ?
<div className="regitemimgs4"
<div className="regitemimgs4 "
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs5">
<p>战队详情</p>
<a href={`/newcompetitions/${"gcc-course-2019"}/competition_teams/${data[0].id}`} style={{
color: "#459be5",
width: "100%",
height: "100%",
lineHeight: "39px",
}}>战队详情</a>
</div>
<div className="regitemimgs6">
<p>退出战队</p>
<div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(data[0].id, false)}>
<p onClick={() => this.props.Exittheteamshow(data[0].id, false)}>退出战队</p>
</div>
</div>
@ -172,8 +220,8 @@ class PersonalCompetititem extends React.Component {
}}
>
<div className="regitemimgs6">
<p>退出战队</p>
<div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(data[0].id, false)}>
<p onClick={() => this.props.Exittheteamshow(data[0].id, false)}>退出战队</p>
</div>
</div>
@ -182,6 +230,7 @@ class PersonalCompetititem extends React.Component {
}
</div>
</div>
: ""
}
</div>

@ -1,14 +1,10 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd';
import {getImageUrl} from 'educoder';
import axios from 'axios';
import './Competitionsindex.css';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import groups1 from './groups1.png';
import groups2 from './groups2.png';
import groups3 from './groups3.png';
import NoneData from "../../courses/coursesPublic/NoneData";
const { SubMenu } = Menu;
@ -42,7 +38,7 @@ class CompetitionsIndex extends Component{
axios.get(Url,{params:{
category:category,
page:page,
per_page:6,
per_page:15,
}
}).then((response) => {
if(response.status===200){
@ -66,17 +62,45 @@ class CompetitionsIndex extends Component{
this.getdata(e.key,page)
};
render() {
let {datas,page,count}=this.state;
setcompetitonurl=(url)=>{
if(url!=null){
this.props.history.replace(url);
}
}
PaginationCourse=(pageNumber)=>{
let {category}=this.state;
this.setState({
page: pageNumber,
})
this.getdata(category,pageNumber);
}
render() {
let {datas,page,count}=this.state;
admin: true
business: false
console.log(this.props.current_user&&this.props.current_user.business)
return (
<div>
<div className="clearfix">
<div>
<div className="newMain clearfix">
<div className="courses-head pr">
<style>
{
`
.courses-head{
width: 100%;
height: 300px;
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
`
}
</style>
<div className="courses-head pr" style={{"background":`url(${getImageUrl(`images/educoder/competitions/courses.jpg`)})`}}>
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav"></div>
</div>
@ -102,28 +126,13 @@ class CompetitionsIndex extends Component{
</div>
<div className={"educontent clearfix mtf10 CompetitionsIndex "}>
<style>
{
`
.CompetitionsList{
position: relative;
max-height: 210px;
}
.competitonimg{
position: absolute;
right: -5px;
width: 80px;
top: 20px;
}
`
}
</style>
<List
{datas===undefined?"":datas.length===0?"":<List
itemLayout="vertical"
size="large"
dataSource={datas&&datas}
renderItem={(item,key) => (
<Link to={`/newcompetitions/${item.identifier}/common_header`}>
<div>
<div className={"CompetitionsList"} >
{item.description===null||item.description===undefined||item.description===""?<style>
{
@ -135,7 +144,7 @@ class CompetitionsIndex extends Component{
}
</style>:""}
<img className={"competitonimg"}
src={item.nearly_published===true?groups2:item.published===true?groups2:groups1} />
src={item.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):item.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):item.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
<List.Item
key={key}
actions={[
@ -161,17 +170,21 @@ class CompetitionsIndex extends Component{
<div className="gutter-box CompetitionsIndexbottomvalue">¥{item.bonus}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">{item.visits_count}</div>
<div className="gutter-box CompetitionsIndexbottomvalue">{item.competition_status==="nearly_published"?"--":item.visits_count}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">{item.member_count}</div>
<div className="gutter-box CompetitionsIndexbottomvalue">{item.competition_status==="nearly_published"?"--":item.member_count}</div>
</Col>
</Row>
</div>
}
>
<List.Item.Meta
title={<a><span className={"competitionstitles"}>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
title={<a className={item.competition_status==="ended"?"endedfont":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.business===true?"":this.props.current_user&&this.props.current_user.admin===true?"":"endedfont":""}>
<span className={"competitionstitles"}
onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?null:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)}
>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
item.sub_title
}</Tag>}</span>
</a>}
@ -179,20 +192,20 @@ class CompetitionsIndex extends Component{
{item.description}
</List.Item>
</div>
</Link>
</div>
)
}
/>
/>}
{datas===undefined?'none':datas.task_count >6 ?<div className="mb40 edu-txt-center padding20-30"
{datas===undefined?'none':datas.task_count >20 ?<div className="mb40 edu-txt-center padding20-30"
>
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={6}
pageSize={20}
total={count===undefined?"":count}
current={page}
onChange={this.PaginationCourse}

@ -1,13 +1,4 @@
.teamsLayout{background: transparent !important;}
.courses-head{
width: 100%;
height: 300px;
background-image: url(./courses.jpg);
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.competitionstitle{
height:50px !important;
@ -23,7 +14,16 @@
background: #fff;
width: 1200px;
}
.CompetitionsList{
position: relative;
max-height: 210px;
}
.competitonimg{
position: absolute;
right: -5px;
width: 80px;
top: 20px;
}
.ant-menu-horizontal {
border-bottom:none !important;
@ -113,4 +113,18 @@
box-shadow:3px 4px 10px 2px rgba(229,229,229,0.5);
opacity: 1;
border-radius: 2px;
}
.endedfont{
color:#000 !important;
}
.zhezhaos{
height: 200px;
overflow: hidden;
position: relative;
border: 1px solid rgb(235, 237, 240);
border-radius: 2px;
padding: 48px;
text-align: center;
background: rgb(250, 250, 250);
}

@ -63,6 +63,7 @@
padding: 20px;
background:rgba(255,255,255,1);
box-shadow:3px 2px 12px 2px rgba(0,0,0,0.05);
position: relative;
}
.CompetitionCommonbannerfont{
@ -92,11 +93,7 @@
color:#05101A;
}
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(4),.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(4) button{
height: 50px;
background: rgba(76,172,255,1);
border-radius: 4px;
}
.Competitioncolor9b{
color: #9B9B9B;
@ -143,6 +140,7 @@
height: 30px;
line-height: 30px;
background:none;
color:#666;
}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
@ -173,4 +171,46 @@
.teamsLayoutleft{
background: transparent !important;
}
.Competitioncharts{
font-size: 24px;
color: rgba(5,16,26,1);
}
.Competitionfirst{
width:233px;
height:298px;
background:rgba(250,250,250,1);
box-shadow:0px 2px 8px 2px rgba(255,134,34,0.5);
border-radius:5px;
}
.Competitionsecondary{
width:234px;
height:277px;
background:rgba(250,250,250,1);
box-shadow:0px 3px 5px 0px rgba(254,190,154,1);
border-radius:5px;
}
.Competitionthird{
width: 234px;
height: 270px;
background: rgba(250,250,250,1);
box-shadow: 0px 4px 5px 0px rgba(200,200,202,1);
border-radius: 5px;
}
.Competition399{
height:399px;
}
.Competitiontransparent table{
background: transparent;
}
.Commonimg{
position: absolute;
right: -5px;
width:93px;
top: 20px;
}

@ -1,7 +1,10 @@
import React, { Component } from 'react';
import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon} from 'antd';
import { Link } from 'react-router-dom';
import axios from 'axios';
import {markdownToHTML} from 'educoder';
import {markdownToHTML,getImageUrl} from 'educoder';
import CompetitionContents from './CompetitionContents';
import CompetitionContentsChart from './CompetitionContentsChart';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import './CompetitionCommon.css';
@ -12,13 +15,24 @@ class CompetitionCommon extends Component{
constructor(props) {
super(props)
this.state={
data:undefined
data:undefined,
bannerdata:undefined
}
}
componentDidMount(){
window.document.title = '竞赛';
this.getbannerdata()
this.getbannerdata();
let url=`/competitions/${this.props.match.params.identifier}.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
bannerdata:response.data
})
}
}).catch((error) => {
console.log(error)
})
}
getbannerdata=()=>{
@ -35,21 +49,29 @@ class CompetitionCommon extends Component{
}
getrightdata=(id,typeid)=>{
debugger
}
render() {
let {data}=this.state;
console.log(data)
let {data,bannerdata}=this.state;
// console.log(bannerdata)
return (
data===undefined?"":<div className={"educontent clearfix mt20 "}>
<Breadcrumb separator=">">
<Breadcrumb.Item href="">在线竞赛</Breadcrumb.Item>
<Breadcrumb.Item href="">全国高校计算机大赛</Breadcrumb.Item>
<Breadcrumb.Item href="">{data&&data.name}</Breadcrumb.Item>
</Breadcrumb>
<div className={"mt10"}>
<Row className={"CompetitionCommonbanner"}>
<Col span={15}>banner</Col>
<Col className={"CompetitionCommonbannerfont"} span={9}>
<img className={"Commonimg"}
src={data.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):data.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):data.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
<Col span={15}>
<img src={getImageUrl(bannerdata&&bannerdata.image_url)}/>
</Col>
<Col className={"CompetitionCommonbannerfont mt50"} span={9}>
<Col className={"competitionbannerdiv"}>{data&&data.name}</Col>
@ -76,20 +98,44 @@ class CompetitionCommon extends Component{
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">¥{data&&data.bonus}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data&&data.visits_count}</div>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status==="nearly_published"?"--":data&&data.visits_count}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data&&data.member_count}</div>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status==="nearly_published"?"--":data&&data.member_count}</div>
</Col>
</Row>
</Col>
{data.competition_status==="ended"?<style>
{
`
.Competitionfontsize22{
height: 50px;
border-radius: 4px;
}
`
}
</style>:<style>
{
`
.Competitionfontsize22{
height: 50px;
background: rgba(76,172,255,1);
border-radius: 4px;
}
`
}
</style>}
<Col className={"competitionbannerdiv mt20"}>
{data.competition_status==="ended"?
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
已结束
</Button>:
<Button type="primary" block className={"Competitionfontsize22"}>
立即报名
</Button>
<Link to={`/newcompetitions/${this.props.match.params.identifier}/enroll`}>立即报名</Link>
</Button>}
</Col>
<Col className={"mt10 Competitionfontsize16"}>{data&&data.enroll_end_time===null?"":"报名截止时间:"+data&&data.enroll_end_time}</Col>
<Col className={"mt10 Competitionfontsize16"}>{data&&data.enroll_end_time===null?"":`报名截止时间:${data&&data.enroll_end_time}`}</Col>
</Col>
</Row>
</div>
@ -101,7 +147,11 @@ class CompetitionCommon extends Component{
{data&&data.competition_modules.map((item,key)=>{
return(
<Menu.Item key={item.position}>
<span>{item.name}</span>
{item.has_url===false?<span onClick={()=>this.getrightdata(item.id,item.module_type)}>{item.name}</span>:<a
// target="_blank"
href={item.module_url}
// onClick={()=>this.getrightdata(item.id,item.module_type)}
>{item.name}</a>}
</Menu.Item>
)
})}
@ -110,10 +160,8 @@ class CompetitionCommon extends Component{
</Sider>
<Layout className={"teamsLayoutleft"}>
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("").replace(/▁/g, "▁▁▁")}}>
</Content>
<CompetitionContents/>
<CompetitionContentsChart/>
</Layout>
</Layout>

@ -0,0 +1,38 @@
import React, { Component } from 'react';
import {Button,Layout} from 'antd';
import axios from 'axios';
import {markdownToHTML,getImageUrl} from 'educoder';
import NoneData from "../../courses/shixunHomework/shixunHomework";
const { Header, Footer, Sider, Content } = Layout;
class CompetitionContents extends Component{
constructor(props) {
super(props)
this.state={
}
}
componentDidMount(){
window.document.title = '竞赛';
}
render() {
return (
<div className={"fr"}>
<Button className={"fr"} type="primary" ghost>
编辑
</Button>
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("").replace(/▁/g, "▁▁▁")}}>
</Content>
</div>
)
}
}
export default CompetitionContents;

@ -0,0 +1,189 @@
import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table} from 'antd';
import axios from 'axios';
import {markdownToHTML,getImageUrl} from 'educoder';
import NoneData from "../../courses/shixunHomework/shixunHomework";
const { Header, Footer, Sider, Content } = Layout;
const { TabPane } = Tabs;
const { Meta } = Card;
class CompetitionContents extends Component{
constructor(props) {
super(props)
this.state={
}
}
componentDidMount(){
window.document.title = '竞赛';
}
render() {
const operations = <Icon type="form" />;
const columns = [
{
title: 'Name',
dataIndex: 'name',
key: 'name',
render: text => <a>{text}</a>,
},
{
title: 'Age',
dataIndex: 'age',
key: 'age',
},
{
title: 'Address',
dataIndex: 'address',
key: 'address',
},
{
title: 'Tags',
key: 'tags',
dataIndex: 'tags',
render: tags => (
<span>
123123
</span>
),
},
{
title: 'Action',
key: 'action',
render: (text, record) => (
<span>
<a>Invite {record.name}</a>
<a>Delete</a>
</span>
),
},
{
title: 'Values',
key: 'values',
dataIndex: 'values',
render: tags => (
<span>
123123
</span>
),
},
];
const data = [
{
key: '1',
name: 'John Brown',
age: 32,
address: 'New York No. 1 Lake Park',
tags: ['nice', 'developer'],
values:123
},
{
key: '2',
name: 'Jim Green',
age: 42,
address: 'London No. 1 Lake Park',
tags: ['loser'],
values:123
},
{
key: '3',
name: 'Joe Black',
age: 32,
address: 'Sidney No. 1 Lake Park',
tags: ['cool', 'teacher'],
values:123
},
];
return (
<div>
<Tabs tabBarExtraContent={operations}>
<TabPane tab="总排行榜" key="1">
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("Content of tab 1").replace(/▁/g, "▁▁▁")}}>
</Content>
</TabPane>
<TabPane tab="决赛排行榜" key="2">
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("Content of tab 2").replace(/▁/g, "▁▁▁")}}>
</Content>
</TabPane>
<TabPane tab="预赛排行榜" key="3">
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("Content of tab 3").replace(/▁/g, "▁▁▁")}}>
</Content>
</TabPane>
</Tabs>
<Col className="gutter-row Competitioncharts mt30 mb30">
总排名
</Col>
<Row calssName={"Competition399"}>
<Col className="mt40" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 2 }}>
<Card
className={"Competitionthird"}
cover={
<img
alt="example"
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
/>
}
>
<Meta
title="Card title"
description="This is the description"
/>
</Card>
</Col>
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Card
className={"Competitionfirst"}
cover={
<img
alt="example"
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
/>
}
>
<Meta
title="Card title"
description="This is the description"
/>
</Card>
</Col>
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Card
className={"Competitionsecondary"}
cover={
<img
alt="example"
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
/>
}
>
<Meta
title="Card title"
description="This is the description"
/>
</Card>
</Col>
</Row>
<Row className={"mt80 mb80"}>
<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>
</Row>
</div>
)
}
}
export default CompetitionContents;

@ -29,6 +29,11 @@ const CompetitionTeams = Loadable({
loading: Loading,
})
//团队竞赛报名
const Registration = Loadable({
loader: () => import('../competition/Registration'),
loading: Loading,
});
class Competitions extends Component {
constructor(props) {
@ -36,6 +41,8 @@ class Competitions extends Component {
}
componentDidMount(){
console.log("Competitions竞赛");
console.log(this.props);
window.document.title = '竞赛';
}
@ -53,6 +60,15 @@ class Competitions extends Component {
}
></Route>
{/*新版竞赛报名*/}
<Route
path="/newcompetitions/:identifier/enroll"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>)
}
/>
{/*新版竞赛详情页面*/}
<Route path="/newcompetitions/:identifier/common_header"
render={

Loading…
Cancel
Save