Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
Conflicts: db/migrate/20160324074942_add_index_to_forge_activities.rb
This commit is contained in:
commit
dea1c13a64
|
@ -71,18 +71,18 @@ class BlogCommentsController < ApplicationController
|
|||
@course.save
|
||||
redirect_to course_path(:id=>params[:course_id])
|
||||
else
|
||||
@article.children.delete
|
||||
@article.delete
|
||||
@article.children.destroy
|
||||
@article.destroy
|
||||
redirect_to user_blogs_path(:user_id=>User.current)
|
||||
end
|
||||
|
||||
else#如果是回复被删,
|
||||
if params[:course_id] #如果带了course_id过来了,那么这是要跳到课程大纲去的
|
||||
@article.delete
|
||||
@article.destroy
|
||||
redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||
else
|
||||
root = @article.root
|
||||
@article.delete
|
||||
@article.destroy
|
||||
redirect_to user_blog_blog_comment_path(:user_id=>root.author_id,:blog_id=>root.blog_id,:id=>root.id)
|
||||
end
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class OrgSubfieldsController < ApplicationController
|
|||
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
|
||||
"and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'"
|
||||
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
|
||||
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir])
|
||||
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir].downcase)
|
||||
end
|
||||
end
|
||||
@subfield.update_attributes(:field_type => params[:field_type])
|
||||
|
|
|
@ -225,7 +225,7 @@ class OrganizationsController < ApplicationController
|
|||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
sql = "select courses.* from courses inner join members on courses.id = members.course_id where members.user_id = #{User.current.id} and courses.name like '#{condition}'"+
|
||||
"and courses.id not in (select distinct org_courses.course_id from org_courses where org_courses.organization_id = #{@organization.id})"
|
||||
"and courses.id not in (select distinct org_courses.course_id from org_courses where org_courses.organization_id = #{@organization.id}) and courses.is_delete=0"
|
||||
#user_courses = Course.find_by_sql(sql)
|
||||
@courses = Course.find_by_sql(sql)
|
||||
# @added_course_ids = @organization.courses.map(&:id)
|
||||
|
@ -269,7 +269,7 @@ class OrganizationsController < ApplicationController
|
|||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
sql = "select projects.* from projects inner join members on projects.id = members.project_id where members.user_id = #{User.current.id} and projects.status != 9 and projects.name like '#{condition}'" +
|
||||
" and projects.id not in (select org_projects.project_id from org_projects where organization_id = #{@organization.id})"
|
||||
" and projects.id not in (select org_projects.project_id from org_projects where organization_id = #{@organization.id}) and status=1"
|
||||
#user_projects = Course.find_by_sql(sql)
|
||||
@projects = Course.find_by_sql(sql)
|
||||
# @added_course_ids = @organization.projects.map(&:id)
|
||||
|
|
|
@ -63,6 +63,13 @@ class StudentWorkController < ApplicationController
|
|||
homework_message.update_attributes(:viewed => true) if homework_message.viewed == 0
|
||||
end
|
||||
end
|
||||
|
||||
#修改作品提示消息更新
|
||||
student_work_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, StudentWork.name, 0)
|
||||
student_work_messages.each do |message|
|
||||
message.update_attribute(:viewed, true)
|
||||
end
|
||||
|
||||
# 作品打分消息状态更新
|
||||
studentworks_scores = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScore", 0)
|
||||
studentworks_scores.each do |studentworks_score|
|
||||
|
@ -369,6 +376,8 @@ class StudentWorkController < ApplicationController
|
|||
@work.save_attachments(params[:attachments])
|
||||
render_attachment_warning_if_needed(@work)
|
||||
if @work.save
|
||||
#如果学生作品被打分后修改,应该给老师提示
|
||||
send_message_to_teacher(@work)
|
||||
if @homework.homework_type == 3
|
||||
@student_work_project = @homework.student_work_projects.where("user_id=?",User.current.id).first
|
||||
student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",@work.id,0)
|
||||
|
|
|
@ -714,6 +714,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
student_work.save
|
||||
send_message_to_teacher(student_work)
|
||||
homework.update_attributes(:updated_at => Time.now)
|
||||
update_course_activity(homework.class,homework.id)
|
||||
update_user_activity(homework.class,homework.id)
|
||||
|
@ -1213,12 +1214,12 @@ class UsersController < ApplicationController
|
|||
params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false)
|
||||
join_course_messages.update_all(:viewed => true)
|
||||
end
|
||||
shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
|
||||
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||
user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
|
||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||
principal_types = "JournalsForMessage"
|
||||
if params[:type].present?
|
||||
|
@ -1231,6 +1232,8 @@ class UsersController < ApplicationController
|
|||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "course_poll"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "course_journals"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "project_issue"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "project_message"
|
||||
|
@ -1250,7 +1253,8 @@ class UsersController < ApplicationController
|
|||
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
# 减少数据库交互
|
||||
user_ids = "(" + @user.id.to_s + "," + User.watched_by(@user.id).map{|u| u.id }.join(',') + ")"
|
||||
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
|
||||
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
|
||||
blog_ids = "(" + watched_user_blog_ids + ")"
|
||||
|
||||
|
|
|
@ -2137,6 +2137,20 @@ module ApplicationHelper
|
|||
|
||||
end
|
||||
|
||||
#如果学生作品被打分后修改,应该给老师提示
|
||||
def send_message_to_teacher student_work
|
||||
if StudentWork === student_work
|
||||
if student_work.student_works_scores.any?
|
||||
course = student_work.homework_common.course
|
||||
course.members.map(&:user_id).uniq.each do|user_id|
|
||||
if User.find(user_id).allowed_to?(:as_teacher, course)
|
||||
student_work.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course.id, :viewed => false, :status => 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def wiki_helper
|
||||
|
@ -3044,3 +3058,7 @@ def is_default_field? field
|
|||
(field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default'
|
||||
end
|
||||
|
||||
def host_with_protocol
|
||||
return Setting.protocol + "://" + Setting.host_name
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ module OrgMemberHelper
|
|||
principals = paginateHelper scope,10
|
||||
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
|
||||
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
|
||||
link_to text, org_member_autocomplete_org_member_index_path(parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js')), :remote => true
|
||||
link_to text, host_with_protocol + "/org_member/org_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js').to_query, :remote => true
|
||||
}
|
||||
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
|
||||
end
|
||||
|
|
|
@ -42,9 +42,9 @@ class Principal < ActiveRecord::Base
|
|||
if q.blank?
|
||||
where({})
|
||||
else
|
||||
pattern = "%#{q}%"
|
||||
pattern = "%#{q}%".gsub("/","//").gsub("_","/_")
|
||||
# sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ")
|
||||
sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p)"
|
||||
sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p) escape '/'"
|
||||
params = {:p => pattern}
|
||||
if q =~ /^(.+)\s+(.+)$/
|
||||
a, b = "#{$1}%", "#{$2}%"
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
<div class="break_word">
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true -%>
|
||||
</span>
|
||||
</span>
|
||||
<span class="postAttSize">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= link_to h(truncate(attachment.author.name, length: 15, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<% if @order == "asc" %>
|
||||
按 <%= link_to "时间",params.merge(:sort => "created_on:desc", :order => order,:tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||
<%= link_to "下载次数",params.merge(:sort => "downloads:desc", :order => order,:tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||
<%= link_to "引用次数",params.merge(:sort => "quotes:desc", :order => order,:tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||
<% else %>
|
||||
按 <%= link_to "时间",params.merge(:sort => "created_on:asc", :order => order, :tag_name => tag_name,:name => search_name),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||
<%= link_to "下载次数",params.merge(:sort => "downloads:asc", :order => order, :tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||
<%= link_to "引用次数",params.merge(:sort =>"quotes:asc", :order => order, :tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||
<% end %>
|
|
@ -56,16 +56,8 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<p class="f_l fontBlue f_b f_14">共有 <span id="attachment_count"><%= User.current.member_of_org?(@org_subfield.organization) ? @all_attachments.count : @all_attachments.select{|attach| attach.is_public == 1 }.count %></span> 个资源</p>
|
||||
<p class="f_r" style="color: #808080">
|
||||
<% if @order == "asc" %>
|
||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||
<% else %>
|
||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||
<% end %>
|
||||
<p class="f_r" style="color: #808080" id="org_sort">
|
||||
<%= render :partial => 'files/org_order_filter', :locals => {:order => @order, :sort => @sort, :tag_name => @tag_name, :search_name => nil} %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -5,4 +5,6 @@
|
|||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
||||
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @result.count %>");
|
||||
$("#org_sort").html("<%= escape_javascript(render :partial => 'org_order_filter',
|
||||
:locals => {:sort => @sort, :order => @order, :tag_name => @tag_name, :search_name => @q}) %>");
|
||||
<% end %>
|
|
@ -1,3 +1,5 @@
|
|||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
||||
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @result.count %>");
|
||||
$("#attachment_count").html("<%= @result.count %>");
|
||||
$("#org_sort").html("<%= escape_javascript(render :partial => 'org_order_filter',
|
||||
:locals => {:sort => @sort, :order => @order, :tag_name => @tag_name,:search_name => @q}) %>");
|
|
@ -90,8 +90,8 @@
|
|||
<% end%>
|
||||
</div>
|
||||
<!--<div class="orgName fl mb5 f14">组织id:<%#= @organization.id %></div>-->
|
||||
<div class="orgName fl mb5 f14">
|
||||
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||
<div class="orgName fl mb5 f14" title="<%= @organization.name %>">
|
||||
<%= link_to truncate(@organization.name,:length => 26), organization_path(@organization.id), :class=>"pr_info_name c_dark fb break_word" %>
|
||||
<% if User.current.logged? %>
|
||||
<% if @organization.is_public? %>
|
||||
<span class="img_private"><%= l(:label_public)%></span>
|
||||
|
|
|
@ -32,7 +32,10 @@
|
|||
location.href = document.referrer;
|
||||
}
|
||||
</script>
|
||||
<div class="resources" nhname="new_topic_form">
|
||||
<div class="homepageRightBanner" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>; margin-bottom:10px;">
|
||||
<div class="NewsBannerName"><%= OrgSubfield.try(:find, params[:field_id]).try(:name) %></div>
|
||||
</div>
|
||||
<div class="resources" nhname="new_topic_form" style="padding-top:<%= params[:field_id].present? ? '0px': '15px' %>">
|
||||
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %>
|
||||
<div>
|
||||
<textarea class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" placeholder="请输入文章标题"></textarea>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
|
||||
$("#sub_field_left_lists").html("");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
||||
$("#subfield_name").val("");
|
||||
<% else %>
|
||||
$("#subfield_name").val("");
|
||||
<% end %>
|
||||
<% end %>
|
||||
$("#subfield_name").val("");
|
||||
$("#sub_dir").val("");
|
|
@ -63,7 +63,7 @@
|
|||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.where("is_delete=0").reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -77,7 +77,7 @@
|
|||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.where("status=1").reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
||||
<% if @organization.home_id == document.id %>
|
||||
<span class="red_homework_btn_cir ml5">已设为首页</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||
<div class="homepagePostDate fl">
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<div id="sub_dir_edit_<%= field.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
|
||||
<input type="text" name="name" onfocus="observe_input_to_lowercase($(this));" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val().toLowerCase());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
|
||||
|
@ -85,6 +85,9 @@
|
|||
url: "/org_subfields/" + field_id + "?name=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
|
@ -109,6 +112,9 @@
|
|||
url: "/org_subfields/" + field_id + "/update_sub_dir?sub_dir_name=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
|
@ -128,16 +134,13 @@
|
|||
function update_priority(show_id, edit_id, field_id, input_value){
|
||||
var re = /^[0-9]*[1-9]*[0-9]$/
|
||||
if(re.test(input_value) && $(show_id).html().trim() != input_value.trim() && input_value.trim() != ''){
|
||||
if(confirm("确定修改为" + input_value + "?")){
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/update_priority?priority=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/update_priority?priority=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$(edit_id).find("input").val($(show_id).html().trim());
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</li>
|
||||
<li class=" mb5 ml80">
|
||||
<label >公开 :</label>
|
||||
<input id="organization_is_public" name="organization[is_public]" onblur="disable_down($(this), $('#organization_alow_download'), $('#allow_down_hint'));" type="checkbox" value="1" checked="checked">
|
||||
<input id="organization_is_public" name="organization[is_public]" onclick="disable_down($(this), $('#organization_alow_download'), $('#allow_down_hint'));" type="checkbox" value="1" checked="checked">
|
||||
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()+"&config_page=Y" + "&org_id="+id
|
||||
)
|
||||
}
|
||||
function update_org(id){
|
||||
check_uniq(id);
|
||||
function update_org(id, old_value, input_value){
|
||||
if (old_value == input_value)
|
||||
{
|
||||
check_uniq(id);
|
||||
}
|
||||
if( $checkName){
|
||||
$("#edit_organization_"+id).submit();
|
||||
}
|
||||
|
@ -57,7 +60,7 @@
|
|||
<div style="margin-left: 80px " id="check_desc_hint"></div>
|
||||
<div class="orgRow mb10"><span class="ml10">组织URL:</span>
|
||||
<div class="w607 fr">http://
|
||||
<input type="text" name="organization[domain]" id="domain" value="<%= domain.nil? ? '' : domain.subname %>" class="orgUrlInput" />
|
||||
<input type="text" name="organization[domain]" id="domain" value="<%= domain.nil? ? '' : domain.subname %>" class="orgUrlInput" onfocus="observe_input_to_lowercase($(this));" />
|
||||
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
|
||||
<% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %>
|
||||
<% if domain.present? and record.present? and record.content == domain.subname %>
|
||||
|
@ -77,7 +80,7 @@
|
|||
<span>允许游客下载</span>
|
||||
<span class="c_green f12" id="allow_down_hint"><%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %></span>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org(<%=@organization.id %>);">保存</a>
|
||||
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="undis ml15 mr15" id="orgContent_2">
|
||||
|
@ -96,7 +99,7 @@
|
|||
<p class="fontBlue fb mb5">添加成员</p>
|
||||
<%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%>
|
||||
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %>
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<div id="principals_for_new_member">
|
||||
<%= find_user_not_in_current_org_by_name(@project) %>
|
||||
</div>
|
||||
|
@ -129,9 +132,9 @@
|
|||
<div class="mb5">
|
||||
<p class="fontGrey3"><span class="fb">域名目录</span>(用户自定义url,可选)</p>
|
||||
<% if domain %>
|
||||
<span class="fl"><%= domain.subname %>.trustie.net/</span><input class="fl personalUrl ml3" type="text" name="sub_dir">
|
||||
<span class="fl"><%= domain.subname %>.trustie.net/</span><input id="sub_dir" class="fl personalUrl ml3" type="text" name="sub_dir" onfocus="observe_input_to_lowercase($(this));">
|
||||
<% else %>
|
||||
<span class="fl">您还没有子域名,请先在左侧信息栏申请子域名</span>
|
||||
<span class="fl" style="width:195px;">您还没有子域名,请先在左侧信息栏申请子域名</span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -195,12 +198,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
// $(document).ready(function(){
|
||||
// if ( $("#is_public").attr("checked") != true){
|
||||
// alert($(this).attr("checked"));
|
||||
// $("#allow_download").attr("checked", false);
|
||||
// $("#allow_download").attr("disabled", true);
|
||||
// $("#allow_down_hint").html("");
|
||||
// }
|
||||
// });
|
||||
//输入子域名或者二级目录,自动将输入换成小写
|
||||
function observe_input_to_lowercase(id){
|
||||
$(id).each(function(){
|
||||
var $this = $(this);
|
||||
var old_input = $this.val();
|
||||
var check=function(){
|
||||
var val = $this.val();
|
||||
if ( old_input != val){
|
||||
$this.val(val.toLowerCase());
|
||||
old_input = val.toLowerCase();
|
||||
}
|
||||
};
|
||||
var reset = function() {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
};
|
||||
var timer = setInterval(check, 300);
|
||||
$this.bind('blur', reset);
|
||||
});
|
||||
}
|
||||
</script>
|
|
@ -59,7 +59,7 @@
|
|||
<% if x["status"].to_i != 0 %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width150"><pre><%=x["result"]%></pre></span>
|
||||
<span class="width150"><pre><%=x["result"].force_encoding("UTF-8")%></pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="width150"><pre><%=x["output"]%></pre></span>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -46,45 +46,43 @@
|
|||
<% end%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
<% if !@is_evaluation && !@is_teacher %>
|
||||
<% work = @homework.student_works.where("user_id = ?",User.current.id).first %>
|
||||
<% elsif !@message_student_work_id.nil? %>
|
||||
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>
|
||||
<% end %>
|
||||
<% unless work.nil? %>
|
||||
<% if @homework.homework_type == 2 %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) %>
|
||||
<% work= params[:show_work_id].nil? ? @homework.student_works.where("user_id = ?",User.current.id).first : StudentWork.find(params[:show_work_id]) %>
|
||||
<% unless work.nil? %>
|
||||
<% if @homework.homework_type == 2 %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
|
||||
var program_name = "text/x-csrc";
|
||||
var language = <%= @homework.language %>;
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
var editor = CodeMirror(document.getElementById("work-code_<%= work.id%>"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
value: $("#work-src_<%= work.id%>").text()
|
||||
});
|
||||
<% elsif @homework.homework_type == 1 %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% elsif @homework.homework_type == 3 %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% if pro && pro.student_work_id == work.id %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
||||
var program_name = "text/x-csrc";
|
||||
var language = <%= @homework.language %>;
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
var editor = CodeMirror(document.getElementById("work-code_<%= work.id%>"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
value: $("#work-src_<%= work.id%>").text()
|
||||
});
|
||||
<% elsif @homework.homework_type == 1 %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% elsif @homework.homework_type == 3 %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% if pro && pro.student_work_id == work.id %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
||||
<% end %>
|
||||
<% end %>
|
||||
});
|
||||
</script>
|
|
@ -54,56 +54,64 @@
|
|||
sd_create_editor_from_data(<%= user_activity.id %>, null, "100%", "<%= user_activity.class.to_s %>");
|
||||
});
|
||||
</script>
|
||||
<% unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% act= user_activity.act %>
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<% when 'Course'%>
|
||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Principal' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
|
||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>1} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Blog'%>
|
||||
<%if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'BlogComment' %>
|
||||
<%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => user_activity,:user_activity_id =>user_activity.id} %>
|
||||
<% else %>
|
||||
<% act= user_activity.act %>
|
||||
<%if act %>
|
||||
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<% cache (act) do %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %>
|
||||
<% end %>
|
||||
<% when 'News' %>
|
||||
<% cache [act, act.comments.count] do %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<% when 'Course'%>
|
||||
<% cache (act) do %>
|
||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %>
|
||||
<%end%>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<% cache [act, act.journals.count, act.attachments.count] do%>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
|
||||
<% end %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<% cache (act) do %>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Principal' %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
|
||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>1} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Blog'%>
|
||||
<% cache (act) do %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'BlogComment' %>
|
||||
<%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if user_activities.count == 10%>
|
||||
|
|
|
@ -9,6 +9,13 @@
|
|||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.course_message.title %></p>
|
||||
<% unless ma.course_message.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -22,6 +29,13 @@
|
|||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>评论对象:</strong><%= ma.course_message.commented.title %></p>
|
||||
<% unless ma.course_message.comments.nil? %>
|
||||
<div class="fl"><strong>评论内容:</strong></div>
|
||||
<div class="ml60"><%= ma.course_message.comments.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -44,6 +58,43 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
<% end %>
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if User.current.allowed_to?(:as_teacher,ma.course_message.course) %>
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %>老师您好!
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.show_name + "老师")%>刚刚发布了一个作业:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>
|
||||
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red"><%= ma.course_message.name %></span></li>
|
||||
<li>发布时间:<span style="color:Red;"><%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M').to_s %></span></li>
|
||||
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %> 23:59</span></li>
|
||||
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59</span></li>
|
||||
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59</span></li>
|
||||
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
|
||||
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
|
||||
</ul>
|
||||
<p>
|
||||
您可以修改作业内容、评分规则、匿评过程等,谢谢!
|
||||
</p>
|
||||
<% else %>
|
||||
<p><%= User.current.lastname + User.current.firstname %>同学您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>
|
||||
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
|
||||
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %> 23:59</span></li>
|
||||
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59</span></li>
|
||||
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59</span></li>
|
||||
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
|
||||
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
|
||||
</ul>
|
||||
<p>
|
||||
请抓紧时间提交您的作品,谢谢!
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -59,6 +110,24 @@
|
|||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% 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 %>老师发布的作业截止日期快到了:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
|
||||
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %> 23:59</span></li>
|
||||
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59</span></li>
|
||||
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59</span></li>
|
||||
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
|
||||
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
|
||||
<p>请抓紧时间提交您的作品,谢谢!</p>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl"> 截止时间快到啦</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
@ -79,6 +148,22 @@
|
|||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</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,ma.course_message.course) ? '老师' : '同学' %>您好!
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>开启了匿评,作业详情如下:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
|
||||
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
|
||||
<li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59</span></li>
|
||||
</ul>
|
||||
<% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%>
|
||||
<p>请您尽早完成匿评,如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p>
|
||||
<p>例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分</p>
|
||||
<% end%>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -94,6 +179,22 @@
|
|||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))"%>-->
|
||||
</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,ma.course_message.course) ? '老师':'同学'%>您好!
|
||||
该作业已经关闭了匿评。作业信息如下:
|
||||
</p>
|
||||
<ul class="ul_grey">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>作业标题:<%= ma.course_message.name %></li>
|
||||
</ul>
|
||||
<p></p>
|
||||
<p class="c_red">注:缺省情况下,系统将在作业提交截止日期后14天自动关闭匿评。</p>
|
||||
<p></p>
|
||||
<% if User.current.allowed_to?(:as_teacher,ma.course_message.course)%>
|
||||
<p>祝您的教学活动高效、顺利、愉快!</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -113,6 +214,18 @@
|
|||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</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, ma.course_message.course) ? '老师':'同学'%>您好!
|
||||
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败啦
|
||||
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
|
||||
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time%> 23:59</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -127,6 +240,9 @@
|
|||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.polls_name %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -136,13 +252,37 @@
|
|||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
|
||||
<%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %></span></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.subject, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<% if ma.course_message.parent_id.nil? %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.subject, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.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><strong>主题:</strong><%= ma.course_message.subject %></p>
|
||||
<% unless ma.course_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.content.html_safe, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.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><strong>主题:</strong><%= ma.course_message.subject %></p>
|
||||
<% unless ma.course_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.course_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "StudentWorksScore" %>
|
||||
|
@ -167,14 +307,33 @@
|
|||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<% unless ma.content.nil? %>
|
||||
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id, :student_work_id => ma.course_message.student_work),
|
||||
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.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.show_name %>同学您好!
|
||||
<%= ma.course_message.reviewer_role == 3? "匿名用户" : (ma.course_message.user.show_name + "老师")%><%= ma.status == 0? "评阅了您的作品":"重新评阅了您的作品"%>。详情如下:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red;"><%=ma.course_message.student_work.homework_common.name %></span></li>
|
||||
<% content = ma.content.gsub("作业评分:","").split(" 评语:")%>
|
||||
<li>作品评分:<span style="color:Red;"><%= content[0] %>分</span></li>
|
||||
<% if content.size > 1 %>
|
||||
<div class="fl" style="width:74px;"><li>作品评语:</li></div>
|
||||
<div style="margin-left:74px"><span style="color:Red;"><%= content[1] %></span></div>
|
||||
<% end %>
|
||||
</ul>
|
||||
<p>
|
||||
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 23:59结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步!
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "JournalsForMessage" %>
|
||||
<% if ma.course_message.jour_type == 'Course' %>
|
||||
|
@ -193,6 +352,9 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.notes.html_safe %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -208,11 +370,23 @@
|
|||
<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.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id, :student_work_id => ma.course_message.jour.student_work), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_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.show_name %>老师您好!
|
||||
<%= ma.course_message.user.show_name%><%= ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"%>回复了您的作品评论。详情如下:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>回复内容:<span style="color:red;"><%= ma.course_message.notes %></span></li>
|
||||
<li>您的评论:<span style="color:red;"><%= ma.course_message.jour.comment %></span></li>
|
||||
<li>课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)</li>
|
||||
<li>作业标题:<span style="color:Red;"><%=ma.course_message.jour.student_work.homework_common.name %></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -232,10 +406,46 @@
|
|||
<!--: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,ma.course_message.homework_common.course) ? '老师':'同学'%>您好!由于迟交作业,您及您的作品都不能参与以下作业的匿评。作业详情如下:
|
||||
</p>
|
||||
<ul class="ul_grey">
|
||||
<li>课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)</li>
|
||||
<li>作业标题:<%= ma.course_message.homework_common.name %></li>
|
||||
<li>提交截止:<%= ma.course_message.homework_common.end_time %> 23:59</li>
|
||||
<li>提交时间:<%= format_time(ma.course_message.created_at) %></li>
|
||||
<li>迟交扣分:<%= ma.course_message.homework_common.late_penalty %>分</li>
|
||||
</ul>
|
||||
<p>如需获得最终成绩,请您联系主讲老师对您的作品进行单独评分!</p>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl"> 您成功提交了作品(但被标记为迟交啦)</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if ma.course_message_type == "StudentWork" && ma.status == 1 %>
|
||||
<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" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">重新提交了作品:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<%#= link_to truncate(ma.course_message.name,:length=>25)+'(失败原因:提交作品的人数低于2人)', student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "c_red" : "newsGrey "}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!-- 创建课程消息 -->
|
||||
<% if ma.course_message_type == "Course" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
|
@ -252,6 +462,23 @@
|
|||
<!--: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>
|
||||
<p>课程ID:<span style="color:red;"><%= ma.course_message.id %></span></p>
|
||||
<p>课程密码:<span style="color:red;"><%= ma.course_message.password %></span></p>
|
||||
<p>学时总数:<%= ma.course_message.class_period %></p>
|
||||
<p>创建时间:<%= format_time(ma.course_message.created_at) %></p>
|
||||
<p>您可以点击左上角的“配置”按钮,修改课程基本信息,添加及删除课程成员。您也可以把课程ID及密码告诉学生和其他成员,让他们输入ID及密码加入课程。</p>
|
||||
<% if ma.course_message.is_public %>
|
||||
<p>您的课程是公开的,所有人都能访问您的课程。若不想设置为公开,您可以在配置中设置。</p>
|
||||
<% else %>
|
||||
<p>您的课程是私有的,非课程成员不能访问您的课程。如果想设置为公开,您可以在配置中设置。</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -269,6 +496,16 @@
|
|||
<!--: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>真实姓名:<%= User.find(ma.course_message_id).realname %></p>
|
||||
<p>申请课程:<%= Course.find(ma.course_id).name%></p>
|
||||
<div class="fl">课程描述:</div>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe %></div>
|
||||
<p>申请职位:<%= ma.content == '9' ? "教师" : "教辅"%></p>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<span id="deal_info_<%=ma.id%>">
|
||||
<% if ma.status == 0 || ma.status.nil?%>
|
||||
|
@ -304,6 +541,15 @@
|
|||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %>老师您好!您已成功加入课程<%= Course.find(ma.course_id).name%>。
|
||||
</p>
|
||||
<p>申请课程:<%= Course.find(ma.course_id).name%></p>
|
||||
<div class="fl">课程描述:</div>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe %></div>
|
||||
<p>申请职位:<%= ma.content == '9' ? "教师" : "教辅"%></p>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -324,6 +570,20 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
|
||||
<% teacher = User.find(ma.course_message_id) %>
|
||||
<p><%= teacher.show_name %>(<%= teacher %>)老师把您加入了课程,详情如下:</p>
|
||||
<p>课程名称:<%= ma.course.name %></p>
|
||||
<p>开课学期:<%= ma.course.time.to_s + '年'+ ma.course.term %></p>
|
||||
<p>课程ID:<%= ma.course.id %></p>
|
||||
<p>课时总数:<%= ma.course.class_period %></p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有课程,非课程成员没有权限访问私有课程
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -344,6 +604,20 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
|
||||
<p>您增加了新的课程成员,详情如下:</p>
|
||||
<p>成员:<%= User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")" %></p>
|
||||
<p>课程名称:<%= ma.course.name %></p>
|
||||
<p>开课学期:<%= ma.course.time.to_s + '年'+ ma.course.term %></p>
|
||||
<p>课程ID:<%= ma.course.id %></p>
|
||||
<p>课时总数:<%= ma.course.class_period %></p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有课程,非课程成员没有权限访问私有课程
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -364,6 +638,21 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.course.is_public? || User.current.member_of?(ma.course) || User.current.admin? %>
|
||||
<p>您已被<%= User.find(ma.course_message_id).show_name %>老师移出了课程,详情如下:</p>
|
||||
<p>课程名称:<%= ma.course.name %></p>
|
||||
<p>开课学期:<%= ma.course.time.to_s + '年'+ ma.course.term %></p>
|
||||
<% if !ma.content.nil? %>
|
||||
<p>担任角色:<%= ma.content %></p>
|
||||
<% end %>
|
||||
<p>学时总数:<%= ma.course.class_period %></p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有课程,非课程成员没有权限访问私有课程
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -380,6 +669,27 @@
|
|||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))"%>-->
|
||||
</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,ma.course_message.course) ? '老师':'同学'%>您好!
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布了课程测验 ,测验详情如下:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>测验标题:<%= ma.course_message.exercise_name %></li>
|
||||
<!--<li>测验描述:<%#= ma.course_message.exercise_description %></li>-->
|
||||
<!--<li>测验状态:<%#= ma.course_message.exercise_status == 1 ? '未发布':'已发布'%></li>-->
|
||||
<!--<%# if ma.course_message.publish_time %>-->
|
||||
<!--<li>发布时间:<%#= ma.course_message.publish_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>-->
|
||||
<!--<%# end %>-->
|
||||
<li>截止时间:<%= ma.course_message.end_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>
|
||||
<li>答题时长:<%= ma.course_message.time == -1 ? '不限时' : ma.course_message.time.to_s + '分钟' %></li>
|
||||
<% if !User.current.allowed_to?(:as_teacher,ma.course_message.course)%>
|
||||
<p>请记得在截止时间前完成测验噢,辛苦啦!</p>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -395,7 +705,23 @@
|
|||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))"%>-->
|
||||
|
||||
</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,ma.course_message.course) ? '老师':'同学'%>您好!
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布的课程测验截止时间快到了,测验详情如下:
|
||||
</p>
|
||||
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>测验标题:<%= ma.course_message.exercise_name %></li>
|
||||
<li>截止时间:<%= ma.course_message.end_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>
|
||||
<li>答题时长:<%= ma.course_message.time == -1 ? '无限制' : ma.course_message.time.to_s + '分钟' %></li>
|
||||
<p>请及时完成课程测验,辛苦啦!</p>
|
||||
</ul>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl">截止时间快到啦 </li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||
<li><%= link_to "课程留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
</ul>
|
||||
|
@ -30,7 +31,7 @@
|
|||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">更多</li>
|
||||
<li class="mt-4"><%= link_to "留言动态", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
</ul>
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
class ChangeDomainNameToLowercase < ActiveRecord::Migration
|
||||
def up
|
||||
Secdomain.all.each do |domain|
|
||||
domain.update_attribute(:subname, domain.subname.downcase)
|
||||
end
|
||||
|
||||
SubfieldSubdomainDir.all.each do |dir|
|
||||
dir.update_attribute(:name, dir.name.downcase)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -54,7 +54,7 @@ function nh_check_field(params){
|
|||
params.content.sync();
|
||||
|
||||
if(params.content.isEmpty()){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.html('请输入文章描述');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
}else{
|
||||
params.contentmsg.html('填写正确');
|
||||
|
@ -131,7 +131,7 @@ function init_des_data(){
|
|||
});
|
||||
params.submit_btn.click(function () {
|
||||
params.editor.sync();
|
||||
params.form[0].submit();
|
||||
params.form.submit();
|
||||
});
|
||||
params.textarea.data('init', 1);
|
||||
$(this).show();
|
||||
|
|
|
@ -419,6 +419,7 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
|
||||
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
|
||||
.list_style ul li{list-style-type: disc;margin-left: 20px;}
|
||||
span.author { font-size: 0.9em; color: #888; }
|
||||
|
||||
/* 创建作品 work */
|
||||
.Newwork{ width:668px; height:418px;}
|
||||
|
|
|
@ -99,6 +99,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.mr40{ margin-right:40px !important;}
|
||||
.mr65 {margin-right: 65px;}
|
||||
.mw20{ margin: 0 20px;}
|
||||
.mw380 {max-width: 380px !important;}
|
||||
.mw400 {max-width: 400px !important;}
|
||||
.mt-20 {margin-top:-20px;}
|
||||
.mt-4 {margin-top: -4px;}
|
||||
|
|
|
@ -180,6 +180,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.h150{ height:150px;}
|
||||
.p10 {padding-left:10px; padding-right:10px;}
|
||||
.mw360 {max-width: 360px !important;}
|
||||
.mw380 {max-width: 380px !important;}
|
||||
.mw400 {max-width: 400px !important;}
|
||||
.mh18 {max-height: 18px;}
|
||||
|
||||
|
@ -1136,4 +1137,4 @@ a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repea
|
|||
.mediaIco{margin: 30px 0 30px 20px;width: 200px;}
|
||||
/*排序样式*/
|
||||
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
||||
|
|
Loading…
Reference in New Issue