diff --git a/Gemfile b/Gemfile index ad254d436..55030971d 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,8 @@ gem 'bootsnap', '>= 1.1.0', require: false gem 'gitlab', path: 'lib/gitlab-cli' +gem 'chinese_pinyin' + gem 'rack-cors' gem 'redis-rails' gem 'roo-xls' diff --git a/app/assets/javascripts/admins/shixun_settings/index.js b/app/assets/javascripts/admins/shixun_settings/index.js index 8b3eee505..ece7b3233 100644 --- a/app/assets/javascripts/admins/shixun_settings/index.js +++ b/app/assets/javascripts/admins/shixun_settings/index.js @@ -12,6 +12,11 @@ $(document).on('turbolinks:load', function() { window.location.href = "/admins/shixun_settings.xls?" + searchForm.serialize(); }); + // 基础数据导出 + searchContainer.on('click', "#shixun-settings-base-export", function () { + window.location.href = "/admins/shixun_settings.xls?base_data=1" + searchForm.serialize(); + }); + $(".shixun-settings-list-container").on("change", '.shixun-setting-form', function () { var s_id = $(this).attr("data-id"); var s_value = $(this).val(); diff --git a/app/assets/javascripts/comments.js b/app/assets/javascripts/comments.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/comments.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 756a5e241..a401fc379 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -53,3 +53,8 @@ input.form-control { position: absolute; } +.export-base-absolute{ + right:100px; + position: absolute; +} + diff --git a/app/assets/stylesheets/comments.scss b/app/assets/stylesheets/comments.scss new file mode 100644 index 000000000..3722c124e --- /dev/null +++ b/app/assets/stylesheets/comments.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the comments controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb index d635ae8df..bd54018cd 100644 --- a/app/controllers/admins/shixun_settings_controller.rb +++ b/app/controllers/admins/shixun_settings_controller.rb @@ -28,7 +28,13 @@ class Admins::ShixunSettingsController < Admins::BaseController format.html format.xls{ filename = "实训详情_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.xls" - send_data(shixun_list_xls(shixun_settings), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + export_url = + if params[:base_data].present? + shixun_base_list_xls(shixun_settings) + else + shixun_list_xls(shixun_settings) + end + send_data(export_url, :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) } end @@ -65,19 +71,20 @@ class Admins::ShixunSettingsController < Admins::BaseController sheet1.row(0).default_format = blue sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "实践任务","选择题任务","挑战人数", "通关人数", "状态","创建者", "单位", "职业", "关卡序号","关卡名称","技能标签"]) count_row = 1 - shixuns.find_each do |shixun| + shixuns.includes(:fork_shixuns, :myshixuns, :mirror_repositories, challenges: [:challenge_tags], user: [user_extension: :school]).find_each do |shixun| sheet1[count_row, 0] = shixun.identifier sheet1[count_row, 1] = shixun.name - sheet1[count_row, 2] = shixun.shixun_main_name + sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name + sheet1[count_row, 3] = shixun.fork_identifier - sheet1[count_row, 4] = shixun.challenges.practice_type.count - sheet1[count_row, 5] = shixun.challenges.choose_type.count - sheet1[count_row, 6] = shixun.myshixuns.count - sheet1[count_row, 7] = shixun.myshixuns.finished.count + sheet1[count_row, 4] = shixun.challenges.select{|c| c.st == 0}.size + sheet1[count_row, 5] = shixun.challenges.select{|c| c.st == 1}.size + sheet1[count_row, 6] = shixun.myshixuns_count + sheet1[count_row, 7] = shixun.myshixuns.select{|m| m.status == 1}.size sheet1[count_row, 8] = shixun.shixun_status - sheet1[count_row, 9] = shixun.owner.show_real_name - sheet1[count_row, 10] = shixun.owner.school_name - sheet1[count_row, 11] = shixun.owner.identity + sheet1[count_row, 9] = shixun.user.show_real_name + sheet1[count_row, 10] = shixun.user.school_name + sheet1[count_row, 11] = shixun.user.identity shixun.challenges.each do |challenge| sheet1[count_row, 12] = "第#{challenge.position}关" sheet1[count_row, 13] = challenge.subject @@ -90,6 +97,34 @@ class Admins::ShixunSettingsController < Admins::BaseController xls_report.string end + def shixun_base_list_xls shixuns + xls_report = StringIO.new + book = Spreadsheet::Workbook.new + sheet1 = book.create_worksheet :name => "sheet" + blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 + sheet1.row(0).default_format = blue + sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "状态","创建者", "单位", "职业", "关卡序号","关卡名称"]) + count_row = 1 + shixuns.includes(:mirror_repositories, :challenges, user: [user_extension: :school]).find_each do |shixun| + sheet1[count_row, 0] = shixun.identifier + sheet1[count_row, 1] = shixun.name + sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name + sheet1[count_row, 3] = shixun.fork_from + sheet1[count_row, 4] = shixun.shixun_status + sheet1[count_row, 5] = shixun.user.show_real_name + sheet1[count_row, 6] = shixun.user.school_name + sheet1[count_row, 7] = shixun.user.identity + shixun.challenges.each do |challenge| + sheet1[count_row, 8] = "第#{challenge.position}关" + sheet1[count_row, 9] = challenge.subject + count_row += 1 + end + count_row += 1 + end + book.write xls_report + xls_report.string + end + def setting_params params.permit(:use_scope,:excute_time,:close,:status,:can_copy,:webssh,:hidden,:homepage_show,:task_pass,:code_hidden,:page_no, :id,tag_repertoires:[]) end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1bc2bad7d..c6aca5ae5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -45,6 +45,13 @@ class ApplicationController < ActionController::Base check_account tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") end + if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT + # 实名认证和职业认证的身份判断 + tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication && + @course.professional_certification && (!current_user.authentication && !current_user.professional_certification) + tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication + tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification + end uid_logger("###############user_course_identity:#{@user_course_identity}") end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb new file mode 100644 index 000000000..851567c92 --- /dev/null +++ b/app/controllers/comments_controller.rb @@ -0,0 +1,59 @@ +class CommentsController < ApplicationController + before_action :find_hack + before_action :require_login + + + # 评论 + def create + begin + @discuss = @hack.discusses.new(comment_params) # 管理员回复的能够显示 + @discuss.hidden = false + @discuss.user_id = current_user.id + @discuss.save! + rescue Exception => e + uid_logger_error("create discuss failed : #{e.message}") + render_error("评论异常") + end + end + + # 回复 + def reply + begin + @discuss = @hack.discusses.new(reply_params) + @discuss.hidden = false + @discuss.user_id = current_user.id + @discuss.root_id = params[:parent_id] + @discuss.save! + rescue Exception => e + uid_logger_error("reply discuss failed : #{e.message}") + render_error("回复评论异常") + end + end + + # 列表 + def index + disscusses = @hack.disscusses.where(:root_id => nil) + @disscuss_count = disscusses.count + @disscusses= paginate disscusses + end + + # 删除 + def destroy + @hack.discusses.find_by(id: params[:id]).destroy + render_ok + end + + + private + def find_hack + @hack = Hack.find_by_identifier params[:identifier] + end + + def comment_params + params.require(:comments).permit(:content) + end + + def reply_params + params.require(:comments).permit(:content, :parent_id) + end +end diff --git a/app/controllers/concerns/login_helper.rb b/app/controllers/concerns/login_helper.rb index e94cf8a21..b3ec6da63 100644 --- a/app/controllers/concerns/login_helper.rb +++ b/app/controllers/concerns/login_helper.rb @@ -62,6 +62,17 @@ module LoginHelper end def start_user_session(user) + # re_subdomain = "#{request.subdomain.split('.').first}_user_id" + # session[:"#{request.subdomain}_user_id"] = user.id + # Rails.logger.info("domain_user_id session is: 3333332222111#{session[:"#{request.subdomain}_user_id"]}") + # Rails.logger.info("user_id session is: 3333332222111#{session[:"#{request.subdomain}_user_id"]}") + # + # # if current_laboratory.main_site? + # # session[:user_id] = user.id + # # else + # # session[:"#{request.subdomain}_user_id"] = user.id + # # end + session[:user_id] = user.id session[:ctime] = Time.now.utc.to_i session[:atime] = Time.now.utc.to_i diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index f78844a58..de24f7a8e 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -635,7 +635,7 @@ class CoursesController < ApplicationController teacher_member = CourseMember.create!(course_id: @course.id, user_id: params[:user_id], role: params[:roles].include?("PROFESSOR") ? 2 : 3) # 如果有未审批的申请教师/助教的记录,则修改状态为已审批 apply_teacher = CourseMessage.where(course_id: @course.id, course_message_id: params[:user_id], status: 0).last - apply_teacher.update!(status: 1, apply_user_id: current_user.id) + apply_teacher.update!(status: 1, apply_user_id: current_user.id) if apply_teacher.present? elsif course_members.exists?(role: %i[PROFESSOR ASSISTANT_PROFESSOR]) teacher_member = course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).take if params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR") diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index fff320323..48554111c 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -610,7 +610,7 @@ class ExercisesController < ApplicationController # 对未提交的用户进行调分 def adjust_score exercise_user = @exercise.exercise_users.find_by!(user_id: params[:user_id]) - tip_exception("已提交的作品请去评阅页进行调分") if exercise_user.commit_status == 1 + tip_exception("已提交的作品请去评阅页进行调分") if exercise_user.commit_status == 1 && exercise_user.commit_method != 5 if @exercise.subjective_score > 0 tip_exception("主观题成绩不能为空") if params[:subjective_score].blank? tip_exception("主观题成绩不能小于零") if params[:subjective_score].to_f < 0 @@ -628,8 +628,13 @@ class ExercisesController < ApplicationController subjective_score = @exercise.subjective_score > 0 ? params[:subjective_score].to_f.round(2) : 0 objective_score = @exercise.objective_score > 0 ? params[:objective_score].to_f.round(2) : 0 score = subjective_score + objective_score - exercise_user.update_attributes!(start_at: start_at_time, end_at: Time.now, status: 1, commit_status: 1, score: score, - subjective_score: subjective_score, objective_score: objective_score, commit_method: 5) + if exercise_user.commit_status == 1 + exercise_user.update_attributes!(score: score, subjective_score: subjective_score, objective_score: objective_score) + else + exercise_user.update_attributes!(start_at: start_at_time, end_at: Time.now, status: 1, commit_status: 1, score: score, + subjective_score: subjective_score, objective_score: objective_score, commit_method: 5) + end + ExerciseUserScore.create!(exercise_id: @exercise.id, exercise_user_id: exercise_user.id, subjective_score: subjective_score, objective_score: objective_score) normal_status("操作成功") @@ -1760,19 +1765,12 @@ class ExercisesController < ApplicationController else ques_number = q.question_number end + ques_status = 0 if q.question_type != Exercise::PRACTICAL ques_vote = q.exercise_answers.select{|answer| answer.user_id == user_id} - else - ques_vote = q.exercise_shixun_answers.select{|answer| answer.user_id == user_id} - end - ques_status = 0 - if ques_vote.present? - if q.question_type == Exercise::PRACTICAL - if ques_vote.pluck(:exercise_shixun_challenge_id).sort == q.exercise_shixun_challenges.pluck(:id).sort #用户的总得分等于问题的分数 - ques_status = 1 #全部回答了,才算已答 - question_answered += 1 - end - else #其他题目,需回答的有内容,才会为已答,否则如内容为空,视为未答 + + if ques_vote.present? + #其他题目,需回答的有内容,才会为已答,否则如内容为空,视为未答 vote_answer_id = ques_vote.pluck(:exercise_choice_id).reject(&:blank?) vote_text_count = ques_vote.pluck(:answer_text).reject(&:blank?).size if q.question_type <= Exercise::JUDGMENT #选择题和判断题的时候,需要有选项,才算回答 @@ -1780,11 +1778,6 @@ class ExercisesController < ApplicationController ques_status = 1 question_answered += 1 end - elsif q.question_type == Exercise::COMPLETION #填空题的时候,需要有选项和内容,才算回答 - if vote_answer_id.uniq.sort == q.exercise_standard_answers.pluck(:exercise_choice_id).uniq.sort - ques_status = 1 - question_answered += 1 - end else if vote_text_count > 0 #主观题,必选有内容,才算回答 ques_status = 1 @@ -1792,6 +1785,11 @@ class ExercisesController < ApplicationController end end end + else + if Myshixun.exists?(user_id: user_id, shixun_id: q.shixun_id) + ques_status = 1 + question_answered += 1 + end end question_status = { :ques_id => q.id, diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index c9659302e..bbb0e293e 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -49,6 +49,12 @@ class GitsController < ApplicationController repo_name = username + "/" + shixunname uid_logger("git start: repo_name is #{repo_name}") shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first + if shixun.blank? + shixun_id = ShixunSecretRepository.where(repo_name: repo_name).pluck(:shixun_id).first + logger.info("####repo_name:#{repo_name}") + logger.info("####shixun_id:#{shixun_id}") + shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).find_by(id: shixun_id) + end uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}") uid_logger("git start auth: systemuser is #{system_user.try(:login)}") @@ -63,7 +69,7 @@ class GitsController < ApplicationController else uid_logger_error("shixun is not exist") # result = false - result = false # 为了测试跳出 + result = true # 为了测试跳出 end end end diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index bbe94233f..9602673e5 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -1,12 +1,13 @@ class HackUserLastestCodesController < ApplicationController before_action :require_login, except: [:listen_result] - before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :listen_result, :result] + before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, + :listen_result, :result, :submit_records] before_action :update_user_hack_status, only: [:code_debug, :code_submit] before_action :require_auth_identity, only: [:update_code] before_action :require_manager_identity, only: [:update_code] def show - @my_hack.update_attribute(:status, 0) if @my_hack.status == 1 + @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 end def update_code @@ -33,8 +34,26 @@ class HackUserLastestCodesController < ApplicationController # 提交结果显示 def result - return if @my_hack.status == 1 + if @my_hack.submit_status == 1 + render json: {status:0, message: "正在评测中"} + else + @mode = params[:mode] + @result = + if @mode == "submit" + @my_hack.hack_user_codes.last + elsif @mode == "debug" + @my_hack.hack_user_debug + end + end + end + + # 提交记录 + def submit_records;end + + # 提交记录详情 + def record_detail + @hack_user = HackUserCode.find params[:id] end # 接收中间件返回结果接口 @@ -60,7 +79,7 @@ class HackUserLastestCodesController < ApplicationController if ojEvaResult['execMode'] == "debug" save_debug_data ds_params elsif ojEvaResult['execMode'] == "submit" - save_submit_data ds_params + save_submit_data ds_params.merge(expected_output: testCase['expectedOutput']) end # 评测完成后,还原评测中的状态 @my_hack.update_attribute(:submit_status, 0) @@ -84,7 +103,7 @@ class HackUserLastestCodesController < ApplicationController if exec_mode == "submit" @hack.hack_sets.map{|set| {input: set.input, output: set.output, caseId: set.id}} else - {input: params[:input]} + [{input: params[:input]}] end testCases = Base64.urlsafe_encode64(test_sets.to_json) #codeFileContent = Base64.urlsafe_encode64(@my_hack.code) @@ -117,7 +136,9 @@ class HackUserLastestCodesController < ApplicationController if @my_hack.hack_user_debug.present? @my_hack.hack_user_debug.update_attributes!(debug_params) else - @my_hack.hack_user_debug.create!(debug_params) + debug = HackUserDebug.new(debug_params) + debug.hack_user_lastest_code_id = @my_hack.id + debug.save! end end @@ -132,7 +153,7 @@ class HackUserLastestCodesController < ApplicationController RewardExperienceService.call(@my_hack.user, reward_attrs) # 评测完成更新通过数 @hack.increment!(:pass_num) - @my_hack.update_attribute(:passed, true) + @my_hack.update_attributes(passed: true, passed_time: Time.now) end end # 创建用户评测记录 diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index 9fa8e26e3..aee4ba338 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -1,8 +1,8 @@ class HacksController < ApplicationController before_action :require_login, except: [:index] - before_action :require_teacher_identity, only: [:create, :edit, :update] - before_action :require_auth_identity, only: [:update, :edit, :publish] - before_action :find_hack, only: [:edit, :update, :publish, :start] + before_action :require_teacher_identity, only: [:create, :update_set] + before_action :require_auth_identity, only: [:update, :edit, :publish, :update_set, :delete_set] + before_action :find_hack, only: [:edit, :update, :publish, :start, :update_set, :delete_set] # 开启编程,如果第一次开启,创建一条记录,如果已经开启过的话,直接返回标识即可 def start @@ -27,7 +27,7 @@ class HacksController < ApplicationController # 筛选过滤与排序 params_filter_or_order # 我解决的编程题数 - user_codes = HackUserLastestCode.mine(current_user).passed.joins(:hack) + user_codes = HackUserLastestCode.joins(:hack).mine_hack(current_user).passed @simple_count = user_codes.where(hacks: {difficult: 1}).count @medium_count = user_codes.where(hacks: {difficult: 2}).count @diff_count = user_codes.where(hacks: {difficult: 3}).count @@ -75,6 +75,20 @@ class HacksController < ApplicationController end end + # 更新测试集接口 + def update_set + set = @hack.hack_sets.find_by(id: params[:id]) + set.update_attributes!(hack_set_params) + render_ok + end + + # 单独删除测试集 + def delete_set + set = @hack.hack_sets.find_by(id: params[:id]) + set.destroy! + render_ok + end + # 发布功能 def publish @hack.update_attribute(:status, 1) @@ -119,6 +133,10 @@ class HacksController < ApplicationController params.permit(hack_sets: [:input, :output, :position])[:hack_sets] end + def hack_set_params + params.require(:hack_set).permit(:id, :input, :output, :position) + end + def hack_code_params params.require(:hack_codes).permit(:code, :language) end @@ -144,7 +162,8 @@ class HacksController < ApplicationController if params[:come_from] hacks = Hack.select(select_sql).mine(current_user.id) else - hacks = Hack.select(select_sql).published.opening + # 全部包括已经发布的,和我的未发布的 + hacks = Hack.select(select_sql).published.opening.or(Hack.select(select_sql).unpublish.mine(current_user.id)) end # 搜索 if params[:search] @@ -162,9 +181,14 @@ class HacksController < ApplicationController hacks = hacks.where.not(id: user_hacks.pluck(:hack_id)) end else - hacks = hacks.joins(:hack_user_lastest_code).where(hack_user_lastest_code: {status: params[:status]}) + hacks = hacks.joins(:hack_user_lastest_codes).where(hack_user_lastest_codes: {status: params[:status]}) end end + # 分类 + if params[:category] + hacks = hacks.where(category: params[:category]) + end + # 排序 sort_by = params[:sort_by] || "hack_user_lastest_codes_count" sort_direction = params[:sort_direction] || "desc" diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 94ced56fd..3a3d61e6d 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -64,21 +64,25 @@ class HomeworkCommonsController < ApplicationController end unless order.blank? - case order - when '1' - sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_commons.end_time > '#{Time.now}') - when '2' - sql_str = %Q(allow_late = 1 and homework_commons.end_time < '#{Time.now}' and (late_time is null or late_time > '#{Time.now}')) - when '3' - sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.evaluation_end > '#{Time.now}') - when '4' - sql_str = %Q((homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.appeal_time > '#{Time.now}')) - when '5' - sql_str = %Q((homework_detail_manuals.comment_status = #{order} or (anonymous_comment = 0 and homework_commons.end_time <= '#{Time.now}'))) + if @course.is_end + @homework_commons = @homework_commons.none else - sql_str = %Q(homework_detail_manuals.comment_status = #{order}) + case order + when '1' + sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_commons.end_time > '#{Time.now}') + when '2' + sql_str = %Q(allow_late = 1 and homework_commons.end_time < '#{Time.now}' and (late_time is null or late_time > '#{Time.now}')) + when '3' + sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.evaluation_end > '#{Time.now}') + when '4' + sql_str = %Q((homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.appeal_time > '#{Time.now}')) + when '5' + sql_str = %Q((homework_detail_manuals.comment_status = #{order} or (anonymous_comment = 0 and homework_commons.end_time <= '#{Time.now}'))) + else + sql_str = %Q(homework_detail_manuals.comment_status = #{order}) + end + @homework_commons = @homework_commons.joins(:homework_detail_manual).where(sql_str) end - @homework_commons = @homework_commons.joins(:homework_detail_manual).where(sql_str) end @task_count = @homework_commons.size @@ -577,8 +581,8 @@ class HomeworkCommonsController < ApplicationController tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil? tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil? tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank? - tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_i <= 0 - tip_exception("效率分不能大于总分值") if params[:eff_score] && params[:eff_score].to_i > params[:total_score].to_i + tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_f <= 0 + tip_exception("效率分不能大于总分值") if params[:eff_score] && params[:eff_score].to_f.round(2) > params[:total_score].to_f.round(2) tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank? tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank? # tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank? @@ -586,12 +590,12 @@ class HomeworkCommonsController < ApplicationController # tip_exception("challenge_id参数的长度与challenge_score参数的长度不匹配") if # params[:challenge_settings][:challenge_score].length != params[:challenge_settings][:challenge_id].length - current_eff_score = @homework.eff_score + current_eff_score = @homework.eff_score.to_f.round(2) @homework.total_score = params[:total_score] @homework.work_efficiency = params[:work_efficiency] - @homework.eff_score = params[:work_efficiency] ? params[:eff_score].to_i : 0 + @homework.eff_score = params[:work_efficiency] ? params[:eff_score].to_f.round(2) : 0 - update_eff_score = current_eff_score != @homework.eff_score + update_eff_score = current_eff_score.round(2) != @homework.eff_score.round(2) if @homework_detail_manual.answer_open_evaluation != params[:answer_open_evaluation] @homework_detail_manual.answer_open_evaluation = params[:answer_open_evaluation] @@ -625,14 +629,10 @@ class HomeworkCommonsController < ApplicationController @homework.score_open = params[:score_open] @homework.save! - # if score_change - # @homework.student_works.has_committed.each do |student_work| - # HomeworksService.new.set_shixun_final_score student_work - # end - # end - - # 更新所有学生的效率分(作业允许补交且补交已截止 或者 作业不允许补交且提交已截止) - if update_eff_score && @homework.end_or_late_none_group + if score_change && @homework.end_or_late_none_group + UpdateShixunWorkScoreJob.perform_now(@homework.id) + elsif update_eff_score && (@homework.end_or_late_none_group || @homework.max_efficiency > 0) + # 更新所有学生的效率分(作业允许补交且补交已截止 或者 作业不允许补交且提交已截止 或者作业已计算过效率分) HomeworksService.new.update_student_eff_score HomeworkCommon.find_by(id: @homework.id) end diff --git a/app/controllers/poll_questions_controller.rb b/app/controllers/poll_questions_controller.rb index 6a0b9ea47..411961e96 100644 --- a/app/controllers/poll_questions_controller.rb +++ b/app/controllers/poll_questions_controller.rb @@ -235,9 +235,9 @@ class PollQuestionsController < ApplicationController end def validates_params - normal_status(-1, "问题标题不能为空!") if params[:question_title].blank? + normal_status(-1, "题目不能为空!") if params[:question_title].blank? normal_status(-1, "是否要求必答的值不能为空!") if params[:is_necessary].blank? - normal_status(-1, "问题类型不能为空!") if params[:question_type].blank? + normal_status(-1, "题目类型不能为空!") if params[:question_type].blank? if params[:min_choices].present? && params[:max_choices].present? && (params[:min_choices].to_i > params[:max_choices].to_i) normal_status(-1, "最小可选不能大于最大可选!") elsif params[:question_answers].present? && (params[:max_choices].to_i > params[:question_answers].count) @@ -247,9 +247,9 @@ class PollQuestionsController < ApplicationController elsif params[:question_type] == 3 && (params[:question_answers] || params[:question_other_answer]) normal_status(-1, "主观问题不需要可选答案!") elsif params[:question_type] != 3 - if params[:question_answers].present? && params[:question_answers].include?("") - normal_status(-1, "选择题不能有空值!") - elsif params[:question_other_answer].present? && params[:question_other_answer].length > 0 + if params[:question_answers].present? && params[:question_answers].select{|answer| answer.blank?}.count > 0 + normal_status(-1, "选项不能有空值!") + elsif params[:question_other_answer].present? && !params[:question_other_answer].blank? normal_status(-1, "其他选项不能有值!") elsif params[:question_type] == 1 && params[:question_answers].count < 2 normal_status(-1, "单选题选项不能小于2!") diff --git a/app/controllers/weapps/courses_controller.rb b/app/controllers/weapps/courses_controller.rb index a36d56402..f35b0591a 100644 --- a/app/controllers/weapps/courses_controller.rb +++ b/app/controllers/weapps/courses_controller.rb @@ -1,6 +1,6 @@ class Weapps::CoursesController < Weapps::BaseController before_action :require_login - before_action :user_course_identity, except: [:create] + before_action :set_course, :user_course_identity, except: [:create] before_action :teacher_allowed, only: [:edit, :update] before_action :teacher_or_admin_allowed, only: [:change_member_roles, :delete_course_teachers] @@ -46,7 +46,7 @@ class Weapps::CoursesController < Weapps::BaseController @applications_size = CourseMessage.unhandled_join_course_requests_by_course(@course).size - @teacher_list = @teacher_list.preload(user: [user_extension: :school]).order("CONVERT(CONCAT(users.lastname, users.firstname) USING gbk) COLLATE gbk_chinese_ci asc") + @teacher_list = @teacher_list.preload(user: [user_extension: :school]) end # 批量删除教师或助教 @@ -82,6 +82,7 @@ class Weapps::CoursesController < Weapps::BaseController # 批量修改角色 def change_member_roles + @course = current_course tip_exception("请至少选择一个角色") if params[:roles].blank? tip_exception("不能具有老师、助教两种角色") if params[:roles].include?("PROFESSOR") && params[:roles].include?("ASSISTANT_PROFESSOR") @@ -97,7 +98,7 @@ class Weapps::CoursesController < Weapps::BaseController teacher_member = CourseMember.create!(course_id: @course.id, user_id: user_id, role: params[:roles].include?("PROFESSOR") ? 2 : 3) # 如果有未审批的申请教师/助教的记录,则修改状态为已审批 apply_teacher = CourseMessage.where(course_id: @course.id, course_message_id: user_id, status: 0).last - apply_teacher.update!(status: 1, apply_user_id: current_user.id) + apply_teacher.update!(status: 1, apply_user_id: current_user.id) if apply_teacher elsif course_members.exists?(role: %i[PROFESSOR ASSISTANT_PROFESSOR]) teacher_member = course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).take if params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR") @@ -166,4 +167,9 @@ class Weapps::CoursesController < Weapps::BaseController tip_exception(403, "..") end end + + def set_course + @course = Course.find_by!(id: params[:id]) + tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin? + end end \ No newline at end of file diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb new file mode 100644 index 000000000..0ec9ca5f2 --- /dev/null +++ b/app/helpers/comments_helper.rb @@ -0,0 +1,2 @@ +module CommentsHelper +end diff --git a/app/helpers/weapps/courses_helper.rb b/app/helpers/weapps/courses_helper.rb new file mode 100644 index 000000000..94769fc2e --- /dev/null +++ b/app/helpers/weapps/courses_helper.rb @@ -0,0 +1,67 @@ +module Weapps::CoursesHelper + require 'chinese_pinyin' + + def teacher_list teachers + data = [] + teachers.each do |teacher| + if teacher.user.present? + teacher_user = teacher.user + name = teacher_user.real_name + role = teacher.role == "CREATOR" ? "管理员" : teacher.role == "PROFESSOR" ? "教师" : "助教" + item = {name: name, course_member_id: teacher.id, login: teacher_user.login, user_id: teacher.user_id, role: role, + school: teacher_user.school_name, image_url: url_to_avatar(teacher_user)} + pinyin = Pinyin.t(name.strip, splitter: '') + first_char = pinyin[0] + letter = first_letter first_char + if data.pluck(:letter).include?(letter) + data.select{|a|a[:letter]==letter}.first[:items] << item + else + data << {letter: letter, items: [item]} + end + end + end + data = data.sort do |a, b| + [a[:letter]] <=> [b[:letter]] + end + data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后 + return data + end + + + def student_list students, excellent + data = [] + students.each do |student| + if student.user.present? + student_user = student.user + name = student_user.real_name + phone = excellent ? "" : student_user.hidden_phone + item = {name: name, course_member_id: student.id, login: student_user.login, user_id: student.user_id, + student_id: student_user.student_id, image_url: url_to_avatar(student_user), phone: phone} + pinyin = Pinyin.t(name.strip, splitter: '') + first_char = pinyin[0] + letter = first_letter first_char + if data.pluck(:letter).include?(letter) + data.select{|a|a[:letter]==letter}.first[:items] << item + else + data << {letter: letter, items: [item]} + end + end + end + data = data.sort do |a, b| + [a[:letter]] <=> [b[:letter]] + end + data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后 + return data + end + + def first_letter char + if char.ord >= 97 && char.ord <= 122 + letter = (char.ord - 32).chr.to_s + elsif char.ord >= 65 && char.ord <= 90 + letter = char + else + letter = '#' + end + letter + end +end \ No newline at end of file diff --git a/app/jobs/update_shixun_work_score_job.rb b/app/jobs/update_shixun_work_score_job.rb new file mode 100644 index 000000000..1701915c9 --- /dev/null +++ b/app/jobs/update_shixun_work_score_job.rb @@ -0,0 +1,10 @@ +class UpdateShixunWorkScoreJob < ApplicationJob + queue_as :default + + def perform(homework_id) + homework = HomeworkCommon.find_by(id: homework_id) + return if homework.blank? + + homework.update_homework_work_score + end +end diff --git a/app/models/hack.rb b/app/models/hack.rb index 1256aa53f..814debef5 100644 --- a/app/models/hack.rb +++ b/app/models/hack.rb @@ -8,9 +8,11 @@ class Hack < ApplicationRecord # 代码 has_many :hack_codes, :dependent => :destroy has_many :hack_user_lastest_codes, :dependent => :destroy + has_many :discusses, as: :dis, dependent: :destroy belongs_to :user scope :published, -> { where(status: 1) } + scope :unpublish, -> { where(status: 0) } scope :opening, -> {where(open_or_not: 1)} scope :mine, -> (author_id){ where(user_id: author_id) } diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index d0518a5b4..669fa10b1 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,4 +1,6 @@ class HackSet < ApplicationRecord + validates :input, presence: { message: "测试集输入不能为空" } + validates :output, uniqueness: { message: "测试集输出不能为空" } # 编程题测试集 belongs_to :hack end diff --git a/app/models/hack_user_lastest_code.rb b/app/models/hack_user_lastest_code.rb index 0a9e1131c..b4a707603 100644 --- a/app/models/hack_user_lastest_code.rb +++ b/app/models/hack_user_lastest_code.rb @@ -2,12 +2,14 @@ class HackUserLastestCode < ApplicationRecord # passed: 用户之前评测是否通过 # status: 最新评测状态: -1测试用例结果不匹配; 0: 评测通过; ;2 评测超时;3 创建pod失败; 4 编译失败;5 执行失败 # submit_status: 0: 可以评测, 1:评测中 + # passed_time:第一次通关的时间 # 编程题最新代码 belongs_to :hack, counter_cache: true belongs_to :user has_many :hack_user_codes, dependent: :destroy has_one :hack_user_debug scope :mine, ->(author_id){ find_by(user_id: author_id) } + scope :mine_hack, ->(author_id){ where(user_id: author_id) } scope :passed, -> {where(status: 1)} end diff --git a/app/models/shixun.rb b/app/models/shixun.rb index a0f88260b..e8aa1b186 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -28,6 +28,7 @@ class Shixun < ApplicationRecord has_one :first_tag_repertoire, through: :first_shixun_tag_repertoire, source: :tag_repertoire has_many :homework_commons_shixuns, class_name: 'HomeworkCommonsShixun' + has_many :fork_shixuns, foreign_key: "fork_from", class_name: 'Shixun' #实训的关卡 has_many :exercise_shixun_challenges, :dependent => :destroy @@ -97,7 +98,7 @@ class Shixun < ApplicationRecord end def fork_identifier - self.fork_from.nil? ? "--" : Shixun.where(id: self.fork_from).first.try(:identifier) + self.fork_from.nil? ? "--" : fork_shixuns.first&.identifier end def shixun_status @@ -171,7 +172,7 @@ class Shixun < ApplicationRecord end def owner - User.find(self.user_id) + User.find_by_id(self.user_id) end def shixun_main_name diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 8477da774..d4f372823 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -111,14 +111,14 @@ class StudentWork < ApplicationRecord # 作品总体评价 def overall_appraisal - case self.work_score.to_i - when (90..100) + case (self.work_score.to_f / homework_common.total_score).round(2) + when (0.90..1.00) '优秀' - when (70...90) + when (0.70...0.90) '良好' - when (60...70) + when (0.60...0.70) '及格' - when (0...60) + when (0.00...0.60) '不及格' end end diff --git a/app/services/admins/identity_auths/refuse_apply_service.rb b/app/services/admins/identity_auths/refuse_apply_service.rb index 7ac2e6c38..dfc9168a9 100644 --- a/app/services/admins/identity_auths/refuse_apply_service.rb +++ b/app/services/admins/identity_auths/refuse_apply_service.rb @@ -10,6 +10,7 @@ class Admins::IdentityAuths::RefuseApplyService < ApplicationService def call ActiveRecord::Base.transaction do apply.update!(status: 2, remarks: reason) + user.update!(authentication: false) deal_tiding! apply.attachment&.destroy diff --git a/app/services/admins/professional_auths/refuse_apply_service.rb b/app/services/admins/professional_auths/refuse_apply_service.rb index a055488c3..014fbab0b 100644 --- a/app/services/admins/professional_auths/refuse_apply_service.rb +++ b/app/services/admins/professional_auths/refuse_apply_service.rb @@ -10,6 +10,7 @@ class Admins::ProfessionalAuths::RefuseApplyService < ApplicationService def call ActiveRecord::Base.transaction do apply.update!(status: 2, remarks: reason) + user.update!(professional_certification: false) deal_tiding! apply.attachment&.destroy diff --git a/app/services/users/apply_authentication_service.rb b/app/services/users/apply_authentication_service.rb index 1b9b02c91..a6b02f431 100644 --- a/app/services/users/apply_authentication_service.rb +++ b/app/services/users/apply_authentication_service.rb @@ -10,7 +10,7 @@ class Users::ApplyAuthenticationService < ApplicationService raise Error, '请先完善基本信息' unless user.profile_completed? Users::ApplyAuthenticationForm.new(params).validate! - raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id) + # raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id) user.lastname = params[:name].to_s.strip user.firstname = '' @@ -18,7 +18,9 @@ class Users::ApplyAuthenticationService < ApplicationService user.show_realname = params[:show_realname].to_s == 'true' if params[:show_realname].to_s.present? ActiveRecord::Base.transaction do - user.authentication = false + ApplyUserAuthentication.real_name_auth.processing.where(user_id: user.id).destroy_all + + user.authentication = true user.save! user.user_extension.update!(gender: params[:gender].to_i) if params[:gender].present? diff --git a/app/services/users/apply_professional_auth_service.rb b/app/services/users/apply_professional_auth_service.rb index 81cd11a4c..c94481890 100644 --- a/app/services/users/apply_professional_auth_service.rb +++ b/app/services/users/apply_professional_auth_service.rb @@ -12,15 +12,15 @@ class Users::ApplyProfessionalAuthService < ApplicationService raise Error, '请先完善基本信息' unless user.profile_completed? Users::ApplyProfessionalAuthForm.new(params).validate! - raise Error, '您已经申请过职业认证了' if ApplyUserAuthentication.professional_auth.processing.exists?(user_id: user.id) - - user.professional_certification = false + # raise Error, '您已经申请过职业认证了' if ApplyUserAuthentication.professional_auth.processing.exists?(user_id: user.id) extension = user.user_extension extension.school_id = params[:school_id] extension.department_id = params[:department_id] extension.identity = params[:identity] + user.professional_certification = params[:identity] != "teacher" + extra = params[:extra].to_s.strip.presence if extension.identity.to_s == 'student' extension.technical_title = nil @@ -31,6 +31,7 @@ class Users::ApplyProfessionalAuthService < ApplicationService end ActiveRecord::Base.transaction do + ApplyUserAuthentication.professional_auth.processing.where(user_id: user.id).destroy_all user.save! extension.save! diff --git a/app/views/admins/shixun_settings/index.html.erb b/app/views/admins/shixun_settings/index.html.erb index 2687de67b..7aab73f64 100644 --- a/app/views/admins/shixun_settings/index.html.erb +++ b/app/views/admins/shixun_settings/index.html.erb @@ -24,6 +24,7 @@ <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> <%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %>
+ 导出基础数据 导出
diff --git a/app/views/admins/shixun_settings/shared/_td.html.erb b/app/views/admins/shixun_settings/shared/_td.html.erb index ddbbdff02..f4a05f178 100644 --- a/app/views/admins/shixun_settings/shared/_td.html.erb +++ b/app/views/admins/shixun_settings/shared/_td.html.erb @@ -27,7 +27,7 @@ <%= raw '
' if weappImageExists %> <%= javascript_void_link weappImageExists ? '重新上传' : '上传图片', class: 'action upload-shixun-weapp-image-action', data: { source_id: shixun.id, source_type: 'Shixun', suffix: '_weapp', toggle: 'modal', target: '.admin-upload-file-modal' } %> -<%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.login}",target:'_blank' %> +<%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner&.login}",target:'_blank' %> <% if shixun.status.to_i < 3 %> <%= link_to "关闭", admins_shixun_setting_path(shixun,status:3,page_no:page_no),method: :put, :class => "", :remote => true %> diff --git a/app/views/comments/_discuss.json.jbuilder b/app/views/comments/_discuss.json.jbuilder new file mode 100644 index 000000000..e9f983a47 --- /dev/null +++ b/app/views/comments/_discuss.json.jbuilder @@ -0,0 +1,11 @@ +json.id discuss.id +json.content content_safe(discuss.content) +json.time time_from_now(discuss.created_at) +json.hack_id discuss.dis_id +# 主贴和回复有一些不同点 +if discuss.parent_id + json.can_delete discuss.can_deleted?(current_user) +else + json.praise_count discuss.praises_count + json.user_praise discuss.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 +end \ No newline at end of file diff --git a/app/views/comments/create.json.jbuilder b/app/views/comments/create.json.jbuilder new file mode 100644 index 000000000..629c3b0a0 --- /dev/null +++ b/app/views/comments/create.json.jbuilder @@ -0,0 +1,4 @@ +json.discuss @discuss +json.author do + json.partial! 'users/user', user: @discuss.user +end \ No newline at end of file diff --git a/app/views/comments/index.json.jbuilder b/app/views/comments/index.json.jbuilder new file mode 100644 index 000000000..399b144d9 --- /dev/null +++ b/app/views/comments/index.json.jbuilder @@ -0,0 +1,7 @@ +json.disscuss_count @disscuss_count +json.comments @discusses do |discuss| + json.partial! 'comments/discuss', locals: { discuss: discuss} + json.children discuss.child_discuss(current_user) do |c_d| + json.partial! 'comments/discuss', locals: { discuss: c_d } + end +end diff --git a/app/views/comments/reply.json.jbuilder b/app/views/comments/reply.json.jbuilder new file mode 100644 index 000000000..4024ee7ea --- /dev/null +++ b/app/views/comments/reply.json.jbuilder @@ -0,0 +1 @@ +json.discuss @discuss \ No newline at end of file diff --git a/app/views/courses/apply_teachers.json.jbuilder b/app/views/courses/apply_teachers.json.jbuilder index bd88d5fbe..b81f5d77b 100644 --- a/app/views/courses/apply_teachers.json.jbuilder +++ b/app/views/courses/apply_teachers.json.jbuilder @@ -9,6 +9,7 @@ json.application_list do json.name_link user_path(application.application_user) json.login application.application_user.login json.image_url url_to_avatar(application.application_user) + json.school_name application.application_user.school_name json.role application.content.to_i == 3 || application.content.to_i == 7 ? "助教" : application.content.to_i == 2 || application.content.to_i == 9 ? "教师" : "" end end \ No newline at end of file diff --git a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder new file mode 100644 index 000000000..247dced91 --- /dev/null +++ b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder @@ -0,0 +1,2 @@ +json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output, + :input, :output, :execute_time, :execute_memory) \ No newline at end of file diff --git a/app/views/hack_user_lastest_codes/result.json.jbuilder b/app/views/hack_user_lastest_codes/result.json.jbuilder new file mode 100644 index 000000000..31164d4f7 --- /dev/null +++ b/app/views/hack_user_lastest_codes/result.json.jbuilder @@ -0,0 +1,7 @@ +json.(@result, :id, :status, :error_line, :error_msg, + :input, :output, :execute_time, :execute_memory) +# 提交模式多了一个预计输出 +if @mode == "submit" + json.expected_output @result.expected_output +end + diff --git a/app/views/hack_user_lastest_codes/submit_records.json.jbuilder b/app/views/hack_user_lastest_codes/submit_records.json.jbuilder new file mode 100644 index 000000000..9aa505160 --- /dev/null +++ b/app/views/hack_user_lastest_codes/submit_records.json.jbuilder @@ -0,0 +1,3 @@ +json.array! @my_hack.hack_user_codes do |hack_user| + json.(hack_user, :id, :created_at, :status, :execute_time, :execute_memory) +end \ No newline at end of file diff --git a/app/views/student_works/shixun_work_report.json.jbuilder b/app/views/student_works/shixun_work_report.json.jbuilder index 40b0e28c2..162e2ab1c 100644 --- a/app/views/student_works/shixun_work_report.json.jbuilder +++ b/app/views/student_works/shixun_work_report.json.jbuilder @@ -11,13 +11,13 @@ if @shixun json.myself_experience @work.myshixun.try(:total_score).to_i json.total_experience @shixun.all_score json.work_score number_with_precision @work.work_score.to_f.round(2), precision: 1 - json.all_work_score number_with_precision 100, precision: 1 + json.all_work_score number_with_precision @homework.total_score, precision: 1 json.time_consuming @work.myshixun_consume json.evaluate_count @user_evaluate_count.to_i if @homework.work_efficiency json.eff_score_full number_with_precision @homework.eff_score, precision: 1 json.eff_score number_with_precision @work.eff_score.to_f.round(2), precision: 1 - json.challenge_score_full number_with_precision (100 - @homework.eff_score), precision: 1 + json.challenge_score_full number_with_precision (@homework.total_score - @homework.eff_score), precision: 1 json.challenge_score number_with_precision @work.final_score.to_f.round(2), precision: 1 end diff --git a/app/views/subjects/right_banner.json.jbuilder b/app/views/subjects/right_banner.json.jbuilder index ef5645f26..f9a52af83 100644 --- a/app/views/subjects/right_banner.json.jbuilder +++ b/app/views/subjects/right_banner.json.jbuilder @@ -1,4 +1,4 @@ -json.qrcode_img Util::FileManage.exists?(@subject, '_qrcode') ? Util::FileManage.source_disk_file_url(@subject, '_qrcode') : nil +json.qrcode_img nil json.members @members do |member| json.partial! 'subject_member', locals: { user: member.user } diff --git a/app/views/weapps/courses/students.json.jbuilder b/app/views/weapps/courses/students.json.jbuilder index fa0cbb972..5aaaee0aa 100644 --- a/app/views/weapps/courses/students.json.jbuilder +++ b/app/views/weapps/courses/students.json.jbuilder @@ -1,12 +1,2 @@ -json.students do - json.array! @students do |student| - json.user_id student.user_id - json.login student.user.try(:login) - json.name student.user.try(:real_name) - json.student_id student.user.try(:student_id) - json.course_member_id student.id - json.user_phone @course.excellent ? "" : student.user.hidden_phone - json.image_url url_to_avatar(student.user) - end -end +json.students student_list @students, @course.excellent json.students_count @students_count \ No newline at end of file diff --git a/app/views/weapps/courses/teachers.json.jbuilder b/app/views/weapps/courses/teachers.json.jbuilder index 0d89ca814..424fd296a 100644 --- a/app/views/weapps/courses/teachers.json.jbuilder +++ b/app/views/weapps/courses/teachers.json.jbuilder @@ -1,16 +1,3 @@ -json.teacher_list do - json.array! @teacher_list do |teacher| - json.course_member_id teacher.id - json.name teacher.user.real_name - json.login teacher.user.login - json.user_id teacher.user.id - json.role teacher.role == "CREATOR" ? "管理员" : teacher.role == "PROFESSOR" ? "教师" : "助教" - json.school teacher.user&.school_name - json.image_url url_to_avatar(teacher.user) - # if @user_course_identity < Course::ASSISTANT_PROFESSOR - # json.member_roles teacher.user.course_role(@course) - # end - end -end +json.teacher_list teacher_list(@teacher_list) json.teacher_list_size @teacher_list_size json.apply_size @applications_size \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 277139f20..86bac4533 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -43,6 +43,11 @@ Rails.application.routes.draw do post :publish get :start get :result + post :update_set + delete :delete_set + end + resources :comments do + post :reply end end diff --git a/db/migrate/20191120012538_remove_pass_time_for_hack_user_lastest_codes.rb b/db/migrate/20191120012538_remove_pass_time_for_hack_user_lastest_codes.rb new file mode 100644 index 000000000..48063b9a2 --- /dev/null +++ b/db/migrate/20191120012538_remove_pass_time_for_hack_user_lastest_codes.rb @@ -0,0 +1,6 @@ +class RemovePassTimeForHackUserLastestCodes < ActiveRecord::Migration[5.2] + def change + remove_column :hack_user_lastest_codes, :pass_time + add_column :hack_user_codes, :expected_output, :text + end +end diff --git a/db/migrate/20191120080224_migrate_eff_score_default.rb b/db/migrate/20191120080224_migrate_eff_score_default.rb new file mode 100644 index 000000000..0561eb646 --- /dev/null +++ b/db/migrate/20191120080224_migrate_eff_score_default.rb @@ -0,0 +1,5 @@ +class MigrateEffScoreDefault < ActiveRecord::Migration[5.2] + def change + change_column :homework_commons, :eff_score, :float, default: 0 + end +end diff --git a/db/migrate/20191120123353_add_code_forhack_user_debugs.rb b/db/migrate/20191120123353_add_code_forhack_user_debugs.rb new file mode 100644 index 000000000..d3285f26b --- /dev/null +++ b/db/migrate/20191120123353_add_code_forhack_user_debugs.rb @@ -0,0 +1,5 @@ +class AddCodeForhackUserDebugs < ActiveRecord::Migration[5.2] + def change + add_column :hack_user_debugs, :code, :text + end +end diff --git a/db/migrate/20191121025552_modify_execute_time_for_hack_user_code.rb b/db/migrate/20191121025552_modify_execute_time_for_hack_user_code.rb new file mode 100644 index 000000000..c66e13a03 --- /dev/null +++ b/db/migrate/20191121025552_modify_execute_time_for_hack_user_code.rb @@ -0,0 +1,6 @@ +class ModifyExecuteTimeForHackUserCode < ActiveRecord::Migration[5.2] + def change + change_column :hack_user_debugs, :execute_time, :float + change_column :hack_user_codes, :execute_time, :float + end +end diff --git a/public/assets/.sprockets-manifest-24666da656f929c54857463c5d45f3cb.json b/public/assets/.sprockets-manifest-24666da656f929c54857463c5d45f3cb.json deleted file mode 100644 index 384b7563c..000000000 --- a/public/assets/.sprockets-manifest-24666da656f929c54857463c5d45f3cb.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"admin-1804acf3302c43a3595c93638a0ac16b1a52add3ad69f35a9e4069ae31da26f4.js":{"logical_path":"admin.js","mtime":"2019-11-15T20:47:17+08:00","size":4578598,"digest":"1804acf3302c43a3595c93638a0ac16b1a52add3ad69f35a9e4069ae31da26f4","integrity":"sha256-GASs8zAsQ6NZXJNjigrBaxpSrdOtafNankBprjHaJvQ="},"admin-25fddd68d59f6cc99ff0033a0da6bb6c45f2da9f7550b22bc01420aac8681622.css":{"logical_path":"admin.css","mtime":"2019-11-16T21:46:55+08:00","size":844415,"digest":"25fddd68d59f6cc99ff0033a0da6bb6c45f2da9f7550b22bc01420aac8681622","integrity":"sha256-Jf3daNWfbMmf8AM6Daa7bEXy2p91ULIrwBQgqshoFiI="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-22T14:54:27+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-22T14:54:27+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-22T14:54:27+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-22T14:54:27+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-22T14:54:27+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"college-1e70702e2d864fb4d5f57841bfa5937e31c7c059e6cd672a07f0b4b20740f607.js":{"logical_path":"college.js","mtime":"2019-11-19T14:35:19+08:00","size":3569292,"digest":"1e70702e2d864fb4d5f57841bfa5937e31c7c059e6cd672a07f0b4b20740f607","integrity":"sha256-HnBwLi2GT7TV9XhBv6WTfjHHwFnmzWcqB/C0sgdA9gc="},"college-c6ec982b835bdd69b610bdc7be8e5900e4f6115679c2b29dc2400ecf22e26d00.css":{"logical_path":"college.css","mtime":"2019-11-15T10:53:28+08:00","size":586151,"digest":"c6ec982b835bdd69b610bdc7be8e5900e4f6115679c2b29dc2400ecf22e26d00","integrity":"sha256-xuyYK4Nb3Wm2EL3Hvo5ZAOT2EVZ5wrKdwkAOzyLibQA="},"cooperative-bbf9b1ef14747d17410f2f38a6f308697335f86d4525ed6a5579905efc314ef3.js":{"logical_path":"cooperative.js","mtime":"2019-11-19T14:35:19+08:00","size":4463241,"digest":"bbf9b1ef14747d17410f2f38a6f308697335f86d4525ed6a5579905efc314ef3","integrity":"sha256-u/mx7xR0fRdBDy84pvMIaXM1+G1FJe1qVXmQXvwxTvM="},"cooperative-f16d25edcc79c0e41048dfacae580b0ef077a1e42dd52bd2b81a8fd812f2e880.css":{"logical_path":"cooperative.css","mtime":"2019-11-17T00:15:54+08:00","size":810311,"digest":"f16d25edcc79c0e41048dfacae580b0ef077a1e42dd52bd2b81a8fd812f2e880","integrity":"sha256-8W0l7cx5wOQQSN+srlgLDvB3oeQt1SvSuBqP2BLy6IA="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-10-21T22:52:15+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js":{"logical_path":"application.js","mtime":"2019-11-19T14:35:19+08:00","size":600706,"digest":"9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb","integrity":"sha256-nPvD15JZmh0N5ce4QgnhwrLmAzbw8B4Z8FgWY5GHCPs="},"application-4cde71a02307b8f652363711c2d0e567b80beb718b675d6a23be712eee78b664.css":{"logical_path":"application.css","mtime":"2019-09-09T09:26:59+08:00","size":419184,"digest":"4cde71a02307b8f652363711c2d0e567b80beb718b675d6a23be712eee78b664","integrity":"sha256-TN5xoCMHuPZSNjcRwtDlZ7gL63GLZ11qI75xLu54tmQ="},"admin-ec0c7805c96af407f1603ea37d0ee9341f92862db526162033b707775af25efd.css":{"logical_path":"admin.css","mtime":"2019-11-17T09:36:46+08:00","size":868470,"digest":"ec0c7805c96af407f1603ea37d0ee9341f92862db526162033b707775af25efd","integrity":"sha256-7Ax4Bclq9AfxYD6jfQ7pNB+Shi21JhYgM7cHd1ryXv0="},"college-a14be76ebc459e3bedd86e64c62b07c2dfc7ce632d73b86a7270b17462e5b746.css":{"logical_path":"college.css","mtime":"2019-11-11T18:25:42+08:00","size":610352,"digest":"a14be76ebc459e3bedd86e64c62b07c2dfc7ce632d73b86a7270b17462e5b746","integrity":"sha256-oUvnbrxFnjvt2G5kxisHwt/HzmMtc7hqcnCxdGLlt0Y="},"cooperative-c36bba05d6a13482ccb6c3696ba5d750841dec9cae7a8043a0318c34c3a4638e.css":{"logical_path":"cooperative.css","mtime":"2019-11-17T09:36:46+08:00","size":849736,"digest":"c36bba05d6a13482ccb6c3696ba5d750841dec9cae7a8043a0318c34c3a4638e","integrity":"sha256-w2u6BdahNILMtsNpa6XXUIQd7JyueoBDoDGMNMOkY44="},"application-8c9d6bb61c50908f584b3070c79aeb95f25c1166d39e07da5e95438b39ca0de9.css":{"logical_path":"application.css","mtime":"2019-10-21T22:52:15+08:00","size":436995,"digest":"8c9d6bb61c50908f584b3070c79aeb95f25c1166d39e07da5e95438b39ca0de9","integrity":"sha256-jJ1rthxQkI9YSzBwx5rrlfJcEWbTngfaXpVDiznKDek="},"admin-9448419f6ce5f2f4be09862967fc6e8c2d8342db763aa2156616a11b1a3e2acf.js":{"logical_path":"admin.js","mtime":"2019-11-19T15:23:48+08:00","size":4578965,"digest":"9448419f6ce5f2f4be09862967fc6e8c2d8342db763aa2156616a11b1a3e2acf","integrity":"sha256-lEhBn2zl8vS+CYYpZ/xujC2DQtt2OqIVZhahGxo+Ks8="}},"assets":{"admin.js":"admin-9448419f6ce5f2f4be09862967fc6e8c2d8342db763aa2156616a11b1a3e2acf.js","admin.css":"admin-ec0c7805c96af407f1603ea37d0ee9341f92862db526162033b707775af25efd.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-1e70702e2d864fb4d5f57841bfa5937e31c7c059e6cd672a07f0b4b20740f607.js","college.css":"college-a14be76ebc459e3bedd86e64c62b07c2dfc7ce632d73b86a7270b17462e5b746.css","cooperative.js":"cooperative-bbf9b1ef14747d17410f2f38a6f308697335f86d4525ed6a5579905efc314ef3.js","cooperative.css":"cooperative-c36bba05d6a13482ccb6c3696ba5d750841dec9cae7a8043a0318c34c3a4638e.css","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js","application.css":"application-8c9d6bb61c50908f584b3070c79aeb95f25c1166d39e07da5e95438b39ca0de9.css"}} \ No newline at end of file diff --git a/public/assets/.sprockets-manifest-7dca074080e6fa27eec63959609f446f.json b/public/assets/.sprockets-manifest-7dca074080e6fa27eec63959609f446f.json new file mode 100644 index 000000000..80f940abf --- /dev/null +++ b/public/assets/.sprockets-manifest-7dca074080e6fa27eec63959609f446f.json @@ -0,0 +1 @@ +{"files":{"admin-a8fadc2d1f4bdfca978013a9be384f67e3b92580cf81a94316632144d8bf9e71.js":{"logical_path":"admin.js","mtime":"2019-11-21T17:52:05+08:00","size":4594002,"digest":"a8fadc2d1f4bdfca978013a9be384f67e3b92580cf81a94316632144d8bf9e71","integrity":"sha256-qPrcLR9L38qXgBOpvjhPZ+O5JYDPgalDFmMhRNi/nnE="},"admin-e78dd8b2041c26973b3851180e413539c07042575e336147194b5f2a1f7fa09c.css":{"logical_path":"admin.css","mtime":"2019-11-21T17:49:31+08:00","size":817848,"digest":"e78dd8b2041c26973b3851180e413539c07042575e336147194b5f2a1f7fa09c","integrity":"sha256-543YsgQcJpc7OFEYDkE1OcBwQldeM2FHGUtfKh9/oJw="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-23T09:14:02+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:14:02+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:14:02+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:14:02+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:14:02+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"college-431d908264782ef54e90202095d4cf397c586f74d2b7879684348dc8b53d2cd2.js":{"logical_path":"college.js","mtime":"2019-11-20T18:17:10+08:00","size":3570046,"digest":"431d908264782ef54e90202095d4cf397c586f74d2b7879684348dc8b53d2cd2","integrity":"sha256-Qx2QgmR4LvVOkCAgldTPOXxYb3TSt4eWhDSNyLU9LNI="},"college-eb35b6573dea2a069abd5acb0211940c2165fa21da333555fa859ed155b3ca1f.css":{"logical_path":"college.css","mtime":"2019-11-20T17:50:44+08:00","size":565772,"digest":"eb35b6573dea2a069abd5acb0211940c2165fa21da333555fa859ed155b3ca1f","integrity":"sha256-6zW2Vz3qKgaavVrLAhGUDCFl+iHaMzVV+oWe0VWzyh8="},"cooperative-4f2218bb223392ea4332e9ace5a748baccd4fe66d4b5cc3b5574f97a425203ec.js":{"logical_path":"cooperative.js","mtime":"2019-11-20T18:17:10+08:00","size":4478060,"digest":"4f2218bb223392ea4332e9ace5a748baccd4fe66d4b5cc3b5574f97a425203ec","integrity":"sha256-TyIYuyIzkupDMums5adIuszU/mbUtcw7VXT5ekJSA+w="},"cooperative-9244063fa63cd29c9c3b074af565be75a130cfb31741b2f5252fe68a1f5c13c5.css":{"logical_path":"cooperative.css","mtime":"2019-11-20T17:50:44+08:00","size":799850,"digest":"9244063fa63cd29c9c3b074af565be75a130cfb31741b2f5252fe68a1f5c13c5","integrity":"sha256-kkQGP6Y80pycOwdK9WW+daEwz7MXQbL1JS/mih9cE8U="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-11-20T17:50:44+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-d44f4301c7dfbe07bcb2788d7c006c22c184ae6b7016c09f7911b4962aacd767.js":{"logical_path":"application.js","mtime":"2019-11-20T18:17:10+08:00","size":615525,"digest":"d44f4301c7dfbe07bcb2788d7c006c22c184ae6b7016c09f7911b4962aacd767","integrity":"sha256-1E9DAcffvge8sniNfABsIsGErmtwFsCfeRG0liqs12c="},"application-2bf79ac2818959eb18d4df720a0cd0721b3b2385dd4565d635851fc41e192975.css":{"logical_path":"application.css","mtime":"2019-09-09T09:26:59+08:00","size":401033,"digest":"2bf79ac2818959eb18d4df720a0cd0721b3b2385dd4565d635851fc41e192975","integrity":"sha256-K/eawoGJWesY1N9yCgzQchs7I4XdRWXWNYUfxB4ZKXU="}},"assets":{"admin.js":"admin-a8fadc2d1f4bdfca978013a9be384f67e3b92580cf81a94316632144d8bf9e71.js","admin.css":"admin-e78dd8b2041c26973b3851180e413539c07042575e336147194b5f2a1f7fa09c.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-431d908264782ef54e90202095d4cf397c586f74d2b7879684348dc8b53d2cd2.js","college.css":"college-eb35b6573dea2a069abd5acb0211940c2165fa21da333555fa859ed155b3ca1f.css","cooperative.js":"cooperative-4f2218bb223392ea4332e9ace5a748baccd4fe66d4b5cc3b5574f97a425203ec.js","cooperative.css":"cooperative-9244063fa63cd29c9c3b074af565be75a130cfb31741b2f5252fe68a1f5c13c5.css","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-d44f4301c7dfbe07bcb2788d7c006c22c184ae6b7016c09f7911b4962aacd767.js","application.css":"application-2bf79ac2818959eb18d4df720a0cd0721b3b2385dd4565d635851fc41e192975.css"}} \ No newline at end of file diff --git a/public/assets/admin-1804acf3302c43a3595c93638a0ac16b1a52add3ad69f35a9e4069ae31da26f4.js b/public/assets/admin-1804acf3302c43a3595c93638a0ac16b1a52add3ad69f35a9e4069ae31da26f4.js deleted file mode 100644 index dc941383d..000000000 --- a/public/assets/admin-1804acf3302c43a3595c93638a0ac16b1a52add3ad69f35a9e4069ae31da26f4.js +++ /dev/null @@ -1,140008 +0,0 @@ -/* -Unobtrusive JavaScript -https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts -Released under the MIT license - */ - - -(function() { - var context = this; - - (function() { - (function() { - this.Rails = { - linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]', - buttonClickSelector: { - selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])', - exclude: 'form button' - }, - inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', - formSubmitSelector: 'form', - formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])', - formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled', - formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled', - fileInputSelector: 'input[name][type=file]:not([disabled])', - linkDisableSelector: 'a[data-disable-with], a[data-disable]', - buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]' - }; - - }).call(this); - }).call(context); - - var Rails = context.Rails; - - (function() { - (function() { - var cspNonce; - - cspNonce = Rails.cspNonce = function() { - var meta; - meta = document.querySelector('meta[name=csp-nonce]'); - return meta && meta.content; - }; - - }).call(this); - (function() { - var expando, m; - - m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector; - - Rails.matches = function(element, selector) { - if (selector.exclude != null) { - return m.call(element, selector.selector) && !m.call(element, selector.exclude); - } else { - return m.call(element, selector); - } - }; - - expando = '_ujsData'; - - Rails.getData = function(element, key) { - var ref; - return (ref = element[expando]) != null ? ref[key] : void 0; - }; - - Rails.setData = function(element, key, value) { - if (element[expando] == null) { - element[expando] = {}; - } - return element[expando][key] = value; - }; - - Rails.$ = function(selector) { - return Array.prototype.slice.call(document.querySelectorAll(selector)); - }; - - }).call(this); - (function() { - var $, csrfParam, csrfToken; - - $ = Rails.$; - - csrfToken = Rails.csrfToken = function() { - var meta; - meta = document.querySelector('meta[name=csrf-token]'); - return meta && meta.content; - }; - - csrfParam = Rails.csrfParam = function() { - var meta; - meta = document.querySelector('meta[name=csrf-param]'); - return meta && meta.content; - }; - - Rails.CSRFProtection = function(xhr) { - var token; - token = csrfToken(); - if (token != null) { - return xhr.setRequestHeader('X-CSRF-Token', token); - } - }; - - Rails.refreshCSRFTokens = function() { - var param, token; - token = csrfToken(); - param = csrfParam(); - if ((token != null) && (param != null)) { - return $('form input[name="' + param + '"]').forEach(function(input) { - return input.value = token; - }); - } - }; - - }).call(this); - (function() { - var CustomEvent, fire, matches, preventDefault; - - matches = Rails.matches; - - CustomEvent = window.CustomEvent; - - if (typeof CustomEvent !== 'function') { - CustomEvent = function(event, params) { - var evt; - evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - CustomEvent.prototype = window.Event.prototype; - preventDefault = CustomEvent.prototype.preventDefault; - CustomEvent.prototype.preventDefault = function() { - var result; - result = preventDefault.call(this); - if (this.cancelable && !this.defaultPrevented) { - Object.defineProperty(this, 'defaultPrevented', { - get: function() { - return true; - } - }); - } - return result; - }; - } - - fire = Rails.fire = function(obj, name, data) { - var event; - event = new CustomEvent(name, { - bubbles: true, - cancelable: true, - detail: data - }); - obj.dispatchEvent(event); - return !event.defaultPrevented; - }; - - Rails.stopEverything = function(e) { - fire(e.target, 'ujs:everythingStopped'); - e.preventDefault(); - e.stopPropagation(); - return e.stopImmediatePropagation(); - }; - - Rails.delegate = function(element, selector, eventType, handler) { - return element.addEventListener(eventType, function(e) { - var target; - target = e.target; - while (!(!(target instanceof Element) || matches(target, selector))) { - target = target.parentNode; - } - if (target instanceof Element && handler.call(target, e) === false) { - e.preventDefault(); - return e.stopPropagation(); - } - }); - }; - - }).call(this); - (function() { - var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse; - - cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire; - - AcceptHeaders = { - '*': '*/*', - text: 'text/plain', - html: 'text/html', - xml: 'application/xml, text/xml', - json: 'application/json, text/javascript', - script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript' - }; - - Rails.ajax = function(options) { - var xhr; - options = prepareOptions(options); - xhr = createXHR(options, function() { - var ref, response; - response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type')); - if (Math.floor(xhr.status / 100) === 2) { - if (typeof options.success === "function") { - options.success(response, xhr.statusText, xhr); - } - } else { - if (typeof options.error === "function") { - options.error(response, xhr.statusText, xhr); - } - } - return typeof options.complete === "function" ? options.complete(xhr, xhr.statusText) : void 0; - }); - if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) { - return false; - } - if (xhr.readyState === XMLHttpRequest.OPENED) { - return xhr.send(options.data); - } - }; - - prepareOptions = function(options) { - options.url = options.url || location.href; - options.type = options.type.toUpperCase(); - if (options.type === 'GET' && options.data) { - if (options.url.indexOf('?') < 0) { - options.url += '?' + options.data; - } else { - options.url += '&' + options.data; - } - } - if (AcceptHeaders[options.dataType] == null) { - options.dataType = '*'; - } - options.accept = AcceptHeaders[options.dataType]; - if (options.dataType !== '*') { - options.accept += ', */*; q=0.01'; - } - return options; - }; - - createXHR = function(options, done) { - var xhr; - xhr = new XMLHttpRequest(); - xhr.open(options.type, options.url, true); - xhr.setRequestHeader('Accept', options.accept); - if (typeof options.data === 'string') { - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); - } - if (!options.crossDomain) { - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - } - CSRFProtection(xhr); - xhr.withCredentials = !!options.withCredentials; - xhr.onreadystatechange = function() { - if (xhr.readyState === XMLHttpRequest.DONE) { - return done(xhr); - } - }; - return xhr; - }; - - processResponse = function(response, type) { - var parser, script; - if (typeof response === 'string' && typeof type === 'string') { - if (type.match(/\bjson\b/)) { - try { - response = JSON.parse(response); - } catch (error) {} - } else if (type.match(/\b(?:java|ecma)script\b/)) { - script = document.createElement('script'); - script.setAttribute('nonce', cspNonce()); - script.text = response; - document.head.appendChild(script).parentNode.removeChild(script); - } else if (type.match(/\b(xml|html|svg)\b/)) { - parser = new DOMParser(); - type = type.replace(/;.+/, ''); - try { - response = parser.parseFromString(response, type); - } catch (error) {} - } - } - return response; - }; - - Rails.href = function(element) { - return element.href; - }; - - Rails.isCrossDomain = function(url) { - var e, originAnchor, urlAnchor; - originAnchor = document.createElement('a'); - originAnchor.href = location.href; - urlAnchor = document.createElement('a'); - try { - urlAnchor.href = url; - return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host)); - } catch (error) { - e = error; - return true; - } - }; - - }).call(this); - (function() { - var matches, toArray; - - matches = Rails.matches; - - toArray = function(e) { - return Array.prototype.slice.call(e); - }; - - Rails.serializeElement = function(element, additionalParam) { - var inputs, params; - inputs = [element]; - if (matches(element, 'form')) { - inputs = toArray(element.elements); - } - params = []; - inputs.forEach(function(input) { - if (!input.name || input.disabled) { - return; - } - if (matches(input, 'select')) { - return toArray(input.options).forEach(function(option) { - if (option.selected) { - return params.push({ - name: input.name, - value: option.value - }); - } - }); - } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) { - return params.push({ - name: input.name, - value: input.value - }); - } - }); - if (additionalParam) { - params.push(additionalParam); - } - return params.map(function(param) { - if (param.name != null) { - return (encodeURIComponent(param.name)) + "=" + (encodeURIComponent(param.value)); - } else { - return param; - } - }).join('&'); - }; - - Rails.formElements = function(form, selector) { - if (matches(form, 'form')) { - return toArray(form.elements).filter(function(el) { - return matches(el, selector); - }); - } else { - return toArray(form.querySelectorAll(selector)); - } - }; - - }).call(this); - (function() { - var allowAction, fire, stopEverything; - - fire = Rails.fire, stopEverything = Rails.stopEverything; - - Rails.handleConfirm = function(e) { - if (!allowAction(this)) { - return stopEverything(e); - } - }; - - allowAction = function(element) { - var answer, callback, message; - message = element.getAttribute('data-confirm'); - if (!message) { - return true; - } - answer = false; - if (fire(element, 'confirm')) { - try { - answer = confirm(message); - } catch (error) {} - callback = fire(element, 'confirm:complete', [answer]); - } - return answer && callback; - }; - - }).call(this); - (function() { - var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, matches, setData, stopEverything; - - matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements; - - Rails.handleDisabledElement = function(e) { - var element; - element = this; - if (element.disabled) { - return stopEverything(e); - } - }; - - Rails.enableElement = function(e) { - var element; - element = e instanceof Event ? e.target : e; - if (matches(element, Rails.linkDisableSelector)) { - return enableLinkElement(element); - } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) { - return enableFormElement(element); - } else if (matches(element, Rails.formSubmitSelector)) { - return enableFormElements(element); - } - }; - - Rails.disableElement = function(e) { - var element; - element = e instanceof Event ? e.target : e; - if (matches(element, Rails.linkDisableSelector)) { - return disableLinkElement(element); - } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) { - return disableFormElement(element); - } else if (matches(element, Rails.formSubmitSelector)) { - return disableFormElements(element); - } - }; - - disableLinkElement = function(element) { - var replacement; - replacement = element.getAttribute('data-disable-with'); - if (replacement != null) { - setData(element, 'ujs:enable-with', element.innerHTML); - element.innerHTML = replacement; - } - element.addEventListener('click', stopEverything); - return setData(element, 'ujs:disabled', true); - }; - - enableLinkElement = function(element) { - var originalText; - originalText = getData(element, 'ujs:enable-with'); - if (originalText != null) { - element.innerHTML = originalText; - setData(element, 'ujs:enable-with', null); - } - element.removeEventListener('click', stopEverything); - return setData(element, 'ujs:disabled', null); - }; - - disableFormElements = function(form) { - return formElements(form, Rails.formDisableSelector).forEach(disableFormElement); - }; - - disableFormElement = function(element) { - var replacement; - replacement = element.getAttribute('data-disable-with'); - if (replacement != null) { - if (matches(element, 'button')) { - setData(element, 'ujs:enable-with', element.innerHTML); - element.innerHTML = replacement; - } else { - setData(element, 'ujs:enable-with', element.value); - element.value = replacement; - } - } - element.disabled = true; - return setData(element, 'ujs:disabled', true); - }; - - enableFormElements = function(form) { - return formElements(form, Rails.formEnableSelector).forEach(enableFormElement); - }; - - enableFormElement = function(element) { - var originalText; - originalText = getData(element, 'ujs:enable-with'); - if (originalText != null) { - if (matches(element, 'button')) { - element.innerHTML = originalText; - } else { - element.value = originalText; - } - setData(element, 'ujs:enable-with', null); - } - element.disabled = false; - return setData(element, 'ujs:disabled', null); - }; - - }).call(this); - (function() { - var stopEverything; - - stopEverything = Rails.stopEverything; - - Rails.handleMethod = function(e) { - var csrfParam, csrfToken, form, formContent, href, link, method; - link = this; - method = link.getAttribute('data-method'); - if (!method) { - return; - } - href = Rails.href(link); - csrfToken = Rails.csrfToken(); - csrfParam = Rails.csrfParam(); - form = document.createElement('form'); - formContent = ""; - if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) { - formContent += ""; - } - formContent += ''; - form.method = 'post'; - form.action = href; - form.target = link.target; - form.innerHTML = formContent; - form.style.display = 'none'; - document.body.appendChild(form); - form.querySelector('[type="submit"]').click(); - return stopEverything(e); - }; - - }).call(this); - (function() { - var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything, - slice = [].slice; - - matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement; - - isRemote = function(element) { - var value; - value = element.getAttribute('data-remote'); - return (value != null) && value !== 'false'; - }; - - Rails.handleRemote = function(e) { - var button, data, dataType, element, method, url, withCredentials; - element = this; - if (!isRemote(element)) { - return true; - } - if (!fire(element, 'ajax:before')) { - fire(element, 'ajax:stopped'); - return false; - } - withCredentials = element.getAttribute('data-with-credentials'); - dataType = element.getAttribute('data-type') || 'script'; - if (matches(element, Rails.formSubmitSelector)) { - button = getData(element, 'ujs:submit-button'); - method = getData(element, 'ujs:submit-button-formmethod') || element.method; - url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href; - if (method.toUpperCase() === 'GET') { - url = url.replace(/\?.*$/, ''); - } - if (element.enctype === 'multipart/form-data') { - data = new FormData(element); - if (button != null) { - data.append(button.name, button.value); - } - } else { - data = serializeElement(element, button); - } - setData(element, 'ujs:submit-button', null); - setData(element, 'ujs:submit-button-formmethod', null); - setData(element, 'ujs:submit-button-formaction', null); - } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) { - method = element.getAttribute('data-method'); - url = element.getAttribute('data-url'); - data = serializeElement(element, element.getAttribute('data-params')); - } else { - method = element.getAttribute('data-method'); - url = Rails.href(element); - data = element.getAttribute('data-params'); - } - ajax({ - type: method || 'GET', - url: url, - data: data, - dataType: dataType, - beforeSend: function(xhr, options) { - if (fire(element, 'ajax:beforeSend', [xhr, options])) { - return fire(element, 'ajax:send', [xhr]); - } else { - fire(element, 'ajax:stopped'); - return false; - } - }, - success: function() { - var args; - args = 1 <= arguments.length ? slice.call(arguments, 0) : []; - return fire(element, 'ajax:success', args); - }, - error: function() { - var args; - args = 1 <= arguments.length ? slice.call(arguments, 0) : []; - return fire(element, 'ajax:error', args); - }, - complete: function() { - var args; - args = 1 <= arguments.length ? slice.call(arguments, 0) : []; - return fire(element, 'ajax:complete', args); - }, - crossDomain: isCrossDomain(url), - withCredentials: (withCredentials != null) && withCredentials !== 'false' - }); - return stopEverything(e); - }; - - Rails.formSubmitButtonClick = function(e) { - var button, form; - button = this; - form = button.form; - if (!form) { - return; - } - if (button.name) { - setData(form, 'ujs:submit-button', { - name: button.name, - value: button.value - }); - } - setData(form, 'ujs:formnovalidate-button', button.formNoValidate); - setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction')); - return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod')); - }; - - Rails.handleMetaClick = function(e) { - var data, link, metaClick, method; - link = this; - method = (link.getAttribute('data-method') || 'GET').toUpperCase(); - data = link.getAttribute('data-params'); - metaClick = e.metaKey || e.ctrlKey; - if (metaClick && method === 'GET' && !data) { - return e.stopImmediatePropagation(); - } - }; - - }).call(this); - (function() { - var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMetaClick, handleMethod, handleRemote, refreshCSRFTokens; - - fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMetaClick = Rails.handleMetaClick, handleMethod = Rails.handleMethod; - - if ((typeof jQuery !== "undefined" && jQuery !== null) && (jQuery.ajax != null) && !jQuery.rails) { - jQuery.rails = Rails; - jQuery.ajaxPrefilter(function(options, originalOptions, xhr) { - if (!options.crossDomain) { - return CSRFProtection(xhr); - } - }); - } - - Rails.start = function() { - if (window._rails_loaded) { - throw new Error('rails-ujs has already been loaded!'); - } - window.addEventListener('pageshow', function() { - $(Rails.formEnableSelector).forEach(function(el) { - if (getData(el, 'ujs:disabled')) { - return enableElement(el); - } - }); - return $(Rails.linkDisableSelector).forEach(function(el) { - if (getData(el, 'ujs:disabled')) { - return enableElement(el); - } - }); - }); - delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement); - delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement); - delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement); - delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement); - delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement); - delegate(document, Rails.linkClickSelector, 'click', handleConfirm); - delegate(document, Rails.linkClickSelector, 'click', handleMetaClick); - delegate(document, Rails.linkClickSelector, 'click', disableElement); - delegate(document, Rails.linkClickSelector, 'click', handleRemote); - delegate(document, Rails.linkClickSelector, 'click', handleMethod); - delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement); - delegate(document, Rails.buttonClickSelector, 'click', handleConfirm); - delegate(document, Rails.buttonClickSelector, 'click', disableElement); - delegate(document, Rails.buttonClickSelector, 'click', handleRemote); - delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement); - delegate(document, Rails.inputChangeSelector, 'change', handleConfirm); - delegate(document, Rails.inputChangeSelector, 'change', handleRemote); - delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement); - delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm); - delegate(document, Rails.formSubmitSelector, 'submit', handleRemote); - delegate(document, Rails.formSubmitSelector, 'submit', function(e) { - return setTimeout((function() { - return disableElement(e); - }), 13); - }); - delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement); - delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement); - delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement); - delegate(document, Rails.formInputClickSelector, 'click', handleConfirm); - delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick); - document.addEventListener('DOMContentLoaded', refreshCSRFTokens); - return window._rails_loaded = true; - }; - - if (window.Rails === Rails && fire(document, 'rails:attachBindings')) { - Rails.start(); - } - - }).call(this); - }).call(this); - - if (typeof module === "object" && module.exports) { - module.exports = Rails; - } else if (typeof define === "function" && define.amd) { - define(Rails); - } -}).call(this); -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ActiveStorage=e():t.ActiveStorage=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,r){"use strict";function n(t){var e=a(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}function i(t,e){return"string"==typeof t&&(e=t,t=document),o(t.querySelectorAll(e))}function a(t,e){return"string"==typeof t&&(e=t,t=document),t.querySelector(e)}function u(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.disabled,i=r.bubbles,a=r.cancelable,u=r.detail,o=document.createEvent("Event");o.initEvent(e,i||!0,a||!0),o.detail=u||{};try{t.disabled=!1,t.dispatchEvent(o)}finally{t.disabled=n}return o}function o(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}e.d=n,e.c=i,e.b=a,e.a=u,e.e=o},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(t&&"function"==typeof t[e]){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this.form,"direct-uploads:"+t,{detail:e})}}]),t}()},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return o});var i=r(1),a=r(0),u=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,Object(a.a)(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",function(t){return e.uploadRequestDidProgress(t)})}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}()},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return s});var i=r(7),a=r.n(i),u=function(){function t(t,e){for(var r=0;r>>25)+n|0,a+=(r&n|~r&i)+e[1]-389564586|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[2]+606105819|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[3]-1044525330|0,n=(n<<22|n>>>10)+i|0,r+=(n&i|~n&a)+e[4]-176418897|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[5]+1200080426|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[6]-1473231341|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[7]-45705983|0,n=(n<<22|n>>>10)+i|0,r+=(n&i|~n&a)+e[8]+1770035416|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[9]-1958414417|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[10]-42063|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[11]-1990404162|0,n=(n<<22|n>>>10)+i|0,r+=(n&i|~n&a)+e[12]+1804603682|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[13]-40341101|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[14]-1502002290|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[15]+1236535329|0,n=(n<<22|n>>>10)+i|0,r+=(n&a|i&~a)+e[1]-165796510|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[6]-1069501632|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[11]+643717713|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[0]-373897302|0,n=(n<<20|n>>>12)+i|0,r+=(n&a|i&~a)+e[5]-701558691|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[10]+38016083|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[15]-660478335|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[4]-405537848|0,n=(n<<20|n>>>12)+i|0,r+=(n&a|i&~a)+e[9]+568446438|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[14]-1019803690|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[3]-187363961|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[8]+1163531501|0,n=(n<<20|n>>>12)+i|0,r+=(n&a|i&~a)+e[13]-1444681467|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[2]-51403784|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[7]+1735328473|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[12]-1926607734|0,n=(n<<20|n>>>12)+i|0,r+=(n^i^a)+e[5]-378558|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[8]-2022574463|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[11]+1839030562|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[14]-35309556|0,n=(n<<23|n>>>9)+i|0,r+=(n^i^a)+e[1]-1530992060|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[4]+1272893353|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[7]-155497632|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[10]-1094730640|0,n=(n<<23|n>>>9)+i|0,r+=(n^i^a)+e[13]+681279174|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[0]-358537222|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[3]-722521979|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[6]+76029189|0,n=(n<<23|n>>>9)+i|0,r+=(n^i^a)+e[9]-640364487|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[12]-421815835|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[15]+530742520|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[2]-995338651|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~a))+e[0]-198630844|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[7]+1126891415|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[14]-1416354905|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[5]-57434055|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~a))+e[12]+1700485571|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[3]-1894986606|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[10]-1051523|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[1]-2054922799|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~a))+e[8]+1873313359|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[15]-30611744|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[6]-1560198380|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[13]+1309151649|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~a))+e[4]-145523070|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[11]-1120210379|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[2]+718787259|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[9]-343485551|0,n=(n<<21|n>>>11)+i|0,t[0]=r+t[0]|0,t[1]=n+t[1]|0,t[2]=i+t[2]|0,t[3]=a+t[3]|0}function r(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}function n(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return r}function i(t){var n,i,a,u,o,s,f=t.length,c=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=f;n+=64)e(c,r(t.substring(n-64,n)));for(t=t.substring(n-64),i=t.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n>2]|=t.charCodeAt(n)<<(n%4<<3);if(a[n>>2]|=128<<(n%4<<3),n>55)for(e(c,a),n=0;n<16;n+=1)a[n]=0;return u=8*f,u=u.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(u[2],16),s=parseInt(u[1],16)||0,a[14]=o,a[15]=s,e(c,a),c}function a(t){var r,i,a,u,o,s,f=t.length,c=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=f;r+=64)e(c,n(t.subarray(r-64,r)));for(t=r-64>2]|=t[r]<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(e(c,a),r=0;r<16;r+=1)a[r]=0;return u=8*f,u=u.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(u[2],16),s=parseInt(u[1],16)||0,a[14]=o,a[15]=s,e(c,a),c}function u(t){var e,r="";for(e=0;e<4;e+=1)r+=p[t>>8*e+4&15]+p[t>>8*e&15];return r}function o(t){var e;for(e=0;e>16)+(e>>16)+(r>>16)<<16|65535&r},"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return t=0|t||0,t<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(r,n){var i,a,u,o,s=this.byteLength,f=e(r,s),c=s;return n!==t&&(c=e(n,s)),f>c?new ArrayBuffer(0):(i=c-f,a=new ArrayBuffer(i),u=new Uint8Array(a),o=new Uint8Array(this,f,i),u.set(o),a)}}(),d.prototype.append=function(t){return this.appendBinary(s(t)),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var n,i=this._buff.length;for(n=64;n<=i;n+=64)e(this._hash,r(this._buff.substring(n-64,n)));return this._buff=this._buff.substring(n-64),this},d.prototype.end=function(t){var e,r,n=this._buff,i=n.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=n.charCodeAt(e)<<(e%4<<3);return this._finish(a,i),r=o(this._hash),t&&(r=l(r)),this.reset(),r},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},d.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(t,r){var n,i,a,u=r;if(t[u>>2]|=128<<(u%4<<3),u>55)for(e(this._hash,t),u=0;u<16;u+=1)t[u]=0;n=8*this._length,n=n.toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),a=parseInt(n[1],16)||0,t[14]=i,t[15]=a,e(this._hash,t)},d.hash=function(t,e){return d.hashBinary(s(t),e)},d.hashBinary=function(t,e){var r=i(t),n=o(r);return e?l(n):n},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var r,i=h(this._buff.buffer,t,!0),a=i.length;for(this._length+=t.byteLength,r=64;r<=a;r+=64)e(this._hash,n(i.subarray(r-64,r)));return this._buff=r-64>2]|=n[e]<<(e%4<<3);return this._finish(a,i),r=o(this._hash),t&&(r=l(r)),this.reset(),r},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var t=d.prototype.getState.call(this);return t.buff=c(t.buff),t},d.ArrayBuffer.prototype.setState=function(t){return t.buff=f(t.buff,!0),d.prototype.setState.call(this,t)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(t,e){var r=a(new Uint8Array(t)),n=o(r);return e?l(n):n},d})},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return u});var i=r(0),a=function(){function t(t,e){for(var r=0;r=200&&this.status<300){var e=this.response,r=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=r,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,r=t.response;return"json"==e?r:JSON.parse(r)}}]),t}()},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return a});var i=function(){function t(t,e){for(var r=0;r=200&&r<300?this.callback(null,n):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}()}])}); -/* -Turbolinks 5.2.0 -Copyright © 2018 Basecamp, LLC - */ - -(function(){var t=this;(function(){(function(){this.Turbolinks={supported:function(){return null!=window.history.pushState&&null!=window.requestAnimationFrame&&null!=window.addEventListener}(),visit:function(t,r){return e.controller.visit(t,r)},clearCache:function(){return e.controller.clearCache()},setProgressBarDelay:function(t){return e.controller.setProgressBarDelay(t)}}}).call(this)}).call(t);var e=t.Turbolinks;(function(){(function(){var t,r,n,o=[].slice;e.copyObject=function(t){var e,r,n;r={};for(e in t)n=t[e],r[e]=n;return r},e.closest=function(e,r){return t.call(e,r)},t=function(){var t,e;return t=document.documentElement,null!=(e=t.closest)?e:function(t){var e;for(e=this;e;){if(e.nodeType===Node.ELEMENT_NODE&&r.call(e,t))return e;e=e.parentNode}}}(),e.defer=function(t){return setTimeout(t,1)},e.throttle=function(t){var e;return e=null,function(){var r;return r=1<=arguments.length?o.call(arguments,0):[],null!=e?e:e=requestAnimationFrame(function(n){return function(){return e=null,t.apply(n,r)}}(this))}},e.dispatch=function(t,e){var r,o,i,s,a,u;return a=null!=e?e:{},u=a.target,r=a.cancelable,o=a.data,i=document.createEvent("Events"),i.initEvent(t,!0,r===!0),i.data=null!=o?o:{},i.cancelable&&!n&&(s=i.preventDefault,i.preventDefault=function(){return this.defaultPrevented||Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),s.call(this)}),(null!=u?u:document).dispatchEvent(i),i},n=function(){var t;return t=document.createEvent("Events"),t.initEvent("test",!0,!0),t.preventDefault(),t.defaultPrevented}(),e.match=function(t,e){return r.call(t,e)},r=function(){var t,e,r,n;return t=document.documentElement,null!=(e=null!=(r=null!=(n=t.matchesSelector)?n:t.webkitMatchesSelector)?r:t.msMatchesSelector)?e:t.mozMatchesSelector}(),e.uuid=function(){var t,e,r;for(r="",t=e=1;36>=e;t=++e)r+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return r}}).call(this),function(){e.Location=function(){function t(t){var e,r;null==t&&(t=""),r=document.createElement("a"),r.href=t.toString(),this.absoluteURL=r.href,e=r.hash.length,2>e?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=r.hash.slice(1))}var e,r,n,o;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.requestURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=r(t),this.isEqualTo(t)||o(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},r=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return n(t,"/")?t:t+"/"},o=function(t,e){return t.slice(0,e.length)===e},n=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.HttpRequest=function(){function r(r,n,o){this.delegate=r,this.requestCanceled=t(this.requestCanceled,this),this.requestTimedOut=t(this.requestTimedOut,this),this.requestFailed=t(this.requestFailed,this),this.requestLoaded=t(this.requestLoaded,this),this.requestProgressed=t(this.requestProgressed,this),this.url=e.Location.wrap(n).requestURL,this.referrer=e.Location.wrap(o).absoluteURL,this.createXHR()}return r.NETWORK_FAILURE=0,r.TIMEOUT_FAILURE=-1,r.timeout=60,r.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},r.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},r.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},r.prototype.requestLoaded=function(){return this.endRequest(function(t){return function(){var e;return 200<=(e=t.xhr.status)&&300>e?t.delegate.requestCompletedWithResponse(t.xhr.responseText,t.xhr.getResponseHeader("Turbolinks-Location")):(t.failed=!0,t.delegate.requestFailedWithStatusCode(t.xhr.status,t.xhr.responseText))}}(this))},r.prototype.requestFailed=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}}(this))},r.prototype.requestTimedOut=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}}(this))},r.prototype.requestCanceled=function(){return this.endRequest()},r.prototype.notifyApplicationBeforeRequestStart=function(){return e.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},r.prototype.notifyApplicationAfterRequestEnd=function(){return e.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},r.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},r.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},r.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},r.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},r}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.ProgressBar=function(){function e(){this.trickle=t(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var r;return r=300,e.defaultCSS=".turbolinks-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 9999;\n transition: width "+r+"ms ease-out, opacity "+r/2+"ms "+r/2+"ms ease-in;\n transform: translate3d(0, 0, 0);\n}",e.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},e.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement(function(t){return function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}}(this))):void 0},e.prototype.setValue=function(t){return this.value=t,this.refresh()},e.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},e.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},e.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,1.5*r)},e.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},e.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,r)},e.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},e.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},e.prototype.refresh=function(){return requestAnimationFrame(function(t){return function(){return t.progressElement.style.width=10+90*t.value+"%"}}(this))},e.prototype.createStylesheetElement=function(){var t;return t=document.createElement("style"),t.type="text/css",t.textContent=this.constructor.defaultCSS,t},e.prototype.createProgressElement=function(){var t;return t=document.createElement("div"),t.className="turbolinks-progress-bar",t},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.BrowserAdapter=function(){function r(r){this.controller=r,this.showProgressBar=t(this.showProgressBar,this),this.progressBar=new e.ProgressBar}var n,o,i;return i=e.HttpRequest,n=i.NETWORK_FAILURE,o=i.TIMEOUT_FAILURE,r.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},r.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},r.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},r.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},r.prototype.visitRequestCompleted=function(t){return t.loadResponse()},r.prototype.visitRequestFailedWithStatusCode=function(t,e){switch(e){case n:case o:return this.reload();default:return t.loadResponse()}},r.prototype.visitRequestFinished=function(t){return this.hideProgressBar()},r.prototype.visitCompleted=function(t){return t.followRedirect()},r.prototype.pageInvalidated=function(){return this.reload()},r.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,this.controller.progressBarDelay)},r.prototype.showProgressBar=function(){return this.progressBar.show()},r.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},r.prototype.reload=function(){return window.location.reload()},r}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.History=function(){function r(e){this.delegate=e,this.onPageLoad=t(this.onPageLoad,this),this.onPopState=t(this.onPopState,this)}return r.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0)},r.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1):void 0},r.prototype.push=function(t,r){return t=e.Location.wrap(t),this.update("push",t,r)},r.prototype.replace=function(t,r){return t=e.Location.wrap(t),this.update("replace",t,r)},r.prototype.onPopState=function(t){var r,n,o,i;return this.shouldHandlePopState()&&(i=null!=(n=t.state)?n.turbolinks:void 0)?(r=e.Location.wrap(window.location),o=i.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(r,o)):void 0},r.prototype.onPageLoad=function(t){return e.defer(function(t){return function(){return t.pageLoaded=!0}}(this))},r.prototype.shouldHandlePopState=function(){return this.pageIsLoaded()},r.prototype.pageIsLoaded=function(){return this.pageLoaded||"complete"===document.readyState},r.prototype.update=function(t,e,r){var n;return n={turbolinks:{restorationIdentifier:r}},history[t+"State"](n,null,e)},r}()}.call(this),function(){e.HeadDetails=function(){function t(t){var e,r,n,s,a,u;for(this.elements={},n=0,a=t.length;a>n;n++)u=t[n],u.nodeType===Node.ELEMENT_NODE&&(s=u.outerHTML,r=null!=(e=this.elements)[s]?e[s]:e[s]={type:i(u),tracked:o(u),elements:[]},r.elements.push(u))}var e,r,n,o,i;return t.fromHeadElement=function(t){var e;return new this(null!=(e=null!=t?t.childNodes:void 0)?e:[])},t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var t,e;return function(){var r,n;r=this.elements,n=[];for(t in r)e=r[t].tracked,e&&n.push(t);return n}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var r,n,o,i,s,a;o=this.elements,s=[];for(n in o)i=o[n],a=i.type,r=i.elements,a!==t||e.hasElementWithKey(n)||s.push(r[0]);return s},t.prototype.getProvisionalElements=function(){var t,e,r,n,o,i,s;r=[],n=this.elements;for(e in n)o=n[e],s=o.type,i=o.tracked,t=o.elements,null!=s||i?t.length>1&&r.push.apply(r,t.slice(1)):r.push.apply(r,t);return r},t.prototype.getMetaValue=function(t){var e;return null!=(e=this.findMetaElementByName(t))?e.getAttribute("content"):void 0},t.prototype.findMetaElementByName=function(t){var r,n,o,i;r=void 0,i=this.elements;for(o in i)n=i[o].elements,e(n[0],t)&&(r=n[0]);return r},i=function(t){return r(t)?"script":n(t)?"stylesheet":void 0},o=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},r=function(t){var e;return e=t.tagName.toLowerCase(),"script"===e},n=function(t){var e;return e=t.tagName.toLowerCase(),"style"===e||"link"===e&&"stylesheet"===t.getAttribute("rel")},e=function(t,e){var r;return r=t.tagName.toLowerCase(),"meta"===r&&t.getAttribute("name")===e},t}()}.call(this),function(){e.Snapshot=function(){function t(t,e){this.headDetails=t,this.bodyElement=e}return t.wrap=function(t){return t instanceof this?t:"string"==typeof t?this.fromHTMLString(t):this.fromHTMLElement(t)},t.fromHTMLString=function(t){var e;return e=document.createElement("html"),e.innerHTML=t,this.fromHTMLElement(e)},t.fromHTMLElement=function(t){var r,n,o,i;return o=t.querySelector("head"),r=null!=(i=t.querySelector("body"))?i:document.createElement("body"),n=e.HeadDetails.fromHeadElement(o),new this(n,r)},t.prototype.clone=function(){return new this.constructor(this.headDetails,this.bodyElement.cloneNode(!0))},t.prototype.getRootLocation=function(){var t,r;return r=null!=(t=this.getSetting("root"))?t:"/",new e.Location(r)},t.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},t.prototype.getElementForAnchor=function(t){try{return this.bodyElement.querySelector("[id='"+t+"'], a[name='"+t+"']")}catch(e){}},t.prototype.getPermanentElements=function(){return this.bodyElement.querySelectorAll("[id][data-turbolinks-permanent]")},t.prototype.getPermanentElementById=function(t){return this.bodyElement.querySelector("#"+t+"[data-turbolinks-permanent]")},t.prototype.getPermanentElementsPresentInSnapshot=function(t){var e,r,n,o,i;for(o=this.getPermanentElements(),i=[],r=0,n=o.length;n>r;r++)e=o[r],t.getPermanentElementById(e.id)&&i.push(e);return i},t.prototype.findFirstAutofocusableElement=function(){return this.bodyElement.querySelector("[autofocus]")},t.prototype.hasAnchor=function(t){return null!=this.getElementForAnchor(t)},t.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},t.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},t.prototype.isVisitable=function(){return"reload"!==this.getSetting("visit-control")},t.prototype.getSetting=function(t){return this.headDetails.getMetaValue("turbolinks-"+t)},t}()}.call(this),function(){var t=[].slice;e.Renderer=function(){function e(){}var r;return e.render=function(){var e,r,n,o;return n=arguments[0],r=arguments[1],e=3<=arguments.length?t.call(arguments,2):[],o=function(t,e,r){r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return Object(o)===o?o:n}(this,e,function(){}),o.delegate=n,o.render(r),o},e.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},e.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},e.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:(e=document.createElement("script"),e.textContent=t.textContent,e.async=!1,r(e,t),e)},r=function(t,e){var r,n,o,i,s,a,u;for(i=e.attributes,a=[],r=0,n=i.length;n>r;r++)s=i[r],o=s.name,u=s.value,a.push(t.setAttribute(o,u));return a},e}()}.call(this),function(){var t,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;e.SnapshotRenderer=function(e){function o(t,e,r){this.currentSnapshot=t,this.newSnapshot=e,this.isPreview=r,this.currentHeadDetails=this.currentSnapshot.headDetails,this.newHeadDetails=this.newSnapshot.headDetails,this.currentBody=this.currentSnapshot.bodyElement,this.newBody=this.newSnapshot.bodyElement}return n(o,e),o.prototype.render=function(t){return this.shouldRender()?(this.mergeHead(),this.renderView(function(e){return function(){return e.replaceBody(),e.isPreview||e.focusFirstAutofocusableElement(),t()}}(this))):this.invalidateView()},o.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},o.prototype.replaceBody=function(){var t;return t=this.relocateCurrentBodyPermanentElements(),this.activateNewBodyScriptElements(),this.assignNewBody(),this.replacePlaceholderElementsWithClonedPermanentElements(t)},o.prototype.shouldRender=function(){return this.newSnapshot.isVisitable()&&this.trackedElementsAreIdentical()},o.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},o.prototype.copyNewHeadStylesheetElements=function(){var t,e,r,n,o;for(n=this.getNewHeadStylesheetElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.appendChild(t));return o},o.prototype.copyNewHeadScriptElements=function(){var t,e,r,n,o;for(n=this.getNewHeadScriptElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.appendChild(this.createScriptElement(t)));return o},o.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,r,n,o;for(n=this.getCurrentHeadProvisionalElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.removeChild(t));return o},o.prototype.copyNewHeadProvisionalElements=function(){var t,e,r,n,o;for(n=this.getNewHeadProvisionalElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.appendChild(t));return o},o.prototype.relocateCurrentBodyPermanentElements=function(){var e,n,o,i,s,a,u;for(a=this.getCurrentBodyPermanentElements(),u=[],e=0,n=a.length;n>e;e++)i=a[e],s=t(i),o=this.newSnapshot.getPermanentElementById(i.id),r(i,s.element),r(o,i),u.push(s);return u},o.prototype.replacePlaceholderElementsWithClonedPermanentElements=function(t){var e,n,o,i,s,a,u;for(u=[],o=0,i=t.length;i>o;o++)a=t[o],n=a.element,s=a.permanentElement,e=s.cloneNode(!0),u.push(r(n,e));return u},o.prototype.activateNewBodyScriptElements=function(){var t,e,n,o,i,s;for(i=this.getNewBodyScriptElements(),s=[],e=0,o=i.length;o>e;e++)n=i[e],t=this.createScriptElement(n),s.push(r(n,t));return s},o.prototype.assignNewBody=function(){return document.body=this.newBody},o.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.newSnapshot.findFirstAutofocusableElement())?t.focus():void 0},o.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},o.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},o.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},o.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},o.prototype.getCurrentBodyPermanentElements=function(){return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot)},o.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},o}(e.Renderer),t=function(t){var e;return e=document.createElement("meta"),e.setAttribute("name","turbolinks-permanent-placeholder"),e.setAttribute("content",t.id),{element:e,permanentElement:t}},r=function(t,e){var r;return(r=t.parentNode)?r.replaceChild(e,t):void 0}}.call(this),function(){var t=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;e.ErrorRenderer=function(e){function r(t){var e;e=document.createElement("html"),e.innerHTML=t,this.newHead=e.querySelector("head"),this.newBody=e.querySelector("body")}return t(r,e),r.prototype.render=function(t){return this.renderView(function(e){return function(){return e.replaceHeadAndBody(),e.activateBodyScriptElements(),t()}}(this))},r.prototype.replaceHeadAndBody=function(){var t,e;return e=document.head,t=document.body,e.parentNode.replaceChild(this.newHead,e),t.parentNode.replaceChild(this.newBody,t)},r.prototype.activateBodyScriptElements=function(){var t,e,r,n,o,i;for(n=this.getScriptElements(),i=[],e=0,r=n.length;r>e;e++)o=n[e],t=this.createScriptElement(o),i.push(o.parentNode.replaceChild(t,o));return i},r.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},r}(e.Renderer)}.call(this),function(){e.View=function(){function t(t){this.delegate=t,this.htmlElement=document.documentElement}return t.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},t.prototype.getElementForAnchor=function(t){return this.getSnapshot().getElementForAnchor(t)},t.prototype.getSnapshot=function(){return e.Snapshot.fromHTMLElement(this.htmlElement)},t.prototype.render=function(t,e){var r,n,o;return o=t.snapshot,r=t.error,n=t.isPreview,this.markAsPreview(n),null!=o?this.renderSnapshot(o,n,e):this.renderError(r,e)},t.prototype.markAsPreview=function(t){return t?this.htmlElement.setAttribute("data-turbolinks-preview",""):this.htmlElement.removeAttribute("data-turbolinks-preview")},t.prototype.renderSnapshot=function(t,r,n){return e.SnapshotRenderer.render(this.delegate,n,this.getSnapshot(),e.Snapshot.wrap(t),r)},t.prototype.renderError=function(t,r){return e.ErrorRenderer.render(this.delegate,r,t)},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.ScrollManager=function(){function r(r){this.delegate=r,this.onScroll=t(this.onScroll,this),this.onScroll=e.throttle(this.onScroll)}return r.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},r.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},r.prototype.scrollToElement=function(t){return t.scrollIntoView()},r.prototype.scrollToPosition=function(t){var e,r;return e=t.x,r=t.y,window.scrollTo(e,r)},r.prototype.onScroll=function(t){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},r.prototype.updatePosition=function(t){var e;return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},r}()}.call(this),function(){e.SnapshotCache=function(){function t(t){this.size=t,this.keys=[],this.snapshots={}}var r;return t.prototype.has=function(t){var e;return e=r(t),e in this.snapshots},t.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},t.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},t.prototype.read=function(t){var e;return e=r(t),this.snapshots[e]},t.prototype.write=function(t,e){var n;return n=r(t),this.snapshots[n]=e},t.prototype.touch=function(t){var e,n;return n=r(t),e=this.keys.indexOf(n),e>-1&&this.keys.splice(e,1),this.keys.unshift(n),this.trim()},t.prototype.trim=function(){var t,e,r,n,o;for(n=this.keys.splice(this.size),o=[],t=0,r=n.length;r>t;t++)e=n[t],o.push(delete this.snapshots[e]);return o},r=function(t){return e.Location.wrap(t).toCacheKey()},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.Visit=function(){function r(r,n,o){this.controller=r,this.action=o,this.performScroll=t(this.performScroll,this),this.identifier=e.uuid(),this.location=e.Location.wrap(n),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var n;return r.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},r.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},r.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},r.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},r.prototype.changeHistory=function(){var t,e;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,e=n(t),this.controller[e](this.location,this.restorationIdentifier),this.historyChanged=!0)},r.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new e.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},r.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},r.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},r.prototype.loadCachedSnapshot=function(){var t,e;return(e=this.getCachedSnapshot())?(t=this.shouldIssueRequest(),this.render(function(){var r;return this.cacheSnapshot(),this.controller.render({snapshot:e,isPreview:t},this.performScroll),"function"==typeof(r=this.adapter).visitRendered&&r.visitRendered(this),t?void 0:this.complete()})):void 0},r.prototype.loadResponse=function(){return null!=this.response?this.render(function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())}):void 0},r.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},r.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0},r.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},r.prototype.requestCompletedWithResponse=function(t,r){return this.response=t,null!=r&&(this.redirectedToLocation=e.Location.wrap(r)),this.adapter.visitRequestCompleted(this)},r.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,this.adapter.visitRequestFailedWithStatusCode(this,t)},r.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},r.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},r.prototype.scrollToRestoredPosition=function(){var t,e;return t=null!=(e=this.restorationData)?e.scrollPosition:void 0,null!=t?(this.controller.scrollToPosition(t),!0):void 0},r.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},r.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},r.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},r.prototype.getTimingMetrics=function(){return e.copyObject(this.timingMetrics)},n=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},r.prototype.shouldIssueRequest=function(){return"restore"===this.action?!this.hasCachedSnapshot():!0},r.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},r.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame(function(e){return function(){return e.frame=null,t.call(e)}}(this))},r.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},r}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};e.Controller=function(){function r(){this.clickBubbled=t(this.clickBubbled,this),this.clickCaptured=t(this.clickCaptured,this),this.pageLoaded=t(this.pageLoaded,this),this.history=new e.History(this),this.view=new e.View(this),this.scrollManager=new e.ScrollManager(this),this.restorationData={},this.clearCache(),this.setProgressBarDelay(500)}return r.prototype.start=function(){return e.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},r.prototype.disable=function(){return this.enabled=!1},r.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},r.prototype.clearCache=function(){return this.cache=new e.SnapshotCache(10)},r.prototype.visit=function(t,r){var n,o;return null==r&&(r={}),t=e.Location.wrap(t),this.applicationAllowsVisitingLocation(t)?this.locationIsVisitable(t)?(n=null!=(o=r.action)?o:"advance",this.adapter.visitProposedToLocationWithAction(t,n)):window.location=t:void 0},r.prototype.startVisitToLocationWithAction=function(t,r,n){var o;return e.supported?(o=this.getRestorationDataForIdentifier(n),this.startVisit(t,r,{restorationData:o})):window.location=t},r.prototype.setProgressBarDelay=function(t){return this.progressBarDelay=t},r.prototype.startHistory=function(){return this.location=e.Location.wrap(window.location),this.restorationIdentifier=e.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},r.prototype.stopHistory=function(){return this.history.stop()},r.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(t,r){return this.restorationIdentifier=r,this.location=e.Location.wrap(t),this.history.push(this.location,this.restorationIdentifier)},r.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(t,r){return this.restorationIdentifier=r,this.location=e.Location.wrap(t),this.history.replace(this.location,this.restorationIdentifier)},r.prototype.historyPoppedToLocationWithRestorationIdentifier=function(t,r){var n;return this.restorationIdentifier=r,this.enabled?(n=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(t,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:n,historyChanged:!0}),this.location=e.Location.wrap(t)):this.adapter.pageInvalidated()},r.prototype.getCachedSnapshotForLocation=function(t){var e;return null!=(e=this.cache.get(t))?e.clone():void 0},r.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable(); -},r.prototype.cacheSnapshot=function(){var t,r;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),r=this.view.getSnapshot(),t=this.lastRenderedLocation,e.defer(function(e){return function(){return e.cache.put(t,r.clone())}}(this))):void 0},r.prototype.scrollToAnchor=function(t){var e;return(e=this.view.getElementForAnchor(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},r.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},r.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},r.prototype.scrollPositionChanged=function(t){var e;return e=this.getCurrentRestorationData(),e.scrollPosition=t},r.prototype.render=function(t,e){return this.view.render(t,e)},r.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},r.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},r.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},r.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},r.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},r.prototype.clickBubbled=function(t){var e,r,n;return this.enabled&&this.clickEventIsSignificant(t)&&(r=this.getVisitableLinkForNode(t.target))&&(n=this.getVisitableLocationForLink(r))&&this.applicationAllowsFollowingLinkToLocation(r,n)?(t.preventDefault(),e=this.getActionForLink(r),this.visit(n,{action:e})):void 0},r.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){var r;return r=this.notifyApplicationAfterClickingLinkToLocation(t,e),!r.defaultPrevented},r.prototype.applicationAllowsVisitingLocation=function(t){var e;return e=this.notifyApplicationBeforeVisitingLocation(t),!e.defaultPrevented},r.prototype.notifyApplicationAfterClickingLinkToLocation=function(t,r){return e.dispatch("turbolinks:click",{target:t,data:{url:r.absoluteURL},cancelable:!0})},r.prototype.notifyApplicationBeforeVisitingLocation=function(t){return e.dispatch("turbolinks:before-visit",{data:{url:t.absoluteURL},cancelable:!0})},r.prototype.notifyApplicationAfterVisitingLocation=function(t){return e.dispatch("turbolinks:visit",{data:{url:t.absoluteURL}})},r.prototype.notifyApplicationBeforeCachingSnapshot=function(){return e.dispatch("turbolinks:before-cache")},r.prototype.notifyApplicationBeforeRender=function(t){return e.dispatch("turbolinks:before-render",{data:{newBody:t}})},r.prototype.notifyApplicationAfterRender=function(){return e.dispatch("turbolinks:render")},r.prototype.notifyApplicationAfterPageLoad=function(t){return null==t&&(t={}),e.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:t}})},r.prototype.startVisit=function(t,e,r){var n;return null!=(n=this.currentVisit)&&n.cancel(),this.currentVisit=this.createVisit(t,e,r),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},r.prototype.createVisit=function(t,r,n){var o,i,s,a,u;return i=null!=n?n:{},a=i.restorationIdentifier,s=i.restorationData,o=i.historyChanged,u=new e.Visit(this,t,r),u.restorationIdentifier=null!=a?a:e.uuid(),u.restorationData=e.copyObject(s),u.historyChanged=o,u.referrer=this.location,u},r.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},r.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},r.prototype.getVisitableLinkForNode=function(t){return this.nodeIsVisitable(t)?e.closest(t,"a[href]:not([target]):not([download])"):void 0},r.prototype.getVisitableLocationForLink=function(t){var r;return r=new e.Location(t.getAttribute("href")),this.locationIsVisitable(r)?r:void 0},r.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},r.prototype.nodeIsVisitable=function(t){var r;return(r=e.closest(t,"[data-turbolinks]"))?"false"!==r.getAttribute("data-turbolinks"):!0},r.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},r.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},r.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},r}()}.call(this),function(){!function(){var t,e;if((t=e=document.currentScript)&&!e.hasAttribute("data-turbolinks-suppress-warning"))for(;t=t.parentNode;)if(t===document.body)return console.warn("You are loading Turbolinks from a