diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 59b0d7e41..fb68f23bf 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -890,7 +890,7 @@ class CoursesController < ApplicationController name = worksheet.cell(row, 1).to_s if @course.course_groups.where(:name => name).blank? - @course.course_groups << CourseGroup.new(:name => name) + @course.course_groups << CourseGroup.new(:name => name, :position => @course.course_groups_count + 1) group_count += 1 end end diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index 96fcbeace..00fea5f3e 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -1,6 +1,7 @@ class QuestionBanksController < ApplicationController before_action :require_login, :check_auth before_action :params_filter, except: [:my_courses] + before_action :teacher_or_admin, except: [:bank_list] # 题库选用列表 # object_type: # normal 普通作业题库; group 分组作业题库; poll问卷题库; exercise试卷题库; gtask 毕设选题题库;gtopic 毕设任务 @@ -81,24 +82,29 @@ class QuestionBanksController < ApplicationController def my_courses @courses = current_user.manage_courses.where(is_delete: 0, is_end: 0) + unless params[:search].blank? + @courses = @courses.where("name like ?", "%#{params[:search].strip}%") + end end def send_to_course - bank = current_bank - course = current_user.manage_courses.find_by(id: params[:course_id]) - case @object_type - when 'HomeworkBank' # 作业 - quote_homework_bank bank, course - when 'ExerciseBank' - if bank.container_type == 'Exercise' # 试卷 - quote_exercise_bank bank, course - else # 问卷 - quote_poll_bank bank, course + banks = object_banks + course = current_user.manage_courses.find_by!(id: params[:course_id]) + banks.each do |bank| + case @object_type + when 'HomeworkBank' # 作业 + quote_homework_bank bank, course + when 'ExerciseBank' + if bank.container_type == 'Exercise' # 试卷 + quote_exercise_bank bank, course + else # 问卷 + quote_poll_bank bank, course + end + when 'GtaskBank' + quote_gtask_bank bank, course + when 'GtopicBank' + quote_gtopic_bank bank, course end - when 'GtaskBank' - quote_gtask_bank bank, course - when 'GtopicBank' - quote_gtopic_bank bank, course end normal_status("发送成功") end @@ -106,7 +112,7 @@ class QuestionBanksController < ApplicationController def destroy bank = current_bank - unless user.admin? || bank.user_id == user.id + unless current_user.admin? || bank.user_id == current_user.id render_forbidden return end @@ -121,11 +127,32 @@ class QuestionBanksController < ApplicationController render_ok end + def multi_delete + @objects = object_banks + @objects.destroy_all + normal_status("删除成功") + end + + def multi_public + @objects = object_banks + @objects.update_all(is_public: true) + normal_status("更新成功") + end + private + def object_banks + banks ||= @object_type.classify.constantize.where(@object_filter).where(id: params[:object_id]) + unless current_user.admin? + banks = banks.where(user_id: current_user.id) + end + banks + end + def current_bank @_current_bank ||= @object_type.classify.constantize.where(@object_filter).find(params[:id]) end + def params_filter type = ["normal", "group", "poll", "exercise", "gtask", "gtopic"] tip_exception("object_type类型不正确") unless type.include?(params[:object_type]) @@ -152,6 +179,10 @@ class QuestionBanksController < ApplicationController end end + def teacher_or_admin + tip_exception(403, "无权限操作") unless current_user.is_certification_teacher || current_user.admin? + end + def quote_homework_bank homework, course ActiveRecord::Base.transaction do # 复制作业的基本信息 diff --git a/app/views/admins/shixun_settings/shared/_td.html.erb b/app/views/admins/shixun_settings/shared/_td.html.erb index 8523b682b..931ad11ac 100644 --- a/app/views/admins/shixun_settings/shared/_td.html.erb +++ b/app/views/admins/shixun_settings/shared/_td.html.erb @@ -17,15 +17,16 @@ + -- - - <%= File.exist?(disk_filename("Shixun",shixun.id)) ? "重新上传" : "上传图片" %> - - <% if File.exist?(disk_filename("Shixun",shixun.id)) %> - <%= image_tag(url_to_avatar(shixun), :class => "w80 h80 fl ml5 shixun_image_show", :id => "shixun_image_show_#{shixun.id}") %> - <% else %> - - <% end %> + + <%#= File.exist?(disk_filename("Shixun",shixun.id)) ? "重新上传" : "上传图片" %> + + <%# if File.exist?(disk_filename("Shixun",shixun.id)) %> + <%#= image_tag(url_to_avatar(shixun), :class => "w80 h80 fl ml5 shixun_image_show", :id => "shixun_image_show_#{shixun.id}") %> + <%# else %> + + <%# end %> <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.login}",target:'_blank' %> diff --git a/config/routes.rb b/config/routes.rb index ec366edec..a0aaa65cc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -632,6 +632,8 @@ Rails.application.routes.draw do post :save_banks get :my_courses post :send_to_course + delete :multi_delete + post :multi_public end end diff --git a/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json b/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json index 1da7534f9..ef941726e 100644 --- a/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json +++ b/public/assets/.sprockets-manifest-1c370772f16743f825981ab0e5c94237.json @@ -1 +1 @@ -{"files":{"admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js":{"logical_path":"admin.js","mtime":"2019-08-29T10:56:46+08:00","size":1325003,"digest":"9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d","integrity":"sha256-m8AdkpYRCK2wZzmuQ9UpKMv0HTg78npK4hJa0jLy8W0="},"admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css":{"logical_path":"admin.css","mtime":"2019-08-29T10:56:46+08:00","size":640292,"digest":"96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b","integrity":"sha256-lq8GMDfgur8lsVedHJ0eGQGWHRCljvPUH+ueaP7/NIs="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-23T09:13:14+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-23T09:13:14+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-23T09:13:14+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-23T09:13:14+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-23T09:13:14+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-08-23T10:44:25+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js":{"logical_path":"application.js","mtime":"2019-08-29T10:56:46+08:00","size":1459545,"digest":"761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13","integrity":"sha256-dh0Ls1TWAI6FP9C2hmP1MGxQNdzA9QDWhxAlvK7+CxM="},"application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css":{"logical_path":"application.css","mtime":"2019-08-29T10:56:46+08:00","size":1146039,"digest":"7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe","integrity":"sha256-fkxPXnRqLWpv73Fdb8cQBbPYq4l+e4+3ywZBk1e9YP4="}},"assets":{"admin.js":"admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js","admin.css":"admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.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","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js","application.css":"application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css"}} \ No newline at end of file +{"files":{"admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js":{"logical_path":"admin.js","mtime":"2019-08-29T10:56:46+08:00","size":1325003,"digest":"9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d","integrity":"sha256-m8AdkpYRCK2wZzmuQ9UpKMv0HTg78npK4hJa0jLy8W0="},"admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css":{"logical_path":"admin.css","mtime":"2019-08-29T10:56:46+08:00","size":640292,"digest":"96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b","integrity":"sha256-lq8GMDfgur8lsVedHJ0eGQGWHRCljvPUH+ueaP7/NIs="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-23T09:13:14+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-23T09:13:14+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-23T09:13:14+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-23T09:13:14+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-23T09:13:14+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-08-23T10:44:25+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js":{"logical_path":"application.js","mtime":"2019-08-29T10:56:46+08:00","size":1459545,"digest":"761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13","integrity":"sha256-dh0Ls1TWAI6FP9C2hmP1MGxQNdzA9QDWhxAlvK7+CxM="},"application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css":{"logical_path":"application.css","mtime":"2019-08-29T10:56:46+08:00","size":1146039,"digest":"7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe","integrity":"sha256-fkxPXnRqLWpv73Fdb8cQBbPYq4l+e4+3ywZBk1e9YP4="},"admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js":{"logical_path":"admin.js","mtime":"2019-08-29T13:45:30+08:00","size":1324968,"digest":"692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53","integrity":"sha256-aSw5JSjFYJDYj+yS5v87ajRCxqaR2UZ8O1HoJiVBfFM="},"admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css":{"logical_path":"admin.css","mtime":"2019-08-29T13:45:30+08:00","size":640433,"digest":"94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051","integrity":"sha256-lPa6CwwXINYbTb9g18k5+AI/Fw42CZWXzAAvVG+QoFE="},"application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js":{"logical_path":"application.js","mtime":"2019-08-29T13:45:30+08:00","size":1459510,"digest":"8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957","integrity":"sha256-i6a85ZVbdgzVu5Ip0kQNPvU/y8SwcdnQ6SBhdqAzeVc="},"application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css":{"logical_path":"application.css","mtime":"2019-08-29T13:45:30+08:00","size":1146321,"digest":"d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb","integrity":"sha256-2FwKsrPsLO9MvIxO/ObVv6d8hWigy/1Kx04Msga28+s="}},"assets":{"admin.js":"admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js","admin.css":"admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.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","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js","application.css":"application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css"}} \ No newline at end of file diff --git a/public/assets/admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js b/public/assets/admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js similarity index 99% rename from public/assets/admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js rename to public/assets/admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js index 6cf15aa3a..54423bac3 100644 --- a/public/assets/admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js +++ b/public/assets/admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js @@ -38362,46 +38362,37 @@ $(document).on('turbolinks:load', function() { ; $(document).on('turbolinks:load', function() { if ($('body.admins-shixun-settings-index-page').length > 0) { + $(".shixun-settings-select").on("change", function () { + var s_value = $(this).val(); + var s_name = $(this).attr("name"); + var json = {}; + json[s_name] = s_value; + $.ajax({ + url: "/admins/shixun_settings", + type: "GET", + dataType:'script', + data: json + }) + }); + $(".shixun-setting-form").on("change",function () { + var s_id = $(this).attr("data-id"); + var s_value = $(this).val(); + var s_name = $(this).attr("name"); + var json = {}; + var s_index = $(this).parent("td").siblings(".shixun-line-no").text(); + json[s_name] = s_value; + json["page_no"] = s_index; + $.ajax({ + url: "/admins/shixun_settings/" + s_id, + type: "PUT", + dataType:'script', + data: json + }) + }) } }); -function update_change(target) { - var s_id = $(target).attr("data-id"); - var s_value = $(target).val(); - var s_name = $(target).attr("name"); - var json = {}; - var s_index = $(target).parent("td").siblings(".shixun-line-no").text(); - json[s_name] = s_value; - json["page_no"] = s_index; - $.ajax({ - url: "/admins/shixun_settings/" + s_id, - type: "PUT", - dataType:'script', - data: json, - success: function (data) { - - } - }) -} - - -function select_change(target) { - var s_value = $(target).val(); - var s_name = $(target).attr("name"); - var json = {}; - json[s_name] = s_value; - $.ajax({ - url: "/admins/shixun_settings/", - type: "GET", - dataType:'script', - data: json, - success: function (data) { - - } - }) -} -; $(document).on('turbolinks:load', function() { $('select#tag-choosed').select2({ placeholder: "请选择分类", diff --git a/public/assets/admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js.gz b/public/assets/admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js.gz similarity index 97% rename from public/assets/admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js.gz rename to public/assets/admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js.gz index 0302686cf..03c214092 100644 Binary files a/public/assets/admin-9bc01d92961108adb06739ae43d52928cbf41d383bf27a4ae2125ad232f2f16d.js.gz and b/public/assets/admin-692c392528c56090d88fec92e6ff3b6a3442c6a691d9467c3b51e82625417c53.js.gz differ diff --git a/public/assets/admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css b/public/assets/admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css similarity index 99% rename from public/assets/admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css rename to public/assets/admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css index 0acd5f130..ea95aa0e2 100644 --- a/public/assets/admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css +++ b/public/assets/admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css @@ -18726,6 +18726,13 @@ input[type="checkbox"] { border: 1px solid #eee !important; } +/* line 10, app/assets/stylesheets/admins/shixun_settings.scss */ +.setting-chosen { + font-weight: 400; + font-size: 10px; + color: #333; +} + /* line 1, app/assets/stylesheets/admins/sidebar.scss */ #sidebar { min-width: 200px; diff --git a/public/assets/admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css.gz b/public/assets/admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css.gz similarity index 97% rename from public/assets/admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css.gz rename to public/assets/admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css.gz index b48eb3027..64b11d882 100644 Binary files a/public/assets/admin-96af063037e0babf25b1579d1c9d1e1901961d10a58ef3d41feb9e68feff348b.css.gz and b/public/assets/admin-94f6ba0b0c1720d61b4dbf60d7c939f8023f170e36099597cc002f546f90a051.css.gz differ diff --git a/public/assets/application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js b/public/assets/application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js similarity index 99% rename from public/assets/application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js rename to public/assets/application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js index 31929c033..62b797984 100644 --- a/public/assets/application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js +++ b/public/assets/application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js @@ -38362,46 +38362,37 @@ $(document).on('turbolinks:load', function() { ; $(document).on('turbolinks:load', function() { if ($('body.admins-shixun-settings-index-page').length > 0) { + $(".shixun-settings-select").on("change", function () { + var s_value = $(this).val(); + var s_name = $(this).attr("name"); + var json = {}; + json[s_name] = s_value; + $.ajax({ + url: "/admins/shixun_settings", + type: "GET", + dataType:'script', + data: json + }) + }); + $(".shixun-setting-form").on("change",function () { + var s_id = $(this).attr("data-id"); + var s_value = $(this).val(); + var s_name = $(this).attr("name"); + var json = {}; + var s_index = $(this).parent("td").siblings(".shixun-line-no").text(); + json[s_name] = s_value; + json["page_no"] = s_index; + $.ajax({ + url: "/admins/shixun_settings/" + s_id, + type: "PUT", + dataType:'script', + data: json + }) + }) } }); -function update_change(target) { - var s_id = $(target).attr("data-id"); - var s_value = $(target).val(); - var s_name = $(target).attr("name"); - var json = {}; - var s_index = $(target).parent("td").siblings(".shixun-line-no").text(); - json[s_name] = s_value; - json["page_no"] = s_index; - $.ajax({ - url: "/admins/shixun_settings/" + s_id, - type: "PUT", - dataType:'script', - data: json, - success: function (data) { - - } - }) -} - - -function select_change(target) { - var s_value = $(target).val(); - var s_name = $(target).attr("name"); - var json = {}; - json[s_name] = s_value; - $.ajax({ - url: "/admins/shixun_settings/", - type: "GET", - dataType:'script', - data: json, - success: function (data) { - - } - }) -} -; $(document).on('turbolinks:load', function() { $('select#tag-choosed').select2({ placeholder: "请选择分类", diff --git a/public/assets/application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js.gz b/public/assets/application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js.gz similarity index 81% rename from public/assets/application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js.gz rename to public/assets/application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js.gz index 29e2dd916..36faaa5a0 100644 Binary files a/public/assets/application-761d0bb354d6008e853fd0b68663f5306c5035dcc0f500d6871025bcaefe0b13.js.gz and b/public/assets/application-8ba6bce5955b760cd5bb9229d2440d3ef53fcbc4b071d9d0e9206176a0337957.js.gz differ diff --git a/public/assets/application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css b/public/assets/application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css similarity index 99% rename from public/assets/application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css rename to public/assets/application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css index 2b89b1fad..b819aa43c 100644 --- a/public/assets/application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css +++ b/public/assets/application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css @@ -18726,6 +18726,13 @@ input[type="checkbox"] { border: 1px solid #eee !important; } +/* line 10, app/assets/stylesheets/admins/shixun_settings.scss */ +.setting-chosen { + font-weight: 400; + font-size: 10px; + color: #333; +} + /* line 1, app/assets/stylesheets/admins/sidebar.scss */ #sidebar { min-width: 200px; @@ -19421,6 +19428,13 @@ input[type="checkbox"] { .select2 .select2-selection__choice { border: 1px solid #eee !important; } + +/* line 10, app/assets/stylesheets/admins/shixun_settings.scss */ +.setting-chosen { + font-weight: 400; + font-size: 10px; + color: #333; +} /* line 1, app/assets/stylesheets/admins/sidebar.scss */ #sidebar { min-width: 200px; diff --git a/public/assets/application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css.gz b/public/assets/application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css.gz similarity index 60% rename from public/assets/application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css.gz rename to public/assets/application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css.gz index 6b2204c06..c44bb3a3b 100644 Binary files a/public/assets/application-7e4c4f5e746a2d6a6fef715d6fc71005b3d8ab897e7b8fb7cb06419357bd60fe.css.gz and b/public/assets/application-d85c0ab2b3ec2cef4cbc8c4efce6d5bfa77c8568a0cbfd4ac74e0cb206b6f3eb.css.gz differ