diff --git a/app/assets/javascripts/admins/carousels/index.js b/app/assets/javascripts/admins/carousels/index.js
index fe665a35f..31ce3000d 100644
--- a/app/assets/javascripts/admins/carousels/index.js
+++ b/app/assets/javascripts/admins/carousels/index.js
@@ -1,6 +1,13 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-carousels-index-page').length > 0) {
var laboratoryId = $('#carousels-container').data('laboratoryId');
+ var resetNo = function(){
+ $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+ // 删除后
+ $(document).on('delete_success', resetNo);
// ------------ 保存链接 -----------
$('.carousels-card').on('click', '.save-data-btn', function(){
@@ -67,9 +74,7 @@ $(document).on('turbolinks:load', function() {
dataType: 'json',
data: { move_id: moveId, after_id: insertId },
success: function(data){
- $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
- $(ele).html(index + 1);
- })
+ resetNo();
},
error: function(res){
var data = res.responseJSON;
diff --git a/app/assets/javascripts/admins/weapp_adverts/index.js b/app/assets/javascripts/admins/weapp_adverts/index.js
new file mode 100644
index 000000000..74e06fbab
--- /dev/null
+++ b/app/assets/javascripts/admins/weapp_adverts/index.js
@@ -0,0 +1,124 @@
+$(document).on('turbolinks:load', function() {
+ if ($('body.admins-weapp-adverts-index-page').length > 0) {
+ var resetNo = function(){
+ $('#adverts-container .advert-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+
+ // ------------ 保存链接 -----------
+ $('.adverts-card').on('click', '.save-data-btn', function(){
+ var $link = $(this);
+ var id = $link.data('id');
+ var link = $('.advert-item-' + id).find('.link-input').val();
+ $link.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_adverts/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { link: link },
+ success: function(data){
+ $.notify({ message: '操作成功' });
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $link.removeAttr('disabled');
+ }
+ })
+ });
+ // -------------- 是否在首页展示 --------------
+ $('.adverts-card').on('change', '.online-check-box', function(){
+ var $checkbox = $(this);
+ var id = $checkbox.data('id');
+ var checked = $checkbox.is(':checked');
+ $checkbox.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_adverts/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { online: checked },
+ success: function(data){
+ $.notify({ message: '保存成功' });
+ var box = $('.advert-item-' + id).find('.drag');
+ if(checked){
+ box.removeClass('not_active');
+ }else{
+ box.addClass('not_active');
+ }
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $checkbox.removeAttr('disabled');
+ }
+ })
+ });
+
+ // ------------ 拖拽 -------------
+ var onDropFunc = function(el, _target, _source, sibling){
+ var moveId = $(el).data('id');
+ var insertId = $(sibling).data('id') || '';
+
+ $.ajax({
+ url: '/admins/weapp_adverts/drag',
+ method: 'POST',
+ dataType: 'json',
+ data: { move_id: moveId, after_id: insertId },
+ success: function(data){
+ resetNo();
+ },
+ error: function(res){
+ var data = res.responseJSON;
+ $.notify({message: '移动失败,原因:' + data.message}, {type: 'danger'});
+ }
+ })
+ };
+ var ele1 = document.getElementById('adverts-container');
+ dragula([ele1], { mirrorContainer: ele1 }).on('drop', onDropFunc);
+
+
+ // ----------- 新增 --------------
+ var $createModal = $('.modal.admin-add-weapp-advert-modal');
+ var $createForm = $createModal.find('form.admin-add-weapp-advert-form');
+
+ $createForm.validate({
+ errorElement: 'span',
+ errorClass: 'danger text-danger',
+ rules: {
+ "weapp_settings_advert[image]": {
+ required: true
+ }
+ }
+ });
+
+ $createModal.on('show.bs.modal', function(event){
+ resetFileInputFunc($createModal.find('.img-file-input'));
+ $createModal.find('.file-names').html('选择文件');
+ });
+
+ $createModal.on('click', '.submit-btn', function() {
+ $createForm.find('.error').html('');
+
+ if ($createForm.valid()) {
+ $createForm.submit();
+ } else {
+ $createForm.find('.error').html('请选择图片');
+ }
+ });
+ $createModal.on('change', '.img-file-input', function(){
+ var file = $(this)[0].files[0];
+ $createModal.find('.file-names').html(file ? file.name : '请选择文件');
+ })
+
+ // -------------- 重新上传图片 --------------
+ //replace_image_url
+ $('.modal.admin-upload-file-modal').on('upload:success', function(e, data){
+ var $advertItem = $('.advert-item-' + data.source_id);
+ $advertItem.find('.advert-item-img img').attr('src', data.url);
+ })
+
+ // 删除后
+ $(document).on('delete_success', resetNo)
+ }
+})
\ No newline at end of file
diff --git a/app/assets/javascripts/admins/weapp_carousels/index.js b/app/assets/javascripts/admins/weapp_carousels/index.js
new file mode 100644
index 000000000..2fc63f61d
--- /dev/null
+++ b/app/assets/javascripts/admins/weapp_carousels/index.js
@@ -0,0 +1,123 @@
+$(document).on('turbolinks:load', function() {
+ if ($('body.admins-weapp-carousels-index-page').length > 0) {
+ var resetNo = function(){
+ $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+ // ------------ 保存链接 -----------
+ $('.carousels-card').on('click', '.save-data-btn', function(){
+ var $link = $(this);
+ var id = $link.data('id');
+ var link = $('.custom-carousel-item-' + id).find('.link-input').val();
+ $link.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_carousels/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { link: link },
+ success: function(data){
+ $.notify({ message: '操作成功' });
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $link.removeAttr('disabled');
+ }
+ })
+ });
+ // -------------- 是否在首页展示 --------------
+ $('.carousels-card').on('change', '.online-check-box', function(){
+ var $checkbox = $(this);
+ var id = $checkbox.data('id');
+ var checked = $checkbox.is(':checked');
+ $checkbox.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_carousels/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { online: checked },
+ success: function(data){
+ $.notify({ message: '保存成功' });
+ var box = $('.custom-carousel-item-' + id).find('.drag');
+ if(checked){
+ box.removeClass('not_active');
+ }else{
+ box.addClass('not_active');
+ }
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $checkbox.removeAttr('disabled');
+ }
+ })
+ });
+
+ // ------------ 拖拽 -------------
+ var onDropFunc = function(el, _target, _source, sibling){
+ var moveId = $(el).data('id');
+ var insertId = $(sibling).data('id') || '';
+
+ $.ajax({
+ url: '/admins/weapp_carousels/drag',
+ method: 'POST',
+ dataType: 'json',
+ data: { move_id: moveId, after_id: insertId },
+ success: function(data){
+ resetNo();
+ },
+ error: function(res){
+ var data = res.responseJSON;
+ $.notify({message: '移动失败,原因:' + data.message}, {type: 'danger'});
+ }
+ })
+ };
+ var ele1 = document.getElementById('carousels-container');
+ dragula([ele1], { mirrorContainer: ele1 }).on('drop', onDropFunc);
+
+
+ // ----------- 新增 --------------
+ var $createModal = $('.modal.admin-add-weapp-carousel-modal');
+ var $createForm = $createModal.find('form.admin-add-weapp-carousel-form');
+
+ $createForm.validate({
+ errorElement: 'span',
+ errorClass: 'danger text-danger',
+ rules: {
+ "weapp_settings_carousel[image]": {
+ required: true
+ }
+ }
+ });
+
+ $createModal.on('show.bs.modal', function(event){
+ resetFileInputFunc($createModal.find('.img-file-input'));
+ $createModal.find('.file-names').html('选择文件');
+ });
+
+ $createModal.on('click', '.submit-btn', function() {
+ $createForm.find('.error').html('');
+
+ if ($createForm.valid()) {
+ $createForm.submit();
+ } else {
+ $createForm.find('.error').html('请选择图片');
+ }
+ });
+ $createModal.on('change', '.img-file-input', function(){
+ var file = $(this)[0].files[0];
+ $createModal.find('.file-names').html(file ? file.name : '请选择文件');
+ })
+
+ // -------------- 重新上传图片 --------------
+ //replace_image_url
+ $('.modal.admin-upload-file-modal').on('upload:success', function(e, data){
+ var $carouselItem = $('.custom-carousel-item-' + data.source_id);
+ $carouselItem.find('.custom-carousel-item-img img').attr('src', data.url);
+ })
+
+ // 删除后
+ $(document).on('delete_success', resetNo)
+ }
+})
\ No newline at end of file
diff --git a/app/assets/javascripts/cooperative/carousels/index.js b/app/assets/javascripts/cooperative/carousels/index.js
index 4d8fe1b2c..42c87f46f 100644
--- a/app/assets/javascripts/cooperative/carousels/index.js
+++ b/app/assets/javascripts/cooperative/carousels/index.js
@@ -1,5 +1,12 @@
$(document).on('turbolinks:load', function() {
if ($('body.cooperative-carousels-index-page').length > 0) {
+ var resetNo = function(){
+ $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+ // 删除后
+ $(document).on('delete_success', resetNo);
// ------------ 保存链接 -----------
$('.carousels-card').on('click', '.save-data-btn', function(){
var $link = $(this);
@@ -65,9 +72,7 @@ $(document).on('turbolinks:load', function() {
dataType: 'json',
data: { move_id: moveId, after_id: insertId },
success: function(data){
- $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
- $(ele).html(index + 1);
- })
+ resetNo();
},
error: function(res){
var data = res.responseJSON;
diff --git a/app/assets/stylesheets/admins/weapp_adverts.scss b/app/assets/stylesheets/admins/weapp_adverts.scss
new file mode 100644
index 000000000..d6bfa48ea
--- /dev/null
+++ b/app/assets/stylesheets/admins/weapp_adverts.scss
@@ -0,0 +1,60 @@
+.admins-weapp-adverts-index-page {
+ .adverts-card {
+ .advert-item {
+ & > .drag {
+ cursor: move;
+ background: #fff;
+ box-shadow: 1px 2px 5px 3px #f0f0f0;
+ }
+
+ &-no {
+ font-size: 28px;
+ text-align: center;
+ }
+
+ &-img {
+ cursor: pointer;
+ width: 100%;
+ height: 60px;
+
+ & > img {
+ display: block;
+ width: 100%;
+ height: 60px;
+ background: #F5F5F5;
+ }
+ }
+
+ .not_active {
+ background: #F0F0F0;
+ }
+
+ .delete-btn {
+ font-size: 20px;
+ color: red;
+ cursor: pointer;
+ }
+
+ .save-url-btn {
+ cursor: pointer;
+ }
+
+ .operate-box {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .online-check-box {
+ font-size: 20px;
+ }
+
+ .name-input {
+ flex: 1;
+ }
+ .link-input {
+ flex: 3;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/admins/weapp_carousels.scss b/app/assets/stylesheets/admins/weapp_carousels.scss
new file mode 100644
index 000000000..4ecf35da0
--- /dev/null
+++ b/app/assets/stylesheets/admins/weapp_carousels.scss
@@ -0,0 +1,60 @@
+.admins-weapp-carousels-index-page {
+ .carousels-card {
+ .custom-carousel-item {
+ & > .drag {
+ cursor: move;
+ background: #fff;
+ box-shadow: 1px 2px 5px 3px #f0f0f0;
+ }
+
+ &-no {
+ font-size: 28px;
+ text-align: center;
+ }
+
+ &-img {
+ cursor: pointer;
+ width: 100%;
+ height: 60px;
+
+ & > img {
+ display: block;
+ width: 100%;
+ height: 60px;
+ background: #F5F5F5;
+ }
+ }
+
+ .not_active {
+ background: #F0F0F0;
+ }
+
+ .delete-btn {
+ font-size: 20px;
+ color: red;
+ cursor: pointer;
+ }
+
+ .save-url-btn {
+ cursor: pointer;
+ }
+
+ .operate-box {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .online-check-box {
+ font-size: 20px;
+ }
+
+ .name-input {
+ flex: 1;
+ }
+ .link-input {
+ flex: 3;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/controllers/admins/weapp_adverts_controller.rb b/app/controllers/admins/weapp_adverts_controller.rb
new file mode 100644
index 000000000..873036ae7
--- /dev/null
+++ b/app/controllers/admins/weapp_adverts_controller.rb
@@ -0,0 +1,79 @@
+class Admins::WeappAdvertsController < Admins::BaseController
+ before_action :convert_file!, only: [:create]
+ def index
+ @adverts = WeappSettings::Advert.all
+ end
+
+ def create
+ position = WeappSettings::Advert.count + 1
+
+ ActiveRecord::Base.transaction do
+ advert = WeappSettings::Advert.create!(create_params.merge(position: position))
+
+ file_path = Util::FileManage.source_disk_filename(advert)
+ File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
+ Util.write_file(@file, file_path)
+ end
+
+ flash[:success] = '保存成功'
+ redirect_to admins_weapp_adverts_path
+ end
+
+ def update
+ current_advert.update!(update_params)
+ render_ok
+ end
+
+ def destroy
+ ActiveRecord::Base.transaction do
+ current_advert.destroy!
+ # 前移
+ WeappSettings::Advert.where('position > ?', current_advert.position)
+ .update_all('position = position - 1')
+
+ file_path = Util::FileManage.source_disk_filename(current_advert)
+ File.delete(file_path) if File.exist?(file_path)
+ end
+ render_delete_success
+ end
+
+ def drag
+ move = WeappSettings::Advert.find_by(id: params[:move_id])
+ after = WeappSettings::Advert.find_by(id: params[:after_id])
+
+ Admins::DragWeappAdvertService.call(move, after)
+ render_ok
+ rescue ApplicationService::Error => e
+ render_error(e.message)
+ end
+
+ private
+
+ def current_advert
+ @_current_advert ||= WeappSettings::Advert.find(params[:id])
+ end
+
+ def create_params
+ params.require(:weapp_settings_advert).permit(:link)
+ end
+
+ def update_params
+ params.permit(:link, :online)
+ end
+
+ def convert_file!
+ max_size = 10 * 1024 * 1024 # 10M
+ file = params.dig('weapp_settings_advert', 'image')
+ if file.class == ActionDispatch::Http::UploadedFile
+ @file = file
+ render_error('请上传文件') if @file.size.zero?
+ render_error('文件大小超过限制') if @file.size > max_size
+ else
+ file = file.to_s.strip
+ return render_error('请上传正确的图片') if file.blank?
+ @file = Util.convert_base64_image(file, max_size: max_size)
+ end
+ rescue Base64ImageConverter::Error => ex
+ render_error(ex.message)
+ end
+end
\ No newline at end of file
diff --git a/app/controllers/admins/weapp_carousels_controller.rb b/app/controllers/admins/weapp_carousels_controller.rb
new file mode 100644
index 000000000..9f22efdbe
--- /dev/null
+++ b/app/controllers/admins/weapp_carousels_controller.rb
@@ -0,0 +1,80 @@
+class Admins::WeappCarouselsController < Admins::BaseController
+ before_action :convert_file!, only: [:create]
+
+ def index
+ @carousels = WeappSettings::Carousel.all
+ end
+
+ def create
+ position = WeappSettings::Carousel.count + 1
+
+ ActiveRecord::Base.transaction do
+ carousel = WeappSettings::Carousel.create!(create_params.merge(position: position))
+
+ file_path = Util::FileManage.source_disk_filename(carousel)
+ File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
+ Util.write_file(@file, file_path)
+ end
+
+ flash[:success] = '保存成功'
+ redirect_to admins_weapp_carousels_path
+ end
+
+ def update
+ current_carousel.update!(update_params)
+ render_ok
+ end
+
+ def destroy
+ ActiveRecord::Base.transaction do
+ current_carousel.destroy!
+ # 前移
+ WeappSettings::Carousel.where('position > ?', current_carousel.position)
+ .update_all('position = position - 1')
+
+ file_path = Util::FileManage.source_disk_filename(current_carousel)
+ File.delete(file_path) if File.exist?(file_path)
+ end
+ render_delete_success
+ end
+
+ def drag
+ move = WeappSettings::Carousel.find_by(id: params[:move_id])
+ after = WeappSettings::Carousel.find_by(id: params[:after_id])
+
+ Admins::DragWeappCarouselService.call(move, after)
+ render_ok
+ rescue ApplicationService::Error => e
+ render_error(e.message)
+ end
+
+ private
+
+ def current_carousel
+ @_current_carousel ||= WeappSettings::Carousel.find(params[:id])
+ end
+
+ def create_params
+ params.require(:weapp_settings_carousel).permit(:link)
+ end
+
+ def update_params
+ params.permit(:link, :online)
+ end
+
+ def convert_file!
+ max_size = 10 * 1024 * 1024 # 10M
+ file = params.dig('weapp_settings_carousel', 'image')
+ if file.class == ActionDispatch::Http::UploadedFile
+ @file = file
+ render_error('请上传文件') if @file.size.zero?
+ render_error('文件大小超过限制') if @file.size > max_size
+ else
+ file = file.to_s.strip
+ return render_error('请上传正确的图片') if file.blank?
+ @file = Util.convert_base64_image(file, max_size: max_size)
+ end
+ rescue Base64ImageConverter::Error => ex
+ render_error(ex.message)
+ end
+end
\ No newline at end of file
diff --git a/app/controllers/weapps/homes_controller.rb b/app/controllers/weapps/homes_controller.rb
index efb80b898..9646f6108 100644
--- a/app/controllers/weapps/homes_controller.rb
+++ b/app/controllers/weapps/homes_controller.rb
@@ -1,12 +1,15 @@
class Weapps::HomesController < Weapps::BaseController
def show
- # banner图
- @images = PortalImage.where(status: true).order(position: :asc)
+ # banner
+ @carousels = WeappSettings::Carousel.only_online
+ # 广告
+ @advert = WeappSettings::Advert.only_online.first
# 热门实训
@shixuns = Shixun.where(homepage_show: true).includes(:tag_repertoires, :challenges).limit(4)
# 热门实践课程
@subjects = Subject.where(homepage_show: true).includes(:shixuns, :repertoire).limit(4)
+
end
end
\ No newline at end of file
diff --git a/app/models/weapp_setting.rb b/app/models/weapp_setting.rb
new file mode 100644
index 000000000..a4ef86eb1
--- /dev/null
+++ b/app/models/weapp_setting.rb
@@ -0,0 +1,3 @@
+class WeappSetting < ApplicationRecord
+ scope :only_online, -> { where(online: true) }
+end
\ No newline at end of file
diff --git a/app/models/weapp_settings/advert.rb b/app/models/weapp_settings/advert.rb
new file mode 100644
index 000000000..564e85565
--- /dev/null
+++ b/app/models/weapp_settings/advert.rb
@@ -0,0 +1,2 @@
+class WeappSettings::Advert < WeappSetting
+end
\ No newline at end of file
diff --git a/app/models/weapp_settings/carousel.rb b/app/models/weapp_settings/carousel.rb
new file mode 100644
index 000000000..71445fd3f
--- /dev/null
+++ b/app/models/weapp_settings/carousel.rb
@@ -0,0 +1,3 @@
+class WeappSettings::Carousel < WeappSetting
+ default_scope { order(position: :asc) }
+end
\ No newline at end of file
diff --git a/app/services/admins/drag_weapp_advert_service.rb b/app/services/admins/drag_weapp_advert_service.rb
new file mode 100644
index 000000000..b041c9d18
--- /dev/null
+++ b/app/services/admins/drag_weapp_advert_service.rb
@@ -0,0 +1,32 @@
+class Admins::DragWeappAdvertService < ApplicationService
+ attr_reader :move, :after
+
+ def initialize(move, after)
+ @move = move
+ @after = after # 移动后下一个位置的元素
+ end
+
+ def call
+ return if move.position + 1 == after&.position # 未移动
+
+ carousels = WeappSettings::Advert.all
+
+ ActiveRecord::Base.transaction do
+ if after.blank? || move.id == after.id # 移动至末尾
+ total = carousels.count
+
+ carousels.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')
+ move.update!(position: after.position)
+ else # 后移
+ carousels.where('position > ? AND position < ?', move.position, after.position).update_all('position = position - 1')
+ move.update!(position: after.position - 1)
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/services/admins/drag_weapp_carousel_service.rb b/app/services/admins/drag_weapp_carousel_service.rb
new file mode 100644
index 000000000..f0b3832b2
--- /dev/null
+++ b/app/services/admins/drag_weapp_carousel_service.rb
@@ -0,0 +1,32 @@
+class Admins::DragWeappCarouselService < ApplicationService
+ attr_reader :move, :after
+
+ def initialize(move, after)
+ @move = move
+ @after = after # 移动后下一个位置的元素
+ end
+
+ def call
+ return if move.position + 1 == after&.position # 未移动
+
+ carousels = WeappSettings::Carousel.all
+
+ ActiveRecord::Base.transaction do
+ if after.blank? || move.id == after.id # 移动至末尾
+ total = carousels.count
+
+ carousels.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')
+ move.update!(position: after.position)
+ else # 后移
+ carousels.where('position > ? AND position < ?', move.position, after.position).update_all('position = position - 1')
+ move.update!(position: after.position - 1)
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb
index 4d6986bc6..87b1a7f67 100644
--- a/app/views/admins/shared/_sidebar.html.erb
+++ b/app/views/admins/shared/_sidebar.html.erb
@@ -78,6 +78,14 @@
<%= sidebar_item(edit_admins_help_center_path, '帮助中心', icon: 'question-circle-o', controller: 'admins-help_centers') %>
<% end %>
+
+
+ <%= sidebar_item_group('#weapp-setting-submenu', '小程序设置', icon: 'id-badge') do %>
+ <%= sidebar_item(admins_weapp_carousels_path, '轮播图', icon: 'image', controller: 'admins-weapp_carousels') %>
+ <%= sidebar_item(admins_weapp_adverts_path, '广告栏', icon: 'paper-plane', controller: 'admins-weapp_adverts') %>
+ <% end %>
+
+
<%= sidebar_item('/', '返回主站', icon: 'sign-out', controller: 'root') %>
\ No newline at end of file
diff --git a/app/views/admins/shared/delete.js.erb b/app/views/admins/shared/delete.js.erb
index 0da435fd7..d4989f392 100644
--- a/app/views/admins/shared/delete.js.erb
+++ b/app/views/admins/shared/delete.js.erb
@@ -24,4 +24,5 @@ if (!notRefresh) {
}
} else {
deleteRow.remove();
-}
\ No newline at end of file
+}
+$(document).trigger('delete_success');
\ No newline at end of file
diff --git a/app/views/admins/weapp_adverts/index.html.erb b/app/views/admins/weapp_adverts/index.html.erb
new file mode 100644
index 000000000..c560fdb8a
--- /dev/null
+++ b/app/views/admins/weapp_adverts/index.html.erb
@@ -0,0 +1,42 @@
+<%
+ define_admin_breadcrumbs do
+ add_admin_breadcrumb('广告栏')
+ end
+%>
+
+
+
+
+ <% @adverts.each_with_index do |advert, index| %>
+
+
+
<%= index + 1 %>
+
+
 ? Util::FileManage.source_disk_file_url(advert) : '' %>)
+
+
+
+ <%= check_box_tag(:online, 1, advert.online?, id: nil, class: 'online-check-box', data: { id: advert.id, toggle: 'tooltip', title: '首页展示' }) %>
+ <%= delete_link '删除', admins_weapp_advert_path(advert, element: ".advert-item-#{advert.id}", not_refresh: true), class: 'delete-btn' do %>
+
+ <% end %>
+
+
+
+ <% end %>
+
+
+
+
+<%= render partial: 'admins/weapp_adverts/shared/add_weapp_advert_modal' %>
+<%= render partial: 'admins/shared/modal/upload_file_modal' %>
\ No newline at end of file
diff --git a/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb b/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb
new file mode 100644
index 000000000..9909084b8
--- /dev/null
+++ b/app/views/admins/weapp_adverts/shared/_add_weapp_advert_modal.html.erb
@@ -0,0 +1,35 @@
+
+
+
+
+
+ <%= simple_form_for(WeappSettings::Advert.new, url: admins_weapp_adverts_path, html: { class: 'admin-add-weapp-advert-form', enctype: 'multipart/form-data' }) do |f| %>
+
+
+ <%= f.input :link, as: :url, label: '跳转地址', placeholder: '请输入跳转地址' %>
+
+
+ <% end %>
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/admins/weapp_carousels/index.html.erb b/app/views/admins/weapp_carousels/index.html.erb
new file mode 100644
index 000000000..ec6cfa57c
--- /dev/null
+++ b/app/views/admins/weapp_carousels/index.html.erb
@@ -0,0 +1,42 @@
+<%
+ define_admin_breadcrumbs do
+ add_admin_breadcrumb('轮播图')
+ end
+%>
+
+
+
+
+ <% @carousels.each_with_index do |carousel, index| %>
+
+
+
<%= index + 1 %>
+
+
 ? Util::FileManage.source_disk_file_url(carousel) : '' %>)
+
+
+
+ <%= check_box_tag(:online, 1, carousel.online?, id: nil, class: 'online-check-box', data: { id: carousel.id, toggle: 'tooltip', title: '首页展示' }) %>
+ <%= delete_link '删除', admins_weapp_carousel_path(carousel, element: ".custom-carousel-item-#{carousel.id}", not_refresh: true), class: 'delete-btn' do %>
+
+ <% end %>
+
+
+
+ <% end %>
+
+
+
+
+<%= render partial: 'admins/weapp_carousels/shared/add_weapp_carousel_modal' %>
+<%= render partial: 'admins/shared/modal/upload_file_modal' %>
\ No newline at end of file
diff --git a/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb b/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb
new file mode 100644
index 000000000..767ae61ae
--- /dev/null
+++ b/app/views/admins/weapp_carousels/shared/_add_weapp_carousel_modal.html.erb
@@ -0,0 +1,35 @@
+
+
+
+
+
+ <%= simple_form_for(WeappSettings::Carousel.new, url: admins_weapp_carousels_path, html: { class: 'admin-add-weapp-carousel-form', enctype: 'multipart/form-data' }) do |f| %>
+
+
+ <%= f.input :link, as: :url, label: '跳转地址', placeholder: '请输入跳转地址' %>
+
+
+ <% end %>
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/cooperative/shared/delete.js.erb b/app/views/cooperative/shared/delete.js.erb
index 0da435fd7..d4989f392 100644
--- a/app/views/cooperative/shared/delete.js.erb
+++ b/app/views/cooperative/shared/delete.js.erb
@@ -24,4 +24,5 @@ if (!notRefresh) {
}
} else {
deleteRow.remove();
-}
\ No newline at end of file
+}
+$(document).trigger('delete_success');
\ No newline at end of file
diff --git a/app/views/weapps/homes/show.json.jbuilder b/app/views/weapps/homes/show.json.jbuilder
index eb5b238ac..ab366507c 100644
--- a/app/views/weapps/homes/show.json.jbuilder
+++ b/app/views/weapps/homes/show.json.jbuilder
@@ -1,8 +1,19 @@
-json.images do
- json.array! @images do |image|
- json.path image.link
- json.image_url Util::FileManage.source_disk_file_url(image)
+json.carousels do
+ json.array! @carousels do |carousel|
+ json.extract! carousel, :id, :link, :position
+
+ json.path carousel.link
+ json.image_url Util::FileManage.source_disk_file_url(carousel)
+ end
+end
+
+if @advert.present?
+ json.advert do
+ json.extract! @advert, :id, :link
+ json.image_url Util::FileManage.source_disk_file_url(@advert)
end
+else
+ json.advert nil
end
json.shixuns do
diff --git a/config/routes.rb b/config/routes.rb
index 6013eaf3f..b2037ff78 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1025,6 +1025,13 @@ Rails.application.routes.draw do
resources :competition_settings, only: [:index, :update]
resources :enroll_lists, only: [:index]
end
+
+ resources :weapp_carousels, only: [:index, :create, :update, :destroy] do
+ post :drag, on: :collection
+ end
+ resources :weapp_adverts, only: [:index, :create, :update, :destroy] do
+ post :drag, on: :collection
+ end
end
namespace :cooperative do
diff --git a/db/migrate/20191022003750_create_weapp_settings.rb b/db/migrate/20191022003750_create_weapp_settings.rb
new file mode 100644
index 000000000..20b3d5879
--- /dev/null
+++ b/db/migrate/20191022003750_create_weapp_settings.rb
@@ -0,0 +1,12 @@
+class CreateWeappSettings < ActiveRecord::Migration[5.2]
+ def change
+ create_table :weapp_settings do |t|
+ t.string :type
+ t.string :link
+ t.boolean :online, default: false
+ t.integer :position, default: 0
+
+ t.timestamps
+ end
+ end
+end
diff --git a/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json b/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json
index 81a6274f1..2404fbf37 100644
--- a/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json
+++ b/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json
@@ -1 +1 @@
-{"files":{"admin-cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121.js":{"logical_path":"admin.js","mtime":"2019-09-11T16:20:07+08:00","size":4350881,"digest":"cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121","integrity":"sha256-zZyousyXPOLbrOMMl/bEC8COLC7kSXL2aOc44ZAsASE="},"admin-a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa.css":{"logical_path":"admin.css","mtime":"2019-09-11T16:20:07+08:00","size":773445,"digest":"a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa","integrity":"sha256-obM1bv5Q/0cXzyJHVjm1MzxTVLoD/RB8m3qNSudvR6o="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-14T17:22:43+08:00","size":165742,"digest":"7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979","integrity":"sha256-e/yrbbmdXPvxcFygU23ceFhUMsxfpBu9etDwCQM7KXk="},"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2":{"logical_path":"font-awesome/fontawesome-webfont.woff2","mtime":"2019-08-14T17:22:43+08:00","size":77160,"digest":"2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe","integrity":"sha256-Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8/4="},"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff":{"logical_path":"font-awesome/fontawesome-webfont.woff","mtime":"2019-08-14T17:22:43+08:00","size":98024,"digest":"ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07","integrity":"sha256-ugxZ3rVFD1y0Gz+TYJ7i0NmVQVh33foiPoqKdTNHTwc="},"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf":{"logical_path":"font-awesome/fontawesome-webfont.ttf","mtime":"2019-08-14T17:22:43+08:00","size":165548,"digest":"aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8","integrity":"sha256-qljzPyOaD7AvXHpsRcBD16msmgkzNYBmlOzW1O3A1qg="},"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg":{"logical_path":"font-awesome/fontawesome-webfont.svg","mtime":"2019-08-14T17:22:43+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js":{"logical_path":"college.js","mtime":"2019-10-17T09:44:58+08:00","size":3352744,"digest":"18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287","integrity":"sha256-GPXoQAMxY06JijWswhh4FcCWwl4Kt0q6NBrpFhZs0oc="},"college-944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9.css":{"logical_path":"college.css","mtime":"2019-09-11T16:20:07+08:00","size":546841,"digest":"944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9","integrity":"sha256-lE1Cc/YsdTg2i5AX/dM4e1476jGoeHN3DrIxMkVG1Nk="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-09-03T08:55:53+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js":{"logical_path":"application.js","mtime":"2019-10-17T09:44:58+08:00","size":600706,"digest":"9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb","integrity":"sha256-nPvD15JZmh0N5ce4QgnhwrLmAzbw8B4Z8FgWY5GHCPs="},"application-5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2.css":{"logical_path":"application.css","mtime":"2019-09-11T16:20:07+08:00","size":1844002,"digest":"5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2","integrity":"sha256-Xrh8bhNnbQGDMX3rzhf63ifmjErO4oxBlDjaFdU8lPI="},"admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js":{"logical_path":"admin.js","mtime":"2019-09-21T15:28:08+08:00","size":4382031,"digest":"c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4","integrity":"sha256-yeXr5hkVSFUOJ1FBluoSXPu0AoIOwSWgyaz5nS03j+Q="},"admin-59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38.css":{"logical_path":"admin.css","mtime":"2019-09-21T14:49:04+08:00","size":840093,"digest":"59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38","integrity":"sha256-WcWfjK6L70qDWShsmFRYEQydA+oSFRZZXJiJQ/RxfDg="},"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css":{"logical_path":"college.css","mtime":"2019-09-16T13:56:09+08:00","size":579109,"digest":"38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437","integrity":"sha256-OPlT1rpbhdP6tjyzwrvw0FfMxkVNB8+q+sOwbaN7hDc="},"application-646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3.css":{"logical_path":"application.css","mtime":"2019-09-21T14:49:04+08:00","size":1988767,"digest":"646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3","integrity":"sha256-ZGsRWKTowfE+aE1v6QJavHX407pSVuRAgCwDmCIzdPM="},"admin-a47e37c0ec7cf5f22380249776d1e82d65b6b6aa272ed7389185aa200fa40751.js":{"logical_path":"admin.js","mtime":"2019-09-25T15:33:05+08:00","size":4383107,"digest":"a47e37c0ec7cf5f22380249776d1e82d65b6b6aa272ed7389185aa200fa40751","integrity":"sha256-pH43wOx89fIjgCSXdtHoLWW2tqonLtc4kYWqIA+kB1E="},"admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js":{"logical_path":"admin.js","mtime":"2019-09-25T15:35:20+08:00","size":4383103,"digest":"432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9","integrity":"sha256-QyxOrAmwNsV/8eiNkCuKp9+BFk5LQZusVXzxNmwdOtk="},"admin-978e5ce607f77c26814a174f480da79ac246c2201868ef84654aa03bb6727b5a.js":{"logical_path":"admin.js","mtime":"2019-09-30T14:43:41+08:00","size":4387200,"digest":"978e5ce607f77c26814a174f480da79ac246c2201868ef84654aa03bb6727b5a","integrity":"sha256-l45c5gf3fCaBShdPSA2nmsJGwiAYaO+EZUqgO7Zye1o="},"admin-896281f4731722b0c084dbb1af21d0f34a5bc142d58aff57b391864ab71ddca7.css":{"logical_path":"admin.css","mtime":"2019-09-30T14:43:41+08:00","size":842269,"digest":"896281f4731722b0c084dbb1af21d0f34a5bc142d58aff57b391864ab71ddca7","integrity":"sha256-iWKB9HMXIrDAhNuxryHQ80pbwULViv9Xs5GGSrcd3Kc="},"application-97f313e9bb7d25476649f7d7215959cf421480fd0a3785d1956953bf94a1e8bd.css":{"logical_path":"application.css","mtime":"2019-09-30T14:43:41+08:00","size":1993118,"digest":"97f313e9bb7d25476649f7d7215959cf421480fd0a3785d1956953bf94a1e8bd","integrity":"sha256-l/MT6bt9JUdmSffXIVlZz0IUgP0KN4XRlWlTv5Sh6L0="},"admin-2cdb23442fa735025385b88f2900df04fef38b61530041a6dbe375ef0f0ae888.js":{"logical_path":"admin.js","mtime":"2019-10-11T14:38:33+08:00","size":4394616,"digest":"2cdb23442fa735025385b88f2900df04fef38b61530041a6dbe375ef0f0ae888","integrity":"sha256-LNsjRC+nNQJThbiPKQDfBP7zi2FTAEGm2+N17w8K6Ig="},"admin-2c2854b9a02158ded5a809aaf7144a8630b10354ab4e56fecc4dffcc713796cc.css":{"logical_path":"admin.css","mtime":"2019-10-10T17:12:05+08:00","size":846514,"digest":"2c2854b9a02158ded5a809aaf7144a8630b10354ab4e56fecc4dffcc713796cc","integrity":"sha256-LChUuaAhWN7VqAmq9xRKhjCxA1SrTlb+zE3/zHE3lsw="},"application-50059ae929866043b47015128702fcfba53d32a2df148e64e1d961c10651c6af.css":{"logical_path":"application.css","mtime":"2019-10-10T17:12:05+08:00","size":2001607,"digest":"50059ae929866043b47015128702fcfba53d32a2df148e64e1d961c10651c6af","integrity":"sha256-UAWa6SmGYEO0cBUShwL8+6U9MqLfFI5k4dlhwQZRxq8="},"admin-992cde09b6d17f00a49576ae2d9f1ced127244ba401ef5b7d677cab9741688d2.js":{"logical_path":"admin.js","mtime":"2019-10-16T16:11:32+08:00","size":4394790,"digest":"992cde09b6d17f00a49576ae2d9f1ced127244ba401ef5b7d677cab9741688d2","integrity":"sha256-mSzeCbbRfwCklXauLZ8c7RJyRLpAHvW31nfKuXQWiNI="},"admin-84f2a7791e275d6f820514370b3f968176b994b9dd7b8c3ba8bf48336b03f257.css":{"logical_path":"admin.css","mtime":"2019-10-16T19:25:40+08:00","size":846676,"digest":"84f2a7791e275d6f820514370b3f968176b994b9dd7b8c3ba8bf48336b03f257","integrity":"sha256-hPKneR4nXW+CBRQ3Cz+WgXa5lLnde4w7qL9IM2sD8lc="},"application-ef6bab84852baaf69a91fe6af875b6e1b118c55b4c7d165665c488fac80c4997.css":{"logical_path":"application.css","mtime":"2019-10-16T19:25:40+08:00","size":2001931,"digest":"ef6bab84852baaf69a91fe6af875b6e1b118c55b4c7d165665c488fac80c4997","integrity":"sha256-72urhIUrqvaakf5q+HW24bEYxVtMfRZWZcSI+sgMSZc="},"admin-c99030d305662f740aa84b6c925a1adbbaadaa07fd74e2655e64d44b4b97fc4a.js":{"logical_path":"admin.js","mtime":"2019-10-17T09:44:58+08:00","size":4394897,"digest":"c99030d305662f740aa84b6c925a1adbbaadaa07fd74e2655e64d44b4b97fc4a","integrity":"sha256-yZAw0wVmL3QKqEtskloa27qtqgf9dOJlXmTUS0uX/Eo="},"admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css":{"logical_path":"admin.css","mtime":"2019-10-17T10:22:41+08:00","size":846699,"digest":"534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d","integrity":"sha256-U0vehx1n9Nb8jaYRkX14vkBm/HWTulPukqoXBooZnW0="},"cooperative-04cd6a60d41220d38ee45ce40b1d004e1d0bcd87c132fb1a7bab6144c1deb8d7.js":{"logical_path":"cooperative.js","mtime":"2019-10-17T10:17:56+08:00","size":4330072,"digest":"04cd6a60d41220d38ee45ce40b1d004e1d0bcd87c132fb1a7bab6144c1deb8d7","integrity":"sha256-BM1qYNQSINOO5FzkCx0ATh0LzYfBMvsae6thRMHeuNc="},"cooperative-a345bbfd8e38b70c9285ecc1747012ffcde429187983e2aea5657abb56b9b4f3.css":{"logical_path":"cooperative.css","mtime":"2019-10-17T10:21:41+08:00","size":830628,"digest":"a345bbfd8e38b70c9285ecc1747012ffcde429187983e2aea5657abb56b9b4f3","integrity":"sha256-o0W7/Y44twyShezBdHAS/83kKRh5g+KupWV6u1a5tPM="},"application-0e417478d56f42467e857cd186b29cbbc0d6c7c6e85c8a6f42f39ac618943de8.css":{"logical_path":"application.css","mtime":"2019-09-03T08:55:53+08:00","size":442932,"digest":"0e417478d56f42467e857cd186b29cbbc0d6c7c6e85c8a6f42f39ac618943de8","integrity":"sha256-DkF0eNVvQkZ+hXzRhrKcu8DWx8boXIpvQvOaxhiUPeg="},"cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js":{"logical_path":"cooperative.js","mtime":"2019-10-17T14:03:03+08:00","size":4338033,"digest":"149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b","integrity":"sha256-FJ9HuGddYKgBTM/1DwD5Mv9p4r4ob/t0NDvEo+/7E1s="},"cooperative-6273b766d6ef11dd56174d868bab55e7f17af17546c888d2ba0dd0a6bcda76c8.css":{"logical_path":"cooperative.css","mtime":"2019-10-17T11:13:07+08:00","size":832914,"digest":"6273b766d6ef11dd56174d868bab55e7f17af17546c888d2ba0dd0a6bcda76c8","integrity":"sha256-YnO3ZtbvEd1WF02Gi6tV5/F68XVGyIjSug3Qprzadsg="},"admin-82f66cc80b5649c6530a562567f28fe8d05f7bc3b8221e0695b2216255c52ba6.js":{"logical_path":"admin.js","mtime":"2019-10-21T13:51:43+08:00","size":4397012,"digest":"82f66cc80b5649c6530a562567f28fe8d05f7bc3b8221e0695b2216255c52ba6","integrity":"sha256-gvZsyAtWScZTClYlZ/KP6NBfe8O4Ih4GlbIhYlXFK6Y="},"admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js":{"logical_path":"admin.js","mtime":"2019-10-21T16:41:06+08:00","size":4397437,"digest":"1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec","integrity":"sha256-G1co2U9rzPvO9FKnYNlMO28xlmvGXX+Jvgd/wupRK+w="}},"assets":{"admin.js":"admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js","admin.css":"admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css","font-awesome/fontawesome-webfont.eot":"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot","font-awesome/fontawesome-webfont.woff2":"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2","font-awesome/fontawesome-webfont.woff":"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff","font-awesome/fontawesome-webfont.ttf":"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf","font-awesome/fontawesome-webfont.svg":"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg","college.js":"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js","college.css":"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js","application.css":"application-0e417478d56f42467e857cd186b29cbbc0d6c7c6e85c8a6f42f39ac618943de8.css","cooperative.js":"cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js","cooperative.css":"cooperative-6273b766d6ef11dd56174d868bab55e7f17af17546c888d2ba0dd0a6bcda76c8.css"}}
\ No newline at end of file
+{"files":{"admin-cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121.js":{"logical_path":"admin.js","mtime":"2019-09-11T16:20:07+08:00","size":4350881,"digest":"cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121","integrity":"sha256-zZyousyXPOLbrOMMl/bEC8COLC7kSXL2aOc44ZAsASE="},"admin-a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa.css":{"logical_path":"admin.css","mtime":"2019-09-11T16:20:07+08:00","size":773445,"digest":"a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa","integrity":"sha256-obM1bv5Q/0cXzyJHVjm1MzxTVLoD/RB8m3qNSudvR6o="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-14T17:22:43+08:00","size":165742,"digest":"7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979","integrity":"sha256-e/yrbbmdXPvxcFygU23ceFhUMsxfpBu9etDwCQM7KXk="},"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2":{"logical_path":"font-awesome/fontawesome-webfont.woff2","mtime":"2019-08-14T17:22:43+08:00","size":77160,"digest":"2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe","integrity":"sha256-Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8/4="},"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff":{"logical_path":"font-awesome/fontawesome-webfont.woff","mtime":"2019-08-14T17:22:43+08:00","size":98024,"digest":"ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07","integrity":"sha256-ugxZ3rVFD1y0Gz+TYJ7i0NmVQVh33foiPoqKdTNHTwc="},"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf":{"logical_path":"font-awesome/fontawesome-webfont.ttf","mtime":"2019-08-14T17:22:43+08:00","size":165548,"digest":"aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8","integrity":"sha256-qljzPyOaD7AvXHpsRcBD16msmgkzNYBmlOzW1O3A1qg="},"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg":{"logical_path":"font-awesome/fontawesome-webfont.svg","mtime":"2019-08-14T17:22:43+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js":{"logical_path":"college.js","mtime":"2019-10-17T09:44:58+08:00","size":3352744,"digest":"18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287","integrity":"sha256-GPXoQAMxY06JijWswhh4FcCWwl4Kt0q6NBrpFhZs0oc="},"college-944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9.css":{"logical_path":"college.css","mtime":"2019-09-11T16:20:07+08:00","size":546841,"digest":"944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9","integrity":"sha256-lE1Cc/YsdTg2i5AX/dM4e1476jGoeHN3DrIxMkVG1Nk="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-09-03T08:55:53+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js":{"logical_path":"application.js","mtime":"2019-10-17T09:44:58+08:00","size":600706,"digest":"9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb","integrity":"sha256-nPvD15JZmh0N5ce4QgnhwrLmAzbw8B4Z8FgWY5GHCPs="},"application-5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2.css":{"logical_path":"application.css","mtime":"2019-09-11T16:20:07+08:00","size":1844002,"digest":"5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2","integrity":"sha256-Xrh8bhNnbQGDMX3rzhf63ifmjErO4oxBlDjaFdU8lPI="},"admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js":{"logical_path":"admin.js","mtime":"2019-09-21T15:28:08+08:00","size":4382031,"digest":"c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4","integrity":"sha256-yeXr5hkVSFUOJ1FBluoSXPu0AoIOwSWgyaz5nS03j+Q="},"admin-59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38.css":{"logical_path":"admin.css","mtime":"2019-09-21T14:49:04+08:00","size":840093,"digest":"59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38","integrity":"sha256-WcWfjK6L70qDWShsmFRYEQydA+oSFRZZXJiJQ/RxfDg="},"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css":{"logical_path":"college.css","mtime":"2019-09-16T13:56:09+08:00","size":579109,"digest":"38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437","integrity":"sha256-OPlT1rpbhdP6tjyzwrvw0FfMxkVNB8+q+sOwbaN7hDc="},"application-646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3.css":{"logical_path":"application.css","mtime":"2019-09-21T14:49:04+08:00","size":1988767,"digest":"646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3","integrity":"sha256-ZGsRWKTowfE+aE1v6QJavHX407pSVuRAgCwDmCIzdPM="},"admin-a47e37c0ec7cf5f22380249776d1e82d65b6b6aa272ed7389185aa200fa40751.js":{"logical_path":"admin.js","mtime":"2019-09-25T15:33:05+08:00","size":4383107,"digest":"a47e37c0ec7cf5f22380249776d1e82d65b6b6aa272ed7389185aa200fa40751","integrity":"sha256-pH43wOx89fIjgCSXdtHoLWW2tqonLtc4kYWqIA+kB1E="},"admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js":{"logical_path":"admin.js","mtime":"2019-09-25T15:35:20+08:00","size":4383103,"digest":"432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9","integrity":"sha256-QyxOrAmwNsV/8eiNkCuKp9+BFk5LQZusVXzxNmwdOtk="},"admin-978e5ce607f77c26814a174f480da79ac246c2201868ef84654aa03bb6727b5a.js":{"logical_path":"admin.js","mtime":"2019-09-30T14:43:41+08:00","size":4387200,"digest":"978e5ce607f77c26814a174f480da79ac246c2201868ef84654aa03bb6727b5a","integrity":"sha256-l45c5gf3fCaBShdPSA2nmsJGwiAYaO+EZUqgO7Zye1o="},"admin-896281f4731722b0c084dbb1af21d0f34a5bc142d58aff57b391864ab71ddca7.css":{"logical_path":"admin.css","mtime":"2019-09-30T14:43:41+08:00","size":842269,"digest":"896281f4731722b0c084dbb1af21d0f34a5bc142d58aff57b391864ab71ddca7","integrity":"sha256-iWKB9HMXIrDAhNuxryHQ80pbwULViv9Xs5GGSrcd3Kc="},"application-97f313e9bb7d25476649f7d7215959cf421480fd0a3785d1956953bf94a1e8bd.css":{"logical_path":"application.css","mtime":"2019-09-30T14:43:41+08:00","size":1993118,"digest":"97f313e9bb7d25476649f7d7215959cf421480fd0a3785d1956953bf94a1e8bd","integrity":"sha256-l/MT6bt9JUdmSffXIVlZz0IUgP0KN4XRlWlTv5Sh6L0="},"admin-2cdb23442fa735025385b88f2900df04fef38b61530041a6dbe375ef0f0ae888.js":{"logical_path":"admin.js","mtime":"2019-10-11T14:38:33+08:00","size":4394616,"digest":"2cdb23442fa735025385b88f2900df04fef38b61530041a6dbe375ef0f0ae888","integrity":"sha256-LNsjRC+nNQJThbiPKQDfBP7zi2FTAEGm2+N17w8K6Ig="},"admin-2c2854b9a02158ded5a809aaf7144a8630b10354ab4e56fecc4dffcc713796cc.css":{"logical_path":"admin.css","mtime":"2019-10-10T17:12:05+08:00","size":846514,"digest":"2c2854b9a02158ded5a809aaf7144a8630b10354ab4e56fecc4dffcc713796cc","integrity":"sha256-LChUuaAhWN7VqAmq9xRKhjCxA1SrTlb+zE3/zHE3lsw="},"application-50059ae929866043b47015128702fcfba53d32a2df148e64e1d961c10651c6af.css":{"logical_path":"application.css","mtime":"2019-10-10T17:12:05+08:00","size":2001607,"digest":"50059ae929866043b47015128702fcfba53d32a2df148e64e1d961c10651c6af","integrity":"sha256-UAWa6SmGYEO0cBUShwL8+6U9MqLfFI5k4dlhwQZRxq8="},"admin-992cde09b6d17f00a49576ae2d9f1ced127244ba401ef5b7d677cab9741688d2.js":{"logical_path":"admin.js","mtime":"2019-10-16T16:11:32+08:00","size":4394790,"digest":"992cde09b6d17f00a49576ae2d9f1ced127244ba401ef5b7d677cab9741688d2","integrity":"sha256-mSzeCbbRfwCklXauLZ8c7RJyRLpAHvW31nfKuXQWiNI="},"admin-84f2a7791e275d6f820514370b3f968176b994b9dd7b8c3ba8bf48336b03f257.css":{"logical_path":"admin.css","mtime":"2019-10-16T19:25:40+08:00","size":846676,"digest":"84f2a7791e275d6f820514370b3f968176b994b9dd7b8c3ba8bf48336b03f257","integrity":"sha256-hPKneR4nXW+CBRQ3Cz+WgXa5lLnde4w7qL9IM2sD8lc="},"application-ef6bab84852baaf69a91fe6af875b6e1b118c55b4c7d165665c488fac80c4997.css":{"logical_path":"application.css","mtime":"2019-10-16T19:25:40+08:00","size":2001931,"digest":"ef6bab84852baaf69a91fe6af875b6e1b118c55b4c7d165665c488fac80c4997","integrity":"sha256-72urhIUrqvaakf5q+HW24bEYxVtMfRZWZcSI+sgMSZc="},"admin-c99030d305662f740aa84b6c925a1adbbaadaa07fd74e2655e64d44b4b97fc4a.js":{"logical_path":"admin.js","mtime":"2019-10-17T09:44:58+08:00","size":4394897,"digest":"c99030d305662f740aa84b6c925a1adbbaadaa07fd74e2655e64d44b4b97fc4a","integrity":"sha256-yZAw0wVmL3QKqEtskloa27qtqgf9dOJlXmTUS0uX/Eo="},"admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css":{"logical_path":"admin.css","mtime":"2019-10-17T10:22:41+08:00","size":846699,"digest":"534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d","integrity":"sha256-U0vehx1n9Nb8jaYRkX14vkBm/HWTulPukqoXBooZnW0="},"cooperative-04cd6a60d41220d38ee45ce40b1d004e1d0bcd87c132fb1a7bab6144c1deb8d7.js":{"logical_path":"cooperative.js","mtime":"2019-10-17T10:17:56+08:00","size":4330072,"digest":"04cd6a60d41220d38ee45ce40b1d004e1d0bcd87c132fb1a7bab6144c1deb8d7","integrity":"sha256-BM1qYNQSINOO5FzkCx0ATh0LzYfBMvsae6thRMHeuNc="},"cooperative-a345bbfd8e38b70c9285ecc1747012ffcde429187983e2aea5657abb56b9b4f3.css":{"logical_path":"cooperative.css","mtime":"2019-10-17T10:21:41+08:00","size":830628,"digest":"a345bbfd8e38b70c9285ecc1747012ffcde429187983e2aea5657abb56b9b4f3","integrity":"sha256-o0W7/Y44twyShezBdHAS/83kKRh5g+KupWV6u1a5tPM="},"application-0e417478d56f42467e857cd186b29cbbc0d6c7c6e85c8a6f42f39ac618943de8.css":{"logical_path":"application.css","mtime":"2019-09-03T08:55:53+08:00","size":442932,"digest":"0e417478d56f42467e857cd186b29cbbc0d6c7c6e85c8a6f42f39ac618943de8","integrity":"sha256-DkF0eNVvQkZ+hXzRhrKcu8DWx8boXIpvQvOaxhiUPeg="},"cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js":{"logical_path":"cooperative.js","mtime":"2019-10-17T14:03:03+08:00","size":4338033,"digest":"149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b","integrity":"sha256-FJ9HuGddYKgBTM/1DwD5Mv9p4r4ob/t0NDvEo+/7E1s="},"cooperative-6273b766d6ef11dd56174d868bab55e7f17af17546c888d2ba0dd0a6bcda76c8.css":{"logical_path":"cooperative.css","mtime":"2019-10-17T11:13:07+08:00","size":832914,"digest":"6273b766d6ef11dd56174d868bab55e7f17af17546c888d2ba0dd0a6bcda76c8","integrity":"sha256-YnO3ZtbvEd1WF02Gi6tV5/F68XVGyIjSug3Qprzadsg="},"admin-82f66cc80b5649c6530a562567f28fe8d05f7bc3b8221e0695b2216255c52ba6.js":{"logical_path":"admin.js","mtime":"2019-10-21T13:51:43+08:00","size":4397012,"digest":"82f66cc80b5649c6530a562567f28fe8d05f7bc3b8221e0695b2216255c52ba6","integrity":"sha256-gvZsyAtWScZTClYlZ/KP6NBfe8O4Ih4GlbIhYlXFK6Y="},"admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js":{"logical_path":"admin.js","mtime":"2019-10-21T16:41:06+08:00","size":4397437,"digest":"1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec","integrity":"sha256-G1co2U9rzPvO9FKnYNlMO28xlmvGXX+Jvgd/wupRK+w="},"admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js":{"logical_path":"admin.js","mtime":"2019-10-22T09:53:29+08:00","size":4408150,"digest":"c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f","integrity":"sha256-yMEn/vpeypi8oZgywkZhkxgWTo8kJjXAcDPiQjzBim8="},"admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css":{"logical_path":"admin.css","mtime":"2019-10-22T09:43:20+08:00","size":851150,"digest":"60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e","integrity":"sha256-YNIAwfzfYaYFN9Kcz0R5xrHl6QQgiHCmO47md8lrNH4="},"cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js":{"logical_path":"cooperative.js","mtime":"2019-10-22T09:55:26+08:00","size":4338142,"digest":"9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286","integrity":"sha256-n7esStRAgfr9WtKjob+39DKayW8ovGRG0f9SseLnEoY="}},"assets":{"admin.js":"admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js","admin.css":"admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css","font-awesome/fontawesome-webfont.eot":"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot","font-awesome/fontawesome-webfont.woff2":"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2","font-awesome/fontawesome-webfont.woff":"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff","font-awesome/fontawesome-webfont.ttf":"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf","font-awesome/fontawesome-webfont.svg":"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg","college.js":"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js","college.css":"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js","application.css":"application-0e417478d56f42467e857cd186b29cbbc0d6c7c6e85c8a6f42f39ac618943de8.css","cooperative.js":"cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js","cooperative.css":"cooperative-6273b766d6ef11dd56174d868bab55e7f17af17546c888d2ba0dd0a6bcda76c8.css"}}
\ No newline at end of file
diff --git a/public/assets/admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css b/public/assets/admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css
similarity index 99%
rename from public/assets/admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css
rename to public/assets/admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css
index 1779feb9c..edf0f7f74 100644
--- a/public/assets/admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css
+++ b/public/assets/admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css
@@ -25915,6 +25915,150 @@ input.form-control {
color: #6c757d;
}
+/* line 4, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item > .drag {
+ cursor: move;
+ background: #fff;
+ box-shadow: 1px 2px 5px 3px #f0f0f0;
+}
+
+/* line 10, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item-no {
+ font-size: 28px;
+ text-align: center;
+}
+
+/* line 15, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item-img {
+ cursor: pointer;
+ width: 100%;
+ height: 60px;
+}
+
+/* line 20, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item-img > img {
+ display: block;
+ width: 100%;
+ height: 60px;
+ background: #F5F5F5;
+}
+
+/* line 28, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .not_active {
+ background: #F0F0F0;
+}
+
+/* line 32, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .delete-btn {
+ font-size: 20px;
+ color: red;
+ cursor: pointer;
+}
+
+/* line 38, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .save-url-btn {
+ cursor: pointer;
+}
+
+/* line 42, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .operate-box {
+ display: -webkit-box;
+ display: flex;
+ -webkit-box-pack: justify;
+ justify-content: space-between;
+ -webkit-box-align: center;
+ align-items: center;
+}
+
+/* line 48, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .online-check-box {
+ font-size: 20px;
+}
+
+/* line 52, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .name-input {
+ -webkit-box-flex: 1;
+ flex: 1;
+}
+
+/* line 55, app/assets/stylesheets/admins/weapp_adverts.scss */
+.admins-weapp-adverts-index-page .adverts-card .advert-item .link-input {
+ -webkit-box-flex: 3;
+ flex: 3;
+}
+
+/* line 4, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item > .drag {
+ cursor: move;
+ background: #fff;
+ box-shadow: 1px 2px 5px 3px #f0f0f0;
+}
+
+/* line 10, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item-no {
+ font-size: 28px;
+ text-align: center;
+}
+
+/* line 15, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item-img {
+ cursor: pointer;
+ width: 100%;
+ height: 60px;
+}
+
+/* line 20, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item-img > img {
+ display: block;
+ width: 100%;
+ height: 60px;
+ background: #F5F5F5;
+}
+
+/* line 28, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .not_active {
+ background: #F0F0F0;
+}
+
+/* line 32, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .delete-btn {
+ font-size: 20px;
+ color: red;
+ cursor: pointer;
+}
+
+/* line 38, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .save-url-btn {
+ cursor: pointer;
+}
+
+/* line 42, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .operate-box {
+ display: -webkit-box;
+ display: flex;
+ -webkit-box-pack: justify;
+ justify-content: space-between;
+ -webkit-box-align: center;
+ align-items: center;
+}
+
+/* line 48, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .online-check-box {
+ font-size: 20px;
+}
+
+/* line 52, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .name-input {
+ -webkit-box-flex: 1;
+ flex: 1;
+}
+
+/* line 55, app/assets/stylesheets/admins/weapp_carousels.scss */
+.admins-weapp-carousels-index-page .carousels-card .custom-carousel-item .link-input {
+ -webkit-box-flex: 3;
+ flex: 3;
+}
+
/* line 18, app/assets/stylesheets/admin.scss */
body {
width: 100vw;
diff --git a/public/assets/admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css.gz b/public/assets/admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css.gz
similarity index 77%
rename from public/assets/admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css.gz
rename to public/assets/admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css.gz
index 26a606a1c..44bb80d0d 100644
Binary files a/public/assets/admin-534bde871d67f4d6fc8da611917d78be4066fc7593ba53ee92aa17068a199d6d.css.gz and b/public/assets/admin-60d200c1fcdf61a60537d29ccf4479c6b1e5e904208870a63b8ee677c96b347e.css.gz differ
diff --git a/public/assets/admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js b/public/assets/admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js
similarity index 99%
rename from public/assets/admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js
rename to public/assets/admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js
index 1c9d07222..bbc2ec400 100644
--- a/public/assets/admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js
+++ b/public/assets/admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js
@@ -133857,6 +133857,13 @@ $(document).on('turbolinks:load', function(){
$(document).on('turbolinks:load', function() {
if ($('body.admins-carousels-index-page').length > 0) {
var laboratoryId = $('#carousels-container').data('laboratoryId');
+ var resetNo = function(){
+ $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+ // 删除后
+ $(document).on('delete_success', resetNo);
// ------------ 保存链接 -----------
$('.carousels-card').on('click', '.save-data-btn', function(){
@@ -133923,9 +133930,7 @@ $(document).on('turbolinks:load', function() {
dataType: 'json',
data: { move_id: moveId, after_id: insertId },
success: function(data){
- $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
- $(ele).html(index + 1);
- })
+ resetNo();
},
error: function(res){
var data = res.responseJSON;
@@ -134056,8 +134061,70 @@ $(document).on('turbolinks:load', function() {
$imageElement.attr('src', data.url);
$imageElement.show();
$imageElement.next().html('重新上传');
- })
+ });
}
+
+ $(".admin-competition-list-form").on("change", '.competitions-hot-select', function () {
+ var s_value = $(this).get(0).checked ? 1 : 0;
+ var json = {};
+ json["hot"] = s_value;
+ $.ajax({
+ url: "/admins/competitions/hot_setting",
+ type: "POST",
+ dataType:'json',
+ data: json,
+ success: function(){
+ $.notify({ message: '操作成功' });
+ }
+ });
+ });
+
+ // ============== 新增竞赛 ===============
+ var $modal = $('.modal.admin-create-competition-modal');
+ var $form = $modal.find('form.admin-create-competition-form');
+ var $competitionNameInput = $form.find('input[name="competition_name"]');
+
+ $form.validate({
+ errorElement: 'span',
+ errorClass: 'danger text-danger',
+ rules: {
+ competition_name: {
+ required: true
+ }
+ }
+ });
+
+ // modal ready fire
+ $modal.on('show.bs.modal', function () {
+ $competitionNameInput.val('');
+ });
+
+ $modal.on('click', '.submit-btn', function(){
+ $form.find('.error').html('');
+
+ if ($form.valid()) {
+ var url = $form.data('url');
+
+ $.ajax({
+ method: 'POST',
+ dataType: 'json',
+ url: url,
+ data: $form.serialize(),
+ success: function(){
+ $.notify({ message: '创建成功' });
+ $modal.modal('hide');
+
+ setTimeout(function(){
+ window.location.reload();
+ }, 500);
+ },
+ error: function(res){
+ var data = res.responseJSON;
+ $form.find('.error').html(data.message);
+ }
+ });
+ }
+ });
});
$(document).on('turbolinks:load', function() {
@@ -134479,6 +134546,15 @@ $(document).on('turbolinks:load', function() {
})
}
});
+$(document).on('turbolinks:load', function() {
+ if($('body.admins-enroll-lists-index-page').length > 0){
+ let search_form = $(".search-form");
+ //导出
+ $(".competition-enroll-list-form").on("click","#enroll-lists-export",function () {
+ window.location.href = "/admins/competitions/"+$(this).attr("data-competition-id")+"/enroll_lists.xls?" + search_form.serialize();
+ });
+ }
+});
$(document).on('turbolinks:load', function() {
if($(".admins-graduation-standards-index-page").length > 0){
$(".admin-body-container").on("click", ".standard-create-modal", function () {
@@ -135262,14 +135338,17 @@ $(document).on('turbolinks:load', function() {
var $form = $modal.find('form.admin-upload-file-form')
var $sourceIdInput = $modal.find('input[name="source_id"]');
var $sourceTypeInput = $modal.find('input[name="source_type"]');
+ var $suffixInput = $modal.find('input[name="suffix"]');
$modal.on('show.bs.modal', function(event){
var $link = $(event.relatedTarget);
var sourceId = $link.data('sourceId');
var sourceType = $link.data('sourceType');
+ var suffix = $link.data('suffix');
$sourceIdInput.val(sourceId);
$sourceTypeInput.val(sourceType);
+ if(suffix != undefined){ $suffixInput.val(suffix); }
$modal.find('.upload-file-input').trigger('click');
});
@@ -135306,6 +135385,7 @@ $(document).on('turbolinks:load', function() {
contentType: false,
success: function(data){
$.notify({ message: '上传成功' });
+ $modal.find('.file-names').html('');
$modal.trigger('upload:success', data);
$modal.modal('hide');
},
@@ -135597,10 +135677,17 @@ $(document).on('turbolinks:load', function() {
});
$('.modal.admin-upload-file-modal').on('upload:success', function(e, data){
- var $imageElement = $('.shixun-image-' + data.source_id);
- $imageElement.attr('src', data.url);
- $imageElement.show();
- $imageElement.next().html('重新上传');
+ if(data.suffix == '_weapp'){
+ var $imageElement = $('.shixun-weapp-image-' + data.source_id);
+ $imageElement.attr('src', data.url);
+ $imageElement.show();
+ $imageElement.next().html('重新上传');
+ } else {
+ var $imageElement = $('.shixun-image-' + data.source_id);
+ $imageElement.attr('src', data.url);
+ $imageElement.show();
+ $imageElement.next().html('重新上传');
+ }
})
}
});
@@ -136097,6 +136184,255 @@ $(document).on('turbolinks:load', function() {
}
})
;
+$(document).on('turbolinks:load', function() {
+ if ($('body.admins-weapp-adverts-index-page').length > 0) {
+ var resetNo = function(){
+ $('#adverts-container .advert-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+
+ // ------------ 保存链接 -----------
+ $('.adverts-card').on('click', '.save-data-btn', function(){
+ var $link = $(this);
+ var id = $link.data('id');
+ var link = $('.advert-item-' + id).find('.link-input').val();
+ $link.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_adverts/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { link: link },
+ success: function(data){
+ $.notify({ message: '操作成功' });
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $link.removeAttr('disabled');
+ }
+ })
+ });
+ // -------------- 是否在首页展示 --------------
+ $('.adverts-card').on('change', '.online-check-box', function(){
+ var $checkbox = $(this);
+ var id = $checkbox.data('id');
+ var checked = $checkbox.is(':checked');
+ $checkbox.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_adverts/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { online: checked },
+ success: function(data){
+ $.notify({ message: '保存成功' });
+ var box = $('.advert-item-' + id).find('.drag');
+ if(checked){
+ box.removeClass('not_active');
+ }else{
+ box.addClass('not_active');
+ }
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $checkbox.removeAttr('disabled');
+ }
+ })
+ });
+
+ // ------------ 拖拽 -------------
+ var onDropFunc = function(el, _target, _source, sibling){
+ var moveId = $(el).data('id');
+ var insertId = $(sibling).data('id') || '';
+
+ $.ajax({
+ url: '/admins/weapp_adverts/drag',
+ method: 'POST',
+ dataType: 'json',
+ data: { move_id: moveId, after_id: insertId },
+ success: function(data){
+ resetNo();
+ },
+ error: function(res){
+ var data = res.responseJSON;
+ $.notify({message: '移动失败,原因:' + data.message}, {type: 'danger'});
+ }
+ })
+ };
+ var ele1 = document.getElementById('adverts-container');
+ dragula([ele1], { mirrorContainer: ele1 }).on('drop', onDropFunc);
+
+
+ // ----------- 新增 --------------
+ var $createModal = $('.modal.admin-add-weapp-advert-modal');
+ var $createForm = $createModal.find('form.admin-add-weapp-advert-form');
+
+ $createForm.validate({
+ errorElement: 'span',
+ errorClass: 'danger text-danger',
+ rules: {
+ "weapp_settings_advert[image]": {
+ required: true
+ }
+ }
+ });
+
+ $createModal.on('show.bs.modal', function(event){
+ resetFileInputFunc($createModal.find('.img-file-input'));
+ $createModal.find('.file-names').html('选择文件');
+ });
+
+ $createModal.on('click', '.submit-btn', function() {
+ $createForm.find('.error').html('');
+
+ if ($createForm.valid()) {
+ $createForm.submit();
+ } else {
+ $createForm.find('.error').html('请选择图片');
+ }
+ });
+ $createModal.on('change', '.img-file-input', function(){
+ var file = $(this)[0].files[0];
+ $createModal.find('.file-names').html(file ? file.name : '请选择文件');
+ })
+
+ // -------------- 重新上传图片 --------------
+ //replace_image_url
+ $('.modal.admin-upload-file-modal').on('upload:success', function(e, data){
+ var $advertItem = $('.advert-item-' + data.source_id);
+ $advertItem.find('.advert-item-img img').attr('src', data.url);
+ })
+
+ // 删除后
+ $(document).on('delete_success', resetNo)
+ }
+})
+;
+$(document).on('turbolinks:load', function() {
+ if ($('body.admins-weapp-carousels-index-page').length > 0) {
+ var resetNo = function(){
+ $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+ // ------------ 保存链接 -----------
+ $('.carousels-card').on('click', '.save-data-btn', function(){
+ var $link = $(this);
+ var id = $link.data('id');
+ var link = $('.custom-carousel-item-' + id).find('.link-input').val();
+ $link.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_carousels/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { link: link },
+ success: function(data){
+ $.notify({ message: '操作成功' });
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $link.removeAttr('disabled');
+ }
+ })
+ });
+ // -------------- 是否在首页展示 --------------
+ $('.carousels-card').on('change', '.online-check-box', function(){
+ var $checkbox = $(this);
+ var id = $checkbox.data('id');
+ var checked = $checkbox.is(':checked');
+ $checkbox.attr('disabled', true);
+
+ $.ajax({
+ url: '/admins/weapp_carousels/' + id,
+ method: 'PATCH',
+ dataType: 'json',
+ data: { online: checked },
+ success: function(data){
+ $.notify({ message: '保存成功' });
+ var box = $('.custom-carousel-item-' + id).find('.drag');
+ if(checked){
+ box.removeClass('not_active');
+ }else{
+ box.addClass('not_active');
+ }
+ },
+ error: ajaxErrorNotifyHandler,
+ complete: function(){
+ $checkbox.removeAttr('disabled');
+ }
+ })
+ });
+
+ // ------------ 拖拽 -------------
+ var onDropFunc = function(el, _target, _source, sibling){
+ var moveId = $(el).data('id');
+ var insertId = $(sibling).data('id') || '';
+
+ $.ajax({
+ url: '/admins/weapp_carousels/drag',
+ method: 'POST',
+ dataType: 'json',
+ data: { move_id: moveId, after_id: insertId },
+ success: function(data){
+ resetNo();
+ },
+ error: function(res){
+ var data = res.responseJSON;
+ $.notify({message: '移动失败,原因:' + data.message}, {type: 'danger'});
+ }
+ })
+ };
+ var ele1 = document.getElementById('carousels-container');
+ dragula([ele1], { mirrorContainer: ele1 }).on('drop', onDropFunc);
+
+
+ // ----------- 新增 --------------
+ var $createModal = $('.modal.admin-add-weapp-carousel-modal');
+ var $createForm = $createModal.find('form.admin-add-weapp-carousel-form');
+
+ $createForm.validate({
+ errorElement: 'span',
+ errorClass: 'danger text-danger',
+ rules: {
+ "weapp_settings_carousel[image]": {
+ required: true
+ }
+ }
+ });
+
+ $createModal.on('show.bs.modal', function(event){
+ resetFileInputFunc($createModal.find('.img-file-input'));
+ $createModal.find('.file-names').html('选择文件');
+ });
+
+ $createModal.on('click', '.submit-btn', function() {
+ $createForm.find('.error').html('');
+
+ if ($createForm.valid()) {
+ $createForm.submit();
+ } else {
+ $createForm.find('.error').html('请选择图片');
+ }
+ });
+ $createModal.on('change', '.img-file-input', function(){
+ var file = $(this)[0].files[0];
+ $createModal.find('.file-names').html(file ? file.name : '请选择文件');
+ })
+
+ // -------------- 重新上传图片 --------------
+ //replace_image_url
+ $('.modal.admin-upload-file-modal').on('upload:success', function(e, data){
+ var $carouselItem = $('.custom-carousel-item-' + data.source_id);
+ $carouselItem.find('.custom-carousel-item-img img').attr('src', data.url);
+ })
+
+ // 删除后
+ $(document).on('delete_success', resetNo)
+ }
+})
+;
diff --git a/public/assets/admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js.gz b/public/assets/admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js.gz
similarity index 98%
rename from public/assets/admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js.gz
rename to public/assets/admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js.gz
index 519d4b32f..c89ad5256 100644
Binary files a/public/assets/admin-1b5728d94f6bccfbcef452a760d94c3b6f31966bc65d7f89be077fc2ea512bec.js.gz and b/public/assets/admin-c8c127fefa5eca98bca19832c246619318164e8f242635c07033e2423cc18a6f.js.gz differ
diff --git a/public/assets/cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js b/public/assets/cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js
similarity index 99%
rename from public/assets/cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js
rename to public/assets/cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js
index 80b121449..5d30eb714 100644
--- a/public/assets/cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js
+++ b/public/assets/cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js
@@ -133825,6 +133825,13 @@ module.exports = tick;
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}();
$(document).on('turbolinks:load', function() {
if ($('body.cooperative-carousels-index-page').length > 0) {
+ var resetNo = function(){
+ $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
+ $(ele).html(index + 1);
+ })
+ }
+ // 删除后
+ $(document).on('delete_success', resetNo);
// ------------ 保存链接 -----------
$('.carousels-card').on('click', '.save-data-btn', function(){
var $link = $(this);
@@ -133890,9 +133897,7 @@ $(document).on('turbolinks:load', function() {
dataType: 'json',
data: { move_id: moveId, after_id: insertId },
success: function(data){
- $('#carousels-container .custom-carousel-item-no').each(function(index, ele){
- $(ele).html(index + 1);
- })
+ resetNo();
},
error: function(res){
var data = res.responseJSON;
diff --git a/public/assets/cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js.gz b/public/assets/cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js.gz
similarity index 96%
rename from public/assets/cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js.gz
rename to public/assets/cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js.gz
index 3f30bd269..4fb78eb9a 100644
Binary files a/public/assets/cooperative-149f47b8675d60a8014ccff50f00f932ff69e2be286ffb74343bc4a3effb135b.js.gz and b/public/assets/cooperative-9fb7ac4ad44081fafd5ad2a3a1bfb7f4329ac96f28bc6446d1ff52b1e2e71286.js.gz differ