Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_sync_trustie
cxt 5 years ago
commit 6f580e6634

@ -11,6 +11,7 @@
//= require select2
//= require jquery.cxselect
//= require bootstrap-datepicker
//= require bootstrap-datetimepicker
//= require bootstrap.viewer
//= require jquery.mloading
//= require jquery-confirm.min

@ -116,11 +116,13 @@ class Competitions::CompetitionTeamsController < Competitions::BaseController
keyword = params[:keyword].to_s.strip
if keyword.present?
teams = teams.joins(users: { user_extension: :school }).where('schools.name LIKE ?', "%#{keyword}%")
teams = teams.joins(users: { user_extension: :school })
.where('competition_teams.name LIKE :keyword OR schools.name LIKE :keyword', keyword: "%#{keyword}%")
end
@all_count = teams.count
@all_teams = paginate(teams.includes(:user, users: { user_extension: :school }))
@all_member_count = current_competition.team_members.count
end
def user_competition_teams

@ -0,0 +1,51 @@
class Weapps::VerificationCodesController < Weapps::BaseController
before_action :require_wechat_login!
def create
params[:type] == 'register' ? check_can_register : check_can_reset_password
end
private
def check_can_register
login = params[:login].to_s.strip
if login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
user = User.find_by(mail: login)
return render_error('该邮箱已注册') if user.present?
elsif login =~ /^1\d{10}$/
user = User.find_by(phone: params[:login])
return render_error('该手机号已注册') if user.present?
else
return render_error('请输入正确的邮箱或手机号')
end
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 1 : 8
# 记录验证码
check_verification_code(verification_code, send_type, login)
render_ok
end
def check_can_reset_password
login = params[:login].to_s.strip
if login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
user = User.find_by(mail: login)
return render_error('该邮箱尚未注册') if user.blank?
elsif login =~ /^1\d{10}$/
user = User.find_by(phone: login)
return render_error('该手机号尚未注册') if user.blank?
else
return render_error('请输入正确的邮箱或手机号')
end
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 2 : 3
# 记录验证码
check_verification_code(verification_code, send_type, login)
render_ok
end
end

@ -1,2 +1,3 @@
class WeappSettings::Advert < WeappSetting
default_scope { order(position: :asc) }
end

@ -9,22 +9,22 @@ class Admins::DragWeappAdvertService < ApplicationService
def call
return if move.position + 1 == after&.position # 未移动
carousels = WeappSettings::Advert.all
adverts = WeappSettings::Advert.all
ActiveRecord::Base.transaction do
if after.blank? || move.id == after.id # 移动至末尾
total = carousels.count
total = adverts.count
carousels.where('position > ?', move.position).update_all('position = position - 1')
adverts.where('position > ?', move.position).update_all('position = position - 1')
move.update!(position: total)
return
end
if move.position > after.position # 前移
carousels.where('position >= ? AND position < ?', after.position, move.position).update_all('position = position + 1')
adverts.where('position >= ? AND position < ?', after.position, move.position).update_all('position = position + 1')
move.update!(position: after.position)
else # 后移
carousels.where('position > ? AND position < ?', move.position, after.position).update_all('position = position - 1')
adverts.where('position > ? AND position < ?', move.position, after.position).update_all('position = position - 1')
move.update!(position: after.position - 1)
end
end

@ -5,11 +5,12 @@
<th width="16%">邮件地址</th>
<th width="10%">手机号码</th>
<th width="14%">单位</th>
<th width="8%">角色</th>
<th width="10%"><%= sort_tag('创建于', name: 'created_on', path: admins_users_path) %></th>
<th width="10%"><%= sort_tag('最后登录', name: 'last_login_on', path: admins_users_path) %></th>
<th width="6%"><%= sort_tag('经验值', name: 'experience', path: admins_users_path) %></th>
<th width="6%"><%= sort_tag('金币', name: 'grade', path: admins_users_path) %></th>
<th width="20%">操作</th>
<th width="12%">操作</th>
</tr>
</thead>
<tbody>
@ -24,6 +25,7 @@
<td><%= overflow_hidden_span display_text(user.mail), width: 150 %></td>
<td><%= overflow_hidden_span display_text(user.phone), width: 100 %></td>
<td><%= overflow_hidden_span display_text(user.school_name), width: 150 %></td>
<td><%= user.identity %></td>
<td><%= display_text(user.created_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= display_text(user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= user.experience.to_i %></td>

@ -1,4 +1,5 @@
json.count @all_count
json.members_count @all_member_count
json.personal @personal
json.competition_name @competition.name
json.competition_teams do

@ -852,6 +852,7 @@ Rails.application.routes.draw do
resource :home, only: [:show]
resource :session, only: [:create]
resource :register, only: [:create]
resource :verification_code, only: [:create]
resource :code_session, only: [:create]
resource :verify, only: [:create]
resource :check_account, only: [:create]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -25131,118 +25131,145 @@ input.form-control {
flex: 1;
}
/* line 32, app/assets/stylesheets/common.scss */
.fl {
float: left;
}
/* line 33, app/assets/stylesheets/common.scss */
.no_padding {
padding: 0px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
.font-12 {
font-size: 12px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
/* line 35, app/assets/stylesheets/common.scss */
.font-14 {
font-size: 14px !important;
}
/* line 35, app/assets/stylesheets/common.scss */
/* line 36, app/assets/stylesheets/common.scss */
.font-16 {
font-size: 16px !important;
}
/* line 36, app/assets/stylesheets/common.scss */
/* line 37, app/assets/stylesheets/common.scss */
.font-18 {
font-size: 18px !important;
}
/* line 37, app/assets/stylesheets/common.scss */
/* line 38, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 39, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 50, app/assets/stylesheets/common.scss */
/* line 51, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.color-orange {
color: #ff6800;
}
/* line 53, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 52, app/assets/stylesheets/common.scss */
/* line 54, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 53, app/assets/stylesheets/common.scss */
/* line 55, app/assets/stylesheets/common.scss */
.show {
display: block;
}
/* line 57, app/assets/stylesheets/common.scss */
.input_small {
-webkit-box-flex: 0 !important;
flex: 0 0 6% !important;
}
/* line 58, app/assets/stylesheets/common.scss */
.input_middle {
-webkit-box-flex: 0 !important;
flex: 0 0 13% !important;
}
/* line 2, app/assets/stylesheets/admins/auth_schools.scss */
.admins-auth-schools-index-page .list-item-title {
padding-bottom: 5px;
@ -25590,7 +25617,68 @@ input.form-control {
/* line 38, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .setBtn_s {
height: 35px;
line-height: 5px;
line-height: 20px;
}
/* line 43, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .sponsor_label {
border: 1px solid #4CACFF;
border-radius: 5px;
background-color: rgba(76, 172, 255, 0.3);
color: #333;
padding: 0px 4px;
height: 30px;
line-height: 30px;
float: left;
margin: 4px 5px;
}
/* line 54, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .sponsor_label span {
display: block;
float: left;
height: 28px;
line-height: 28px;
margin-right: 5px;
}
/* line 62, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .sponsor_label a {
font-size: 18px;
float: left;
height: 28px;
line-height: 28px;
}
/* line 70, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel {
padding: 0px 15px;
}
/* line 73, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .large_panel_part {
border-top: 1px solid #eaeaea;
}
/* line 76, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .large_panel_part:first-child {
border: none;
}
/* line 80, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .large_panel_part > .row, .admins-competition-settings-index-page .large_panel .small_panel > .row {
border-bottom: 1px solid #eaeaea;
padding: 20px 0px;
}
/* line 84, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .small_panel {
margin-left: 20px;
}
/* line 87, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .row:last-child {
border: none;
}
/* line 4, app/assets/stylesheets/admins/cooperatives.scss */

@ -136155,6 +136155,19 @@ $(document).on('turbolinks:load', function(){
}
});
//添加主办方或者开放范围
function addSponsor(item){
var html='<div class="sponsor_label">\n' +
' <input type="hidden" value="school_id" />\n' +
' <span>caicai</span>\n' +
' <a href="javascript:void(0)" onclick="del_sponsor(this)">×</a>\n' +
' </div>';
$(item).parents(".sponsorPanel").append(html);
}
//删除
function del_sponsor(item){
$(item).parents(".sponsor_label").remove();
}
$(function () {
//MD编辑
@ -136297,7 +136310,8 @@ $(function () {
}
})
})
});
//新增子阶段
function add_task_sub(item){
var index = $(item).parents(".large_panel_part").attr("attr_line");
@ -136403,7 +136417,7 @@ function Del_tab(item) {
$(item).parents(".large_panel_part").remove();
}
//新增tab
function addNewTab() {
function addNewTab() {
var count = parseInt($("#large_panel").find(".large_panel_part").length)+1;
var html = '<div class="large_panel_part" attr_line="'+count+'"><div class="row d-flex mt-3">\n' +
' <span class="col-1 mt-2">tab标题</span>\n' +

@ -15767,118 +15767,145 @@ input.form-control {
flex: 1;
}
/* line 32, app/assets/stylesheets/common.scss */
.fl {
float: left;
}
/* line 33, app/assets/stylesheets/common.scss */
.no_padding {
padding: 0px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
.font-12 {
font-size: 12px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
/* line 35, app/assets/stylesheets/common.scss */
.font-14 {
font-size: 14px !important;
}
/* line 35, app/assets/stylesheets/common.scss */
/* line 36, app/assets/stylesheets/common.scss */
.font-16 {
font-size: 16px !important;
}
/* line 36, app/assets/stylesheets/common.scss */
/* line 37, app/assets/stylesheets/common.scss */
.font-18 {
font-size: 18px !important;
}
/* line 37, app/assets/stylesheets/common.scss */
/* line 38, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 39, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 50, app/assets/stylesheets/common.scss */
/* line 51, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.color-orange {
color: #ff6800;
}
/* line 53, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 52, app/assets/stylesheets/common.scss */
/* line 54, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 53, app/assets/stylesheets/common.scss */
/* line 55, app/assets/stylesheets/common.scss */
.show {
display: block;
}
/* line 57, app/assets/stylesheets/common.scss */
.input_small {
-webkit-box-flex: 0 !important;
flex: 0 0 6% !important;
}
/* line 58, app/assets/stylesheets/common.scss */
.input_middle {
-webkit-box-flex: 0 !important;
flex: 0 0 13% !important;
}
/* line 3, app/assets/stylesheets/colleges/statistic.scss */
.colleges-statistics-page .college-body-container .statistic-header {
width: 100%;

@ -24775,118 +24775,145 @@ input.form-control {
flex: 1;
}
/* line 32, app/assets/stylesheets/common.scss */
.fl {
float: left;
}
/* line 33, app/assets/stylesheets/common.scss */
.no_padding {
padding: 0px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
.font-12 {
font-size: 12px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
/* line 35, app/assets/stylesheets/common.scss */
.font-14 {
font-size: 14px !important;
}
/* line 35, app/assets/stylesheets/common.scss */
/* line 36, app/assets/stylesheets/common.scss */
.font-16 {
font-size: 16px !important;
}
/* line 36, app/assets/stylesheets/common.scss */
/* line 37, app/assets/stylesheets/common.scss */
.font-18 {
font-size: 18px !important;
}
/* line 37, app/assets/stylesheets/common.scss */
/* line 38, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 39, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 50, app/assets/stylesheets/common.scss */
/* line 51, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.color-orange {
color: #ff6800;
}
/* line 53, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 52, app/assets/stylesheets/common.scss */
/* line 54, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 53, app/assets/stylesheets/common.scss */
/* line 55, app/assets/stylesheets/common.scss */
.show {
display: block;
}
/* line 57, app/assets/stylesheets/common.scss */
.input_small {
-webkit-box-flex: 0 !important;
flex: 0 0 6% !important;
}
/* line 58, app/assets/stylesheets/common.scss */
.input_middle {
-webkit-box-flex: 0 !important;
flex: 0 0 13% !important;
}
/* line 4, app/assets/stylesheets/cooperative/carousels.scss */
.cooperative-carousels-index-page .carousels-card .custom-carousel-item > .drag {
cursor: move;
Loading…
Cancel
Save