Merge branch 'szzh' into develop
This commit is contained in:
commit
22376f5c08
|
@ -615,6 +615,10 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
#更新创建课程消息状态
|
||||
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
|
||||
create_course_messages.update_all(:viewed => true)
|
||||
|
||||
course_activities = @course.course_activities
|
||||
@canShowRealName = User.current.member_of_course? @course
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
|
|
|
@ -81,8 +81,12 @@ class MembersController < ApplicationController
|
|||
user_ids.each do |user_id|
|
||||
members << Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
|
||||
user_grades << UserGrade.new(:user_id => user_id, :project_id => @project.id)
|
||||
## added by nie
|
||||
|
||||
#给新成员发送加入项目的消息,发送者id放在ForgeMessage的forge_message_id字段中,
|
||||
#forge_message_type设置为JoinProject
|
||||
forge_join = ForgeMessage.new(:user_id =>user_id, :forge_message_id=>User.current.id,:project_id => @project.id,:forge_message_type=>"JoinProject", :viewed => false)
|
||||
forge_join.save
|
||||
## added by nie
|
||||
if (params[:membership][:role_ids])
|
||||
role = Role.find(params[:membership][:role_ids][0])
|
||||
project_info << ProjectInfo.new(:user_id => user_id, :project_id => @project.id) if role.allowed_to?(:is_manager)
|
||||
|
@ -301,6 +305,7 @@ class MembersController < ApplicationController
|
|||
grade.destroy
|
||||
end
|
||||
end
|
||||
ForgeMessage.create(:user_id => @member.user_id, :project_id => @project.id, :forge_message_type => "RemoveFromProject", :viewed => false, :forge_message_id => User.current.id)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to_settings_in_projects }
|
||||
|
|
|
@ -534,6 +534,14 @@ class ProjectsController < ApplicationController
|
|||
project_invite_messages.each do |project_invite_message|
|
||||
project_invite_message.update_attribute(:viewed, true)
|
||||
end
|
||||
#更新被加入项目消息的viewed字段
|
||||
join_project_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type=?", user, project, "JoinProject")
|
||||
join_project_messages.each do |join_project|
|
||||
join_project.update_attribute(:viewed, true)
|
||||
end
|
||||
#更新被移出项目消息的viewed字段
|
||||
remove_project_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type=?", user, project, "RemoveFromProject")
|
||||
remove_project_messages.update_all(:viewed => true)
|
||||
end
|
||||
|
||||
def message_invite(message_id, key)
|
||||
|
|
|
@ -5,14 +5,18 @@ class SchoolController < ApplicationController
|
|||
def upload
|
||||
uploaded_io = params[:logo]
|
||||
school_id ||= params[:id]
|
||||
s1 = School.find(school_id)
|
||||
unless uploaded_io.nil?
|
||||
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
|
||||
file.write(uploaded_io.read)
|
||||
end
|
||||
s1 = School.find(school_id)
|
||||
|
||||
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
|
||||
s1.save
|
||||
|
||||
end
|
||||
s1.name = params[:name] unless params[:name].blank?
|
||||
s1.province = params[:province] unless params[:province].blank?
|
||||
s1.save
|
||||
redirect_to admin_schools_url(:school_name => params[:school_name])
|
||||
end
|
||||
|
||||
|
|
|
@ -62,6 +62,9 @@ class StudentWorkController < ApplicationController
|
|||
journals_for_teacher.each do |journal_for_teacher|
|
||||
journal_for_teacher.update_attributes(:viewed => true)
|
||||
end
|
||||
#不能参与作业匿评消息状态更新
|
||||
no_evaluation = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "NoEvaluation", 0)
|
||||
no_evaluation.update_all(:viewed => true)
|
||||
# 作品留言
|
||||
# 消息end
|
||||
#设置作业对应的forge_messages表的viewed字段
|
||||
|
|
|
@ -128,12 +128,12 @@ class UsersController < ApplicationController
|
|||
|
||||
#课程相关消息
|
||||
when 'homework'
|
||||
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage') and user_id =?", @user).order("created_at desc")
|
||||
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','NoEvaluation') and user_id =?", @user).order("created_at desc")
|
||||
when 'course_message'
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
|
||||
when 'course_news'
|
||||
# 课程通知包含发布的通知和回复的通知
|
||||
@message_alls = CourseMessage.where("course_message_type =? or course_message_type =?", "News", "Comment").where("user_id =?", @user).order("created_at desc")
|
||||
@message_alls = CourseMessage.where("course_message_type in (?, ? ,?)", "News", "Comment", "Course").where("user_id =?", @user).order("created_at desc")
|
||||
when 'poll'
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
|
||||
|
||||
|
@ -145,7 +145,7 @@ class UsersController < ApplicationController
|
|||
when 'forge_news'
|
||||
@message_alls = ForgeMessage.where("forge_message_type in (?,?) and user_id =?", "News", "Comment", @user).order("created_at desc")
|
||||
when 'apply'
|
||||
@message_alls = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject') and user_id =?", @user).order("created_at desc")
|
||||
@message_alls = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject', 'JoinProject', 'RemoveFromProject') and user_id =?", @user).order("created_at desc")
|
||||
|
||||
#贴吧消息
|
||||
when 'forum'
|
||||
|
@ -881,8 +881,8 @@ class UsersController < ApplicationController
|
|||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
||||
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll')"
|
||||
project_types = "('Message','Issue')"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||
principal_types = "JournalsForMessage"
|
||||
if params[:type].present?
|
||||
case params[:type]
|
||||
|
|
|
@ -442,7 +442,12 @@ class Attachment < ActiveRecord::Base
|
|||
|
||||
|
||||
def self.attach_filesex(obj, attachments,attachment_type)
|
||||
result = obj.save_attachmentsex(attachments, User.current,attachment_type)
|
||||
if obj.is_public?
|
||||
public_status = true
|
||||
else
|
||||
public_status = false
|
||||
end
|
||||
result = obj.save_attachmentsex(attachments, User.current,attachment_type, public_status)
|
||||
obj.attach_saved_attachments
|
||||
result
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ class Course < ActiveRecord::Base
|
|||
validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/
|
||||
validates_length_of :description, :maximum => 10000
|
||||
before_save :self_validate
|
||||
after_create :create_board_sync, :act_as_course_activity
|
||||
after_create :create_board_sync, :act_as_course_activity, :act_as_course_message
|
||||
before_destroy :delete_all_members
|
||||
|
||||
safe_attributes 'extra',
|
||||
|
@ -321,6 +321,10 @@ class Course < ActiveRecord::Base
|
|||
self.course_acts << CourseActivity.new(:user_id => self.tea_id,:course_id => self.id)
|
||||
end
|
||||
|
||||
#创建课程后,给该用户发送消息
|
||||
def act_as_course_message
|
||||
self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false)
|
||||
end
|
||||
#项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题
|
||||
#def name
|
||||
# read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
||||
|
|
|
@ -12,6 +12,7 @@ class StudentWork < ActiveRecord::Base
|
|||
before_destroy :delete_praise
|
||||
before_save :set_program_score, :set_src
|
||||
|
||||
after_create :act_as_message
|
||||
acts_as_attachable
|
||||
|
||||
def delete_praise
|
||||
|
@ -136,4 +137,11 @@ class StudentWork < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def act_as_message
|
||||
if self.created_at > self.homework_common.end_time + 1
|
||||
CourseMessage.create(:user_id => self.user_id, :course_id => self.homework_common.course_id,
|
||||
:course_message_id => self.id, :course_message_type => 'NoEvaluation',:viewed => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
<div id="new_course_topic">
|
||||
<div class="homepagePostBrief c_grey">
|
||||
<div>
|
||||
<input type="text" name="message[subject]" id="message_subject" class="InputBox w704" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
|
||||
<input type="text" name="message[subject]" id="message_subject" class="InputBox w713" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
|
||||
<p id="subjectmsg"></p>
|
||||
</div>
|
||||
<div id="topic_editor" style="display: none;">
|
||||
<%if User.current.member_of_course?(course)%>
|
||||
<div class="mt10">
|
||||
<%= f.check_box :sticky, :value => topic.sticky%>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
|
@ -15,6 +16,7 @@
|
|||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="mt10">
|
||||
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<% if User.current.logged? %>
|
||||
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false} %>
|
||||
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => course} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<span class="tips">密 码:</span>
|
||||
<input class=" width190" type="password" name="course_password" id="course_password" value="" >
|
||||
</li>
|
||||
<li style="margin-top: 30px;">
|
||||
<li style="margin-top: 30px;display: none">
|
||||
<span style="margin-right: 20px;">身 份:</span>
|
||||
<select class="IDType">
|
||||
<option>教师</option>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%>
|
||||
<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:onchange => 'addInputFiles(this,"'+ checkBox.to_s+'");',
|
||||
:style => ie8? ? '': 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
|
|
|
@ -33,9 +33,16 @@
|
|||
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
||||
|
||||
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<% if @course.is_public? %>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
<a class="f_l re_open c_blue">私有</a>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
||||
<% end %>
|
||||
|
|
|
@ -557,6 +557,17 @@
|
|||
// });
|
||||
//查询学校
|
||||
$("input[name='province']").on('input', function (e) {
|
||||
throttle(shcool_search_fn,window,e);
|
||||
});
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
function shcool_search_fn(e){
|
||||
$("input[name='occupation']").val(''); //一旦有输入就清空id。
|
||||
if($(e.target).val().trim() == lastSearchCondition && $(e.target).val().trim() != ''){
|
||||
return;
|
||||
|
@ -570,7 +581,7 @@
|
|||
var i = 0;
|
||||
$("#search_school_result_list").html('');
|
||||
for (; i < data.length; i++) {
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name.replace(/\s/g," ") + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
$("#search_school_result_list").append(link);
|
||||
}
|
||||
$("#search_school_result_list").css('left', $(e.target).offset().left);
|
||||
|
@ -592,7 +603,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
$(document.body).click(function(e){
|
||||
if($(e.target).attr("id") != 'search_school_result_list' && $(e.target).attr("id") != 'province')
|
||||
{
|
||||
|
@ -601,7 +612,10 @@
|
|||
}
|
||||
})
|
||||
$("input[name='province']").on('focus', function (e) {
|
||||
if($(e.target).val() == ''){
|
||||
if($(e.target).val() == ''){ //
|
||||
return;
|
||||
}
|
||||
if( $("input[name='occupation']").val() != ''){ //如果已经有id了。肯定存在,不用去找了。
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
|
@ -612,7 +626,7 @@
|
|||
var i = 0;
|
||||
$("#search_school_result_list").html('');
|
||||
for (; i < data.length; i++) {
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name.replace(/\s/g," ") + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
$("#search_school_result_list").append(link);
|
||||
}
|
||||
$("#search_school_result_list").css('left', $(e.target).offset().left);
|
||||
|
@ -658,8 +672,10 @@
|
|||
<% if( !@act.nil? && @act == 'password') %>
|
||||
$("#users_tb_2").click();
|
||||
<% end %>
|
||||
$('#my_account_form_link').click(function(){
|
||||
$('#my_account_form_link').click(function(e){
|
||||
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
|
||||
$("#hint").html('<span style="color:red">学校必须是从下拉列表中选择的,不能手动修改</span>').show();
|
||||
e.stopImmediatePropagation();
|
||||
return;
|
||||
}
|
||||
$('#my_account_form_btn').click();
|
||||
|
|
|
@ -11,18 +11,66 @@ function showPreview(source) {
|
|||
}
|
||||
</script>
|
||||
|
||||
<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true) do %>
|
||||
<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true,:id => "school_form") do %>
|
||||
<%#= text_field_tag 'school'%>
|
||||
<div style="margin: 20px;">
|
||||
<div style="padding:15px; border: 1px solid #dddddd;">
|
||||
<input type="hidden" value="<%= @school_name%>" name="school_name">
|
||||
<%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar")%>
|
||||
<a type="button" onclick="$('#file').click();" style="margin: 90px 0 0 10px;float: left;padding: 2px 5px;border: 1px solid #eaeaea;cursor: pointer;text-decoration: none;width: 55px;">上传图片</a>
|
||||
<a type="button" onclick="$('#file').click();" style="margin: 86px 0 0 15px;float: left;padding: 2px 5px;border: 1px solid #eaeaea;cursor: pointer;text-decoration: none;width: 55px;">上传图片</a>
|
||||
<%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
|
||||
<div style="clear: both;"></div>
|
||||
<div class="mt15">学校名称:<input type="text" name="name" placeholder="现在对应的学校名称" value="<%= @school.name%>" class="schoolName ml4"/></div>
|
||||
<div class="mt10">学校省份:
|
||||
<select class="provinceSelect" name="province">
|
||||
<option value="">--请选择省份--</option>
|
||||
<option value="北京市" <%= @school.province == '北京市' ? 'selected':'' %>>北京</option>
|
||||
<option value="上海市" <%= @school.province == '上海市' ? 'selected':'' %>>上海</option>
|
||||
<option value="广东省" <%= @school.province == '广东省' ? 'selected':'' %>>广东</option>
|
||||
<option value="江苏省" <%= @school.province == '江苏省' ? 'selected':'' %>>江苏</option>
|
||||
<option value="浙江省" <%= @school.province == '浙江省' ? 'selected':'' %>>浙江</option>
|
||||
<option value="重庆市" <%= @school.province == '重庆市' ? 'selected':'' %>>重庆</option>
|
||||
<option value="安徽省" <%= @school.province == '安徽省' ? 'selected':'' %>>安徽</option>
|
||||
<option value="福建省" <%= @school.province == '福建省' ? 'selected':'' %>>福建</option>
|
||||
<option value="甘肃省" <%= @school.province == '甘肃省' ? 'selected':'' %>>甘肃</option>
|
||||
<option value="广西省" <%= @school.province == '广西省' ? 'selected':'' %>>广西</option>
|
||||
<option value="贵州省" <%= @school.province == '贵州省' ? 'selected':'' %>>贵州</option>
|
||||
<option value="海南省" <%= @school.province == '海南省' ? 'selected':'' %>>海南</option>
|
||||
<option value="河北省" <%= @school.province == '河北省' ? 'selected':'' %>>河北</option>
|
||||
<option value="黑龙江省" <%= @school.province == '黑龙江省' ? 'selected':'' %>>黑龙江</option>
|
||||
<option value="河南省" <%= @school.province == '河南省' ? 'selected':'' %>>河南</option>
|
||||
<option value="湖北省" <%= @school.province == '湖北省' ? 'selected':'' %>>湖北</option>
|
||||
<option value="湖南省" <%= @school.province == '湖南省' ? 'selected':'' %>>湖南</option>
|
||||
<option value="江西省" <%= @school.province == '江西省' ? 'selected':'' %>>江西</option>
|
||||
<option value="吉林省" <%= @school.province == '吉林省' ? 'selected':'' %>>吉林</option>
|
||||
<option value="辽宁省" <%= @school.province == '辽宁省' ? 'selected':'' %>>辽宁</option>
|
||||
<option value=" 内蒙古自治区" <%= @school.province == ' 内蒙古自治区' ? 'selected':'' %>>内蒙古</option>
|
||||
<option value="宁夏回族自治区" <%= @school.province == '宁夏回族自治区' ? 'selected':'' %>>宁夏</option>
|
||||
<option value="青海省" <%= @school.province == '青海省' ? 'selected':'' %>>青海</option>
|
||||
<option value="山东省" <%= @school.province == '山东省' ? 'selected':'' %>>山东</option>
|
||||
<option value="山西省" <%= @school.province == '山西省' ? 'selected':'' %>>山西</option>
|
||||
<option value="陕西省" <%= @school.province == '陕西省' ? 'selected':'' %>>陕西</option>
|
||||
<option value="四川省" <%= @school.province == '四川省' ? 'selected':'' %>>四川</option>
|
||||
<option value="天津市" <%= @school.province == '天津市' ? 'selected':'' %>>天津</option>
|
||||
<option value=" 新疆维吾尔自治区" <%= @school.province == ' 新疆维吾尔自治区' ? 'selected':'' %>>新疆</option>
|
||||
<option value="西藏自治区" <%= @school.province == '西藏自治区' ? 'selected':'' %>>西藏</option>
|
||||
<option value="云南省" <%= @school.province == '云南省' ? 'selected':'' %>>云南</option>
|
||||
<option value="香港" <%= @school.province == '香港' ? 'selected':'' %>>香港特别行政区</option>
|
||||
<option value="澳门" <%= @school.province == '澳门' ? 'selected':'' %>>澳门特别行政区</option>
|
||||
<option value="台湾" <%= @school.province == '台湾' ? 'selected':'' %>>台湾</option>
|
||||
<option value="海外" <%= @school.province == '海外' ? 'selected':'' %>>海外</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-top: 10px;">
|
||||
<%= submit_tag('上传') %>
|
||||
<%= submit_tag('取消') %>
|
||||
<input type="button" value="提交" onclick="submit_edit_school($(this));" class="mr5 submit_btn" />
|
||||
<input type="button" value="取消" onclick="history.go(-1);" class="cancel_btn" />
|
||||
<%#= submit_tag('提交',:class=>'mr5') %>
|
||||
<%#= submit_tag('取消') %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<script>
|
||||
function submit_edit_school(dom){
|
||||
$("#school_form").submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<% attachments.each_with_index do |attachment,i| %>
|
||||
<div id="attachment_<%= attachment.id%>">
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %>
|
||||
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end -%>
|
|
@ -1,18 +1,27 @@
|
|||
<% project = Project.find(activity.act_id) %>
|
||||
<% user = User.find(project.user_id)%>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo mt-4"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(项目创建)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if user.try(:realname) == ' ' %>
|
||||
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(project.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "homepageTypePTask postTypeGrey" %></li>
|
||||
<li><%= link_to "项目讨论", user_message_path(User.current, :type => 'forge_message'), :class => "homepagePostTypeForum postTypeGrey" %></li>
|
||||
<li><%= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "homepageTypePNews postTypeGrey" %></li>
|
||||
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "homepageTypeUApply postTypeGrey" %></li>
|
||||
<li><%= link_to "加入项目", user_message_path(User.current, :type => 'apply'), :class => "homepageTypeUApply postTypeGrey" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
@ -27,9 +27,9 @@
|
|||
<li>
|
||||
<ul class="homepagePostTypeMore">
|
||||
<li class="f14"><strong>更多</strong></li>
|
||||
<li class="fl w100"><%= link_to "全部",user_message_path(User.current), :class => "resourcesTypeAll postTypeGrey" %></li>
|
||||
<li class="fl w100"><%= link_to "所有消息",user_message_path(User.current), :class => "resourcesTypeAll postTypeGrey" %></li>
|
||||
<li class="fl"><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "homepageTypeUnread postTypeGrey" %></li>
|
||||
<li class="fl w100"><%= link_to "系统消息", user_system_messages_path(User.current), :class => "homepageTypeSystem postTypeGrey" %></li>
|
||||
<li class="fl w100"><%= link_to "系统消息", user_system_messages_path(User.current, :type => 'system_messages'), :class => "homepageTypeSystem postTypeGrey" %></li>
|
||||
<li class="fl"><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "homepageTypePost postTypeGrey" %></li>
|
||||
<li class="fl w100"><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li>
|
||||
</ul>
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
showNormalImage('activity_description_<%= user_activity.id %>');
|
||||
});
|
||||
</script>
|
||||
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% act= user_activity.act %>
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% if act %>
|
||||
|
@ -54,6 +55,8 @@
|
|||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Course'%>
|
||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
|
@ -63,6 +66,8 @@
|
|||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Principal' %>
|
||||
|
@ -73,6 +78,9 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => user_activity,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? && !ma.course_message.nil? %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<% if User.current.allowed_to?(:as_teacher,ma.course_message.course) %>
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %>老师您好!
|
||||
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.show_name + "老师")%>刚刚发布了一个作业:
|
||||
</p>
|
||||
<p>课程名称:<%= ma.course_message.course.name %>
|
||||
(<%= ma.course_message.course.term %>)</p>
|
||||
|
@ -66,7 +66,7 @@
|
|||
您可以修改作业内容、评分规则、匿评过程等,谢谢!
|
||||
</p>
|
||||
<% else %>
|
||||
<p><%= User.current.lastname + User.current.firstname %>同学你好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:</p>
|
||||
<p><%= User.current.lastname + User.current.firstname %>同学您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:</p>
|
||||
<p>课程名称:<%= ma.course_message.course.name %>
|
||||
(<%= ma.course_message.course.term %>)</p>
|
||||
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
|
||||
|
@ -102,7 +102,7 @@
|
|||
<p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
|
||||
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
|
||||
<p>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %> 24点</span></p>
|
||||
<p>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %> @ 24点</span></p>
|
||||
<p>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %> 24点</span></p>
|
||||
<p>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></p>
|
||||
<p>请同学们抓紧时间提交自己的作品,谢谢!</p>
|
||||
<% else %>
|
||||
|
@ -302,7 +302,7 @@
|
|||
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。
|
||||
</p>
|
||||
<p>
|
||||
期待你取得更大的进步!
|
||||
期待您取得更大的进步!
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -348,6 +348,8 @@
|
|||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<div class="fl">回复人:</div>
|
||||
<div class="ml36"><%= ma.course_message.user.show_name %></div>
|
||||
<div class="fl">回复内容:</div>
|
||||
<div class="ml60"><%= ma.course_message.notes %></div>
|
||||
<div class="fl">您的评论:</div>
|
||||
|
@ -359,4 +361,57 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!-- 作业迟交,不能参与匿评提醒消息 -->
|
||||
<% if ma.course_message_type == "NoEvaluation" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">迟交作业,不能参与作业匿评!</span>
|
||||
</li>
|
||||
<% student_work = StudentWork.find(ma.course_message_id)%>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to "由于迟交作业,您及您的作品都不能参与作业的匿评", student_work_index_path(:homework => student_work.homework_common_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %>
|
||||
<%= User.current.allowed_to?(:as_teacher,student_work.homework_common.course) ? '老师':'同学'%>您好!由于迟交作业,您及您的作品都不能参与以下作业的匿评。作业详情如下:
|
||||
</p>
|
||||
<p>课程名称:<%= student_work.homework_common.course.name %>(<%= student_work.homework_common.course.time.to_s + '年' + student_work.homework_common.course.term %>)</p>
|
||||
<p>作业标题:<span style="color:Red;"><%=student_work.homework_common.name %></span></p>
|
||||
<p>提交截止:<span style="color:Red;"><%=student_work.homework_common.end_time %> 24:00</span></p>
|
||||
<p>提交时间:<span style="color:Red;"><%=format_time(student_work.created_at) %></span></p>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!-- 创建课程消息 -->
|
||||
<% if ma.course_message_type == "Course" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您成功创建了课程:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to "课程名称:" + ma.course_message.name, course_path(ma.course_message),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %>老师您好!您成功创建了一个课程,详情如下:
|
||||
</p>
|
||||
<p>课程名称:<%= ma.course_message.name %></p>
|
||||
<p>开课学期:<%= ma.course_message.time.to_s + '年' + ma.course_message.term %></p>
|
||||
<div class="fl">课程描述:</div>
|
||||
<div class="ml60"><%= ma.course_message.description.html_safe %></div>
|
||||
<p>学时总数:<%= ma.course_message.class_period%></p>
|
||||
<p>创建时间:<%= format_time(ma.course_message.created_at) %></p>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -20,6 +20,72 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--被管理员拉入项目-->
|
||||
<% if ma.forge_message_type == "JoinProject" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(User.find(ma.forge_message_id)), :width => "30", :height => "30"), user_path(ma.forge_message_id) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to User.find(ma.forge_message_id), user_path(User.find(ma.forge_message_id)), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, project_member_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.project.is_public? || User.current.member_of?(ma.project) %>
|
||||
<p>
|
||||
项目名称:<%= ma.project.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
项目描述:<%= ma.project.description %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有项目,非项目成员没有权限访问私有项目
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!-被管理员移出项目-->
|
||||
<% if ma.forge_message_type == "RemoveFromProject" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(User.find(ma.forge_message_id)), :width => "30", :height => "30"), user_path(ma.forge_message_id) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to User.find(ma.forge_message_id), user_path(User.find(ma.forge_message_id)), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, member_project_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.project.is_public? || User.current.member_of?(ma.project) %>
|
||||
<p>
|
||||
项目名称:<%= ma.project.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
项目描述:<%= ma.project.description %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有项目,非项目成员没有权限访问私有项目
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--邀请加入项目-->
|
||||
<% if ma.forge_message_type == "ProjectInvite" %>
|
||||
<% inviter = User.find(ma.forge_message_id) %>
|
||||
|
@ -29,7 +95,7 @@
|
|||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>邀请你加入项目</span>
|
||||
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>邀请你加入项目:</span>
|
||||
</li>
|
||||
<% if ma.user.member_of?(ma.project) %>
|
||||
<li class="homepageNewsContent fl">
|
||||
|
|
|
@ -93,13 +93,13 @@ module Redmine
|
|||
end
|
||||
end
|
||||
|
||||
def save_attachmentsex(attachments, author=User.current,attachment_type)
|
||||
def save_attachmentsex(attachments, author=User.current,attachment_type, public_status)
|
||||
@curattachment_type = attachment_type
|
||||
result = save_attachments(attachments,author)
|
||||
result = save_attachments(attachments,author, public_status)
|
||||
result
|
||||
end
|
||||
|
||||
def save_attachments(attachments, author=User.current)
|
||||
def save_attachments(attachments, author=User.current,public_status)
|
||||
# 清除临时文件
|
||||
if attachments
|
||||
tempAttach = attachments[:dummy]
|
||||
|
@ -140,11 +140,16 @@ module Redmine
|
|||
end
|
||||
end
|
||||
end
|
||||
if public_status
|
||||
if a && !attachment['is_public_checkbox']
|
||||
a.is_public = false
|
||||
elsif a && attachment['is_public_checkbox']
|
||||
a.is_public = true
|
||||
end
|
||||
else
|
||||
a.is_public = false
|
||||
end
|
||||
|
||||
set_attachment_public(a) if a
|
||||
next unless a
|
||||
a.description = attachment['description'].to_s.strip
|
||||
|
|
|
@ -88,7 +88,7 @@ function addFile_board(inputEl, file, eagerUpload, id) {
|
|||
return null;
|
||||
}
|
||||
|
||||
function addFile(inputEl, file, eagerUpload) {
|
||||
function addFile(inputEl, file, eagerUpload,checkBox) {
|
||||
|
||||
var attachments_frame = '#attachments_fields';
|
||||
if ($(attachments_frame).children().length < 30) {
|
||||
|
@ -99,7 +99,28 @@ function addFile(inputEl, file, eagerUpload) {
|
|||
'id': 'attachments_' + attachmentId,
|
||||
'class': 'attachment'
|
||||
});
|
||||
|
||||
//alert(checkBox);
|
||||
if(checkBox){
|
||||
fileSpan.append(
|
||||
$('<input>', {
|
||||
'type': 'text',
|
||||
'class': 'filename readonly',
|
||||
'name': 'attachments[' + attachmentId + '][filename]',
|
||||
'readonly': 'readonly'
|
||||
}).val(file.name),
|
||||
$('<input>', {
|
||||
'type': 'text',
|
||||
'class': 'description',
|
||||
'name': 'attachments[' + attachmentId + '][description]',
|
||||
'maxlength': 254,
|
||||
'placeholder': $(inputEl).data('descriptionPlaceholder')
|
||||
}).toggle(!eagerUpload),
|
||||
$('<div>', {
|
||||
'class': 'div_attachments',
|
||||
'name': 'div_' + 'attachments_' + attachmentId
|
||||
})
|
||||
).appendTo('#attachments_fields');
|
||||
}else {
|
||||
fileSpan.append(
|
||||
$('<input>', {
|
||||
'type': 'text',
|
||||
|
@ -143,6 +164,7 @@ function addFile(inputEl, file, eagerUpload) {
|
|||
'name': 'div_' + 'attachments_' + attachmentId
|
||||
})
|
||||
).appendTo('#attachments_fields');
|
||||
}
|
||||
|
||||
if (eagerUpload) {
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl);
|
||||
|
@ -198,7 +220,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
|
||||
//gcm files count and add delete_all link
|
||||
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ start
|
||||
var containerid = $(inputEl).data('containerid');
|
||||
if (containerid == undefined) {
|
||||
var count = $('#attachments_fields>span').length;
|
||||
|
@ -233,7 +255,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
}));
|
||||
}
|
||||
}
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ end
|
||||
}
|
||||
|
||||
//gcm
|
||||
|
@ -260,7 +282,7 @@ function removeFile() {
|
|||
}
|
||||
|
||||
//gcm delete all file
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ start
|
||||
function removeAll(containerid) {
|
||||
if (confirm(deleteallfiles)) {
|
||||
if (containerid == undefined) {
|
||||
|
@ -276,7 +298,7 @@ function removeAll(containerid) {
|
|||
}
|
||||
// return false;
|
||||
}
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ end
|
||||
//gcm
|
||||
|
||||
function uploadBlob(blob, uploadUrl, attachmentId, options) {
|
||||
|
@ -313,10 +335,11 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
|
|||
}
|
||||
|
||||
function addInputFiles(inputEl) {
|
||||
checkBox = arguments[1] == 'public' ? false : true;
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
// upload files using ajax
|
||||
uploadAndAttachFiles(inputEl.files, inputEl);
|
||||
uploadAndAttachFiles(inputEl.files, inputEl,checkBox);
|
||||
// $(inputEl).remove();
|
||||
} else {
|
||||
// browser not supporting the file API, upload on form submission
|
||||
|
@ -363,7 +386,7 @@ function addInputFiles_board(inputEl, id) {
|
|||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function uploadAndAttachFiles(files, inputEl) {
|
||||
function uploadAndAttachFiles(files, inputEl,checkBox) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
|
||||
|
@ -378,7 +401,7 @@ function uploadAndAttachFiles(files, inputEl) {
|
|||
window.alert(maxFileSizeExceeded);
|
||||
} else {
|
||||
$.each(files, function() {
|
||||
addFile(inputEl, this, true);
|
||||
addFile(inputEl, this, true,checkBox);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,14 @@ h3, .wiki h2 {font-size: 15px; padding-left: 5px}
|
|||
h4, .wiki h3 {font-size: 13px;}
|
||||
h4 {border-bottom: 1px dotted #bbb;}
|
||||
li{list-style-type:none;}
|
||||
|
||||
/*Tim 151019*/
|
||||
.schoolName {border:1px solid #dddddd; outline: none; width: 180px; height: 22px;}
|
||||
.provinceSelect {border: 1px solid #dddddd; outline: none; color: #888888;}
|
||||
.submit_btn {background-color: #269ac9; color: #ffffff; padding: 2px 5px; border: none; border-radius: 3px; cursor: pointer;}
|
||||
.submit_btn:hover {background-color:#297fb8;}
|
||||
.cancel_btn {background-color: #c1c1c1; color: #ffffff; padding: 2px 5px; border: none; border-radius: 3px; cursor: pointer;}
|
||||
.cancel_btn:hover {background-color:#656565; }
|
||||
/*huang*/
|
||||
|
||||
.hwork_input_news{ border:1px solid #64bdd9; height:22px; width:594px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
|
@ -2805,7 +2813,7 @@ img,embed{max-width: 100%;}
|
|||
img.school_avatar {
|
||||
background: rgb(245, 245, 245);
|
||||
padding: 4px;
|
||||
border: 1px solid #e5dfc7;
|
||||
border: 1px solid #eaeaea;
|
||||
float: left;
|
||||
display: block;
|
||||
width: 100px;
|
||||
|
|
|
@ -902,7 +902,7 @@ a:hover.BlueCirBtn{ background:#269ac9; color:#fff;}
|
|||
.w720{width:721px;}
|
||||
.w709{width: 709px;}
|
||||
.w701{width: 701px;}
|
||||
.w704{width: 704px;}
|
||||
.w713{width: 713px;}
|
||||
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888;}
|
||||
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;}
|
||||
a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -1874,9 +1874,9 @@ div.tableline{
|
|||
font-size: 12px;
|
||||
color: #fff;
|
||||
padding: 3px 9px;
|
||||
background: #15bccf;
|
||||
background: #269ac9;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #15bccf;
|
||||
border: 1px solid #269ac9;
|
||||
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
|
||||
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
|
||||
cursor: pointer;
|
||||
|
|
Loading…
Reference in New Issue