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

dev_home
杨树林 5 years ago
commit 32b65df039

@ -3,7 +3,7 @@ $(document).on('turbolinks:load', function() {
var $container = $('.edit-laboratory-setting-container');
var $form = $container.find('.edit_laboratory');
$('.logo-item-left').on("change", 'input[type="file"]', function () {
$('.logo-item-left, .banner-item-bottom').on("change", 'input[type="file"]', function () {
var $fileInput = $(this);
var file = this.files[0];
var imageType = /image.*/;

@ -3,7 +3,7 @@ $(document).on('turbolinks:load', function() {
var $container = $('.edit-laboratory-setting-container');
var $form = $container.find('.edit_laboratory');
$('.logo-item-left').on("change", 'input[type="file"]', function () {
$('.logo-item-left, .banner-item-bottom').on("change", 'input[type="file"]', function () {
var $fileInput = $(this);
var file = this.files[0];
var imageType = /image.*/;

@ -96,5 +96,76 @@
font-size: 14px;
}
}
.banner-item {
margin-bottom: 15px;
display: flex;
flex-direction: column;
&-img {
display: block;
width: 300px;
height: 80px;
background: #f0f0f0;
}
&-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 300px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
&::before {
content: '';
position: absolute;
top: 27px;
left: 149px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
&::after {
content: '';
position: absolute;
top: 39px;
left: 137px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
}
&-top {
margin-bottom: 10px;
}
&-bottom {
position: relative;
width: 300px;
height: 80px;
&.has-img {
.banner-item-upload {
display: none;
}
&:hover {
.banner-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
}
}
}
}
&-title {
color: #23272B;
font-size: 14px;
}
}
}
}

@ -72,5 +72,76 @@
font-size: 14px;
}
}
.banner-item {
margin-bottom: 15px;
display: flex;
flex-direction: column;
&-img {
display: block;
width: 300px;
height: 80px;
background: #f0f0f0;
}
&-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 300px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
&::before {
content: '';
position: absolute;
top: 27px;
left: 149px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
&::after {
content: '';
position: absolute;
top: 39px;
left: 137px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
}
&-top {
margin-bottom: 10px;
}
&-bottom {
position: relative;
width: 300px;
height: 80px;
&.has-img {
.banner-item-upload {
display: none;
}
&:hover {
.banner-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
}
}
}
}
&-title {
color: #23272B;
font-size: 14px;
}
}
}
}

@ -15,6 +15,9 @@ class Admins::LaboratorySettingsController < Admins::BaseController
end
def form_params
params.permit(:identifier, :name, :nav_logo, :login_logo, :tab_logo, :footer, navbar: %i[name link hidden])
params.permit(:identifier, :name,
:nav_logo, :login_logo, :tab_logo,
:subject_banner, :course_banner, :competition_banner, :moop_cases_banner,
:footer, navbar: %i[name link hidden])
end
end

@ -9,7 +9,8 @@ class Competitions::CompetitionsController < Competitions::BaseController
def index
# 已上架 或者 即将上架
competitions = Competition.where(status: true).or(Competition.where.not(published_at: nil))
competitions = current_laboratory.competitions
competitions = competitions.where(status: true).or(competitions.where.not(published_at: nil))
competitions =
case params[:category]

@ -9,6 +9,9 @@ class Cooperative::LaboratorySettingsController < Cooperative::BaseController
end
def form_params
params.permit(:identifier, :name, :nav_logo, :login_logo, :tab_logo, :footer, navbar: %i[name link hidden])
params.permit(:identifier, :name,
:nav_logo, :login_logo, :tab_logo,
:subject_banner, :course_banner, :competition_banner, :moop_cases_banner,
:footer, navbar: %i[name link hidden])
end
end

@ -61,12 +61,13 @@ class CoursesController < ApplicationController
@user = current_user
# 根据分类查询课堂(全部,我的,最新,最热)
@order = params[:order].present? ? params[:order] : "all"
@courses = current_laboratory.courses
if @order == "visits"
order_str = "courses.id = 1309 DESC, courses.visits DESC"
@courses = Course.where(is_delete: 0, is_hidden: 0)
@courses = @courses.where(is_delete: 0, is_hidden: 0)
else
order_str = "courses.id = 1309 DESC, courses.homepage_show DESC, courses.created_at desc"
@courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0)
@courses = @courses.where(is_delete: 0, is_hidden: 0, is_end: 0)
end
# 金课未开课的不显示在首页

@ -1,6 +1,6 @@
class ShixunListsController < ApplicationController
def index
@results = ShixunSearchService.call(search_params)
@results = ShixunSearchService.call(search_params, request.subdomain)
end
private

@ -1,6 +1,6 @@
class SubjectListsController < ApplicationController
def index
@results = SubjectSearchService.call(search_params)
@results = SubjectSearchService.call(search_params, request.subdomain)
end
private

@ -1,4 +1,5 @@
class Competition < ApplicationRecord
belongs_to :laboratory, optional: true
has_many :competition_modules, dependent: :destroy
has_many :unhidden_competition_modules, -> { where(hidden: false) }, class_name: 'CompetitionModule'
@ -32,6 +33,7 @@ class Competition < ApplicationRecord
has_many :competition_prizes, dependent: :destroy
has_many :competition_prize_users, dependent: :destroy
before_save :set_laboratory
after_create :create_competition_modules
def mode_type
@ -180,4 +182,10 @@ class Competition < ApplicationRecord
end
end
end
def set_laboratory
return unless new_record?
self.laboratory = Laboratory.current if laboratory_id.blank?
end
end

@ -7,6 +7,8 @@ class Course < ApplicationRecord
belongs_to :school, class_name: 'School', foreign_key: :school_id #定义一个方法school该方法通过school_id来调用School表
belongs_to :course_list, optional: true
belongs_to :laboratory, optional: true
# 所属实践课程
belongs_to :subject, optional: true
has_many :informs, as: :container, dependent: :destroy
@ -105,6 +107,7 @@ class Course < ApplicationRecord
validates :name, presence: true, length: { maximum: 60 }
before_save :set_laboratory
after_create :create_board_sync, :act_as_course_activity, :send_tiding
def course_member? user_id, role
@ -409,4 +412,10 @@ class Course < ApplicationRecord
else 100
end
end
def set_laboratory
return unless new_record? # 新记录才需要标记
self.laboratory = Laboratory.current if laboratory_id.blank?
end
end

@ -9,7 +9,13 @@ class Laboratory < ApplicationRecord
has_many :portal_images, dependent: :destroy
has_many :laboratory_shixuns, dependent: :destroy
has_many :shixuns, through: :laboratory_shixuns, source: :shixun
has_many :laboratory_subjects, dependent: :destroy
has_many :subjects, through: :laboratory_subjects, source: :subject
has_many :courses, dependent: :destroy
has_many :competitions, dependent: :destroy
validates :identifier, uniqueness: { case_sensitive: false }, allow_nil: true

@ -15,15 +15,31 @@ class LaboratorySetting < ApplicationRecord
end
def login_logo_url
logo_url('login')
image_url('login')
end
def nav_logo_url
logo_url('nav')
image_url('nav')
end
def tab_logo_url
logo_url('tab')
image_url('tab')
end
def subject_banner_url
image_url('_subject_banner')
end
def course_banner_url
image_url('_course_banner')
end
def competition_banner_url
image_url('_competition_banner')
end
def moop_cases_banner_url
image_url('_moop_cases_banner')
end
def default_navbar
@ -32,7 +48,7 @@ class LaboratorySetting < ApplicationRecord
private
def logo_url(type)
def image_url(type)
return nil unless Util::FileManage.exists?(self, type)
Util::FileManage.source_disk_file_url(self, type)
end

@ -17,7 +17,7 @@ class Admins::SaveLaboratorySettingService < ApplicationService
laboratory.save!
laboratory_setting.save!
deal_logo_file
deal_image_file
end
laboratory
@ -35,13 +35,17 @@ class Admins::SaveLaboratorySettingService < ApplicationService
end
end
def deal_logo_file
save_logo_file(params[:nav_logo], 'nav')
save_logo_file(params[:login_logo], 'login')
save_logo_file(params[:tab_logo], 'tab')
def deal_image_file
save_image_file(params[:nav_logo], 'nav')
save_image_file(params[:login_logo], 'login')
save_image_file(params[:tab_logo], 'tab')
save_image_file(params[:subject_banner], '_subject_banner')
save_image_file(params[:course_banner], '_course_banner')
save_image_file(params[:competition_banner], '_competition_banner')
save_image_file(params[:moop_cases_banner], '_moop_cases_banner')
end
def save_logo_file(file, type)
def save_image_file(file, type)
return unless file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
file_path = Util::FileManage.source_disk_filename(laboratory_setting, type)

@ -1,10 +1,11 @@
class ShixunSearchService < ApplicationService
include ElasticsearchAble
attr_reader :params
attr_reader :params, :subdomain
def initialize(params)
def initialize(params, subdomain)
@params = params
@subdomain = subdomain
end
def call
@ -35,6 +36,9 @@ class ShixunSearchService < ApplicationService
@shixuns = @shixuns.where(trainee: params[:diff])
end
laboratory = Laboratory.find_by_subdomain(subdomain)
@shixuns = @shixuns.where(id: laboratory.shixuns) if laboratory
Shixun.search(keyword, search_options)
end

@ -1,10 +1,11 @@
class SubjectSearchService < ApplicationService
include ElasticsearchAble
attr_reader :params
attr_reader :params, :subdomain
def initialize(params)
def initialize(params, subdomain)
@params = params
@subdomain = subdomain
end
def call
@ -17,6 +18,9 @@ class SubjectSearchService < ApplicationService
@subjects = Subject.visible.unhidden
end
laboratory = Laboratory.find_by_subdomain(subdomain)
@subjects = @subjects.where(id: laboratory.subjects) if laboratory
Subject.search(keyword, search_options)
end

@ -86,6 +86,52 @@
</div>
</div>
<div class="form-group px-2 setting-item">
<div class="setting-item-head"><h6>Banner设置</h6></div>
<div class="dropdown-divider"></div>
<div class="pl-0 py-3 row setting-item-body">
<div class="col-12 col-md-4 banner-item">
<%- subject_banner = setting.subject_banner_url -%>
<div class="banner-item-top">实践课程</div>
<div class="banner-item-bottom <%= subject_banner ? 'has-img' : '' %>">
<img class="banner-item-img subject-banner-img" src="<%= subject_banner %>" style="<%= subject_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:subject_banner, accept: 'image/*', style: 'display: none', value: params[:subject_banner]) %>
<label for="subject_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item">
<%- course_banner = setting.course_banner_url -%>
<div class="banner-item-top">翻转课堂</div>
<div class="banner-item-bottom <%= course_banner ? 'has-img' : '' %>">
<img class="banner-item-img course-banner-img" src="<%= course_banner %>" style="<%= course_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: params[:course_banner]) %>
<label for="course_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item">
<%- competition_banner = setting.competition_banner_url -%>
<div class="banner-item-top">在线竞赛</div>
<div class="banner-item-bottom <%= competition_banner ? 'has-img' : '' %>">
<img class="banner-item-img competition-banner-img" src="<%= competition_banner %>" style="<%= competition_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:competition_banner, accept: 'image/*', style: 'display: none', value: params[:competition_banner]) %>
<label for="competition_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item">
<%- moop_cases_banner = setting.moop_cases_banner_url -%>
<div class="banner-item-top">教学案例</div>
<div class="banner-item-bottom <%= moop_cases_banner ? 'has-img' : '' %>">
<img class="banner-item-img moop-cases-banner-img" src="<%= moop_cases_banner %>" style="<%= moop_cases_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:moop_cases_banner, accept: 'image/*', style: 'display: none', value: params[:moop_cases_banner]) %>
<label for="moop_cases_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
</div>
</div>
<div class="form-group px-2 setting-item">
<div class="setting-item-head"><h6>导航设置</h6></div>
<div class="dropdown-divider"></div>

@ -85,6 +85,52 @@
</div>
</div>
<div class="form-group px-2 setting-item">
<div class="setting-item-head"><h6>Banner设置</h6></div>
<div class="dropdown-divider"></div>
<div class="pl-0 py-3 row setting-item-body">
<div class="col-12 col-md-4 banner-item">
<%- subject_banner = setting.subject_banner_url -%>
<div class="banner-item-top">实践课程</div>
<div class="banner-item-bottom <%= subject_banner ? 'has-img' : '' %>">
<img class="banner-item-img subject-banner-img" src="<%= subject_banner %>" style="<%= subject_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:subject_banner, accept: 'image/*', style: 'display: none', value: params[:subject_banner]) %>
<label for="subject_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item">
<%- course_banner = setting.course_banner_url -%>
<div class="banner-item-top">翻转课堂</div>
<div class="banner-item-bottom <%= course_banner ? 'has-img' : '' %>">
<img class="banner-item-img course-banner-img" src="<%= course_banner %>" style="<%= course_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: params[:course_banner]) %>
<label for="course_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item">
<%- competition_banner = setting.competition_banner_url -%>
<div class="banner-item-top">在线竞赛</div>
<div class="banner-item-bottom <%= competition_banner ? 'has-img' : '' %>">
<img class="banner-item-img competition-banner-img" src="<%= competition_banner %>" style="<%= competition_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:competition_banner, accept: 'image/*', style: 'display: none', value: params[:competition_banner]) %>
<label for="competition_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<div class="col-12 col-md-4 banner-item">
<%- moop_cases_banner = setting.moop_cases_banner_url -%>
<div class="banner-item-top">教学案例</div>
<div class="banner-item-bottom <%= moop_cases_banner ? 'has-img' : '' %>">
<img class="banner-item-img moop-cases-banner-img" src="<%= moop_cases_banner %>" style="<%= moop_cases_banner.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:moop_cases_banner, accept: 'image/*', style: 'display: none', value: params[:moop_cases_banner]) %>
<label for="moop_cases_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
</div>
</div>
<div class="form-group px-2 setting-item">
<div class="setting-item-head"><h6>导航设置</h6></div>
<div class="dropdown-divider"></div>

@ -6,6 +6,11 @@ json.setting do
json.login_logo_url (setting.login_logo_url || default_setting.login_logo_url)&.[](1..-1)
json.tab_logo_url (setting.tab_logo_url || default_setting.tab_logo_url)&.[](1..-1)
json.subject_banner_url (setting.subject_banner_url || default_setting.subject_banner_url)&.[](1..-1)
json.course_banner_url (setting.course_banner_url || default_setting.course_banner_url)&.[](1..-1)
json.competition_banner_url (setting.competition_banner_url || default_setting.competition_banner_url)&.[](1..-1)
json.moop_cases_banner_url (setting.moop_cases_banner_url || default_setting.moop_cases_banner_url)&.[](1..-1)
json.navbar setting.navbar || default_setting.navbar
json.footer setting.footer || default_setting.footer

@ -0,0 +1,5 @@
class AddLaboratoryIdToCourses < ActiveRecord::Migration[5.2]
def change
add_reference :courses, :laboratory, null: true
end
end

@ -0,0 +1,5 @@
class AddLaboratoryIdToCompetitions < ActiveRecord::Migration[5.2]
def change
add_reference :competitions, :laboratory
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -25960,6 +25960,86 @@ input.form-control {
font-size: 14px;
}
/* line 100, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item {
margin-bottom: 15px;
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
/* line 105, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-img, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-img {
display: block;
width: 300px;
height: 80px;
background: #f0f0f0;
}
/* line 112, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-upload, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 300px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
}
/* line 121, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-upload::before, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-upload::before {
content: '';
position: absolute;
top: 27px;
left: 149px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
/* line 131, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-upload::after, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-upload::after {
content: '';
position: absolute;
top: 39px;
left: 137px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
/* line 142, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-top, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-top {
margin-bottom: 10px;
}
/* line 146, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-bottom, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-bottom {
position: relative;
width: 300px;
height: 80px;
}
/* line 152, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-bottom.has-img .banner-item-upload, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-bottom.has-img .banner-item-upload {
display: none;
}
/* line 157, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-bottom.has-img:hover .banner-item-upload, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-bottom.has-img:hover .banner-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
}
/* line 165, app/assets/stylesheets/admins/laboratories.scss */
.admins-laboratory-settings-show-page .edit-laboratory-setting-container .banner-item-title, .admins-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-title {
color: #23272B;
font-size: 14px;
}
/* line 4, app/assets/stylesheets/admins/library_applies.scss */
.admins-library-applies-index-page .library-applies-list-container span.apply-status-agreed {
color: #28a745;

@ -137531,7 +137531,7 @@ $(document).on('turbolinks:load', function() {
var $container = $('.edit-laboratory-setting-container');
var $form = $container.find('.edit_laboratory');
$('.logo-item-left').on("change", 'input[type="file"]', function () {
$('.logo-item-left, .banner-item-bottom').on("change", 'input[type="file"]', function () {
var $fileInput = $(this);
var file = this.files[0];
var imageType = /image.*/;

@ -25233,6 +25233,86 @@ input.form-control {
font-size: 14px;
}
/* line 76, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item {
margin-bottom: 15px;
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
/* line 81, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-img, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-img {
display: block;
width: 300px;
height: 80px;
background: #f0f0f0;
}
/* line 88, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-upload, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 300px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
}
/* line 97, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-upload::before, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-upload::before {
content: '';
position: absolute;
top: 27px;
left: 149px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
/* line 107, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-upload::after, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-upload::after {
content: '';
position: absolute;
top: 39px;
left: 137px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
/* line 118, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-top, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-top {
margin-bottom: 10px;
}
/* line 122, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-bottom, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-bottom {
position: relative;
width: 300px;
height: 80px;
}
/* line 128, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-bottom.has-img .banner-item-upload, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-bottom.has-img .banner-item-upload {
display: none;
}
/* line 133, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-bottom.has-img:hover .banner-item-upload, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-bottom.has-img:hover .banner-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
}
/* line 141, app/assets/stylesheets/cooperative/laboratory_settings.scss */
.cooperative-laboratory-settings-edit-page .edit-laboratory-setting-container .banner-item-title, .cooperative-laboratory-settings-update-page .edit-laboratory-setting-container .banner-item-title {
color: #23272B;
font-size: 14px;
}
/* line 1, app/assets/stylesheets/cooperative/sidebar.scss */
#sidebar {
min-width: 200px;

@ -135974,7 +135974,7 @@ $(document).on('turbolinks:load', function() {
var $container = $('.edit-laboratory-setting-container');
var $form = $container.find('.edit_laboratory');
$('.logo-item-left').on("change", 'input[type="file"]', function () {
$('.logo-item-left, .banner-item-bottom').on("change", 'input[type="file"]', function () {
var $fileInput = $(this);
var file = this.files[0];
var imageType = /image.*/;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 410 KiB

@ -250,7 +250,7 @@ class UseBank extends Component{
</style>:""
}
<WordsBtn style="blue" className="mr30 font-16" onClick={()=>this.openSelectBank()}>{engNameMap[object_type]=="问卷"?"问卷选用":engNameMap[object_type]=="试卷"?"试卷选用":"题库选用"}</WordsBtn>
{this.props.user&&this.props.user.main_site===true?<WordsBtn style="blue" className="mr30 font-16" onClick={()=>this.openSelectBank()}>{engNameMap[object_type]=="问卷"?"问卷选用":engNameMap[object_type]=="试卷"?"试卷选用":"题库选用"}</WordsBtn>:""}
{flag===true?<Modal
title="题库选用"
visible={flag}

@ -454,9 +454,9 @@ class commonWork extends Component{
</li>
{ !!course_public && <li className="li_line"><a href="javascript:void(0)" onClick={this.onSetPublic} className="color-grey-9">设为公开</a></li>}
<li><a href="javascript:void(0)" className="color-grey-9"
{this.props.user&&this.props.user.main_site===true?<li><a href="javascript:void(0)" className="color-grey-9"
onClick={this.addToBank}
>加入题库</a></li>
>加入题库</a></li>:""}
</div>
{/* 设为公开 */}
<Modals

@ -550,7 +550,7 @@ class Exercise extends Component{
{
course_types && course_types.course_is_public == 1 && <li className="li_line"><a className="color-grey-9" onClick={()=>this.ActionPoll("public")}>设为公开</a></li>
}
<li className="li_line"><a className="color-grey-9" onClick={()=>this.ActionPoll("bank")}>加入题库</a></li>
{this.props.user&&this.props.user.main_site===true?<li className="li_line"><a className="color-grey-9" onClick={()=>this.ActionPoll("bank")}>加入题库</a></li>:""}
</div>
</div>

@ -571,7 +571,7 @@ class Poll extends Component{
{
course_types && course_types.course_is_public == 1 && <li className="li_line"><a className="color-grey-9" onClick={()=>this.ActionPoll("public")}>设为公开</a></li>
}
<li className="li_line"><a className="color-grey-9" onClick={()=>this.ActionPoll("bank")}>加入题库</a></li>
{this.props.user&&this.props.user.main_site===true?<li className="li_line"><a className="color-grey-9" onClick={()=>this.ActionPoll("bank")}>加入题库</a></li>:""}
</div>
</div>
</div>

Loading…
Cancel
Save