Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
Conflicts: app/views/games/_game_show.html.erb
This commit is contained in:
commit
3f027ea05c
|
|
@ -1,3 +1,4 @@
|
|||
# encoding: utf-8
|
||||
class DiscussesController < ApplicationController
|
||||
include ApplicationHelper
|
||||
before_filter :find_dis_object, :except => [:destroy]
|
||||
|
|
@ -6,10 +7,40 @@ class DiscussesController < ApplicationController
|
|||
def create
|
||||
if @model
|
||||
if params[:reply_id].blank?
|
||||
notes = User.current.show_name.to_s + " 评论了你发布的实训:<a href='#{shixun_discuss_shixun_path(@model)}'>#{params[:content]}</a>"
|
||||
@model.discusses << Discuss.new(:content => params[:content], :user_id => User.current.id, :praise_count => 0, :challenge_id => params[:challenge_id])
|
||||
JournalsForMessage.create(
|
||||
:jour_id => @model.user_id,
|
||||
:jour_type => "Principal",
|
||||
:user_id => User.current.id,
|
||||
:reply_id => 0,
|
||||
:is_readed => 0,
|
||||
:private => 1,
|
||||
:notes => notes
|
||||
)
|
||||
else
|
||||
@model.discusses << Discuss.new(:content => params[:content], :user_id => User.current.id, :parent_id => params[:reply_id], :root_id => params[:reply_id], :praise_count => 0, :challenge_id => params[:challenge_id])
|
||||
notes = User.current.show_name.to_s + " 评论了你的回复:<a href='#{shixun_discuss_shixun_path(@model)}'>#{params[:content]}</a>"
|
||||
user_id = Discuss.find(params[:reply_id]).try(:user_id)
|
||||
@model.discusses << Discuss.new(
|
||||
:content => params[:content],
|
||||
:user_id => User.current.id,
|
||||
:parent_id => params[:reply_id],
|
||||
:root_id => params[:reply_id],
|
||||
:praise_count => 0,
|
||||
:challenge_id => params[:challenge_id]
|
||||
)
|
||||
JournalsForMessage.create(
|
||||
:jour_id => user_id,
|
||||
:jour_type => "Principal",
|
||||
:user_id => User.current.id,
|
||||
:reply_id => 0,
|
||||
:is_readed => 0,
|
||||
:private => 1,
|
||||
:notes => notes
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
if params[:dis_type] == "Shixun"
|
||||
redirect_to shixun_discuss_shixun_path(@model, :challenge_id => params[:challenge_id])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ end
|
|||
@menu_type = 6
|
||||
@sub_type = 2
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
@department = ApplyAddDepartment.where(:status => 1)
|
||||
@department = Department.where(:is_auth => 1)
|
||||
search=params[:search]
|
||||
if search.blank?
|
||||
@department = @department
|
||||
|
|
@ -557,24 +557,28 @@ end
|
|||
def upload_logo
|
||||
@menu_type = 6
|
||||
@sub_type = 1
|
||||
@next_type = 1
|
||||
@school = School.find(params[:school])
|
||||
apply_schools = ApplyAddSchools.where("status = 0")
|
||||
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search)
|
||||
else
|
||||
@schools = School.where("id not in #{apply_school_ids}")
|
||||
end
|
||||
end
|
||||
|
||||
# 修改单位名称为其他
|
||||
def school_upload_logo
|
||||
school = School.where(:id => params[:applied_id]).first
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id])
|
||||
Department.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id])
|
||||
ApplyAddSchools.where(:school_id => params[:applied_id]).destroy_all
|
||||
ApplyAddDepartment.where(:school_id => params[:applied_id]).destroy_all
|
||||
before_apply_departments = Department.where(:school_id => params[:applied_id])
|
||||
after_apply_deparments = Department.where(:school_id => params[:school_id])
|
||||
before_apply_departments.each do |department|
|
||||
after_dep = Department.where(:school_id => params[:school_id], :name => department.name).first
|
||||
if after_dep
|
||||
UserExtensions.where(:school_id => params[:applied_id], :department_id => department.id).update_all(:department_id => after_dep.id)
|
||||
else
|
||||
new_department = Department.create(:name => department.name,:school_id =>params[:school_id], :is_auth => 1)
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:department_id => new_department.id)
|
||||
end
|
||||
ApplyAddDepartment.where(:department_id => department.id).destroy_all
|
||||
department.destroy
|
||||
end
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id])
|
||||
school.destroy
|
||||
redirect_to departments_part_managements_path
|
||||
end
|
||||
|
|
@ -583,8 +587,7 @@ end
|
|||
def school_message_update
|
||||
school = School.where(:name =>params[:schoolname]).first
|
||||
school_id = school.id
|
||||
School.where(:id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address])
|
||||
ApplyAddSchools.where(:school_id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address])
|
||||
School.where(:id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address],:shool_code => params[:school_code])
|
||||
redirect_to departments_part_managements_path
|
||||
end
|
||||
|
||||
|
|
@ -654,6 +657,9 @@ end
|
|||
applied_department = ApplyAddDepartment.find(params[:id])
|
||||
applied_message = AppliedMessage.where(:applied_id => applied_department.id, :applied_type => "ApplyAddDepartment")
|
||||
applied_message.update_all(:status => 1)
|
||||
if applied_department.department
|
||||
applied_department.department.update_attributes(:is_auth => 1)
|
||||
end
|
||||
applied_department.update_attribute(:status, 1) unless applied_department.nil?
|
||||
AppliedMessage.create(:user_id => applied_department.user_id, :status => 1, :viewed => 0, :applied_id => applied_department.id, :applied_type => "ApplyAddDepartment", :name => applied_department.name )
|
||||
UserExtensions.where(:user_id => applied_department.user_id).update_all(:department_id => applied_department.department_id)
|
||||
|
|
@ -804,12 +810,12 @@ end
|
|||
# 单位审批修改
|
||||
def all_schools
|
||||
apply_schools = ApplyAddSchools.where("status = 0")
|
||||
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
|
||||
apply_school_ids = apply_schools.empty? ? "(#{params[:school_id].to_i})" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search)
|
||||
@schools = School.where("id not in #{apply_school_ids} and id != #{params[:school_id].to_i} and #{School.table_name}.name like :p", :p => search)
|
||||
else
|
||||
@schools = School.where("id not in #{apply_school_ids}")
|
||||
@schools = School.where("id not in #{apply_school_ids} and id != #{params[:school_id].to_i}")
|
||||
end
|
||||
@edit_id = params[:school_id]
|
||||
@search = params[:search]
|
||||
|
|
@ -835,6 +841,9 @@ end
|
|||
users.update_all(:school_id => school.id)
|
||||
|
||||
ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id)
|
||||
|
||||
|
||||
|
||||
Department.where(:school_id => aas.school_id).update_all(:school_id => school.id)
|
||||
aas.school.destroy
|
||||
aas.update_attribute(:school_id, school.id)
|
||||
|
|
@ -1251,6 +1260,7 @@ end
|
|||
@menu_type = 7
|
||||
@sub_type = 3
|
||||
@apply_action = School.where(:auto_users_trial => 1).order('updated_at desc')
|
||||
@auto_school_ids = @apply_action.empty? ? "(-1)" : "(" + @apply_action.map(&:id).join(",") + ")"
|
||||
@apply_action_count = @apply_action.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
|
|||
|
|
@ -126,12 +126,22 @@ class SchoolController < ApplicationController
|
|||
chinese << char
|
||||
end
|
||||
end
|
||||
if(condition == '')
|
||||
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.count
|
||||
if params[:no_school_ids]
|
||||
if(condition == '')
|
||||
@school = School.where("id not in #{params[:no_school_ids]}").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.count
|
||||
else
|
||||
@school = School.where("id not in #{params[:no_school_ids]} and name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.where("id not in #{params[:no_school_ids]} and name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
|
||||
end
|
||||
else
|
||||
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
|
||||
if(condition == '')
|
||||
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.count
|
||||
else
|
||||
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
|
||||
end
|
||||
end
|
||||
|
||||
result = []
|
||||
|
|
@ -171,6 +181,8 @@ class SchoolController < ApplicationController
|
|||
school.name = params[:name].strip
|
||||
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
|
||||
school.province = params[:province]
|
||||
school.city = params[:city]
|
||||
school.address = params[:address]
|
||||
|
||||
#status 0未处理 1通过 2拒绝
|
||||
applyschool = ApplyAddSchools.new
|
||||
|
|
|
|||
|
|
@ -803,15 +803,20 @@ class ShixunsController < ApplicationController
|
|||
end
|
||||
|
||||
def shixun_discuss
|
||||
@discusses = @shixun.discusses.where(:parent_id => nil).reorder("created_at desc")
|
||||
@discusses = @shixun.discusses.reorder("created_at desc")
|
||||
@discusses_count = @discusses.count
|
||||
@limit = 15
|
||||
@is_remote = true
|
||||
@discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1
|
||||
@offset ||= @discusses_pages.offset
|
||||
@discusses = paginateHelper @discusses, @limit
|
||||
#@limit = 15
|
||||
#@is_remote = true
|
||||
#@discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1
|
||||
# @offset ||= @discusses_pages.offset
|
||||
#@discusses = paginateHelper @discusses, @limit
|
||||
#@game_challenge = params[:challenge_id].blank? ? Challenge.find(@discusses.challenge_id) : Challenge.find(params[:challenge_id])
|
||||
@game_challenge = Challenge.find(params[:challenge_id].to_i)
|
||||
challenge_id = params[:challenge_id].nil? ? @shixun.challenges.first.try(:id) : params[:challenge_id].to_i
|
||||
@game_challenge = Challenge.find(challenge_id)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class School < ActiveRecord::Base
|
||||
default_scope :order => 'created_at desc'
|
||||
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial
|
||||
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial,:shool_code
|
||||
has_many :courses
|
||||
has_many :departments, :dependent => :destroy
|
||||
|
||||
|
|
|
|||
|
|
@ -1,56 +1,56 @@
|
|||
<div class="mt10">
|
||||
<span id="attachments_fields" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.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>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.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>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= 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)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" id="upload_file_local" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<div class="mt10">
|
||||
<span id="attachments_fields" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.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>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.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>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= 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)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" id="upload_file_local" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" data-tip-down="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
<a href='<%= praise_tread_praise_plus_path({:obj_id => discuss.id,
|
||||
:obj_type => discuss.class
|
||||
}) %>' data-remote="true" data-tip-down="点赞" class="fr mt5">
|
||||
<i class="fa fa-thumbs-up color_Purple_grey"></i>
|
||||
<i class="fa fa-thumbs-up mr5"></i>赞
|
||||
<%= discuss.praise_tread_cache ? (discuss.praise_tread_cache.praise_num == 0 ? "" : discuss.praise_tread_cache.praise_num ) : "" %>
|
||||
</a>
|
||||
<% else %>
|
||||
<a href='<%= praise_tread_praise_minus_path({:obj_id => discuss.id,
|
||||
:obj_type => discuss.class
|
||||
}) %>' data-remote="true" class="fr mt5" data-tip-down="取消点赞" >
|
||||
<i class="fa fa-thumbs-up color-light-green"></i>
|
||||
<i class="fa fa-thumbs-up mr5"></i>赞
|
||||
<%= discuss.praise_tread_cache ? (discuss.praise_tread_cache.praise_num == 0 ? "" : discuss.praise_tread_cache.praise_num ) : "" %>
|
||||
</a>
|
||||
<% end %>
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
<!--)-->
|
||||
<!--</span>-->
|
||||
<label class="panel-form-label fl"> </label>
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" data-tip-down="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
<li class="clearfix mb5 pl30 pr30">
|
||||
<div class="mt5 clearfix">
|
||||
<label class="panel-form-label fl"> </label>
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" data-tip-down="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<% end %>
|
||||
// 渲染用户的HTML的CODE。
|
||||
function tpi_html_show(){
|
||||
$($(".blacktab_con")[0]).trigger("click");
|
||||
var contents = editor_CodeMirror.getValue();
|
||||
$("#data_param").val(contents);
|
||||
$("#html_form").attr("action", "/iframes/html_content");
|
||||
|
|
@ -197,8 +198,10 @@
|
|||
data.language,
|
||||
data.compile_success
|
||||
);
|
||||
$("#blacktab_nav_1").trigger("click");
|
||||
if(data.status == 2){
|
||||
if(data.language == "Html"){
|
||||
tpi_html_show();
|
||||
}
|
||||
clearInterval(cm);
|
||||
clearInterval(intId);
|
||||
var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon
|
||||
|
|
|
|||
|
|
@ -74,19 +74,25 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="tab_con_4" class="tab-info" style="display: none">
|
||||
<%#= render :partial => "games/shixun_comment_list" %>
|
||||
<div class="fit -scroll">
|
||||
<div class="-layout-v -fit">
|
||||
<div class="-flex -scroll panel-box-sizing new_li task-padding10" id="game_comment_show" style="padding: 0px;">
|
||||
<%#= render :partial => "games/shixun_comment_list" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="-layout-h -padding-h-16 -horizontal -footer-left" id="bottom_points" style = "position:relative;">
|
||||
<ul class="-task-ml80 -layout" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
|
||||
<ul class="-task-ml80 -layout df" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
|
||||
<%= render :partial => "games/shixun_comment_block" %>
|
||||
<li class="fl mt10 ml20 " style="width:54px;margin-bottom:10px;"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>
|
||||
<li class="fl ml20 mt15" style="min-width:85px;margin-bottom:10px;">
|
||||
<span data-tip-left="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20">
|
||||
<!-- <li class="fl mt10 ml20 " style="width:54px;margin-bottom:10px;"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>-->
|
||||
<li class="fl ml20 mt15 mb10 mr10" style="width:85px;">
|
||||
<span data-tip-top="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20">
|
||||
<i class="fa fa-thumbs-up font-20 mr3 <%= @praise.nil? ? "" : "color-light-green" %>" alt="赞" ></i><span class="font-12 font-bd" id="game_praise_count"><%= @praise_count %></span>
|
||||
</span>
|
||||
<span data-tip-right="<%= @tread.nil? ? "踩" : "取消踩" %>" onclick="game_tread('<%= @game_challenge.id %>')" id="game_tread" class="color-grey" style="padding-top:7px;">
|
||||
<span data-tip-top="<%= @tread.nil? ? "踩" : "取消踩" %>" onclick="game_tread('<%= @game_challenge.id %>')" id="game_tread" class="color-grey" style="padding-top:7px;">
|
||||
<i class="fa fa-thumbs-down font-20 mr3 <%= @tread.nil? ? "" : "color-orange" %>" ></i><span class="font-12 font-bd" id="game_tread_count"><%= @tread_count %></span>
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,27 @@
|
|||
<li class="comment-input fl" id="shixun_comment_block">
|
||||
<%= form_for('', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<textarea id="comment_news" name="content" placeholder="我想说点什么~" MultiLine = True ScrollBars = 2 type="text"></textarea>
|
||||
<input type="hidden" id="dis_reply_id" name="reply_id" value="">
|
||||
<% end %>
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<li class="comment-input fl" id="shixun_comment_block" style="flex: 1">
|
||||
<!-- <%#= form_for('', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<textarea id="comment_news" name="content" placeholder="我想说点什么~" MultiLine = True ScrollBars = 2 type="text"></textarea>
|
||||
<input type="hidden" id="dis_reply_id" name="reply_id" value="">
|
||||
<%# end %>-->
|
||||
|
||||
<div nhname='new_message_<%= @shixun.id%>' class="fr" style="display:none; width: 99%;">
|
||||
<%= form_for('discuss', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<div nhname='toolbar_container_<%= @shixun.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @shixun.id %>' name="content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= @shixun.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="mt10 task-btn task-btn-blue fr">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= @shixun.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
autoTextarea(document.getElementById("comment_news"),0,150);
|
||||
//autoTextarea(document.getElementById("comment_news"),0,150);
|
||||
sd_create_editor_from_shixun_data(<%= @shixun.id %>, null, "100%", "<%= @shixun.class.to_s %>");
|
||||
});
|
||||
var click = true;
|
||||
function send_dis_to_shixun(){
|
||||
|
|
|
|||
|
|
@ -1,93 +1,123 @@
|
|||
<div class="fit -scroll">
|
||||
<div class="-layout-v -fit">
|
||||
<div class="-flex -scroll panel-box-sizing new_li task-padding10" id="game_comment_show" style="padding: 10px 15px;">
|
||||
<div id="comments_content">
|
||||
<% if @shixun.discusses.blank? %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<% else %>
|
||||
<% @discusses.each do |dis| %>
|
||||
<div class="comments_item_content comment_item_bottom clearfix mt5" onmouseover="$('#discuss_opr_<%= dis.id %>').show();$('#child_discuss_opr_<%= dis.id %>').show();" onmouseout="$('#discuss_opr_<%= dis.id %>').hide();$('#child_discuss_opr_<%= dis.id %>').hide();">
|
||||
<%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 35, :height => 35), user_path(dis.user),:class => "fl mt5", :target => '_blank' %>
|
||||
<div class="fl comment_item_one ml10">
|
||||
<p class="clearfix">
|
||||
<%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %>
|
||||
<span class="fl color-grey font-12 mt3 mr20"><%= time_from_now dis.created_at %></span>
|
||||
<% if dis.try(:challenge_id).present? %>
|
||||
<span class="fl color-light-green font-12 mt3">[第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关]</span>
|
||||
<% no_children_comments = get_no_children_comments_all @discusses %>
|
||||
<div class="panel-comment_item">
|
||||
<% if @discusses.blank? %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<% else %>
|
||||
<% no_children_comments.each do |comment| %>
|
||||
<% unless comment.nil? %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="comment_item_cont df clearfix" style="padding:10px 10px">
|
||||
<div class="J_Comment_Face fl">
|
||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
|
||||
</div>
|
||||
<div class="t_content fl">
|
||||
<div class="J_Comment_Reply">
|
||||
<div class="comment_orig_content" style="margin:0px">
|
||||
<% if !comment.parent.nil? %>
|
||||
<% parents_rely = [] %>
|
||||
<% parents_rely = get_reply_parents parents_rely, comment %>
|
||||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%= comment.id %>" class="mb5">
|
||||
<% if length <= 5 %>
|
||||
<%=render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => @game_challenge.id, :type => @game_challenge.class.to_s} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide clearfix">
|
||||
<i class="fa fa-long-arrow-down mr5"></i>
|
||||
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => @game_challenge.id, :parent_id => comment.id),:remote=>true, :class => '' %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[3], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[2], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[0], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<span class="fr color-grey font-12 color_Purple_grey" id="dis_praise_<%= dis.id %>">
|
||||
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %>
|
||||
</span>
|
||||
<span class="fr none mt5 mr10" id="discuss_opr_<%= dis.id %>">
|
||||
<% if User.current.manager_of_shixun?(@shixun) && dis.children.count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="reply_to_dis('<%= dis.id %>', '<%= dis.user.show_name %>')" class="fr ml10 font-12 link-color-green" id = "reversion">回复</a>
|
||||
<% end %>
|
||||
<% if (User.current.manager_of_shixun?(@shixun) || User.current == dis.user) && dis.children.count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= discuss_path(dis, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')" class="fr font-12 link-color-green">删除</a>
|
||||
<% end %>
|
||||
</span>
|
||||
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
|
||||
<div class="comment_content clearfix" >
|
||||
<div class="color-grey3"><%= comment.content.html_safe %></div>
|
||||
|
||||
</p>
|
||||
<p class="mb10"><%= dis.content %></p>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% dis.children.each do |child| %>
|
||||
<div class="comments_return comment_item_top">
|
||||
<p class="clearfix comment_item_left_green return_item pl5">
|
||||
<span class="fl color-grey mr20">老师回复</span>
|
||||
<span class="fl color-grey font-12"><%= time_from_now child.created_at %></span>
|
||||
<span class="fr color-grey font-12 color_Purple_grey" id="dis_praise_<%= child.id %>">
|
||||
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => child} %>
|
||||
</span>
|
||||
<span class="fr pl8 none mr10 mt5" id="child_discuss_opr_<%= dis.id %>">
|
||||
<% if User.current.manager_of_shixun?(@shixun) || (User.current == dis.user && dis.children.count == 0) %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= discuss_path(dis) %>', '确定要删除该条回复吗?')" class="fr font-12 link-color-green">删除</a>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="J_Comment_Info clearfix">
|
||||
<div class="t_info fl">
|
||||
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
|
||||
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
|
||||
</div>
|
||||
<p class="fr mr10 orig_reply">
|
||||
<% if comment.creator_user == User.current || User.current.admin? || User.current.manager_of_shixun?(comment.dis_id) %>
|
||||
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=@game_challenge.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= discuss_path(comment, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
|
||||
<% end %>
|
||||
<span class="ml5 mr5 color-grey">|</span>
|
||||
<%= link_to(
|
||||
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
|
||||
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply),:class => "color-grey"
|
||||
) %>
|
||||
<span class="ml5 mr5 color-grey">|</span>
|
||||
<span class="reply_praise_count_<%= comment.id %>">
|
||||
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
</p>
|
||||
<p class="pl8 mb10"><%= child.content %></p>
|
||||
<!--<p class="fl pl8">
|
||||
<span class="fl color-grey"><%#= time_from_now child.created_at %></span>
|
||||
</p>
|
||||
<p class="fr pl8 none" id="child_discuss_opr_<%#= dis.id %>">
|
||||
<%# if User.current.manager_of_shixun?(@shixun) || (User.current == dis.user && dis.children.count == 0) %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%#= discuss_path(dis) %>', '确定要删除该条回复吗?')" class="fr font-12 link-color-green">删除</a>
|
||||
<%# end %>
|
||||
</p>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="">
|
||||
<div class="cl"></div>
|
||||
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--回复end-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--评论区域的分页-->
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function ThumbUp(item){
|
||||
$(item).toggleClass("orange-btn");
|
||||
$(item).toggleClass("orange-bg-btn");
|
||||
if($(item).attr("attr-thumb")=="0"){
|
||||
$(item).find("span").html(parseInt($(item).find("span").html())+1);
|
||||
$(item).attr("attr-thumb","1");
|
||||
}else{
|
||||
$(item).find("span").html(parseInt($(item).find("span").html())-1);
|
||||
$(item).attr("attr-thumb","0");
|
||||
}
|
||||
}
|
||||
|
||||
//二次回复的提示结构
|
||||
var $points = $("<div class = \"points-data-tip-top\">"+
|
||||
"<div class = \"data-tip-top1 \">请在此输入回复</div>"+
|
||||
"<div class = \"data-tip-top\">请在此输入回复</div>"+
|
||||
"</div>").appendTo("#bottom_points");
|
||||
$("#reversion").click(function(){
|
||||
$points.show();
|
||||
});
|
||||
$("#comment_news").bind("input propertychange",function(){
|
||||
if($("#comment_news").val() != ''){
|
||||
$points.hide();
|
||||
}
|
||||
$("#comment_news").blur(function(){
|
||||
$points.hide();
|
||||
});
|
||||
function shixun_editor_focus(id, dis_id){
|
||||
window.scrollTo(0,document.body.scrollHeight);
|
||||
$("textarea[nhname='new_message_textarea_"+id+"']").focus();
|
||||
$("#dis_reply_id").val(dis_id);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,58 +1,58 @@
|
|||
<div>
|
||||
<span id="ref_attachments_fields_ref_file" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= 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 "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= 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 "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'ref_attachments[dummy][file]',
|
||||
:id => 'ref_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)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#ref_file').click();" title="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<div>
|
||||
<span id="ref_attachments_fields_ref_file" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= 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 "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= 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 "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'ref_attachments[dummy][file]',
|
||||
:id => 'ref_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)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#ref_file').click();" data-tip-down="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
|
@ -34,13 +34,16 @@
|
|||
<% when 5 %>
|
||||
竞赛
|
||||
<% when 6 %>
|
||||
<%= @sub_type == 1 ? "单位列表" :"单位部门列表" %>
|
||||
<% if @sub_type == 1%>
|
||||
<%= link_to '单位列表',departments_part_managements_path() %>
|
||||
<% if @next_type ==1 %>
|
||||
> <%= @school.name %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
单位部门列表
|
||||
<% end %>
|
||||
<% when 7 %>
|
||||
<%= @sub_type == 1 ? "用户列表" :(@sub_type == 2? "试用授权列表" : "自动授权列表") %>
|
||||
<!--<%# case @next_type %>-->
|
||||
<!--<%# when 1 %>-->
|
||||
<!--<%#= 111 %>-->
|
||||
<!--<%# end %>-->
|
||||
<% when 8 %>
|
||||
<%= @sub_type == 1 ? "作业回复":(@sub_type == 2? "实训反馈" : "课堂讨论区") %>
|
||||
<% when 9 %>
|
||||
|
|
|
|||
|
|
@ -39,8 +39,11 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<li><a href="<%= collaborators_shixun_path(@shixun) %>" class="<%= params[:action] == "collaborators" ? "active" : "" %>">合作者</a></li>
|
||||
<% if @shixun.discusses.present? %>
|
||||
<li><a href="<%= shixun_discuss_shixun_path(@shixun) %>" class="<%= params[:action] == "shixun_discuss" ? "active" : "" %>">评论</a></li>
|
||||
<% end %>
|
||||
<% if @shixun.shixun_status == "已发布" %>
|
||||
<li><a href="<%= statistics_students_shixun_path(@shixun) %>"class="<%= params[:action] == "statistics_students" ? "active" : "" %>">学员统计</a></li>
|
||||
<li><a href="<%= statistics_students_shixun_path(@shixun) %>" class="<%= params[:action] == "statistics_students" ? "active" : "" %>">学员统计</a></li>
|
||||
<% end %>
|
||||
<% if User.current.manager_of_shixun?(@shixun) %>
|
||||
<li><a href="<%= settings_shixun_path(@shixun) %>" class="<%= params[:action] == "settings" ? "active" : "" %>">配置</a></li>
|
||||
|
|
|
|||
|
|
@ -41,10 +41,11 @@
|
|||
d_lastSearchCondition = $(e.target).val().trim();
|
||||
page = 1; //有新的搜索,页面重置为1
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page,
|
||||
url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page+"&no_school_ids=<%= @auto_school_ids %>",
|
||||
type: 'post',
|
||||
success: function (data) {
|
||||
d_schoolsResult = data.schools;
|
||||
console.log(d_schoolsResult)
|
||||
count = data.count;
|
||||
maxPage = Math.ceil(count / 100); //最大页码值
|
||||
if (d_schoolsResult.length != undefined && d_schoolsResult.length != 0) {
|
||||
|
|
|
|||
|
|
@ -11,21 +11,21 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @department.each_with_index do |department,index| %>
|
||||
<% @department.each_with_index do |department,index| %>
|
||||
<tr id="apply_add_department_<%= department.id %>">
|
||||
<td><%= index + 1 %></td>
|
||||
<td class="edu-txt-left"><%= department.name %></td>
|
||||
<td class="edu-txt-left"><%= School.where(:id => department.school_id).first %></td>
|
||||
<td><%= UserExtensions.where(:department_id => department.department_id, :school_id => department.school_id ).count %></td>
|
||||
<td><%= ApplyUserAuthentication.where(:auth_type => 2, :status => 1, :user_id => UserExtensions.where(:department_id => department.department_id,:school_id => department.school_id).map(&:user_id)).count%></td>
|
||||
<td><%= UserExtensions.where(:department_id => department.id, :school_id => department.school_id ).count %></td>
|
||||
<td><%= ApplyUserAuthentication.where(:auth_type => 2, :status => 1, :user_id => UserExtensions.where(:department_id => department.id,:school_id => department.school_id).map(&:user_id)).count%></td>
|
||||
<td><%= format_time department.created_at %></td>
|
||||
<td>
|
||||
<% if UserExtensions.where(:department_id => department.department_id,:school_id => department.school_id ).count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= department_path(department.department_id) %>', '确定要删除该部门吗?')">删除 </a>
|
||||
<% if UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= department_path(department.id) %>', '确定要删除该部门吗?')">删除 </a>
|
||||
<% else %>
|
||||
--
|
||||
<% end %>
|
||||
<%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.department_id), :remote => true, :class => "application-default-link" %>
|
||||
<%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.id), :remote => true, :class => "application-default-link" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@
|
|||
<tr>
|
||||
<th width="9%">ID</th>
|
||||
<th width="6%">LOGO</th>
|
||||
<th width="15%" class="edu-txt-left">单位名称</th>
|
||||
<th width="6%">地区</th>
|
||||
<th width="14%" class="edu-txt-left">单位名称</th>
|
||||
<th width="5%">地区</th>
|
||||
<th width="15%" class="edu-txt-left">详细地址</th>
|
||||
<th style="width: 5%;" >用户数</th>
|
||||
<th width="5%">部门数</th>
|
||||
<th width="13%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th width="13%" class="eud-pointer">修改时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th width="12%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th width="12%" class="eud-pointer">修改时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th width="8%">学校标识码</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -31,7 +32,8 @@
|
|||
<td><%= schools.departments.count %></td>
|
||||
<td><%= format_time schools.created_at %></td>
|
||||
<td><%= format_time schools.updated_at %></td>
|
||||
<td>
|
||||
<td><%= schools.shool_code %></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box('<%= delete_school_managements_path(:school => schools.id) %>', '确定要删除该部门吗?')">删除 </a>
|
||||
|
||||
<%#= link_to("修改", upload_logo_school_path(schools.id,:schools_name => @schools_name), :class => 'icon icon-copy') %>
|
||||
|
|
|
|||
|
|
@ -70,10 +70,15 @@
|
|||
</li>
|
||||
<li class="clearfix mb10">
|
||||
<label class="panel-form-label1 fl"><span class="color-red mr5">*</span>详细地址:</label>
|
||||
<input type="text" id="address" name="address" class="task-form-40 task-height-40 panel-box-sizing fl" placeholder="请填写完整的地址信息" value="<%= ApplyAddSchools.where(:school_id => @school.id,:status => 1).map(&:address).join("-") %>">
|
||||
<input type="text" id="address" name="address" class="task-form-40 task-height-40 panel-box-sizing fl" placeholder="请填写完整的地址信息" value="<%= @school.address %>">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl hint none" id="address_notice" style="margin-left:90px;"><i class="fa fa-exclamation-circle mr5"></i>请填写单位的详细地址</span>
|
||||
</li>
|
||||
<li class="clearfix mb10">
|
||||
<label class="panel-form-label1 fl"><span class="color-red mr5">*</span>学校标识码:</label>
|
||||
<input type="text" id="school_code" name="school_code" class="task-form-40 task-height-40 panel-box-sizing fl" placeholder="请填写学校标识码" value="<%= @school.shool_code %>">
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="clearfix" style="margin-left:50%;">
|
||||
<a href="javascript:void(0);" class="task-btn mr10">取消</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange" onclick="submit_department()">确定</a>
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@
|
|||
<i class="fa fa-thumbs-up mr5"></i>赞
|
||||
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
|
||||
<!-- <span class="ml5"><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
|
||||
<% unless get_praise_num(activity)==0 %>
|
||||
<span class="ml5"><%= get_praise_num(activity) %></span>
|
||||
<% end %>
|
||||
<span class="ml5"><%= get_praise_num(activity)>0 ? get_praise_num(activity):"" %></span>
|
||||
</a>
|
||||
<% else %>
|
||||
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
|
||||
|
|
@ -16,9 +14,7 @@
|
|||
:user_activity_id => user_activity_id,
|
||||
:type => type }) %>' data-remote="true" class="fr mr5 color-orange03" data-tip-down="取消点赞" >
|
||||
<i class="fa fa-thumbs-up mr5"></i>赞
|
||||
<% unless get_praise_num(activity)==0 %>
|
||||
<span class="ml5"><%= get_praise_num(activity) %></span>
|
||||
<% end %>
|
||||
<span class="ml5"><%= get_praise_num(activity)>0 ? get_praise_num(activity):"" %></span>
|
||||
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
|
||||
<!--<span class="ml5"><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<% elsif @type.to_s == 'Memo' %>
|
||||
$('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>');
|
||||
<% else @type.to_s == 'reply' %>
|
||||
<% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %>
|
||||
<% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message' || @obj_type == 'Discuss') && @obj_id == @user_activity_id %>
|
||||
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
<% else %>
|
||||
$('.reply_praise_count_<%=@obj_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
<% elsif @obj_type == 'Memo' %>
|
||||
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
<% elsif @obj_type == 'Discuss' %>
|
||||
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
<% else %>
|
||||
$('.reply_praise_count_<%=@obj_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<div class="orig_cont clearfix">
|
||||
<% unless comment.parent.nil? %>
|
||||
<div>
|
||||
<%= render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => comment, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<div class="df">
|
||||
<div class="orig_user fl">
|
||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "32", :height => "32"), user_path(comment.creator_user), :target => "_blank", :alt => "用户头像" %>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="fl" style="flex:1" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
|
||||
<div class="orig_right" style="width: 100%">
|
||||
<div class="orig_content clearfix" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
</div>
|
||||
<div class="with100 df">
|
||||
<%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %>
|
||||
<span class="t_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
|
||||
<div class="fr pr mr10 font-12" style="flex: 1">
|
||||
<div class="reply-right mt3 none" style="position: absolute; right: 0px;">
|
||||
<%= link_to('<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
|
||||
{:controller => 'users',
|
||||
:action => 'reply_to_comment',
|
||||
:reply_id => comment.id,
|
||||
:type => type,
|
||||
:user_activity_id => user_activity_id,
|
||||
:parent_id => parent_id},
|
||||
:remote => true,
|
||||
:method => 'get',:class=>"color-grey",
|
||||
:title => l(:button_reply)) %><span class="ml5 mr5">|</span>
|
||||
<span class="reply_praise_count_<%=comment.id %>">
|
||||
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="reply_message_<%= comment.id%>" class="reply_to_message clearfix"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<div class="task-pm-content " >
|
||||
<div class="task-pm-box mt30 mb30 box_bg_shandow">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="shixun_title fl mt5">评论</h3>
|
||||
</div>
|
||||
<div id="game_comment_show">
|
||||
<%= render :partial => "games/shixun_comment_list" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
sd_create_editor_from_data(<%= @shixun.id%>,null,"100%", "<%= @shixun.class.to_s%>");
|
||||
});
|
||||
</script>
|
||||
|
|
@ -2,7 +2,9 @@ $("#shixun_comment_block").replaceWith("<%= j(render :partial => "games/shixun_c
|
|||
$(".-tab-nav li").removeClass("tab_hover");
|
||||
$('#tab_nav_4').addClass("tab_hover");
|
||||
$(".tab-info").hide();
|
||||
$('#tab_con_4').show().html("<%= j(render :partial => "games/shixun_comment_list") %>");
|
||||
$('#tab_con_4').show();
|
||||
$("#game_comment_show").html("<%= j(render :partial => "games/shixun_comment_list") %>");
|
||||
|
||||
<% if @discusses_count > 0 %>
|
||||
$("#discusses_count").html("<%= @discusses_count %>");
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
||||
<% if @homework.end_time < Time.now %>
|
||||
<% if revise_attachment && work.user != User.current %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">作业修订附件</span>
|
||||
</div>
|
||||
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
||||
<% unless revise_attachment.description == "" %>
|
||||
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">作业修订附件</span>
|
||||
</div>
|
||||
<% if revise_attachment %>
|
||||
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
||||
<% unless revise_attachment.description == "" %>
|
||||
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="mb10 mt5">
|
||||
<a href="javascript:void(0);" id="upload_revise_attachment" onclick="show_upload();" class="blueCir ml5" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
||||
<% if @homework.end_time < Time.now %>
|
||||
<% if revise_attachment && work.user != User.current %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">作业修订附件</span>
|
||||
</div>
|
||||
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
||||
<% unless revise_attachment.description == "" %>
|
||||
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">作业修订附件</span>
|
||||
</div>
|
||||
<% if revise_attachment %>
|
||||
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
||||
<% unless revise_attachment.description == "" %>
|
||||
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="mb10 mt5">
|
||||
<a href="javascript:void(0);" id="upload_revise_attachment" onclick="show_upload();" class="blueCir ml5" data-tip-down="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@
|
|||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
<% else @type == 'Memo' %>
|
||||
<% else %>
|
||||
<%= form_for('discuss', :url => {:controller => 'discusses', :action => 'create', :dis_id => reply.dis_id, :dis_type => "Shixun", :challenge_id => reply.try(:challenge_id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<input type="hidden" id="dis_reply_id" name="reply_id" value="<%= reply.id %>">
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
|
|
@ -117,7 +117,8 @@
|
|||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="mt10 task-btn task-btn-orange fr">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%> <% end %>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
@ -125,4 +126,4 @@
|
|||
<%= render :partial => "users/show_unlogged_reply" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone mt10" id="reply_to_message_<%= reply.id%>">
|
||||
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone mt10 df" id="reply_to_message_<%= reply.id%>">
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy fl" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="orig_textarea mb10 fl">
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
<div class="mt5">
|
||||
<label class="panel-form-label fl"> </label>
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" data-tip-down="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
if($("#reply_message_<%= @reply.id%>").html() == "") {
|
||||
$(".reply_to_message").html("");
|
||||
<% if params[:is_project] %>
|
||||
$("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/reply_to', :locals => {:reply => @reply}) %>");
|
||||
$("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/reply_to', :locals => {:reply => @reply}) %>");
|
||||
<% else %>
|
||||
$("#reply_message_<%= @reply.id%>").html("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>");
|
||||
$("#reply_message_<%= @reply.id%>").html("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>");
|
||||
<% end %>
|
||||
$("#reply_iconup_<%=@reply.id %>").show();
|
||||
$(function(){
|
||||
sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%=@reply.class.to_s%>");
|
||||
sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%= @reply.class.to_s%>");
|
||||
});
|
||||
}else {
|
||||
$("#reply_message_<%= @reply.id%>").html("");
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@
|
|||
<!-------------------侧边提示区域-------------------------->
|
||||
<div class="-task-sidebar">
|
||||
<div class="feedback" tooltips="意见反馈">
|
||||
<a target="_blank" class="color_white" href="https://www.educoder.net/forums/1/memos/new?forum_index=true"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
|
||||
<a target="_blank" class="color_white" href="<%= feedback_path(User.find(1), :host=> Setting.host_user) %>"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ zh:
|
|||
label_feedback_tips: "在此输入对平台的问题和建议,您也可以通过QQ、微信留言,谢谢!"
|
||||
label_technical_support: "QQ 在线支持:"
|
||||
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
|
||||
label_feedback_value: "该帖来自用户反馈:)"
|
||||
label_feedback_value: "来自用户反馈"
|
||||
label_email_feedback_tips: "请留下您的联系方式(注册邮箱除外),否则我们无法及时联系到您。请管理员尽快帮我解决邮箱激活问题"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
#encoding: utf-8
|
||||
class ModifyContentForMemos < ActiveRecord::Migration
|
||||
def up
|
||||
memos = Memo.where("content like '该帖来自用户反馈%'")
|
||||
memos.update_all(:content => "来自用户反馈") if memos.present?
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
|
|
@ -167,6 +167,7 @@ function choice_answer(st, nThis){
|
|||
|
||||
// 评测区域点击TAB切换样式
|
||||
function check_tab(allClassName,addClassName,item){
|
||||
console.log(editor_CodeMirror);
|
||||
//点击tab添加样式
|
||||
$("."+allClassName).removeClass(addClassName);
|
||||
$(item).addClass(addClassName);
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ a.course-bth-blue{cursor: pointer;background-color:#199ed8 ;color: #ffffff !impo
|
|||
.break_word_firefox{white-space: pre-wrap !important;word-break: break-all;}
|
||||
.pre_word{white-space: pre-wrap;word-wrap: break-word;word-break: normal;}
|
||||
.pr {position:relative;}
|
||||
.df {display:flex;}
|
||||
.df {display:flex;display: -webkit-flex;display: -ms-flex;}
|
||||
.w100{width: 100px;}
|
||||
.w150{width: 150px;}
|
||||
.w200{width: 200px;}
|
||||
|
|
|
|||
Loading…
Reference in New Issue