Merge branch 'develop' into dev_race

dev_bj
p31729568 6 years ago
commit 0b087c98e0

@ -67,6 +67,9 @@ gem 'oauth2'
gem 'axlsx', '3.0.0.pre'
gem 'axlsx_rails', '0.3.0'
# state machine
gem 'aasm'
#Ruby 2.2+ has removed test/unit from the core library.
if RUBY_VERSION>='2.2'
gem 'test-unit', '~> 3.0'

@ -879,7 +879,7 @@ class ExerciseController < ApplicationController
if @order == "student_id"
@exercise_users_list = @exercise_users_list.includes(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}")
else
@exercise_users_list = @exercise_users_list.includes(:user => {:user_extensions => []}).order("#{@order} #{@b_sort}")
@exercise_users_list = @exercise_users_list.includes(:user => {:user_extensions => []}).order("#{@order} #{@b_sort}, id desc")
end
end

@ -0,0 +1,105 @@
class LibrariesController < ApplicationController
layout 'base_library'
before_filter :require_login
def index
libraries = Library.where(nil)
libraries =
if params[:type] == 'mine'
libraries.where(user_id: current_user.id).order('created_at desc')
else
libraries.where(status: :published).order('visited_count desc')
end
search = params[:search].to_s.strip
libraries = libraries.where('title LIKE ?', "%#{search}%") if search.present?
per_page = params[:per_page].to_i <= 0 ? 20 : params[:per_page].to_i
@libraries = paginateHelper libraries.includes(user: :user_extensions), per_page
end
def show
@library = Library.find(params[:id])
return redirect_to libraries_path unless admin_or_self?
@library_applies = @library.library_applies.where(status: :refused).order('created_at desc')
@library.increment_visited_count!
end
def new
@library = current_user.libraries.new
end
def create
@library = current_user.libraries.new
Libraries::SaveService.new(@library, current_user, form_params).call
if with_publish?
Libraries::SubmitService.new(current_library).call
redirect_to publish_success_libraries_path
else
flash[:message] = '保存成功'
render 'new'
end
rescue ActiveRecord::RecordInvalid => _
render 'new'
rescue Libraries::SubmitService::Error => ex
flash[:message] = ex.message
render 'new'
end
def edit
@library = current_library
redirect_to library_path(id: @library.id) unless @library.editable?
end
def update
@library = current_library
Libraries::SaveService.new(@library, current_user, form_params).call
if with_publish?
Libraries::SubmitService.new(current_library).call
redirect_to publish_success_libraries_path
else
flash[:message] = '保存成功'
render 'edit'
end
rescue ActiveRecord::RecordInvalid => _
render 'edit'
rescue Libraries::SubmitService::Error => ex
flash[:message] = ex.message
render 'edit'
end
def publish
Libraries::SubmitService.new(current_library).call
render json: { status: 0 }
rescue Libraries::SubmitService::Error => ex
render json: { status: 0, message: ex.message }
end
def publish_success
end
private
def current_library
@_current_library ||= current_user.libraries.find(params[:id])
end
def form_params
@_form_params ||= begin
hash = params[:library].presence || {}
hash[:attachment_ids] = (params[:attachments].presence || []).values.map{|h| h[:attachment_id]}
hash
end
end
def with_publish?
params[:apply_publish].to_s == 'true'
end
def admin_or_self?
@library.user_id == current_user.id || current_user.admin?
end
end

@ -0,0 +1,47 @@
class Managements::LibraryAppliesController < Managements::BaseController
before_filter :set_menu_type
def index
applies = LibraryApply.order('library_applies.updated_at desc')
search = params[:search].to_s.strip
if search.present?
applies = applies.joins(:library)
.where('libraries.uuid like :search or libraries.title like :search', search: "%#{search}%")
end
applies = applies.where(status: params[:status].presence || :pending)
@library_applies = paginateHelper applies.includes(library: { user: :user_extensions })
respond_to do |format|
format.js
format.html
end
end
def agree
Libraries::AgreeApplyService.new(current_library_apply, current_user).call
render json: { status: 0 }
rescue Libraries::AgreeApplyService::Error => e
render json: { status: -1, message: e.message }
end
def refuse
Libraries::RefuseApplyService.new(current_library_apply, current_user, reason: params[:reason]).call
render json: { status: 0 }
rescue Libraries::RefuseApplyService::Error => e
render json: { status: -1, message: e.message }
end
private
def current_library_apply
@_current_library_apply ||= LibraryApply.find(params[:id])
end
def set_menu_type
@menu_type = 10
@sub_type = 8
end
end

@ -749,6 +749,7 @@ class ShixunsController < ApplicationController
@main_type = MirrorRepository.published_main_mirror
@small_type = MirrorRepository.published_small_mirror
respond_to do |format|
format.html{render :layout => 'base_edu'}
format.json
@ -817,7 +818,7 @@ class ShixunsController < ApplicationController
ShixunServiceConfig.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
end
end
# 自动构建版本
repository = Repository.new
repository.shixun = @shixun
repository.type = 'Repository::Gitlab'
@ -877,6 +878,16 @@ class ShixunsController < ApplicationController
ShixunTagRepertoire.create!(:tag_repertoire_id => str.tag_repertoire_id, :shixun_id => new_shixun.id)
end
# 同步配置
@shixun.shixun_service_configs.each do |config|
ShixunServiceConfig.create!(:shixun_id => new_shixun.id,
:cpu_limit => config.cpu_limit,
:lower_cpu_limit => config.lower_cpu_limit,
:memory_limit => config.memory_limit,
:request_limit => config.request_limit,
:mirror_repository_id => config.mirror_repository_id)
end
# 同步复制版本库先fork再修改版本库名
# eduforge用户作为版本库的创建者
repository = Repository.new
@ -1050,6 +1061,7 @@ class ShixunsController < ApplicationController
mirror_ids = (@shixun.shixun_mirror_repositories.blank? ? [] : @shixun.shixun_mirror_repositories.map(&:id))
update_miiror_id = []
@shixun.shixun_mirror_repositories.destroy_all
if params[:main_type].present?
update_miiror_id << params[:main_type].to_i
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => params[:main_type])
@ -1061,21 +1073,18 @@ class ShixunsController < ApplicationController
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
end
end
# 超级管理员才能保存 中间层服务器pod信息的配置
if User.current.admin? || User.current.business?
@shixun.shixun_service_configs.each_with_index do |config, index|
config.update_attributes(:cpu_limit => params[:cpu_limit][index],
@shixun.shixun_service_configs.destroy_all
params[:mirror_id].each_with_index do |mirror_id, index|
ShixunServiceConfig.create!(:shixun_id => @shixun.id,
:cpu_limit => params[:cpu_limit][index],
:lower_cpu_limit => params[:lower_cpu_limit][index],
:memory_limit => params[:memory_limit][index],
# :resource_limit => params[:resource_limit][index],
:request_limit => params[:request_limit][index],
:mirror_repository_id => params[:mirror_id][index])
end
:mirror_repository_id => mirror_id)
end
ActiveRecord::Base.transaction do
begin
@shixun.save!
@ -1160,6 +1169,8 @@ class ShixunsController < ApplicationController
@small_type = MirrorRepository.published_small_mirror
@shixun_main_mirror = @shixun.mirror_repositories.published_main_mirror.first
# 权限
logger.info("###########{User.current.admin?}")
logger.info("#########business:##{User.current.business?}")
@power = (@shixun.status < 2 ? true : ( User.current.admin? ? true : false))
# unless @repository.nil?
# gitlab_address = Redmine::Configuration['gitlab_address']

@ -277,7 +277,7 @@ module ApplicationHelper
:cpuLimit => config.cpu_limit,
:cpuRequest => config.lower_cpu_limit,
:memoryLimit => "#{config.memory_limit}M",
:memoryRequest => "#{config.request_limit}",
:memoryRequest => "#{config.request_limit}M",
:resourceLimit => "#{config.resource_limit}K",
:type => mirror.try(:main_type) == "1" ? "main" : "sub"}
end
@ -745,16 +745,17 @@ module ApplicationHelper
when 9
sub_type == 1 ? "实训留言列表" : ""
when 10
sub_type == 1 ? "实名认证" :
(sub_type == 2 ? "试用授权" :
(sub_type == 3 ? "部门审批" :
(sub_type == 4 ? "单位审批" :
(sub_type == 5 ? "实训发布" :
(sub_type == 6 ? "实训课程发布" : "职业认证")
)
)
)
)
case sub_type
when 1 then '实名认证'
when 2 then '试用授权'
when 3 then '部门审批'
when 4 then '单位审批'
when 5 then '实训发布'
when 6 then '实训课程发布'
when 7 then '职业认证'
when 8 then '文库发布'
else '职业认证'
end
when 11
"工程认证+"
when 12
@ -3079,7 +3080,7 @@ module ApplicationHelper
elsif @syllabus
title << (@syllabus.title.nil? ? "课堂" : @syllabus.title)
else
title << (User.current.id == 2 ? "未登录" : User.current.show_name)
title << (User.current.anonymous? ? "Educoder实践教学" : User.current.show_name)
end
# if first_page.nil? || first_page.web_title.nil?
# title << Setting.app_title unless Setting.app_title == title.last
@ -7448,6 +7449,8 @@ def tiding_url tiding
project_pull_requests_path(tiding.parent_container_id)
when 'Department'
my_account_path
when 'Library'
tiding.tiding_type == 'Apply' ? library_applies_path : library_path(tiding.container_id)
end
end

@ -0,0 +1,7 @@
module Util
module_function
def generate_time_uuid
"#{Time.zone.now.strftime('%Y%m%d%H%M%S')}#{Random.rand(10**8).to_i}"
end
end

@ -0,0 +1,52 @@
class Library < ActiveRecord::Base
include AASM
belongs_to :user
has_many :library_applies, dependent: :delete_all
has_many :attachments, as: :container
attr_accessible :title, :content
validates :title, presence: true
validates :content, presence: true
validates :uuid, presence: true, uniqueness: true
acts_as_attachable
aasm(:status) do
state :pending, initiali: true
state :processing
state :refused
state :published
event :submit do
transitions from: [:pending, :refused], to: :processing
end
event :refuse do
transitions from: :processing, to: :refused
end
event :publish do
transitions from: :processing, to: :published
end
end
def generate_uuid
uuid = Util.generate_time_uuid
while Library.exists?(uuid: uuid)
uuid = Util.generate_time_uuid
end
self.uuid = uuid
end
def increment_visited_count!
Library.connection.execute("update libraries set visited_count = COALESCE(visited_count, 0) + 1 where id = #{id}")
end
def editable?
pending? || refused?
end
end

@ -0,0 +1,19 @@
class LibraryApply < ActiveRecord::Base
include AASM
belongs_to :library
aasm(:status) do
state :pending, initiali: true
state :refused
state :agreed
event :refuse do
transitions from: :pending, to: :refused
end
event :agree do
transitions from: :pending, to: :agreed
end
end
end

@ -273,6 +273,10 @@ class Shixun < ActiveRecord::Base
return name
end
def child_mirror_ids
self.mirror_repositories.where(:main_type => 0).pluck(:id)
end
def mirror_name
self.mirror_repositories.map(&:type_name).blank? ? "" : self.mirror_repositories.map(&:type_name)
end

@ -358,6 +358,14 @@ class Tiding < ActiveRecord::Base
" "
when 'Department'
"你选填的二级单位:#{self.container.try(:name)}(#{self.container.try(:school).name})因不符合规范,已被系统删除.请重新选择"
when 'Library'
library = Library.find_by_id(container_id)
if tiding_type == 'Apply'
"申请发布文库:#{library.try(:title)}"
elsif tiding_type == 'System'
text = status == 1 ? "审核已通过" : "审核未通过,<br/>原因:#{extra}"
"你提交的发布文库申请:#{library.try(:title)}#{text}"
end
else
logger.error "error type: 1"
end

@ -250,6 +250,7 @@ class User < Principal
has_many :ec_course_users
has_many :libraries, dependent: :destroy
#####
scope :logged, lambda { where("#{User.table_name}.status <> #{STATUS_ANONYMOUS}") }

@ -0,0 +1,32 @@
class Libraries::AgreeApplyService
Error = Class.new(StandardError)
attr_reader :library_apply, :library, :user
def initialize(library_apply, user)
@library_apply = library_apply
@library = library_apply.library
@user = user
end
def call
raise Error, '该状态下不能进行此操作' unless library_apply.may_agree?
ActiveRecord::Base.transaction do
library_apply.agree!
library_apply.library.publish!
# 将消息改为已处理
Tiding.where(container_id: library.id, container_type: 'Library', tiding_type: 'Apply', status: 0).update_all(status: 1)
notify_library_author!
end
end
private
def notify_library_author!
Tiding.create!(user_id: library.user_id, trigger_user_id: 1,
container_id: library.id, container_type: 'Library',
tiding_type: 'System', status: 1)
end
end

@ -0,0 +1,39 @@
class Libraries::RefuseApplyService
Error = Class.new(StandardError)
attr_reader :library_apply, :library, :user, :params
def initialize(library_apply, user, params)
@library_apply = library_apply
@library = library_apply.library
@user = user
@params = params
end
def call
reason = params[:reason].to_s.strip
raise Error, '原因不能为空' if reason.blank?
raise Error, '该状态下不能进行此操作' unless library_apply.may_refuse?
ActiveRecord::Base.transaction do
library_apply.reason = reason
library_apply.refused_at = Time.current
library_apply.refuse
library_apply.save!
library.refuse!
# 将消息改为已处理
Tiding.where(container_id: library.id, container_type: 'Library', tiding_type: 'Apply', status: 0).update_all(status: 1)
notify_library_author!
end
end
private
def notify_library_author!
Tiding.create!(user_id: library.user_id, trigger_user_id: 1,
container_id: library.id, container_type: 'Library',
tiding_type: 'System', status: 2, extra: library_apply.reason)
end
end

@ -0,0 +1,37 @@
class Libraries::SaveService
Error = Class.new(StandardError)
attr_reader :library, :user, :params
def initialize(library, user, params)
@library = library
@user = user
@params = params
end
def call
validate_params!
if library.new_record?
library.user_id = user.id
library.generate_uuid
end
attachment_ids = params.delete(:attachment_ids)
ActiveRecord::Base.transaction do
library.assign_attributes(params)
library.save!
Attachment.where(id: attachment_ids).update_all(container_id: library.id, container_type: 'Library')
end
library
end
private
def validate_params!
raise Error, '附件不能为空' if params[:attachment_ids].blank?
end
end

@ -0,0 +1,31 @@
class Libraries::SubmitService
Error = Class.new(StandardError)
attr_reader :library
def initialize(library)
@library = library
end
def call
raise Error, '该状态下不能提交审核' unless library.may_submit?
ActiveRecord::Base.transaction do
library.published_at = Time.current
library.submit
library.save!
library.library_applies.create!
send_library_apply_notify!
end
end
private
def send_library_apply_notify!
Tiding.create!(user_id: 1, trigger_user_id: library.user_id,
container_id: library.id, container_type: 'Library',
tiding_type: 'Apply', status: 0)
Trustie::Sms.send(mobile: '18711011226', send_type:'publish_library' , name: '管理员') rescue nil
end
end

@ -343,7 +343,7 @@ class UsersService
g = Gitlab.client
g.edit_user(@current_user.gid, :password => params[:new_password])
rescue Exception => e
logger.error "change users password failed! ===> #{e}"
Rails.logger.error "change users password failed! ===> #{e.message}"
end
end
#raise @current_user.errors.full_message

@ -0,0 +1,62 @@
<div class="librariesField">
<li>
<a href="javascript:void(0)" class="color-blue font-18" onclick="$('#_file').click();" data-tip-down="请选择文件上传">上传附件</a>
<!--<p class="color-grey-c">(单个文件<%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>以内)</p>-->
<p class="color-grey-c mt7">从我的电脑选择要上传的文档按住CTRL可以上传多份文档</p>
<div id="network_issue" class="fl ml10 color-red none">上传出现错误,请检查您的网络环境,并刷新页面重新上传。</div>
</li>
</div>
<div id="attachments_fields" class="attachments_fields">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span class="attachment clearfix" id="attachments_p<%= i %>">
<i class="iconfont icon-fujian mr5 color-green fl font-14" aria-hidden="true"></i>
<% size = judge_Chinese_num attachment.filename %>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly hidden color-grey fl', :size => size, :style => 'border:none; max-width:980px;white-space: nowrap; text-overflow:ellipsis;font-family: Consolas;', :readonly => 'readonly') %>
<span class="color-grey mr10 fl"><%= number_to_human_size attachment.filesize %></span>
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span class="attachment clearfix" id="attachments_p<%= i %>">
<label class="panel-form-label fl">&nbsp;</label>
<i class="iconfont icon-fujian mr5 color-green fl font-14" aria-hidden="true"></i>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'hidden atta_input readonly color-grey fl', :style => 'border:none; max-width:980px;', :readonly => 'readonly') %>
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload fl mt2') unless attachment.id.nil? %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
</div>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => ie8? ? '' : 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => ie8? ? '' : 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js',:project =>nil),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:lebel_file_uploding => l(:lebel_file_uploding),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<%= javascript_include_tag 'attachments' %>
<style>
.ui-widget-content{
/*height: 16px;*/
/*width: 200px;*/
top: 320px !important;
float: left;
margin: 5px 10px 0px 10px;
}
</style>

@ -0,0 +1,65 @@
<p class="second_1" style="background: url('/images/educoder/competition/qg/qg_two_1.png') no-repeat top center;"></p>
<p class="second_2" style="background: url('/images/educoder/competition/qg/qg_two_2.png') no-repeat top center;"></p>
<div class="second_3" style="background: url('/images/educoder/competition/qg/qg_two_3.png') no-repeat top center;">
<div class="enter_panel">
<ul class="mb40">
<p class="mb30 font-22 enter_title"><span class="mr20 font-bd">第一阶段</span><span>2019-6-25 09:00-2019-7-10 24:00 </span></p>
<li class="inline enter_btn">
<a href="javascript:void(0)" class="active">Java入口</a>
<a href="javascript:void(0)" class="active">C/C++入口</a>
<a href="javascript:void(0)">Python入口</a>
</li>
</ul>
<ul>
<p class="mb30 font-22 enter_title"><span class="mr20 font-bd">第一阶段</span><span>2019-6-25 09:00-2019-7-10 24:00 </span></p>
<li class="inline enter_btn">
<a href="javascript:void(0)">Java入口</a>
<a href="javascript:void(0)">C/C++入口</a>
<a href="javascript:void(0)">Python入口</a>
</li>
</ul>
</div>
</div>
<div class="second_4" style="background: url('/images/educoder/competition/qg/qg_two_4.png') no-repeat top center;">
<div class="enter_panel">
<ul class="mb40">
<p class="mb30 font-22 enter_title"><span class="mr20 font-bd">第一阶段</span><span>2019-6-25 09:00-2019-7-10 24:00 </span></p>
<li class="inline enter_btn">
<a href="javascript:void(0)" class="active">Java入口</a>
<a href="javascript:void(0)" class="active">C/C++入口</a>
<a href="javascript:void(0)">Python入口</a>
</li>
</ul>
<ul>
<p class="mb30 font-22 enter_title"><span class="mr20 font-bd">第一阶段</span><span>2019-6-25 09:00-2019-7-10 24:00 </span></p>
<li class="inline enter_btn">
<a href="javascript:void(0)">Java入口</a>
<a href="javascript:void(0)">C/C++入口</a>
<a href="javascript:void(0)">Python入口</a>
</li>
</ul>
</div>
</div>
<div class="second_5" style="background: url('/images/educoder/competition/qg/qg_two_5.png') no-repeat top center;">
<div class="enter_panel">
<ul class="mb40">
<p class="mb30 font-22 enter_title"><span class="mr20 font-bd">第一阶段</span><span>2019-6-25 09:00-2019-7-10 24:00 </span></p>
<li class="inline enter_btn">
<a href="javascript:void(0)" class="active">Java入口</a>
<a href="javascript:void(0)" class="active">C/C++入口</a>
<a href="javascript:void(0)">Python入口</a>
</li>
</ul>
<ul>
<p class="mb30 font-22 enter_title"><span class="mr20 font-bd">第一阶段</span><span>2019-6-25 09:00-2019-7-10 24:00 </span></p>
<li class="inline enter_btn">
<a href="javascript:void(0)">Java入口</a>
<a href="javascript:void(0)">C/C++入口</a>
<a href="javascript:void(0)">Python入口</a>
</li>
</ul>
</div>
</div>
<p class="second_6" style="background: url('/images/educoder/competition/qg/qg_two_6.png') no-repeat top center;"></p>
<p class="second_7" style="background: url('/images/educoder/competition/qg/qg_two_7.png') no-repeat top center;"></p>
<p class="second_8" style="background: url('/images/educoder/competition/qg/qg_two_8.png') no-repeat top center;"></p>

@ -200,7 +200,11 @@
}
</script>
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-radio fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" onclick="click_<%= exercise_choice.id %>(this);return false;" type="radio" <%= !@can_edit_excercise ? "disabled" : "" %> <%= answer_be_selected?(exercise_choice, User.current) ? "checked" : "" %>>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index + 1).to_s) %>&nbsp;&nbsp;<%= exercise_choice.choice_text %></label>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id">
<div class="fl">
<%= convert_to_char((index + 1).to_s) %>
</div><pre class="fl ml10"><%= exercise_choice.choice_text %></pre>
</label>
</li>
<% end %>
</div>
@ -243,7 +247,11 @@
}
</script>
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-checkbox fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" onclick="click_<%= exercise_choice.id %>(this);return false;" type="checkbox" <%= !@can_edit_excercise ? "disabled" : "" %> <%= answer_be_selected?(exercise_choice, User.current) ? "checked" : "" %>>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index + 1).to_s) %>&nbsp;&nbsp;<%= exercise_choice.choice_text %></label>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id">
<div class="fl">
<%= convert_to_char((index + 1).to_s) %>
</div><pre class="fl ml10"><%= exercise_choice.choice_text %></pre>
</label>
</li>
<% end %>
</div>

@ -153,7 +153,11 @@
id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="radio" disabled
<%= answer_be_selected?(exercise_choice, user) ? "checked" : "" %>>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index + 1).to_s) %>&nbsp;&nbsp;<%= exercise_choice.choice_text %></label>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id">
<div class="fl">
<%= convert_to_char((index + 1).to_s) %>
</div><pre class="fl ml10"><%= exercise_choice.choice_text %></pre>
</label>
</li>
<% end %>
</div>
@ -168,7 +172,11 @@
<% exercise_choices.each_with_index do |exercise_choice, index| %>
<li class="clearfix">
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-checkbox fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="checkbox" disabled <%= answer_be_selected?(exercise_choice, user) ? "checked" : "" %>>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index + 1).to_s) %>&nbsp;&nbsp;<%= exercise_choice.choice_text %></label>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id">
<div class="fl">
<%= convert_to_char((index + 1).to_s) %>
</div><pre class="fl ml10"><%= exercise_choice.choice_text %></pre>
</label>
</li>
<% end %>
</div>
@ -287,7 +295,7 @@
<a href="javascript:void(0)" onclick="toggle_comment_block(<%= exercise_question.id %>, <%= exercise_shixun_answer.id %>)" data-remote="true" class="mr15 color-blue">调分</a>
<% end %>
<% if game.present? && game.status == 2 && !is_answer_correct && game.answer_open %>
<% if game.present? && game.status == 2 && @exercise_user.end_at && game.end_time < @exercise_user.end_at && !is_answer_correct && game.answer_open %>
<span class="color-red mr5">(答案抄袭)</span>
<% end %>
<% score = exercise_shixun_answer.present? ? exercise_shixun_answer.try(:score) : 0 %>

@ -268,7 +268,11 @@
<% exercise_choices.each_with_index do |exercise_choice, index| %>
<div class="clearfix">
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-radio fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="radio">
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index + 1).to_s) %>&nbsp;&nbsp;<%= exercise_choice.choice_text %></label>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id">
<div class="fl">
<%= convert_to_char((index + 1).to_s) %>
</div><pre class="fl ml10"><%= exercise_choice.choice_text %></pre>
</label>
</div>
<% end %>
</div>
@ -281,7 +285,11 @@
<% exercise_choices.each_with_index do |exercise_choice, index| %>
<div class="clearfix">
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-checkbox fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="checkbox">
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index + 1).to_s) %>&nbsp;&nbsp;<%= exercise_choice.choice_text %></label>
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id">
<div class="fl">
<%= convert_to_char((index + 1).to_s) %>
</div><pre class="fl ml10"><%= exercise_choice.choice_text %></pre>
</label>
</div>
<% end %>
</div>

@ -16,7 +16,8 @@
</ul>
</div>
<div>
<p class="footer_con-p inline lineh-30"><span class="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder<span class="ml15 mr15">湘ICP备17009477号</span><a href="https://team.trustie.net" style="color: #888;" target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;IntelliDE inside.</p>
<p class="footer_con-p inline lineh-30"><span class="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder<a style="color: #888;" target="_blank" href="http://beian.miit.gov.cn/" class="ml15 mr15">湘ICP备17009477号</a>
<a href="https://team.trustie.net" style="color: #888;" target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;IntelliDE inside. <span class="ml15 mr15">版权所有 湖南智擎科技有限公司</span></p>
</div>
<div class="cl"></div>
</div>

@ -25,6 +25,7 @@
<%= link_to "认证", department_ecs_path(:school_id => User.current.ec_school) %>
</li>
<% end %>
<li class="<%= params[:controller] == "libraries" ? "active" : "" %>"><%= link_to '文库', libraries_path %></li>
</ul>
<div class="posi-search" id="posi-search" style="display: none">
<div class="search-all clearfix">

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="utf-8">
<title>
<%= h html_title %>
</title>
<meta name="description" content="高校智能课堂与综合实训平台"/>
<meta name="keywords" content="智能课堂,实训项目"/>
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/common', 'css/public', 'css/ketang', 'css/structure', 'prettify', 'css/courses', 'css/popup', 'css/syllabus', 'css/moduel', 'css/font-awesome', 'css/contest', 'css/font-awesome', 'css/edu-class', 'css/edu-popup', 'educoder/magic-check', 'css/edu-common', "css/edu-public", 'educoder/edu-main', 'educoder/edu-all' %>
<%= javascript_include_tag "avatars", "header", "attachments", 'prettify', "edu/application", 'jquery.datetimepicker.js', 'educoder/edu_application', 'educoder/edu_file' %>
<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %>
<%= stylesheet_link_tag "/codemirror/lib/codemirror" %>
<%= stylesheet_link_tag '/editormd/css/editormd' %>
<%= javascript_include_tag '/editormd/editormd', '/editormd/lib/marked.min.js', '/editormd/lib/prettify.min.js', '/editormd/lib/raphael.min.js', '/editormd/lib/underscore.min.js', '/editormd/lib/sequence-diagram.min.js',
'/editormd/lib/flowchart.min.js', '/editormd/lib/jquery.flowchart.min.js', '/editormd/editormd.js' %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript" src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</head>
<!--add by huang-->
<body onload="prettyPrint();" style="height: 100%;background: #fff">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newHeader" id="nHeader"> <!-- 头部 -->
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else %>
<%= render :partial => 'layouts/unlogin_header' %>
<% end %>
</div>
<div class="cl"></div>
<div class="newMain clearfix">
<%= yield %>
<!-------------------侧边提示区域-------------------------->
<%= render :partial => 'users/returnTop_btn' %>
</div>
<!----------------------- 左侧导航栏 ----------------------------->
<%#= render :partial => 'layouts/public_left_info' %>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<%#= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-notice" style="display: none; text-align: center; bottom: 200px; left: 50%; margin-left: -70px; background: #a1a1a1; width: 140px; height: 80px; position: absolute; z-index: 999999;">
<p id="ajax_notice_p" style="text-align: center; color: #fff; font-size: 18px; padding-top: 26px;">分数已保存</p>
</div>
<div id="ajax-modal" style="display:none;"></div>
<%= call_hook :view_layouts_base_body_bottom %>
</div>
</body>
<script>
</script>
</html>

@ -116,6 +116,7 @@
<li><%= link_to '单位审批', unit_managements_path %></li>
<li><%= link_to '实训发布', shixun_authorization_managements_path %></li>
<li><%= link_to '实训课程发布', subject_authorization_managements_path %></li>
<li><%= link_to '文库发布', library_applies_path(status: :pending) %></li>
</ul>
</li>
<li class="fl edu-admin-nav-li edu-position"><a href="javascript:void(0);" class="edu-admin-nav-a">认证+</a>

@ -0,0 +1,115 @@
<p class="lineh-25 font-22 mb20">上传文档</p>
<div class="library-form-container">
<%= form_for(@library) do |f| %>
<%= hidden_field_tag :apply_publish, false %>
<div class="edu-back-white">
<div class="padding30">
<p class="clearfix mb20">
<span class="upload_Title">标题</span>
<%= f.text_field :title, placeholder: '例如:软件工程教学案例', class: 'greyInput winput-240-35 mr20 fl' %>
<span class="color-grey-c font-12 fl mt5">简明扼要介绍文档&视频所包含的主要的内容</span>
</p>
<div>
<%= render partial: 'attachments/from_libraries', locals: { container: @library } %>
</div>
</div>
<div class="padding30 bor-top-greyE">
<div class="clearfix df">
<span class="upload_Title">描述</span>
<div class="flex1">
<div id="libraries_description">
<%= f.text_area :content %>
</div>
</div>
</div>
</div>
<div class="padding30 bor-top-greyE">
<li class="lineh-25 color-grey-6 font-18 mb20">审核说明</li>
<ul class="font-16">
<li>平台管理员将对每天新上传的文档进行审核,审核通过的文档将公开显示,否则将私有化或移除</li>
</ul>
</div>
<div class="padding30 bor-top-greyE">
<li class="lineh-25 color-grey-6 font-18 mb20">温馨提示</li>
<ul class="font-16">
<li>1.请勿上传已设置加密或只读的文档资源</li>
<li>2.可以上传教学积累和撰写的文档资料如教学案例、总结、心得等上传支持的文件最大容量100MB</li>
<li>3.上传涉及侵权内容的文档将会被移除。</li>
<li>4.为营造绿色网络环境,严禁上传违反国家关于互联网相关规定的内容</li>
<li>5.ChromeFirefoxSafariIE11及以上版本浏览器上传</li>
</ul>
</div>
</div>
<div class="operate mt20 mb20 clearfix">
<%= link_to '确认提交', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %>
<%= link_to '保存', 'javascript:void(0)', class: 'white-btn edu-blueline-btn changebtn mr20 fl submit-btn' %>
</div>
<% end %>
</div>
<script>
/* ------------------------------- 描述md ------------------------------*/
var editormd = editormd("libraries_description", {
width: "100%",
height: 210,
syncScrolling: "single",
//你的lib目录的路径我这边用JSP做测试的
path: "/editormd/lib/",
tex: true,
watch:false,
toolbarIcons: function () {
// Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right.
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
},
toolbarCustomIcons: {
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
},
//这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。
saveHTMLToTextarea: true,
autoFocus: false,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity: 0.6,
placeholder: "请输入参考答案",
imageUpload: true,
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url
});
$(function(){
var submitForm = function(){
var title = $("input[name='library[title]']").val();
var content = $("textarea[name='library[content]']").val();
if (!title || title.length == 0) {
alert('请输入标题');
return
}
if (!content || content.length == 0) {
alert('请输入描述');
return
}
if($('.attachments_fields .attachment').length == 0){
alert('请上传附件');
return
}
$('.library-form-container form').submit();
};
$('.apply-publish-btn').on('click', function(){
$('input[name="apply_publish"]').val(true);
submitForm();
});
$('.submit-btn').on('click', submitForm);
var message = '<%= flash[:message] %>';
if (message.length > 0) {
alert(message);
}
})
</script>

@ -0,0 +1,32 @@
<div class="library_list">
<% if @libraries.present? %>
<% @libraries.each do |library| %>
<li class="library_list_item">
<%= link_to image_tag(url_to_avatar(library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(library.user) %>
<div class="flex1">
<p class="task-hide font-16 mb15 lineh-20"><%= link_to library.title, library_path(library) %></p>
<p class="clearfix lineh-20">
<span class="color-grey-3 mr20"><%= link_to library.user.show_real_name, user_path(library.user) %></span>
<span class="color-grey-c mr20"><%= library.visited_count || 0 %> 浏览</span>
<% if params[:type] == 'mine' %>
<span class="color-grey-c mr20">上传时间:<%= library.created_at.strftime('%Y-%m-%d %H:%M') %></span>
<% else %>
<span class="color-grey-c mr20">发布时间:<%= library.published_at.try(:strftime, '%Y-%m-%d %H:%M') %></span>
<% end %>
</p>
</div>
</li>
<% end %>
<% else %>
<%= render :partial => "welcome/no_data" %>
<% end %>
</div>
<div class="mt30 mb50 edu-txt-center clearfix">
<!--这里放分页-->
<div class="inline pages_user_show">
<ul>
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>

@ -0,0 +1,8 @@
<div class="educontent mb50">
<p class="mt10 mb20 clearfix lineh-20">
<%= link_to '文库', libraries_path, class: 'color-grey-9' %> &gt;
<span class="color-grey-3">编辑</span>
</p>
<%= render partial: 'form' %>
</div>

@ -0,0 +1,51 @@
<div class="educontent">
<div class="edu-back-white mb30 mt30">
<p class="padding20-30 clearfix bor-bottom-greyE">
<span class="font-18 fl color-grey-3">文库</span>
<%= link_to '新建', new_library_path, class: 'fr color-blue font-16 mt3' %>
</p>
<div class="clearfix pt20 pl30 pr30">
<ul class="fl library_nav">
<li class="<%= params[:type] == 'mine' ? '' : 'active' %>">
<%= link_to '全部', libraries_path(search: params[:search]), remote: true %>
</li>
<li class="<%= params[:type] == 'mine' ? 'active' : '' %>">
<%= link_to '我的', libraries_path(search: params[:search], type: 'mine'), remote: true %>
</li>
</ul>
<div class="edu-position fr">
<%= hidden_field_tag(:type, params[:type]) %>
<input class="winput-240-30 panel-box-sizing" placeholder="输入文库标题、编号进行检索" type="text" id="search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey" id="search"><i class="fa fa-search"></i></a>
</div>
</div>
</div>
<div class="library-list-container">
<%= render partial: 'library_list' %>
</div>
</div>
<script>
$(function(){
$(".library_nav").on("click","li",function(){
$(".library_nav li").removeClass("active");
$(this).addClass("active");
});
var searchFunc = function() {
var search = $("#search_name").val();
var type = $("input[name='type']").val();
$.ajax({
url: "/libraries",
dataType: 'script',
data: {search: search, type: type}
});
};
$("#search").live("click", searchFunc);
$('#search_name').bind('keypress',function(event) {
if (event.keyCode == "13") {
searchFunc();
}
});
})
</script>

@ -0,0 +1,3 @@
$('input[name="type"]').val('<%= params[:type].to_s %>');
$('#search_name').val('<%= params[:search].to_s %>');
$('.library-list-container').html('<%= j render(partial: 'library_list') %>')

@ -0,0 +1,8 @@
<div class="educontent mb50">
<p class="mt10 mb20 clearfix lineh-20">
<%= link_to '文库', libraries_path, class: 'color-grey-9' %> &gt;
<span class="color-grey-3">新建</span>
</p>
<%= render partial: 'form' %>
</div>

@ -0,0 +1,14 @@
<div class="educontent edu-back-white mt20 successPage">
<div>
<img src="/images/educoder/success.png" width="100" class="mb30">
<div class="lineh-30 ed-txt-center font-24 color-grey-3 font-bd mb15">
<p>恭喜!</p>
<p>文档上传成功</p>
</div>
<p class="lineh-30 ed-txt-center font-16 color-grey-9 font-bd mb15">通过平台管理员审核后,即可公开显示</p>
<li class="inline">
<%= link_to '查看已上传文档', libraries_path(type: 'mine'), class: 'white-btn edu-blueline-btn changebtn mr20 fl' %>
<%= link_to '继续上传', new_library_path, class: 'white-btn edu-blueback-btn changebtn fl' %>
</li>
</div>
</div>

@ -0,0 +1,96 @@
<%
admin_or_self = User.current.admin? || @library.user_id == User.current.id
%>
<div class="educontent mb50">
<p class="mt10 mb20 clearfix lineh-20">
<%= link_to '文库', libraries_path, class: 'color-grey-9' %> &gt;
<span class="color-grey-3">详情</span>
</p>
<p class="lineh-25 mb20 clearfix">
<span class="font-22 fl mr10 task-hide" style="max-width: 800px"><%= @library.title %></span>
<% if admin_or_self %>
<% if @library.pending? %>
<span class="fl edu-filter-btn edu-activity-green mt5">草稿</span>
<% elsif @library.processing? %>
<span class="fl edu-filter-btn edu-activity-green mt5">审核中</span>
<% elsif @library.refused? %>
<span class="fl edu-filter-btn edu-activity-orange mt5">未通过</span>
<% end %>
<% end %>
<%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %>
</p>
<div class="edu-back-white">
<% if admin_or_self && !@library.published? && @library_applies.size > 0 %>
<div class="padding30">
<p class="mb10 clearfix">
<span class="color-grey-6 font-16 mr10">私有化原因</span>
<span class="color-grey-c font-12">(请按照提示修改,并在完成编辑后重新提交)</span>
<a href="javascript:void(0)" class="color-blue fr" at="0" onclick="getMore(this)">点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i></a>
</p>
<div class="private_reason">
<% @library_applies.each do |apply| %>
<li>
<p class="color-grey-9"><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></p>
<p class="lineh-25 font-16 break-word"><%= apply.reason %></p>
</li>
<% end %>
</div>
</div>
<% end %>
<div class="padding30 bor-top-greyE">
<p class="mb10 clearfix">
<span class="color-grey-6 font-16 mr10">详情</span>
<% if admin_or_self && @library.editable? %>
<%= link_to '编辑', edit_library_path(id: @library.id), class: 'white-btn edu-blueline-btn fr' %>
<% end %>
</p>
<div class="df mb20">
<%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
<div class="flex1">
<li class="font-16"><%= @library.user.show_real_name %></li>
<li class="clearfix">
<span class="fl color-grey-9 mr20"><%= @library.user.school_name %></span>
<span class="fl color-grey-9"><%= @library.user.identity %></span>
<span class="fr">
<span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span>
<% if @library.published? %>
<span class="fl color-grey-9">发布时间:<span class="color-grey-6"><%= @library.published_at.strftime('%Y-%m-%d %H:%M') %></span></span>
<% else %>
<span class="fl color-grey-9">上传时间:<span class="color-grey-6"><%= @library.created_at.strftime('%Y-%m-%d %H:%M') %></span></span>
<% end %>
</span>
</li>
</div>
</div>
<div>
<div class="break_full_word new_li" id="labraries_editorMd_content">
<textarea style="display:none;"><%= @library.content %></textarea>
</div>
<div class="mt10">
<%= render partial: 'attachments/links', locals: { attachments: @library.attachments, options: {} } %>
</div>
</div>
</div>
</div>
</div>
<script>
function getMore(item) {
var at=$(item).attr("at");
if(at=="0"){
$(item).html('点击收起<i class="iconfont icon-shangjiantou color-blue font-14 ml5"></i>');
$(item).attr("at","1");
$(".private_reason").css({maxHeight:"unset"});
}else{
$(item).html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
$(item).attr("at","0");
$(".private_reason").css({maxHeight:"150px"});
}
}
var homeworkDescr = editormd.markdownToHTML("labraries_editorMd_content", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
</script>

@ -0,0 +1,78 @@
<% if @library_applies.present? %>
<% @library_applies.each do |apply| %>
<% user = apply.library.user %>
<% library = apply.library %>
<div class="admin-con-box apply-<%= apply.id %> clearfix">
<a href="<%= user_path(user) %>" target="_blank" class="fl with10 edu-ad-user">
<%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %>
</a>
<div class="fl with90">
<ul>
<li class="clearfix mb5">
<a href="<%= user_path(user) %>" class="fl"><%= user.try(:show_real_name) %></a>
<span class="fl ml30 font-12 mt3 color-grey"><%= time_from_now(apply.created_at) %></span>
<% if apply.pending? %>
<a href="javascript:void(0);" class="fr color-orange" onclick="reject_library_authentication_reason(this);" >拒绝</a>
<a href="javascript:void(0);" class="fr mr15 color-orange" data-remote="true" onclick="library_authorization_gree('<%= apply.id %>');">同意</a>
<% else %>
<a href="javascript:void(0);" class="<%= apply.agreed? ? 'task-btn-green' : '' %> task-btn fr"><%= apply.agreed? ? "已同意" : "已拒绝" %></a>
<% end %>
</li>
<li class="clearfix mb10">
<%= link_to library.title, library_path(library), :target => "_blank" %>
<br>
<%= library.content[0..100] %>
</li>
<% if apply.pending? %>
<div class="undis">
<li class="clearfix edu-form-border mb10">
<label class="edu-form-label fl">原因:</label>
<input type="text" class="task-form-90 task-height-40 panel-box-sizing fl edu-form-noborder" placeholder="我得说点儿什么最多200个字符">
</li>
<li class="clearfix">
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="library_submit_reject_reason('<%= apply.id %>', this);" >确定</a>
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="library_hide_reject_reason(this);" >取消</a>
</li>
</div>
<% else %>
<% if apply.refused? %>
<li>原因:<span class="color-orange"><%= apply.reason %></span></li>
<% end %>
<% end %>
</ul>
</div>
</div>
<% end %>
<div class="mt20 mb20" style="text-align:center;">
<div class="pages_user_show" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<% else %>
<%= render :partial => "welcome/no_data" %>
<% end %>
<script type="text/javascript">
function library_authorization_gree(id){
$.ajax({
url: '/managements/library_applies/' + id + '/agree',
type: 'post',
success: function(data){
if (data && data.status != -1) {
$('#authentication_list .admin-con-box.apply-' + id).remove();
if($('#authentication_list .admin-con-box').length == 0){
location.reload();
}
} else {
alert(data.message);
}
}
})
}
</script>

@ -0,0 +1,120 @@
<div class="edu-class-container mb15">
<div class="edu-con-top clearfix">
<p class="ml15 fl color-grey">文库发布</p>
</div>
<div class="edu-con-bg01 mt15">
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav" class="border-bottom-orange">
<li id="edu-tab-nav-1" class="new-tab-nav background-orange" onclick="HoverLi(1);">
<%= link_to "待审批", library_applies_path(status: :pending), class: 'tab_type', remote: true %>
</li>
<li id="edu-tab-nav-2" class="new-tab-nav" onclick="HoverLi(2);">
<%= link_to "已审批", library_applies_path(status: [:refused, :agreed]), class: 'tab_type', remote: true %>
</li>
</ul>
<div class="cl"></div>
<div id="edu-tab-con-1">
<div class="mt10">
<div class="edu-position fr task-form-30 mb10 mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入文库标题、编号进行检索" type="text" id="search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="authentication_list" class="auth_table">
<%= render :partial => "managements/library_applies/library_apply_list"%>
</div>
</div>
</div>
<div id="edu-tab-con-2" class="undis">
<div class="mt10">
<p class="fl task-form-60 mt8 ml15 clearfix">
<%= link_to "全部", library_applies_path(status: [:refused, :agreed]), :class => "edu-filter-cir-grey mr5 fl font-12 active", :id => "library_all_authentication", :remote => true %>
<%= link_to "同意", library_applies_path(status: :agreed), :class => "edu-filter-cir-grey mr5 fl font-12", :id => "library_agree_authentication", :remote => true %>
<%= link_to "拒绝", library_applies_path(status: :refused), :class => "edu-filter-cir-grey mr5 fl font-12", :id => "library_reject_authentication", :remote => true %>
</p>
<div class="edu-position fr task-form-30 mb10 fr mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入文库标题、编号进行检索" type="text" id="library_search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="library_search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="library_authentication_list" class="auth_table">
</div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script>
/* -------------------------- 拒绝 ------------------------------------ */
function reject_library_authentication_reason(nThis){
var reason = $(nThis).parent().parent().find('div');
reason.find("input").val("");
reason.toggle();
}
/* -------------------------- 取消 ------------------------------------ */
function library_hide_reject_reason(nThis){
var reason = $(nThis).parent().parent();
reason.find("input").val("");
reason.hide();
}
/* ------------------------- 提交拒绝原因 --------------------------------- */
function library_submit_reject_reason(id, nThis){
var nReason = $(nThis).parent().parent();
var reason = nReason.find("input").val();
if (reason == '') {
alert('请输入原因');
return;
}
$.ajax({
url: '/managements/library_applies/' + id + '/refuse',
type: 'post',
data: {reason: reason},
success: function(data){
if (data && data.status != -1) {
$('#authentication_list .admin-con-box.apply-' + id).remove();
if($('#authentication_list .admin-con-box').length == 0){
location.reload();
}
} else {
alert(data.message);
}
}
});
}
/* -------------------------- 按名字进行搜索(未审批) ----------------------------- */
$("#search").live("click", function(){
var iName = $("#search_name").val();
$.ajax({
url: "/managements/library_applies",
dataType: 'script',
data: { search: iName, status: 'pending' }
});
});
/* ------------------- 按名字进行搜索(已审批)-------------------- */
$("#library_search").live("click", function(){
var iName = $("#library_search_name").val();
var id = $("#library_all_authentication").parent().find(".active").attr("id");
var status = '';
if(id == "library_all_authentication"){
status = ['refused', 'agreed'];
}else if(id=="library_agree_authentication"){
status = 'agreed';
}else{
status = 'refused';
}
$.ajax({
url: "/managements/library_applies",
dataType: 'script',
data: { search: iName, status: status}
});
});
</script>

@ -0,0 +1,30 @@
var nTabIcon_1 = $("#edu-tab-con-1");
var nTabIcon_2 = $("#edu-tab-con-2");
var nTabNav_1 = $("#edu-tab-nav-1");
var nTabNav_2 = $("#edu-tab-nav-2");
var nAudit = $("#library_all_authentication").parent();
<% if params[:status].to_s == 'pending' %>
$("#authentication_list").html("<%= j( render :partial => "managements/library_applies/library_apply_list" ) %>");
nTabNav_1.addClass("background-orange");
nTabNav_2.removeClass("background-orange");
nTabIcon_1.show();
nTabIcon_2.hide();
<% else %>
$("#library_authentication_list").html("<%= j( render :partial => "managements/library_applies/library_apply_list" ) %>");
nTabNav_1.removeClass("background-orange");
nTabNav_2.addClass("background-orange");
nTabIcon_1.hide();
nTabIcon_2.show();
/* -------------------------- 未审批(全部、同意、拒绝点击时动态样式) ------------------------------ */
if(<%= params[:status].to_s == 'agreed' %>){
nAudit.find(".active").removeClass("active");
$("#library_agree_authentication").addClass("active");
}else if(<%= params[:status].to_s == 'refused' %>){
nAudit.find(".active").removeClass("active");
$("#library_reject_authentication").addClass("active");
}else{
nAudit.find(".active").removeClass("active");
$("#library_all_authentication").addClass("active");
}
<% end %>

@ -46,20 +46,20 @@
</div>
</tr>
<script>
$(document).ready(function(){
$.ajax({
url:"<%= repository_tree_changes_project_path(@project, :rev => @rev, :ent_path => ent_path, :gpid => @project.gpid) %>",
type: "GET",
data: "text",
success:function(data){
$('#changes_message_<%=tr_id %>').html(data.message)
$('#changes_author_<%=tr_id %>').html(data.author_name)
$('#changes_time_<%=tr_id %>').html(data.time)
}
});
});
</script>
<!-- <script>-->
<!-- $(document).ready(function(){-->
<!-- $.ajax({-->
<!-- url:"<%#= repository_tree_changes_project_path(@project, :rev => @rev, :ent_path => ent_path, :gpid => @project.gpid) %>",-->
<!-- type: "GET",-->
<!-- data: "text",-->
<!-- success:function(data){-->
<!-- $('#changes_message_<%#=tr_id %>').html(data.message)-->
<!-- $('#changes_author_<%#=tr_id %>').html(data.author_name)-->
<!-- $('#changes_time_<%#=tr_id %>').html(data.time)-->
<!-- }-->
<!-- });-->
<!-- });-->
<!-- </script>-->
<% end %>

@ -71,7 +71,7 @@
<div class="down-select" id="shixun_small_language_option" style="padding: 2px 0px">
<% @small_type.try(:each) do |type| %>
<p data-shixun-value="<%= type.id %>">
<input type="checkbox" class="magic-checkbox" id="mirror_<%= type.id %>" value="<%= type.type_name %>"/>
<input type="checkbox" class="magic-checkbox" id="mirror_<%= type.id %>" value="<%= type.type_name %>" <%= @shixun.child_mirror_ids.include?(type.id) ? "checked" : ""%>/>
<label style="top:0px" for="mirror_<%= type.id %>"><%= type.type_name %></label>
</p>
<% end %>
@ -294,16 +294,19 @@
</div>
</div>
<% end %>
<% if User.current.admin? || User.cuurent.business? %>
<div class="edu-back-white padding40-20 mb20">
<p class="color-grey-6 font-16 mb30">服务配置</p>
<% @shixun.shixun_service_configs.each do |config| %>
<p class="color-grey-6 font-16 mt30"><%= config.mirror_repository.try(:type_name) %></p>
<input type="hidden" name="mirror_id[]" value="<%= config.mirror_repository.try(:id) %>'">
<div id="<%= config.mirror_repository.try(:id) %>" >
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name"><%= config.mirror_repository.try(:type_name) %></p>
<input type="hidden" name="mirror_id[]" id="shixun_scenario_type_name_id" value="<%= config.mirror_repository.try(:id) %>">
<div class="clearfix mb5">
<label class="panel-form-label fl">CPU(核)</label>
<div class="pr fl with80 status_con">
<input type="text" name="cpu_limit[]" value="<%= config.cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
<input type="text" <%= User.current.admin? ? "" : "readonly" %> name="cpu_limit[]" value="<%= config.cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
@ -311,7 +314,7 @@
<div class="clearfix mb5">
<label class="panel-form-label fl">最低CPU(核)</label>
<div class="pr fl with80 status_con">
<input type="text" name="lower_cpu_limit[]" value="<%= config.lower_cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
<input type="text" name="lower_cpu_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="<%= config.lower_cpu_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
@ -319,7 +322,7 @@
<div class="clearfix mb5">
<label class="panel-form-label fl">内存限制(M)</label>
<div class="pr fl with80 status_con">
<input type="text" name="memory_limit[]" value="<%= config.memory_limit %>" class="panel-box-sizing task-form-100 task-height-40"
<input type="text" name="memory_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="<%= config.memory_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
@ -327,33 +330,87 @@
<div class="clearfix mb5">
<label class="panel-form-label fl">内存要求(M)</label>
<div class="pr fl with20 status_con">
<input type="text" name="request_limit[]" value="<%= config.request_limit %>" class="panel-box-sizing task-form-100 task-height-40"
<input type="text" name="request_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="<%= config.request_limit %>" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<label class="panel-form-label fl" style="width: 48%">温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
<div class="cl"></div>
</div>
</div>
<!-- <div class="clearfix mb5">-->
<!-- <label class="panel-form-label fl">磁盘限制(K)</label>-->
<!-- <div class="pr fl with80 status_con">-->
<!-- <input type="text" name="resource_limit[]" value="<%#= config.resource_limit %>" class="panel-box-sizing task-form-100 task-height-40"-->
<!-- placeholder="请输入类别名称"/>-->
<!-- </div>-->
<!-- <div class="cl"></div>-->
<!-- </div>-->
<!-- <label class="panel-form-label fl">磁盘限制(K)</label>-->
<!-- <div class="pr fl with80 status_con">-->
<!-- <input type="text" name="resource_limit[]" value="<%#= config.resource_limit %>" class="panel-box-sizing task-form-100 task-height-40"-->
<!-- placeholder="请输入类别名称"/>-->
<!-- </div>-->
<!-- <div class="cl"></div>-->
<!-- </div>-->
<% end %>
<div id='result'></div>
</div>
<% end %>
<div class="clearfix mt30">
<a href="javascript:void(0)" class="defalutSubmitbtn fl mr20" onclick="submit_edit_shixun(<%= @shixun.id %>);">保存</a>
<%= link_to "取消", settings_shixun_path(@shixun), :class => "defalutCancelbtn fl" %>
</div>
<% end %>
</div>
<script id="t:edit-setting-list" type="text/html">
<!if(list.length>0) { !>
<!for(var i=0;i
<list.length
;i++){!>
<div id=<!=list[i]!>>
<p class="color-grey-6 font-16 mt30" id="shixun_scenario_type_name">
<!=listname[i]!>
</p>
<input type="hidden" name="mirror_id[]" value=<!=list[i]!>>
<div class="clearfix mb5">
<label class="panel-form-label fl">CPU(核)</label>
<div class="pr fl with80 status_con">
<input type="text" name="cpu_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="1" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
</div>
<div class="clearfix mb5">
<label class="panel-form-label fl">最低CPU(核)</label>
<div class="pr fl with80 status_con">
<input type="text" name="lower_cpu_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="0.1" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
</div>
<div class="clearfix mb5">
<label class="panel-form-label fl">内存限制(M)</label>
<div class="pr fl with80 status_con">
<input type="text" name="memory_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="1024" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<div class="cl"></div>
</div>
<div class="clearfix mb5">
<label class="panel-form-label fl">内存要求(M)</label>
<div class="pr fl with20 status_con">
<input type="text" name="request_limit[]" <%= User.current.admin? ? "" : "readonly" %> value="10" class="panel-box-sizing task-form-100 task-height-40"
placeholder="请输入类别名称"/>
</div>
<label class="panel-form-label fl" style="width: 48%">温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
<div class="cl"></div>
</div>
</div>
<!}!>
<!}else{!><!}!>
</script>
<script>
<script>
//配置-信息提交
function submit_edit_shixun(id) {
if (regex_shixun_name() && regex_public_unit() && regex_tech_platform()) {
@ -407,6 +464,7 @@
$select = $(this).parents(".down-select");
hideValue = $(this).attr("data-shixun-value");
textValue = $(this).html().trim();
$("#shixun_scenario_type_name").html(textValue)
$parent = $(this).parent();
var parentId = $(this).parent().attr("id");
if (parentId != "shixun_scenario_option") {
@ -416,6 +474,7 @@
}
if (parentId == "shixun_language_option") {
var mirror_id = $("#shixun_main_language").val();
$("#shixun_scenario_type_name_id").val(mirror_id)
$.ajax({
url: "<%= get_mirror_script_shixuns_path %>",
data: {mirror_id: mirror_id},
@ -456,15 +515,37 @@
$(this).find(".down-select").hide();
});
$("[select-more] .down-select p input").bind("click", function () {
var bt = baidu.template;
bt.LEFT_DELIMITER = '<!';
bt.RIGHT_DELIMITER = '!>';
var all = $(this).parents(".down-select");
var arr = "";
var arrs = [];
var idarr = [];
var noidarr=[];
for (var i = 0; i < all.find("input").length; i++) {
if (all.find("input").eq(i).is(':checked')) {
arr += ";" + (all.find("input").eq(i).attr("value"));
arrs.push(all.find("input").eq(i).attr("value"))
idarr.push(all.find("input").eq(i).parents("p").attr("data-shixun-value"));
}else{
noidarr.push(all.find("input").eq(i).parents("p").attr("data-shixun-value"));
}
}
for(var i=0; i<noidarr.length; i++){
$("#"+noidarr[i]).remove();
}
var data = {
"listname": arrs,
"list": idarr,
"admin":<%= User.current.admin? %>
};
var htmlidarr = bt('t:edit-setting-list', data);
document.getElementById('result').innerHTML = htmlidarr;
$("input[name='small_type']").val(idarr);
$(this).parents().prev("input").val(arr.substring(1));
//$(this).parents(".down-select").hide();
@ -625,4 +706,4 @@
});
script_Codemirror.setSize("auto", "600px");
// 非管理员只能查看
</script>
</script>

@ -0,0 +1,8 @@
'zh':
activerecord:
models:
library: '文库'
attributes:
library:
title: '标题'
content: '描述'

@ -730,6 +730,15 @@ RedmineApp::Application.routes.draw do ## oauth相关
get :school_data_grow, controller: 'managements::schools', action: 'data_grow'
get :school_data_contrast, controller: 'managements::schools', action: 'data_contrast'
get :school_statistics_xlsx, controller: 'managements::schools', action: 'statistics_xlsx'
scope module: :managements do
resources :library_applies, only: [:index] do
member do
post :agree
post :refuse
end
end
end
end
end
# Enable Grack support
@ -2649,6 +2658,10 @@ RedmineApp::Application.routes.draw do ## oauth相关
resource :sso, only: [:show, :create]
resources :libraries do
get :publish_success, on: :collection
end
get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_subfield_without_id'
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|

@ -0,0 +1,18 @@
class CreateLibraries < ActiveRecord::Migration
def change
create_table :libraries do |t|
t.references :user
t.string :title
t.text :content
t.string :uuid, unique: true
t.string :status
t.integer :visited_count, default: 0
t.datetime :published_at
t.timestamps
end
add_index :libraries, :published_at
end
end

@ -0,0 +1,14 @@
class CreateLibraryApplies < ActiveRecord::Migration
def change
create_table :library_applies do |t|
t.references :library
t.string :status
t.string :reason
t.datetime :refused_at
t.timestamps
end
add_index :library_applies, :refused_at
end
end

@ -1,5 +1,8 @@
class AddLimitForShixuns < ActiveRecord::Migration
def up
if !Challenge.first.has_attribute?(:exec_time)
add_column :challenges, :exec_time, :integer, :default => 120
end
Shixun.find_each do |shixun|
shixun.challenges.update_all(:exec_time => shixun.exec_time)
shixun.mirror_repositories.each do |mirror|

@ -0,0 +1,15 @@
class ModifyRequestLimitForShixunServiceConfig < ActiveRecord::Migration
def up
ShixunServiceConfig.find_each do |config|
# repertoire_id = 5 代表的是大数据的镜像
if config.mirror_repository.repertoire_id != 5
config.update_column(:request_limit, 10)
else
puts("####---#{config.mirror_repository.name}")
end
end
end
def down
end
end

@ -57,6 +57,9 @@ module Trustie
elsif send_type == "training_pay"
params['text'] = "【计算机实践教学】亲爱的#{user_name}老师您已经成功报名参与了11月24日--25日在深圳大学举办的全国软件工程实践教学案例与应用研讨会请准时参加。如有任何参会问题请致电咨询会务联系人汤老师13099740868"
Rails.logger.info "#{params['text']}"
elsif send_type == 'publish_library'
params['text'] = "【Edu实训】亲爱的#{name},有新的文库发布申请,请尽快处理"
Rails.logger.info "#{params['text']}"
end
http = Net::HTTP.new(send_tpl_sms_uri.host, send_tpl_sms_uri.port)

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -602,7 +602,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;}
#competition-content img,#competition-db-content img,#ccfPage img{vertical-align: bottom;}
#hnpage1{background: url('/images/educoder/competition/logo_1.jpg') no-repeat top center;min-height: 820px;}
#competition-header{background: linear-gradient(to right, #29bd8b , #13dc98);height: 60px;width: 100%;padding-right: 40px;box-sizing: border-box;position: fixed;top: 0px;left: 0px;width: 100%;z-index: 1000;}
#competition-header{background:#24292D;height: 60px;width: 100%;padding-right: 40px;box-sizing: border-box;position: fixed;top: 0px;left: 0px;width: 100%;z-index: 1000;}
.nav-game{position: relative;}
.nav-game li{position: relative;float: left;width: 110px;height: 60px;line-height: 60px;text-align: center;box-sizing: border-box}
.nav-game li a{color:#fff;font-size: 16px;}
@ -639,6 +639,29 @@ a.enterLink{cursor: pointer;color: #418CCD!important;background: none!important;
.position-shixun{position: absolute;z-index: 2;bottom: 40px;text-align: center;width: 100%}
.ccf-position-shixun .shixun-btn,.position-shixun .shixun-btn,.ccf-position-shixun-2 .shixun-btn{display: block;float: left;width: 160px;text-align:center;letter-spacing: 1px;height: 40px;line-height: 40px;color:#fff!important;margin:0px 20px;background: linear-gradient(to right, #ff8634 , #ff9d5b);box-shadow: 6px 4px 11px #f7ece4;}
/*第二次竞赛-全国*/
.second_1{min-height: 832px;}
.second_2{min-height: 446px;}
.second_3{min-height: 595px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_4{min-height: 610px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_5{min-height: 617px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_6{min-height: 1053px;}
.second_7{min-height: 1096px;}
.second_8{min-height: 727px;}
.enter_panel{
width: 1200px;margin:0px auto;height: 360px;text-align: center;
}
.enter_title{
color: #0B8298;
}
.enter_btn a{
float: left;width: 300px;height: 60px;background: #ccc;color: #fff!important;margin:0px 35px;line-height: 60px;
font-size: 22px;font-weight: bold;border-radius: 2px;
}
.enter_btn a.active{
background: #DAECFC;color: #2BC4C6!important;
}
.enter_btn a.active:hover{background: #2CDAD4;color: #fff!important;}
@media screen and (max-width: 1600px) {
@ -3250,3 +3273,39 @@ line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important;
top: 12px;
right: 20px;
}
/*文库*/
.library_nav li{
float: left;cursor: pointer;margin-right: 30px;position: relative;color: #05101A;height: 40px;line-height: 20px;
font-size: 16px;
}
.library_nav li.active,.library_nav li:hover{
color: #4cacff;
}
.library_nav li.active:after{
position: absolute;content: '';background: #4cacff;color: #4cacff;width: 100%;height: 2px;bottom: 0px;left:0px;
}
.library_list{
margin-bottom: 30px;
}
.library_list_item{
background: #fff;padding:30px;margin-bottom: 15px;display: flex;
}
.upload_Title{
position: relative;margin-right: 30px;float: left;line-height: 35px;font-size: 16px;
}
.upload_Title:before{
position: absolute;left: -10px;top:2px;content: '*';color: #FE4F4C;
}
.librariesField{
width: 100%;background: #F2F9FF;justify-content: center;align-items: center;display: -webkit-flex;text-align: center;
height: 120px;border-radius: 4px;border:1px dashed #4cacff;
}
.private_reason{overflow: hidden;max-height:150px;}
.private_reason li{margin-bottom: 10px;}
.successPage{
justify-content: center;align-items: center;display: -webkit-flex;height: 570px;text-align: center;margin-bottom: 50px;
}
.changebtn{
width: 127px;font-size: 16px;height: 40px; line-height: 40px;
}

@ -180,7 +180,7 @@ a.decoration{text-decoration: underline}
/*定位*/
.pr{position: relative}
.df {display:flex;display: -webkit-flex;display: -ms-flex;}
.flex1{flex: 1;}
.flex1{flex: 1;width: 0}
/*去掉IE input框输入时自带的清除按钮*/
input::-ms-clear{display:none;}
/*自定义滚动条宽度*/
@ -529,6 +529,10 @@ a.edu-blueback-btn{padding: 0px 10px;background: #4CACFF;color: #fff!important;b
a.edu-blueline-btn{padding: 0px 10px;color: #4CACFF!important;border: 1px solid #4CACFF;}
a.edu-blueback-btn:hover{background-color: #459BE6;}
a.edu-blueline-btn:hover{border:1px solid #459BE6;color: #459BE6!important;}
input.edu-blueback-btn{padding: 0px 10px;background: #4CACFF;color: #fff!important;border: 1px solid #4CACFF;}
input.edu-blueline-btn{padding: 0px 10px;color: #4CACFF!important;border: 1px solid #4CACFF;}
input.edu-blueback-btn:hover{background-color: #459BE6;}
input.edu-blueline-btn:hover{border:1px solid #459BE6;color: #459BE6!important;}
a.edu-orangeback-btn{background-color: #ff7500;color: #fff!important;border:1px solid #FF7500}
a.edu-orangeback-btn:hover{background-color: #F06200;}

Loading…
Cancel
Save