Merge branch 'dev_aliyun' into dev_tj

merge aliyun
chromesetting
tangjiang 5 years ago
commit 281aaee056

@ -22,7 +22,7 @@ class CommentsController < ApplicationController
@discuss = @hack.discusses.new(reply_params) @discuss = @hack.discusses.new(reply_params)
@discuss.hidden = false @discuss.hidden = false
@discuss.user_id = current_user.id @discuss.user_id = current_user.id
@discuss.root_id = params[:parent_id] @discuss.root_id = params[:comments][:parent_id]
@discuss.save! @discuss.save!
rescue Exception => e rescue Exception => e
uid_logger_error("reply discuss failed : #{e.message}") uid_logger_error("reply discuss failed : #{e.message}")
@ -32,9 +32,14 @@ class CommentsController < ApplicationController
# 列表 # 列表
def index def index
disscusses = @hack.disscusses.where(:root_id => nil) discusses =
@disscuss_count = disscusses.count if current_user.admin_or_business?
@disscusses= paginate disscusses @hack.discusses.where(root_id: nil)
else
@hack.discusses.where(root_id: nil, hidden: false)
end
@discusses_count = discusses.count
@discusses= paginate discusses
end end
# 删除 # 删除
@ -43,10 +48,21 @@ class CommentsController < ApplicationController
render_ok render_ok
end end
# 隐藏、取消隐藏
def hidden
if current_user.admin_or_business?
@discuss = @hack.discusses.where(id: params[:id]).first
@discuss.update_attribute(:hidden, params[:hidden] == "1")
sucess_status
else
Educoder::TipException(403, "..")
end
end
private private
def find_hack def find_hack
@hack = Hack.find_by_identifier params[:identifier] @hack = Hack.find_by_identifier(params[:hack_identifier])
end end
def comment_params def comment_params

@ -117,13 +117,13 @@ class DiscussesController < ApplicationController
# 0 取消赞; # 0 取消赞;
def plus def plus
pt = PraiseTread.where(:praise_tread_object_id => params[:id], :praise_tread_object_type => params[:container_type], pt = PraiseTread.where(:praise_tread_object_id => params[:id], :praise_tread_object_type => params[:container_type],
:user_id => current_user, :praise_or_tread => 1).first :user_id => current_user, :praise_or_tread => 1)
# 如果当前用户已赞过,则不能重复赞 # 如果当前用户已赞过,则不能重复赞
if params[:type] == 1 && pt.blank? if params[:type] == 1 && pt.blank?
PraiseTread.create!(:praise_tread_object_id => params[:id], :praise_tread_object_type => params[:container_type], PraiseTread.create!(:praise_tread_object_id => params[:id], :praise_tread_object_type => params[:container_type],
:user_id => current_user.id, :praise_or_tread => 1) if pt.blank? :user_id => current_user.id, :praise_or_tread => 1)
else else
pt.destroy if pt.present? # 如果已赞过,则删掉这条赞(取消);如果没赞过,则为非法请求不处理 pt.destroy_all if pt.present? # 如果已赞过,则删掉这条赞(取消);如果没赞过,则为非法请求不处理
end end
@praise_count = PraiseTread.where(:praise_tread_object_id => params[:id], :praise_tread_object_type => params[:container_type], @praise_count = PraiseTread.where(:praise_tread_object_id => params[:id], :praise_tread_object_type => params[:container_type],

@ -103,7 +103,7 @@ class GamesController < ApplicationController
begin begin
@tpm_modified = @myshixun.repository_is_modified(@shixun.repo_path) # 判断TPM和TPI的版本库是否被改了 @tpm_modified = @myshixun.repository_is_modified(@shixun.repo_path) # 判断TPM和TPI的版本库是否被改了
rescue rescue
uid_logger("实训平台繁忙繁忙等级81") uid_logger("服务器出现问题,请重置刷新页面")
end end
end end

@ -98,12 +98,20 @@ class HacksController < ApplicationController
# 发布功能 # 发布功能
def publish def publish
@hack.update_attribute(:status, 1) @hack.update_attribute(:status, 1)
base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
}
@hack.tidings.create!(base_attrs)
render_ok render_ok
end end
# 取消发布 # 取消发布
def cancel_publish def cancel_publish
@hack.update_attribute(:status, 0) @hack.update_attribute(:status, 0)
base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id
}
@hack.tidings.create!(base_attrs)
render_ok render_ok
end end

@ -215,7 +215,8 @@ class ShixunsController < ApplicationController
if @shixun.shixun_info.present? if @shixun.shixun_info.present?
ShixunInfo.create!(shixun_id: @new_shixun.id, ShixunInfo.create!(shixun_id: @new_shixun.id,
description: @shixun.description, description: @shixun.description,
evaluate_script: @shixun.evaluate_script) evaluate_script: @shixun.evaluate_script,
shixun_reason: params[:reason].to_s.strip)
end end
# 同步私密版本库 # 同步私密版本库
@ -781,7 +782,7 @@ class ShixunsController < ApplicationController
end end
rescue => e rescue => e
uid_logger_error(e.message) uid_logger_error(e.message)
tip_exception("#{e.message}") tip_exception("服务器出现问题,请重置环境")
end end
end end

@ -214,7 +214,15 @@ class SubjectsController < ApplicationController
GitService.add_repository(repo_path: repo_path) GitService.add_repository(repo_path: repo_path)
# todo: 为什么保存的时候要去除后面的.git呢?? # todo: 为什么保存的时候要去除后面的.git呢??
@shixun.update_column(:repo_name, repo_path.split(".")[0]) @shixun.update_column(:repo_name, repo_path.split(".")[0])
mirror_id = MirrorRepository.find_by(type_name: 'Python3.6')&.id mirror_id =
if @shixun.is_jupyter?
folder = EduSetting.get('shixun_folder')
path = "#{folder}/#{identifier}"
FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path)
MirrorRepository.where("type_name like '%Jupyter%'").first&.id
else
MirrorRepository.find_by(type_name: 'Python3.6')&.id
end
if mirror_id if mirror_id
ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
@shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) @shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)

@ -64,7 +64,7 @@ module ApplicationHelper
shixun_id = shixun_id.blank? ? -1 : shixun_id.join(",") shixun_id = shixun_id.blank? ? -1 : shixun_id.join(",")
Shixun.select([:id, :name, :user_id, :challenges_count, :myshixuns_count, :trainee, :identifier]).where("id Shixun.select([:id, :name, :user_id, :challenges_count, :myshixuns_count, :trainee, :identifier]).where("id
in(#{shixun_id})").unhidden.order("homepage_show asc, myshixuns_count desc").limit(3) in(#{shixun_id})").unhidden.publiced.order("homepage_show asc, myshixuns_count desc").limit(3)
end end

@ -10,7 +10,7 @@ class Discuss < ApplicationRecord
has_one :praise_tread_cache, as: :object, dependent: :destroy has_one :praise_tread_cache, as: :object, dependent: :destroy
belongs_to :dis, polymorphic: true belongs_to :dis, polymorphic: true
belongs_to :challenge belongs_to :challenge, optional: true
after_create :send_tiding after_create :send_tiding
scope :children, -> (discuss_id){ where(parent_id: discuss_id).includes(:user).reorder(created_at: :asc) } scope :children, -> (discuss_id){ where(parent_id: discuss_id).includes(:user).reorder(created_at: :asc) }
@ -52,11 +52,19 @@ class Discuss < ApplicationRecord
private private
def send_tiding def send_tiding
if dis_type == 'Shixun'
user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
parent_container_type = 'Challenge'
challenge_id = challenge_id
elsif dis_type == 'Hack'
user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id
parent_container_type = 'Hack'
challenge_id = nil
end
base_attrs = { base_attrs = {
trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: 'Challenge', trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type,
belong_container_id: dis_id, belong_container_type: 'Shixun', viewed: 0, tiding_type: 'Comment' belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment'
} }
user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
tidings.create!(base_attrs.merge(user_id: user_id)) tidings.create!(base_attrs.merge(user_id: user_id))
end end
end end

@ -11,6 +11,11 @@ class Hack < ApplicationRecord
has_many :hack_codes, :dependent => :destroy has_many :hack_codes, :dependent => :destroy
has_many :hack_user_lastest_codes, :dependent => :destroy has_many :hack_user_lastest_codes, :dependent => :destroy
has_many :discusses, as: :dis, dependent: :destroy has_many :discusses, as: :dis, dependent: :destroy
# 点赞
has_many :praise_treads, as: :praise_tread_object, dependent: :destroy
# 消息
has_many :tidings, as: :container, dependent: :destroy
belongs_to :user belongs_to :user
scope :published, -> { where(status: 1) } scope :published, -> { where(status: 1) }
@ -18,6 +23,8 @@ class Hack < ApplicationRecord
scope :opening, -> {where(open_or_not: 1)} scope :opening, -> {where(open_or_not: 1)}
scope :mine, -> (author_id){ where(user_id: author_id) } scope :mine, -> (author_id){ where(user_id: author_id) }
after_destroy :send_delete_tiding
def language def language
if hack_codes.count == 1 if hack_codes.count == 1
hack_codes.first.language hack_codes.first.language
@ -46,4 +53,12 @@ class Hack < ApplicationRecord
user_id == user.id || user.admin_or_business? user_id == user.id || user.admin_or_business?
end end
private
def send_delete_tiding
base_attrs = {
user_id: user_id, viewed: 0, tiding_type: 'Delete', trigger_user_id: current_user.id, content: "你删除了题目:#{name}"
}
tidings.create!(base_attrs)
end
end end

@ -12,7 +12,7 @@ class PraiseTread < ApplicationRecord
case self.praise_tread_object_type case self.praise_tread_object_type
when "Memo","Message","Issue" when "Memo","Message","Issue"
self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => self.praise_tread_object.author_id, :parent_container_id => self.praise_tread_object_id, :parent_container_type => self.praise_tread_object_type, :viewed => 0, :tiding_type => "Praise") self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => self.praise_tread_object.author_id, :parent_container_id => self.praise_tread_object_id, :parent_container_type => self.praise_tread_object_type, :viewed => 0, :tiding_type => "Praise")
when "Discuss","Challenge","HomeworkCommon","JournalsForMessage","Journal","GraduationTopic","GraduationTask" when "Discuss","Challenge","HomeworkCommon","JournalsForMessage","Journal","GraduationTopic","GraduationTask", "Hack"
self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => self.praise_tread_object.user_id, :parent_container_id => self.praise_tread_object_id, :parent_container_type => self.praise_tread_object_type, :viewed => 0, :tiding_type => "Praise") self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => self.praise_tread_object.user_id, :parent_container_id => self.praise_tread_object_id, :parent_container_type => self.praise_tread_object_type, :viewed => 0, :tiding_type => "Praise")
end end
end end

@ -103,6 +103,19 @@ class Shixun < ApplicationRecord
shixun_info.try(:evaluate_script) shixun_info.try(:evaluate_script)
end end
def fork_reason
case shixun_info.try(:fork_reason)
when 'Shixun'
'实训内容升级'
when 'Course'
'课堂教学使用'
when 'Subject'
'实践课程使用'
else
shixun_info.try(:fork_reason)
end
end
def fork_identifier def fork_identifier
self.fork_from.nil? ? "--" : fork_shixuns.first&.identifier self.fork_from.nil? ? "--" : fork_shixuns.first&.identifier
end end

@ -33,6 +33,16 @@ class Admins::ShixunQuery < ApplicationQuery
all_shixuns = all_shixuns.where(status: status) if status.present? all_shixuns = all_shixuns.where(status: status) if status.present?
all_shixuns = all_shixuns.where(public: public) if public.present? all_shixuns = all_shixuns.where(public: public) if public.present?
if params[:fork_status].present?
all_shixuns = all_shixuns.where.not(fork_from: nil)
case params[:fork_status]
when 'Shixun', 'Course', 'Subject'
all_shixuns = all_shixuns.joins(:shixun_info).where(shixun_infos: {fork_reason: params[:fork_status]})
when 'Other'
all_shixuns = all_shixuns.joins(:shixun_info).where("fork_reason is null or fork_reason not in ('Shixun', 'Course', 'Subject')")
end
end
if params[:tag].present? if params[:tag].present?
all_shixuns = all_shixuns.joins(:mirror_repositories).where("mirror_repositories.id = ?",params[:tag].to_i) all_shixuns = all_shixuns.joins(:mirror_repositories).where("mirror_repositories.id = ?",params[:tag].to_i)
end end

@ -49,12 +49,16 @@ class ShixunSearchService < ApplicationService
includes: [ :shixun_info, :challenges, :subjects, user: { user_extension: :school } ] includes: [ :shixun_info, :challenges, :subjects, user: { user_extension: :school } ]
} }
model_options.merge!(where: { id: @shixuns.pluck(:id) }) model_options.merge!(where: { id: @shixuns.pluck(:id) })
model_options.merge!(order: {"myshixuns_count" => sort_str}) model_options.merge!(order: {sort_str => order_str})
model_options.merge!(default_options) model_options.merge!(default_options)
model_options model_options
end end
def sort_str def order_str
params[:order] || "desc" params[:order] || "desc"
end end
def sort_str
params[:sort] || "myshixuns_count"
end
end end

@ -65,13 +65,18 @@ class Users::ShixunService
end end
def manage_shixun_status_filter(relations) def manage_shixun_status_filter(relations)
status = case params[:status] if params[:status] == "publiced"
when 'editing' then 0 relations = relations.where(public: 2)
when 'applying' then 1 elsif params[:status] == "applying"
when 'published' then 2 relations = relations.where(public: 1)
when 'closed' then 3 else
end status = case params[:status]
relations = relations.where(status: status) if status when 'editing' then 0
when 'published' then 2
when 'closed' then 3
end
relations = relations.where(status: status) if status
end
relations relations
end end

@ -4,33 +4,48 @@
<div class="box search-form-container shixuns-list-form"> <div class="box search-form-container shixuns-list-form">
<%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %> <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
<div class="form-group"> <div class="d-flex flex-column w-100">
<label for="status">状态:</label> <div class="d-flex position-r">
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %> <div class="form-group">
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %> <label for="status">状态:</label>
</div> <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>
<div class="form-group"> <div class="form-group mr-2">
<label for="status">公开:</label> <label for="status">公开:</label>
<% public_options = [['全部', ''], ["未公开(#{@none_public_shixuns})", "editing"], ["待审核(#{@pending_public_shixuns})", 'pending'], ["已公开(#{@processed_pubic_shixuns})", 'processed']] %> <% public_options = [['全部', ''], ["未公开(#{@none_public_shixuns})", "editing"], ["待审核(#{@pending_public_shixuns})", 'pending'], ["已公开(#{@processed_pubic_shixuns})", 'processed']] %>
<%= select_tag(:public, options_for_select(public_options), class: 'form-control') %> <%= select_tag(:public, options_for_select(public_options), class: 'form-control') %>
</div> </div>
<div class="form-group mr-2"> <div class="form-group mr-2">
<label for="tag-choosed">技术平台:</label> <label for="tag-choosed">技术平台:</label>
<%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"tag-choosed") %> <%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"tag-choosed") %>
</div> </div>
<div class="form-group mr-2">
<label>搜索类型:</label>
<% auto_trial_options = [['创建者姓名', 0], ['实训名称', 1], ['学校名称', 2]] %>
<%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
<div class="">
<a href="javascript:void(0)" class="btn btn-primary" id="shixuns-export" data-disable-with = '导出中...'>导出</a>
</div>
</div>
<div class="d-flex mt-3">
<div class="form-group">
<label for="status">fork原因</label>
<% fork_status_options = [['全部', ''], ["全部fork实训", "Fork"], ["实训内容升级", 'Shixun'], ["课堂教学使用", 'Course'],["实践课程使用",'Subject'],["其他原因",'Other']] %>
<%= select_tag(:fork_status, options_for_select(fork_status_options), class: 'form-control') %>
</div>
<div class="form-group"> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
<label>搜索类型:</label> <%= link_to "清除", admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %>
<% auto_trial_options = [['创建者姓名', 0], ['实训名称', 1], ['学校名称', 2]] %> </div>
<%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
</div> </div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2', placeholder: '输入关键字搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary','data-disable-with': '搜索中...') %>
<%= link_to "清除", admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %>
<% end %> <% end %>
<a href="javascript:void(0)" class="btn btn-primary" id="shixuns-export" data-disable-with = '导出中...'>导出</a>
</div> </div>
<div class="box admin-list-container shixuns-list-container"> <div class="box admin-list-container shixuns-list-container">

@ -2,17 +2,18 @@
<thead class="thead-light"> <thead class="thead-light">
<th width="4%">序号</th> <th width="4%">序号</th>
<th width="8%">ID</th> <th width="8%">ID</th>
<th width="24%" class="text-left">实训名称</th> <th width="22%" class="text-left">实训名称</th>
<th width="8%">技术平台</th> <th width="8%">技术平台</th>
<th width="5%">Fork源</th> <th width="5%">Fork源</th>
<th width="10%">Fork原因</th>
<th width="5%">实践</th> <th width="5%">实践</th>
<th width="5%">选择</th> <th width="4%">选择</th>
<th width="6%">状态</th> <th width="6%">状态</th>
<th width="6%">公开</th> <th width="6%">公开</th>
<th width="7%">创建者</th> <th width="6%">创建者</th>
<th width="11%"><%= sort_tag('创建于', name: 'created_at', path: admins_shixuns_path) %></th> <th width="8%"><%= sort_tag('创建于', name: 'created_at', path: admins_shixuns_path) %></th>
<th width="5%">单测</th> <th width="4%">单测</th>
<th width="6%">操作</th> <th width="4%">操作</th>
</thead> </thead>
<tbody> <tbody>
<% if shixuns.present? %> <% if shixuns.present? %>
@ -31,6 +32,7 @@
<%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
<% end%> <% end%>
</td> </td>
<td><%= overflow_hidden_span(shixun&.fork_reason) %></td>
<td><%= shixun.challenges.where(:st => 0).size %></td> <td><%= shixun.challenges.where(:st => 0).size %></td>
<td><%= shixun.challenges.where(:st => 1).size %></td> <td><%= shixun.challenges.where(:st => 1).size %></td>
<td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td> <td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td>

@ -1,7 +1,11 @@
json.author do
json.partial! 'users/user', user: discuss.user
end
json.id discuss.id json.id discuss.id
json.content content_safe(discuss.content) json.content content_safe(discuss.content)
json.time time_from_now(discuss.created_at) json.time time_from_now(discuss.created_at)
json.hack_id discuss.dis_id json.hack_id discuss.dis_id
json.hidden discuss.hidden
# 主贴和回复有一些不同点 # 主贴和回复有一些不同点
if discuss.parent_id if discuss.parent_id
json.can_delete discuss.can_deleted?(current_user) json.can_delete discuss.can_deleted?(current_user)

@ -1,4 +1,4 @@
json.disscuss_count @disscuss_count json.disscuss_count @discusses_count
json.comments @discusses do |discuss| json.comments @discusses do |discuss|
json.partial! 'comments/discuss', locals: { discuss: discuss} json.partial! 'comments/discuss', locals: { discuss: discuss}
json.children discuss.child_discuss(current_user) do |c_d| json.children discuss.child_discuss(current_user) do |c_d|

@ -0,0 +1 @@
json.praise_count @praise_count

@ -1,11 +1,13 @@
json.hack do json.hack do
json.(@hack, :name, :difficult, :time_limit, :description, :score, :identifier, :status) json.(@hack, :id, :name, :difficult, :time_limit, :description, :score, :identifier, :status, :praises_count)
json.language @hack.language json.language @hack.language
json.username @hack.user.real_name json.username @hack.user.real_name
json.code @my_hack.code json.code @my_hack.code
json.pass_count @hack.pass_num json.pass_count @hack.pass_num
json.submit_count @hack.submit_num json.submit_count @hack.submit_num
json.modify_code @modify json.modify_code @modify
json.comments_count @hack.discusses.count
json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0
end end
json.test_case do json.test_case do
@ -15,5 +17,6 @@ end
json.user do json.user do
json.partial! 'users/user', user: current_user json.partial! 'users/user', user: current_user
json.hack_manager @hack.manager?(current_user) json.hack_manager @hack.manager?(current_user)
json.admin current_user.admin_or_business?
end end

@ -69,7 +69,12 @@ Rails.application.routes.draw do
delete :delete_set delete :delete_set
end end
resources :comments do resources :comments do
post :reply collection do
post :reply
end
member do
post :hidden
end
end end
end end

@ -0,0 +1,5 @@
class AddForkReasonToShixunInfo < ActiveRecord::Migration[5.2]
def change
add_column :shixun_infos, :fork_reason, :string
end
end

@ -0,0 +1,8 @@
class ModifyTaskPassForChallenges < ActiveRecord::Migration[5.2]
def change
Challenge.find_each do |challenge|
task_pass = challenge.task_pass.gsub(" ", "").gsub("rac", '\frac')
challenge.update_attribute(:task_pass, task_pass)
end
end
end

@ -0,0 +1,6 @@
class AddPraisesCountForHacks < ActiveRecord::Migration[5.2]
def change
add_column :hacks, :praises_count, :integer, :default => 0
add_column :hacks, :comments_count, :integer, :default => 0
end
end

@ -14,19 +14,19 @@ namespace :excellent_course_exercise do
course = Course.find_by(id: course_id) course = Course.find_by(id: course_id)
course.exercises.each_with_index do |exercise, index| course.exercises.each_with_index do |exercise, index|
# if exercise.exercise_users.where(commit_status: 1).count == 0 if exercise.exercise_users.where(commit_status: 1).count == 0
# 第一个试卷的参与人数和通过人数都是传的数据,后续的随机 # 第一个试卷的参与人数和通过人数都是传的数据,后续的随机
if index == 0 if index == 0
members = course.students.order("id asc").limit(participant_count) members = course.students.order("id asc").limit(participant_count)
update_exercise_user(exercise, members, pass_count) update_exercise_user(exercise, members, pass_count)
else else
new_participant_count = rand((participant_count - 423)..participant_count) new_participant_count = rand((participant_count - 20)..participant_count)
new_pass_count = rand((new_participant_count - 113)..new_participant_count) new_pass_count = rand((new_participant_count - 30)..new_participant_count)
members = course.students.order("id asc").limit(new_participant_count) members = course.students.order("id asc").limit(new_participant_count)
update_exercise_user(exercise, members, new_pass_count) update_exercise_user(exercise, members, new_pass_count)
end end
# end end
end end
end end
@ -36,14 +36,15 @@ namespace :excellent_course_exercise do
# index < pass_count 之前的学生都是通关的,之后的未通过 # index < pass_count 之前的学生都是通关的,之后的未通过
members.each_with_index do |member, index| members.each_with_index do |member, index|
exercise_user = exercise.exercise_users.where(user_id: member.user_id).take exercise_user = exercise.exercise_users.where(user_id: member.user_id).take
if exercise_question_ids.length == 20 question_length = exercise_question_ids.length
if question_length == 20
rand_num = index < pass_count - 1 ? rand(15..20) : rand(1..10) rand_num = index < pass_count - 1 ? rand(15..20) : rand(1..10)
elsif exercise_question_ids.length == 17 elsif question_length == 17
rand_num = index < pass_count - 1 ? rand(12..17) : rand(1..9) rand_num = index < pass_count - 1 ? rand(12..17) : rand(1..9)
elsif exercise_question_ids.length == 39 elsif question_length == 39
rand_num = index < pass_count - 1 ? rand(30..39) : rand(1..18) rand_num = index < pass_count - 1 ? rand(30..39) : rand(1..18)
else else
rand_num = exercise_question_ids.length rand_num = index < pass_count - 1 ? rand((question_length-3)..question_length) : rand(1..(question_length-8))
end end
if exercise_user && exercise_user.commit_status == 0 if exercise_user && exercise_user.commit_status == 0

@ -0,0 +1,32 @@
# 执行示例 RAILS_ENV=production bundle exec rake migrate_course_student:student args=3835,2526,21950,1000
# args 第一个课程 course_id第二个参数是学校school_id第三个参数是部门id第四个参数是迁移数量
#
desc "同步学校的学生"
namespace :migrate_course_student do
if ENV['args']
course_id = ENV['args'].split(",")[0] # 对应课堂的id
school_id = ENV['args'].split(",")[1] # 对应学校id
department_id = ENV['args'].split(",")[2] # 对应部门id
limit = ENV['args'].split(",")[3] # 限制导入的数量
end
task :student => :environment do
course = Course.find course_id
users = User.joins(:user_extension).where(user_extensions: {school_id: school_id, department_id: department_id, identity: 1}).limit(limit)
user_ids = []
users.each do |user|
if user.student_id.present? && !course.students.exists?(user_id: user.id)
begin
CourseMember.create!(course_id: course_id, user_id: user.id, role: 4)
user_ids << user.id
rescue Exception => e
Rails.logger(e.message)
end
end
end
CourseAddStudentCreateWorksJob.perform_later(course_id, user_ids)
end
end

@ -360,7 +360,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer} .subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer}
.search-new{width: 248px;height:32px;position: relative;margin-right: 35px;} .search-new{width: 248px;height:32px;position: relative;}
.search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1} .search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1}
.search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2} .search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2}
.search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2} .search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}

@ -35,7 +35,7 @@ if (isDev) {
// 老师 // 老师
//ebugType="teacher"; //ebugType="teacher";
// 学生 // 学生
// debugType="student"; //debugType="student";
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {

@ -336,7 +336,7 @@ class CommonWorkDetailIndex extends Component{
} }
`}</style> `}</style>
{this.props.isAdmin()? <Spin spinning={this.state.donwloading} style={{ }}> {this.props.isAdmin()? <Spin spinning={this.state.donwloading} style={{ }}>
<li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}> <li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li> <li>

@ -788,7 +788,7 @@ class CommonWorkList extends Component{
{/* value={search} */} {/* value={search} */}
<div className="fr mr5 search-new mr8" style={{marginBottom:'1px'}}> <div className="fr search-new mr8" style={{marginBottom:'1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"

@ -147,7 +147,7 @@ class TabRightComponents extends Component{
padding-bottom: 8px; padding-bottom: 8px;
} }
`}</style> `}</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} onClick={(url)=>this.confirmysl(exportResultUrl)} className="color-dark">导出成绩</a></li> <li><a href={exportResultUrl} onClick={(url)=>this.confirmysl(exportResultUrl)} className="color-dark">导出成绩</a></li>

@ -102,11 +102,26 @@ class CoursesHome extends Component{
}) })
} }
getUser=(url,type)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
if(url !== undefined || url!==""){
this.props.history.push(url);
}
}
render() { render() {
let { order,search,page,coursesHomelist }=this.state; let { order,search,page,coursesHomelist }=this.state;
//console.log(this.props)
return ( return (
<div> <div>
{this.state.updata===undefined?"":<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
@ -144,6 +159,7 @@ class CoursesHome extends Component{
onClick={ () => this.changeStatus("created_at")}>最新</a> onClick={ () => this.changeStatus("created_at")}>最新</a>
<a className={ order == "visits" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} <a className={ order == "visits" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"}
onClick={ () => this.changeStatus("visits")}>最热</a> onClick={ () => this.changeStatus("visits")}>最热</a>
{this.props.user&&this.props.user.user_identity==="学生"?"":<span className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/courses/new")}>+新建翻转课堂</span>}
{/*<div className="fr mr5 search-new">*/} {/*<div className="fr mr5 search-new">*/}
{/*/!* <Search*/} {/*/!* <Search*/}

@ -25,8 +25,15 @@ class NewShixunModel extends Component{
} }
componentDidMount() { componentDidMount() {
let{page,type,keyword,order,diff,limit,status,sort}=this.state; let{page,type,keyword,order,diff,limit,status,sort}=this.state;
let newsort=sort
if(this.props&&this.props.user.course_name===undefined){
newsort="created_at";
}else{
newsort="publish_time";
}
if(this.props.type==='shixuns'){ if(this.props.type==='shixuns'){
this.getdatalist(page,type,status,keyword,order,diff,limit) this.getdatalist(page,type,status,keyword,order,diff,limit,undefined,newsort);
}else{ }else{
this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort); this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort);
} }
@ -34,6 +41,7 @@ class NewShixunModel extends Component{
} }
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{ getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{
this.setState({ this.setState({
isspinning:true isspinning:true
}) })
@ -368,6 +376,7 @@ class NewShixunModel extends Component{
// let {visible,patheditarry}=this.props; // let {visible,patheditarry}=this.props;
// console.log(Grouplist) // console.log(Grouplist)
// console.log(allGrouplist) // console.log(allGrouplist)
const statusmenus=( const statusmenus=(
<Menu className="menus"> <Menu className="menus">
<Menu.Item> <Menu.Item>
@ -425,7 +434,6 @@ class NewShixunModel extends Component{
); );
console.log(shixun_list)
return( return(
<div> <div>

@ -1338,7 +1338,7 @@ samp {
width:237px!important; width:237px!important;
height: 30px; height: 30px;
margin-bottom: 30px; margin-bottom: 30px;
margin-right: 35px; /*margin-right: 35px;*/
} }
.search-new-input { .search-new-input {
padding-left: 16px; padding-left: 16px;

@ -178,16 +178,9 @@ class Exercisesetting extends Component{
} }
if(result.data.exercise.unified_setting == true && moment(result.data.exercise.end_time) <= moment()){ if(result.data.exercise.unified_setting == true && moment(result.data.exercise.end_time) <= moment()){
// if(this.props.isSuperAdmin()===true){
// this.setState({
// end_timetype:false
// })
// }else{
this.setState({ this.setState({
end_timetype:true end_timetype:true
}) })
// }
} }
let group=result.data.published_course_groups; let group=result.data.published_course_groups;
@ -236,10 +229,10 @@ class Exercisesetting extends Component{
//提交form表单 //提交form表单
handleSubmit = (e) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
if(this.props&&this.props.Commonheadofthetestpaper.exercise_status){ // if(this.props&&this.props.Commonheadofthetestpaper.exercise_status){
console.log("190"); // console.log("190");
console.log(this.props.Commonheadofthetestpaper.exercise_status); // console.log(this.props.Commonheadofthetestpaper.exercise_status);
} // }
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){ if(!err){
@ -327,7 +320,7 @@ class Exercisesetting extends Component{
} }
} }
if(this.state.end_timetype === false){ if(this.state.end_timetype === false||this.props.isAdmin()==true){
if(moment(end_time,dataformat) <= moment(publish_time,dataformat)){ if(moment(end_time,dataformat) <= moment(publish_time,dataformat)){
this.setState({ this.setState({
unit_e_tip:"截止时间不能小于发布时间" unit_e_tip:"截止时间不能小于发布时间"
@ -525,7 +518,7 @@ class Exercisesetting extends Component{
end_time:null end_time:null
}) })
}else{ }else{
if(moment(date,"YYYY-MM-DD HH:mm") <= moment()){ if(dateString<=moment().format('YYYY-MM-DD HH:mm')){
this.setState({ this.setState({
unit_e_tip:"截止时间不能早于当前时间", unit_e_tip:"截止时间不能早于当前时间",
e_flag:true e_flag:true
@ -608,9 +601,9 @@ class Exercisesetting extends Component{
}; };
// console.log(flagPageEdit===true?polls&&polls.exercise_status===1?3:2:1) // console.log(flagPageEdit===true?polls&&polls.exercise_status===1?3:2:1)
console.log("asdasdasda"); // console.log("asdasdasda");
console.log(this.props); // console.log(this.props);
console.log(this.props.Commonheadofthetestpaper); // console.log(this.props.Commonheadofthetestpaper);
return( return(
<div> <div>
<Modals <Modals
@ -681,6 +674,7 @@ class Exercisesetting extends Component{
<div className="clearfix"> <div className="clearfix">
<span className="mr15 fl mt10 font-16">截止时间</span> <span className="mr15 fl mt10 font-16">截止时间</span>
<div className="fl"> <div className="fl">
<Tooltip placement="bottom" title={end_timetype===true ? this.props.isAdmin()?"":"截止时间已过,不能再修改":""}>
<DatePicker <DatePicker
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
placeholder="请选择截止时间" placeholder="请选择截止时间"
@ -694,9 +688,10 @@ class Exercisesetting extends Component{
disabledDate={disabledDate} disabledDate={disabledDate}
onChange={this.onChangeTimeEnd} onChange={this.onChangeTimeEnd}
value={end_time && moment(end_time,"YYYY-MM-DD HH:mm")} value={end_time && moment(end_time,"YYYY-MM-DD HH:mm")}
disabled={ end_timetype===true?true:!flagPageEdit} disabled={ end_timetype===true?this.props.isAdmin()?!flagPageEdit:true:!flagPageEdit}
> >
</DatePicker> </DatePicker>
</Tooltip>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}> <p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{ {
unit_e_tip && unit_e_tip != "" ? <span className="fl">{ unit_e_tip }</span>:"" unit_e_tip && unit_e_tip != "" ? <span className="fl">{ unit_e_tip }</span>:""

@ -2882,7 +2882,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
</CheckboxGroup> </CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom: '1px'}}> <div className="fr search-new" style={{marginBottom: '1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"
@ -2914,7 +2914,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
</CheckboxGroup> </CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom: '1px'}}> <div className="fr search-new" style={{marginBottom: '1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"

@ -1158,7 +1158,7 @@ class GraduationTaskssettinglist extends Component{
) )
})} })}
</CheckboxGroup> </CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom:'1px',marginRight:"0px"}}> <div className="fr search-new" style={{marginBottom:'1px',marginRight:"0px"}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"
@ -1350,7 +1350,7 @@ class GraduationTaskssettinglist extends Component{
})} })}
</CheckboxGroup> </CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom:'1px'}}> <div className="fr search-new" style={{marginBottom:'1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"

@ -666,7 +666,7 @@ class GraduationTasks extends Component{
<React.Fragment> <React.Fragment>
{/*{this.props.isAdmin() ?<WordsBtn style="blue" className="mr30" onClick={() => this.addDir()}>题库选用</WordsBtn>:""}*/} {/*{this.props.isAdmin() ?<WordsBtn style="blue" className="mr30" onClick={() => this.addDir()}>题库选用</WordsBtn>:""}*/}
{/*{this.props.isAdmin() ?<a href={"/api/graduation_tasks/"+category_id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a> :""}*/} {/*{this.props.isAdmin() ?<a href={"/api/graduation_tasks/"+category_id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a> :""}*/}
{this.props.isAdmin() ? <WordsBtn style="blue" className="mr10 fr font-16"> {this.props.isAdmin() ? <WordsBtn style="blue" className=" fr font-16">
<Link to={"/courses/" + coursesId + "/graduation_tasks/"+category_id+"/new"}> <Link to={"/courses/" + coursesId + "/graduation_tasks/"+category_id+"/new"}>
<span className={"color-blue font-16"}>新建</span> <span className={"color-blue font-16"}>新建</span>
</Link> </Link>

@ -33,6 +33,11 @@ function disabledDateTime() {
// disabledSeconds: () => [55, 56], // disabledSeconds: () => [55, 56],
}; };
} }
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
const dataformat="YYYY-MM-DD HH:mm"; const dataformat="YYYY-MM-DD HH:mm";
class PollDetailTabForth extends Component{ class PollDetailTabForth extends Component{
@ -597,9 +602,10 @@ class PollDetailTabForth extends Component{
width={"240px"} width={"240px"}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabledDate={disabledDate}
onChange={this.onChangeTimeEnd} onChange={this.onChangeTimeEnd}
value={ end_time && moment(end_time,dataformat) } value={ end_time && moment(end_time,dataformat) }
disabled={un_change_end == true ? true : !flagPageEdit } disabled={un_change_end == true ?true : !flagPageEdit }
> >
</DatePicker> </DatePicker>
</span> </span>
@ -619,6 +625,7 @@ class PollDetailTabForth extends Component{
{...this.state} {...this.state}
ref="pollDetailTabForthRules" ref="pollDetailTabForthRules"
rules={rules} rules={rules}
type={"polls"}
course_group={course_group} course_group={course_group}
flagPageEdit={flagPageEdit} flagPageEdit={flagPageEdit}
rulesCheckInfo={(info)=>this.rulesCheckInfo(info)} rulesCheckInfo={(info)=>this.rulesCheckInfo(info)}

@ -447,7 +447,7 @@ class PollDetailTabForthRules extends Component{
</p> </p>
</div> </div>
<div className="fl mr20 yskspickersy"> <div className="fl mr20 yskspickersy">
<Tooltip placement="bottom" title={rule.e_timeflag ? this.props.isAdmin()?"截止时间已过,不能再修改":"":""}> <Tooltip placement="bottom" title={rule.e_timeflag ? this.props.isAdmin()?"":"截止时间已过,不能再修改":""}>
<span> <span>
<DatePicker <DatePicker
showToday={false} showToday={false}
@ -461,7 +461,11 @@ class PollDetailTabForthRules extends Component{
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabledDate={disabledDate} disabledDate={disabledDate}
disabled={rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ? true : !flagPageEdit : rule.e_timeflag == true ? true : !flagPageEdit} disabled={
this.props.type==="Exercise"?
rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ?this.props.isAdmin()?!flagPageEdit: true : !flagPageEdit : rule.e_timeflag == true ? this.props.isAdmin()?!flagPageEdit :true : !flagPageEdit:
rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ? true : !flagPageEdit : rule.e_timeflag == true ? true : !flagPageEdit
}
style={{"height":"42px"}} style={{"height":"42px"}}
></DatePicker> ></DatePicker>
</span> </span>

@ -1748,10 +1748,11 @@ class Listofworksstudentone extends Component {
} catch (e) { } catch (e) {
} }
// console.log("table1handleChange");
// console.log(sorter.columnKey);
try { try {
//学生成绩排序 //学生成绩排序
if (sorter.columnKey === "finalscore") { if (sorter.columnKey === "work_score") {
if (sorter.order === "ascend") { if (sorter.order === "ascend") {
//升序 //升序
this.setState({ this.setState({
@ -3678,7 +3679,7 @@ class Listofworksstudentone extends Component {
</li> </li>
<li className="clearfix mt10"> <li className="clearfix mt10">
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}> <div className="fr search-newysl" style={{marginBottom: '1px'}}>
{/*{course_is_end===true?"":<span>*/} {/*{course_is_end===true?"":<span>*/}
{/*{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?*/} {/*{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?*/}
{/* (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>*/} {/* (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>*/}

@ -291,7 +291,7 @@ class ShixunHomeworkPage extends Component {
`}</style> `}</style>
{this.props.isAdmin() ? {this.props.isAdmin() ?
<li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}> <li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding": "0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}> <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
{/*<li><a*/} {/*<li><a*/}

@ -898,7 +898,7 @@ class ShixunStudentWork extends Component {
</span>:"":""} </span>:"":""}
{/*请输入姓名或学号搜索*/} {/*请输入姓名或学号搜索*/}
<div className="fr mr5 search-new" style={{marginBottom: '1px'}}> <div className="fr search-new" style={{marginBottom: '1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"

@ -49,7 +49,7 @@ let _url_origin = getUrl()
const $ = window.$ const $ = window.$
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?1525440977`) ); .attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`) );
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`) ); .attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`) );
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append( $('<link rel="stylesheet" type="text/css" />')

@ -1,11 +1,12 @@
.float_button { .float_button {
background-image: url(./images/float_switch.jpg); background-image: url(images/float_switch.jpg);
height: 112px; height: 141px;
width: 38px; width: 38px;
position: absolute; position: absolute;
left: -38px; left: -38px;
top: 32%; top: 32%;
cursor: pointer; cursor: pointer;
padding-top: 15px;
} }
.float_button .text { .float_button .text {
position: relative; position: relative;
@ -17,8 +18,8 @@
} }
.jupyter_float_button { .jupyter_float_button {
background-image: url(./images/float_switch.jpg); background-image: url(images/float_switch.jpg);
height: 112px; height: 141px;
width: 38px; width: 38px;
position: absolute; position: absolute;
right: 0px; right: 0px;
@ -26,6 +27,7 @@
cursor: pointer; cursor: pointer;
left:auto; left:auto;
z-index: 99999999; z-index: 99999999;
padding-top: 15px;
} }
.jupyter_float_button .text { .jupyter_float_button .text {
@ -37,6 +39,16 @@
user-select: none; user-select: none;
} }
@keyframes mymove
{
from {right:0px;}
to {right:330px;}
}
.newjupyter_float_button{ .newjupyter_float_button{
right: 330px; /*right: 330px;*/
/*animation-duration:2s;*/
/*infinite*/
animation:mymove 0.35s;
animation-fill-mode:forwards;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -574,6 +574,7 @@ class DetailCards extends Component{
</div> </div>
} }
<DetailCardsEditAndEdit <DetailCardsEditAndEdit
{...this.props}
idsum={idsum} idsum={idsum}
keys={key} keys={key}
pathCardsedittype={pathCardsedittype} pathCardsedittype={pathCardsedittype}

@ -77,10 +77,6 @@ class DetailTop extends Component{
} }
} }
}) })
console.log(courseslist)
} }
if(courseslist.length!=0){ if(courseslist.length!=0){
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status) this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)

@ -124,10 +124,39 @@ class ShixunPathSearch extends Component{
this.props.history.push(url) this.props.history.push(url)
} }
//头部获取是否已经登录了
getUser=(url,type)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
if(url !== undefined || url!==""){
this.props.history.push(url);
}
}
render() { render() {
let { order,sortList,search,page,total_count,select }=this.state; let { order,sortList,search,page,total_count,select }=this.state;
let pathstype=false;
if(this.props&&this.props.mygetHelmetapi!=null){
let paths="/paths";
this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link);
if(paths.match(reg)){
if(item.hidden===true){
pathstype=true
}
}
// console.log() })
}
// console.log(this.props)
return ( return (
<div> <div>
{this.state.updata===undefined?"":<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
@ -169,6 +198,10 @@ class ShixunPathSearch extends Component{
{/*<a href="javascript:void(0)" className={ order == "mine" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} onClick={ () => this.changeStatus("mine")}>我的</a>*/} {/*<a href="javascript:void(0)" className={ order == "mine" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} onClick={ () => this.changeStatus("mine")}>我的</a>*/}
<span className={ order == "updated_at" ? "active" : ""} onClick={ () => this.changeStatus("updated_at")}>最新</span> <span className={ order == "updated_at" ? "active" : ""} onClick={ () => this.changeStatus("updated_at")}>最新</span>
<span className={ order == "myshixun_count" ? "active" : ""} onClick={ () => this.changeStatus("myshixun_count")}>最热</span> <span className={ order == "myshixun_count" ? "active" : ""} onClick={ () => this.changeStatus("myshixun_count")}>最热</span>
{this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":<a className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/paths/new")}>+新建实践课程</a>}
{this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"":
pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?<a className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/paths/new")}>+新建实践课程</a>:""
}
{/*<div className="fr mr5 search-new">*/} {/*<div className="fr mr5 search-new">*/}
{/*/!* <Search*/} {/*/!* <Search*/}
{/*placeholder="请输入路径名称进行搜索"*/} {/*placeholder="请输入路径名称进行搜索"*/}

@ -1214,7 +1214,7 @@ submittojoinclass=(value)=>{
</li> </li>
{ {
this.props.Headertop && this.props.Headertop.college_identifier && this.props.Headertop && this.props.Headertop.college_identifier &&
<li><a href={`${this.props.Headertop.old_url}/colleges/${this.props.Headertop.college_identifier}/statistics`}>学院统计</a></li> <li><a href={`/colleges/${this.props.Headertop.college_identifier}/statistics`}>学院统计</a></li>
} }
{ {
this.props.Headertop && this.props.Headertop.laboratory_user && this.props.Headertop && this.props.Headertop.laboratory_user &&

@ -15,6 +15,7 @@ import axios from 'axios'
import Modals from '../modals/Modals'; import Modals from '../modals/Modals';
import './shixuns/css/TPMBanner.css'; import './shixuns/css/TPMBanner.css';
import types from "../../redux/actions/actionTypes";
let $ = window.$; let $ = window.$;
@ -22,6 +23,8 @@ const Search = Input.Search;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const { TextArea } = Input;
class TPMBanner extends Component { class TPMBanner extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -54,7 +57,9 @@ class TPMBanner extends Component {
Senttothevcaluetype: false, Senttothevcaluetype: false,
jupyterbool: false, jupyterbool: false,
openknow:false, openknow:false,
openshowpublictype:false openshowpublictype:false,
Radiovalue:1,
TextAreaintshow:false
} }
} }
@ -197,13 +202,46 @@ class TPMBanner extends Component {
}) })
} }
changeTextArea=(e)=>{
this.setState({
TextArea:e.target.value
})
}
addForkvisible = () => { addForkvisible = () => {
let reason;
switch (this.state.Radiovalue) {
case 1:
reason="Shixun";
break;
case 2:
reason="Course";
break;
case 3:
reason="Subject";
break;
case 4:
reason=this.state.TextArea;
}
if(this.state.Radiovalue===4){
if(this.state.TextArea===null||this.state.TextArea===undefined||this.state.TextArea=== ""){
this.setState({
TextAreaintshow:true
})
return
}
}
this.setState({ this.setState({
Forkvisibletype: true, Forkvisibletype:true,
}) })
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = "/shixuns/" + id + "/copy.json"; let url = "/shixuns/" + id + "/copy.json";
axios.post(url).then((response) => { axios.post(url, {
reason:reason,
}).then((response) => {
if (response.data.status === 401) { if (response.data.status === 401) {
} else { } else {
@ -694,17 +732,9 @@ class TPMBanner extends Component {
} }
showonMouseOver = () => { onChangeRadiovalue=(e)=>{
$("#ratePanel").show();
this.setState({
showradios: true
})
}
hideonMouseOut = () => {
$("#ratePanel").hide();
this.setState({ this.setState({
showradios: false Radiovalue:e.target.value
}) })
} }
@ -1128,7 +1158,7 @@ class TPMBanner extends Component {
} }
{ {
<a onClick={this.Senttothe} this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter===true?"":<a onClick={this.Senttothe}
className="fr kaike kkbths mr20 font-18" className="fr kaike kkbths mr20 font-18"
data-tip-down="" data-tip-down=""
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 || shixunsDetails.shixun_status === 1 || shixunsDetails.shixun_status === -1 ? "none" : "block"}} style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 || shixunsDetails.shixun_status === 1 || shixunsDetails.shixun_status === -1 ? "none" : "block"}}
@ -1233,9 +1263,34 @@ class TPMBanner extends Component {
</span> </span>
</Tooltip> </Tooltip>
{Forkvisible===true?<style>
{
`
.ant-modal-body{
padding: 10px;
}
`
}
</style>:""}
{
this.state.TextAreaintshow===true?<style>
{
`
.ant-input:hover {
border: 1px solid red !important;
}
.ant-input:focus {
border: 1px solid red !important;
}
`
}
</style>:""
}
<Modal <Modal
keyboard={false} keyboard={false}
title="提示" title="Fork原因"
visible={Forkvisible} visible={Forkvisible}
closable={false} closable={false}
footer={null} footer={null}
@ -1247,8 +1302,25 @@ class TPMBanner extends Component {
> >
</Spin> : </Spin> :
<div> <div>
<div className="task-popup-content"><p <div className="task-popup-content">
className="task-popup-text-center font-16 pb20">复制将在后台执行平台将为你创建<br/>一个新的同名实训和内容请问是否继续</p> <div className={"forkfactors"}>请根据实际情况填写fork本实训的原因</div>
<Radio.Group onChange={this.onChangeRadiovalue} value={this.state.Radiovalue} className={"ml20 mt20 mb20"} style={{ width: "100%" }}>
<Radio style={radioStyle} value={1}>
实训内容升级
</Radio>
<Radio style={radioStyle} value={2}>
课堂教学使用
</Radio>
<Radio style={radioStyle} value={3}>
实践课程使用
</Radio>
<Radio style={radioStyle} value={4}>
其它原因
</Radio>
{this.state.Radiovalue === 4 ?
<TextArea className={this.state.TextAreaintshow===true?"bor-red mt10":"mt10"} rows={4} style={{ width: '85%', marginLeft: '30px' }} onInput={this.changeTextArea}/>: null}
{this.state.TextAreaintshow===true?<div className={"color-red ml30"}>不能为空</div>:""}
</Radio.Group>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a onClick={this.hideForkvisible} className="task-btn fl">取消</a> <a onClick={this.hideForkvisible} className="task-btn fl">取消</a>

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Redirect} from 'react-router'; import {Redirect} from 'react-router';
import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,notification} from 'antd'; import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,Button} from 'antd';
import { NoneData } from 'educoder' import { NoneData } from 'educoder'
import TPMRightSection from './component/TPMRightSection'; import TPMRightSection from './component/TPMRightSection';
@ -85,6 +85,7 @@ class TPMDataset extends Component {
checked: false, checked: false,
showmodel:false, showmodel:false,
itemtypebool:false, itemtypebool:false,
Buttonloading:false
} }
} }
@ -295,8 +296,17 @@ class TPMDataset extends Component {
handleChange = (info) => { handleChange = (info) => {
// console.log("handleChange123123"); // console.log("handleChange123123");
// console.log(info); // console.log(info);
// debugger //debugger
this.setState({
Buttonloading:true
})
if(!info.file.status){
this.setState({
Buttonloading:false
})
}
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList), fileList: appendFileSizeToUploadFileAll(fileList),
@ -306,12 +316,21 @@ class TPMDataset extends Component {
//done 成功就会调用这个方法 //done 成功就会调用这个方法
if(info.file.response){ if(info.file.response){
if(info.file.response.status===-1||info.file.response.status==="-1"){ if(info.file.response.status===-1||info.file.response.status==="-1"){
this.setState({
Buttonloading:false
})
}else{ }else{
this.getdatas(); this.getdatas();
this.setState({
Buttonloading:false
})
// this.props.showNotification(`上传成功`);
} }
} }
}else{
// this.setState({
// Buttonloading:false
// })
} }
if(info.file.response){ if(info.file.response){
@ -329,9 +348,13 @@ class TPMDataset extends Component {
showmodel:true, showmodel:true,
tittest:info.file.response.message, tittest:info.file.response.message,
itemtypebool:itemtype>-1?true:itemtype<=-1?false:false, itemtypebool:itemtype>-1?true:itemtype<=-1?false:false,
Buttonloading:false
}) })
}else{
}else{
this.setState({
Buttonloading:false
})
} }
} }
@ -445,7 +468,12 @@ class TPMDataset extends Component {
showmodel: false, showmodel: false,
}) })
} }
ButtonloadinghandleChange=()=>{
// this.props.showNotification(`zhzzzzz`);
// this.setState({
// Buttonloading:false
// })
}
render() { render() {
const {tpmLoading, shixun, user, match} = this.props; const {tpmLoading, shixun, user, match} = this.props;
const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state; const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state;
@ -472,12 +500,14 @@ class TPMDataset extends Component {
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file) => { beforeUpload: (file) => {
//上传前的操作 //上传前的操作
// console.log('beforeUpload', file.name); console.log('beforeUpload', file);
const isLt150M = file.size / 1024 / 1024 < 150; // this.props.showNotification(`文件上传中`);
if (!isLt150M) { const isLt400M = file.size / 1024 / 1024 <= 400;
this.props.showNotification('文件大小必须小于150MB!');
if (!isLt400M) {
this.props.showNotification('文件大小必须小于等于400MB!');
} }
return isLt150M; return isLt400M;
}, },
}; };
// console.log("showmodelshowmodel"); // console.log("showmodelshowmodel");
@ -514,12 +544,20 @@ class TPMDataset extends Component {
.ant-upload-list{ .ant-upload-list{
display:none display:none
} }
.deletebuttom{
color: #fff !important;
}
.deletebuttom:hover{
color: #fff !important;
background: #29BD8B !important;
}
` `
} }
</style> </style>
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest" type="upload"> <div className="intermediatecenter deletebuttom">
<Upload {...uploadProps}>
上传文件</p> </Upload></div> <Button className={"deletebuttom"} loading={this.state.Buttonloading}>{this.state.Buttonloading===true?"上传中":"上传文件"}</Button>
</Upload></div>
{ {
data_sets_count>0? data_sets_count>0?
<div <div

@ -412,7 +412,7 @@ class TPMIndex extends Component {
<span className={"tpmbannernavstyler"}>合作者</span> <span className={"tpmbannernavstyler"}>合作者</span>
</Menu.Item> </Menu.Item>
{ this.state.is_jupyter===true?<Menu.Item key="6" className={"competitionmr50"}> { this.state.identity >4||this.state.identity===undefined ? "":this.state.is_jupyter===true?<Menu.Item key="6" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>数据集</span> <span className={"tpmbannernavstyler"}>数据集</span>
</Menu.Item>:""} </Menu.Item>:""}

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1`)); .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?6`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?6`));
// index.html有加载 // index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?6`));
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -325,7 +325,7 @@ function JupyterTPI (props) {
</span> </span>
</p> </p>
<p className="jupyter_btn"> <p className="jupyter_btn">
{/* sync | poweroff */} {/*sync | poweroff */}
{/*<Button*/} {/*<Button*/}
{/* className="btn_common"*/} {/* className="btn_common"*/}
{/* type="link"*/} {/* type="link"*/}

@ -114,7 +114,7 @@
.ant-drawer-content-wrapper{ .ant-drawer-content-wrapper{
width:330px !important; width:330px !important;
box-shadow: -2px 0 8px #070F1A !important; //box-shadow: -2px 0 8px #070F1A !important;
} }
.ant-drawer-body{ .ant-drawer-body{
padding: 0px; padding: 0px;
@ -187,7 +187,7 @@ line-height: 50px !important;
} }
.ant-statistic-content-value{ .ant-statistic-content-value{
color:#fff !important; color:#fff !important;
font-size: 17px !important; font-size: 14px !important;
} }
} }

@ -140,11 +140,13 @@
.shixunstartbutton33BD8C{ .shixunstartbutton33BD8C{
background: #33BD8C !important; background: #33BD8C !important;
border: #33BD8C !important; border: #33BD8C !important;
cursor: inherit !important;
} }
.shixunstartbuttonFF6601{ .shixunstartbuttonFF6601{
background: #FF6601 !important; background: #FF6601 !important;
border: #FF6601 !important; border: #FF6601 !important;
cursor: inherit !important;
} }
.shixunstartbutton666666{ .shixunstartbutton666666{

@ -159,4 +159,10 @@ a:active{text-decoration:none;}
.forkNumst{display: block;float: left;width: 36px;text-align: center;border-left: 1px solid #ffffff !important;color: #ffffff!important; } .forkNumst{display: block;float: left;width: 36px;text-align: center;border-left: 1px solid #ffffff !important;color: #ffffff!important; }
.mlbanner36{ .mlbanner36{
margin-left: 36px; margin-left: 36px;
}
.forkfactors{
text-align: center;
color: #999999;
} }

@ -80,7 +80,7 @@
.deletebuttom{ .deletebuttom{
width:85px; width:85px;
height:30px; height:30px;
background:#29BD8B; background:#29BD8B !important;
border-radius:3px; border-radius:3px;
cursor:pointer cursor:pointer
} }

@ -214,12 +214,12 @@ class InfosShixun extends Component{
</style> </style>
<div className="white-panel edu-back-white pt20 pb20 clearfix "> <div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a <li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a
href="javascript:void(0)" onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li> onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li>
<li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("manage")} onClick={() => this.changeCategory("manage")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li>
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("study")} onClick={() => this.changeCategory("study")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div> </div>
<style> <style>
@ -242,29 +242,30 @@ class InfosShixun extends Component{
{ {
category && category == "manage" && is_current && category && category == "manage" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)" <li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}>
onClick={() => this.changeStatus()} <a onClick={() => this.changeStatus()} className="w32">全部</a></li>
className="w32">全部</a></li>
<li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("editing")} className="w60">编辑中</a></li> onClick={() => this.changeStatus("editing")} className="w60">编辑中</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("published")} className="w60">已发布</a></li> onClick={() => this.changeStatus("published")} className="w60">已发布</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60">已公开</a></li>
<li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("closed")} className="w60">已关闭</a></li> onClick={() => this.changeStatus("closed")} className="w60">已关闭</a></li>
</div> </div>
} }
{ {
category && category == "study" && is_current && category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)" <li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a
onClick={() => this.changeStatus()} onClick={() => this.changeStatus()}
className="w32">全部</a></li> className="w32">全部</a></li>
<li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("processing")} className="w60">未通关</a></li> onClick={() => this.changeStatus("processing")} className="w60">未通关</a></li>
<li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("passed")} className="w60">已通关</a></li> onClick={() => this.changeStatus("passed")} className="w60">已通关</a></li>
</div> </div>
} }
<div className=" clearfix font-12 " style={{ <div className=" clearfix font-12 " style={{
@ -387,12 +388,12 @@ class InfosShixun extends Component{
:""} :""}
<a href="javascript:void(0)" className="square-img"> <a className="square-img">
<img src={setImagesUrl(`${item.image_url}`)}/> <img src={setImagesUrl(`${item.image_url}`)}/>
</a> </a>
<div className="square-main"> <div className="square-main">
<p className="task-hide"> <p className="task-hide">
<a href="javascript:void(0)" className="justify color-grey-name">{item.name}</a> <a className="justify color-grey-name">{item.name}</a>
</p> </p>
<div className="user-bar mt10"> <div className="user-bar mt10">
<p style={{'width': `${parseFloat(parseInt(item.finished_challenges_count)/parseInt(item.challenges_count)).toFixed(2)*100}%`}}></p> <p style={{'width': `${parseFloat(parseInt(item.finished_challenges_count)/parseInt(item.challenges_count)).toFixed(2)*100}%`}}></p>

@ -364,7 +364,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer} .subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer}
.search-new{width: 248px;height:32px;position: relative;margin-right: 35px;} .search-new{width: 248px;height:32px;position: relative;}
.search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1} .search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1}
.search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2} .search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2}
.search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2} .search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}

Loading…
Cancel
Save