Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq
This commit is contained in:
commit
276653d9a2
|
@ -395,4 +395,74 @@ class AdminController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
#留言列表
|
||||
def leave_messages
|
||||
@jour = JournalsForMessage.where("jour_type = 'Principal' or jour_type = 'Course'").reorder('created_on desc')
|
||||
case params[:format]
|
||||
when 'xml', 'json'
|
||||
@offset, @limit = api_offset_and_limit({:limit => 30})
|
||||
else
|
||||
@limit = 30#per_page_option
|
||||
end
|
||||
|
||||
@jour_count = @jour.count
|
||||
@jour_pages = Paginator.new @jour_count, @limit, params['page']
|
||||
@offset ||= @jour_pages.offset
|
||||
@jour = @jour.limit(@limit).offset(@offset).all
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#帖子
|
||||
def messages_list
|
||||
@memo = Memo.reorder("created_at desc")
|
||||
|
||||
=begin
|
||||
case params[:format]
|
||||
when 'xml', 'json'
|
||||
@offset, @limit = api_offset_and_limit({:limit => 30})
|
||||
else
|
||||
@limit = 30#per_page_option
|
||||
end
|
||||
|
||||
@memo_count = @memo.count
|
||||
@memo_pages = Paginator.new @memo_count, @limit, params['page']
|
||||
@offset ||= @memo_pages.offset
|
||||
@memo = @memo.limit(@limit).offset(@offset).all
|
||||
=end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#课程讨论区的帖子
|
||||
def course_messages
|
||||
#@boards=Board.where('course_id is NULL')
|
||||
#@course_ms = Message.reorder('created_on desc')
|
||||
@course_ms=Message.joins("join boards on messages.board_id=boards.id where boards.course_id is not NULL").reorder('created_on desc')
|
||||
end
|
||||
|
||||
#项目讨论区的帖子
|
||||
def project_messages
|
||||
@project_ms=Message.joins("join boards on messages.board_id=boards.id where boards.project_id != -1").reorder('created_on desc')
|
||||
end
|
||||
|
||||
#通知
|
||||
def notices
|
||||
@news = News.where('course_id is not NULL').order('created_on desc')
|
||||
end
|
||||
|
||||
#最近登录用户列表
|
||||
def latest_login_users
|
||||
@user = User.order('last_login_on desc')
|
||||
end
|
||||
|
||||
#作业
|
||||
def homework
|
||||
@homework = HomeworkCommon.order('end_time desc')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -106,74 +106,17 @@ class CoursesController < ApplicationController
|
|||
# 课程搜索
|
||||
# add by nwb
|
||||
def search
|
||||
courses_all = Course.all_course
|
||||
name = params[:name]
|
||||
if name.blank?
|
||||
@courses = []
|
||||
@courses_all = []
|
||||
@course_count = 0
|
||||
@course_pages = Paginator.new @course_count, per_page_option, params['page']
|
||||
if params[:name].empty?
|
||||
courses = Course.visible
|
||||
@courses = paginateHelper courses,10
|
||||
else
|
||||
@courses = courses_all.visible
|
||||
if params[:name].present?
|
||||
@courses_all = @courses.like(params[:name])
|
||||
else
|
||||
@courses_all = @courses;
|
||||
end
|
||||
@course_count = @courses_all.count
|
||||
@course_pages = Paginator.new @course_count, per_page_option, params['page']
|
||||
|
||||
# 课程的动态数
|
||||
# @course_activity_count=Hash.new
|
||||
# @courses_all.each do |course|
|
||||
# @course_activity_count[course.id]=0
|
||||
# end
|
||||
#
|
||||
# case params[:course_sort_type]
|
||||
# when '0'
|
||||
# @courses = @courses_all.order("created_at desc")
|
||||
# @s_type = 0
|
||||
# @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
#
|
||||
# @course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#
|
||||
# when '1'
|
||||
# @courses = @courses_all.order("course_ac_para desc")
|
||||
# @s_type = 1
|
||||
# @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
#
|
||||
# @course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#
|
||||
# when '2'
|
||||
# @courses = @courses_all.order("watchers_count desc")
|
||||
# @s_type = 2
|
||||
# @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
#
|
||||
# @course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#
|
||||
# when '3'
|
||||
# @course_activity_count=get_course_activity @courses_all,@course_activity_count_array
|
||||
# @courses=handle_course @courses_all,@course_activity_count
|
||||
# @s_type = 3
|
||||
# @courses = @courses[@course_pages.offset, @course_pages.per_page]
|
||||
#
|
||||
# else
|
||||
# @s_type = 0
|
||||
# @courses = @courses_all.order("created_at desc")
|
||||
# @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
#
|
||||
# @course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#
|
||||
# end
|
||||
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'")
|
||||
@courses = paginateHelper courses,10
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'course_base'
|
||||
scope = Course
|
||||
unless params[:closed]
|
||||
scope = scope.active
|
||||
end
|
||||
}
|
||||
format.atom {
|
||||
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
|
||||
|
|
|
@ -19,28 +19,28 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
# @homework_type = "1"
|
||||
#
|
||||
# @homework = HomeworkCommon.new
|
||||
# @homework.safe_attributes = params[:homework_common]
|
||||
# @homework.late_penalty = 2
|
||||
# @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
# @homework.publish_time = Time.now.strftime('%Y-%m-%d')
|
||||
#
|
||||
# if @homework_type == "1"
|
||||
# #匿评作业相关属性
|
||||
# @homework_detail_manual = HomeworkDetailManual.new
|
||||
# @homework_detail_manual.ta_proportion = 0.6
|
||||
# @homework_detail_manual.absence_penalty = 2
|
||||
# @homework_detail_manual.evaluation_num = 3
|
||||
# @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
|
||||
# @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
# @homework.homework_detail_manual = @homework_detail_manual
|
||||
# elsif @homework_type == "2"
|
||||
# #编程作业相关属性
|
||||
# @homework_detail_programing = HomeworkDetailPrograming.new
|
||||
# @homework.homework_detail_programing = @homework_detail_programing
|
||||
# end
|
||||
@homework_type = "1"
|
||||
|
||||
@homework = HomeworkCommon.new
|
||||
@homework.safe_attributes = params[:homework_common]
|
||||
@homework.late_penalty = 2
|
||||
@homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
@homework.publish_time = Time.now.strftime('%Y-%m-%d')
|
||||
|
||||
if @homework_type == "1"
|
||||
#匿评作业相关属性
|
||||
@homework_detail_manual = HomeworkDetailManual.new
|
||||
@homework_detail_manual.ta_proportion = 0.6
|
||||
@homework_detail_manual.absence_penalty = 2
|
||||
@homework_detail_manual.evaluation_num = 3
|
||||
@homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
|
||||
@homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
@homework.homework_detail_manual = @homework_detail_manual
|
||||
elsif @homework_type == "2"
|
||||
#编程作业相关属性
|
||||
@homework_detail_programing = HomeworkDetailPrograming.new
|
||||
@homework.homework_detail_programing = @homework_detail_programing
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
|
|
|
@ -104,24 +104,24 @@ class UsersController < ApplicationController
|
|||
end
|
||||
# 当前用户查看消息,则设置消息为已读
|
||||
querys = @user.course_messages
|
||||
if User.current.id == @user.id
|
||||
querys.update_all(:viewed => true)
|
||||
end
|
||||
# if User.current.id == @user.id
|
||||
# querys.update_all(:viewed => true)
|
||||
# end
|
||||
if @user.course_messages
|
||||
if params[:type].nil?
|
||||
@user_course_messages = @user.course_messages
|
||||
@user_project_messges = @user.forge_messages
|
||||
@user_course_messages = @user.course_messages.reverse
|
||||
@user_project_messges = @user.forge_messages.reverse
|
||||
else
|
||||
case params[:type]
|
||||
when 'homework'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "HomeworkCommon"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "HomeworkCommon"}
|
||||
#@user_course_messages = ForgeMessage.find_by_sql("select * from course_messages where user_id='#{@user.id}' and course_message_type = 'HomeworkCommon' order by created_at desc;")
|
||||
when 'message'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "Message"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "Message"}
|
||||
when 'news'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "News"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "News"}
|
||||
when 'poll'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "Poll"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "Poll"}
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
|
|
@ -704,7 +704,7 @@ module CoursesHelper
|
|||
url = course_feedback_path(activity.course)
|
||||
when "Poll"
|
||||
title = "问卷 " + activity.course_act.polls_name
|
||||
url = poll_index_path(:polls_type => "Course", :polls_group_id => activity.course_id)
|
||||
url = poll_path(activity.course_act_id)
|
||||
end
|
||||
end
|
||||
link_to title.gsub(/<(?!img)[^>]*>/,'').html_safe, url, :class => "problem_tit c_dblue fl fb"
|
||||
|
|
|
@ -10,6 +10,7 @@ class Poll < ActiveRecord::Base
|
|||
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
|
||||
# 课程动态
|
||||
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
|
||||
after_create :act_as_activity, :act_as_course_activity
|
||||
# 课程消息
|
||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message
|
||||
|
@ -34,7 +35,11 @@ class Poll < ActiveRecord::Base
|
|||
#课程动态公共表记录
|
||||
def act_as_course_activity
|
||||
if self.polls_type == "Course"
|
||||
self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.polls_group_id)
|
||||
if self.polls_status == 2 #问卷是发布状态
|
||||
self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.polls_group_id)
|
||||
elsif self.polls_status == 1 #问卷是新建状态
|
||||
self.course_acts.destroy_all
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to l(:label_forum), {:action => 'messages_list'}, class: "#{current_page?(messages_list_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to l(:label_borad_course), {:action => 'course_messages'}, class: "#{current_page?(course_messages_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to l(:label_borad_project), {:action => 'project_messages'}, class: "#{current_page?(project_messages_path)? 'selected' : nil }" %></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
|
@ -0,0 +1,66 @@
|
|||
<h3>
|
||||
<%=l(:label_message_plural)%>
|
||||
</h3>
|
||||
|
||||
<%= render 'tab_messages' %>
|
||||
<h4><%=l(:label_borad_course) %></h4>
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
来源
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
作者
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
时间
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
标题
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
回复数
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @count=0%>
|
||||
<% for course in @course_ms -%>
|
||||
|
||||
<% @count=@count + 1 %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= @count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= Board.where('id=?',course.board_id).first.course_id %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if course.try(:author).try(:realname) == ' '%><%= course.try(:author)%><% else %><%=course.try(:author).try(:realname) %><% end %>'>
|
||||
<% if course.try(:author).try(:realname) == ' '%>
|
||||
<%= link_to(course.try(:author), user_path(course.author)) %>
|
||||
<% else %>
|
||||
<%= link_to(course.try(:author).try(:realname), user_path(course.author)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_on) %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title='<%=course.subject %>'>
|
||||
<%= course.subject %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%=course.replies_count %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_message_plural)) -%>
|
|
@ -0,0 +1,62 @@
|
|||
<h3>
|
||||
<%=l(:label_user_homework)%>
|
||||
</h3>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
作业名称
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名称
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
作者
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
提交作品数
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
提交截止日期
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%@count=0 %>
|
||||
<% for homework in @homework do %>
|
||||
<% @count+=1 %>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<%=@count %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=homework.name%>'>
|
||||
<%=link_to(homework.name, student_work_index_path(:homework => homework.id))%>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=homework.course.name%>'>
|
||||
<%= link_to(homework.course.name, course_path(homework.course.id)) %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if homework.try(:user).try(:realname) == ' '%><%= homework.try(:user)%><% else %><%=homework.try(:user).try(:realname) %><% end %>'>
|
||||
<% if homework.try(:user).try(:realname) == ' '%>
|
||||
<%= link_to(homework.try(:user), user_path(homework.user_id)) %>
|
||||
<% else %>
|
||||
<%= link_to(homework.try(:user).try(:realname), user_path(homework.user_id)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=StudentWork.where('homework_common_id=?',homework.id).count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=format_date(homework.end_time) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_user_homework)) -%>
|
|
@ -0,0 +1,73 @@
|
|||
<h3>
|
||||
<%=l(:label_latest_login_user_list)%>
|
||||
</h3>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
登录时间
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
用户id
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
用户姓名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
用户昵称
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
用户身份
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @count=0 %>
|
||||
<% for user in @user do %>
|
||||
<tr>
|
||||
<% @count +=1 %>
|
||||
<td align="center">
|
||||
<%=@count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=format_date(user.last_login_on) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=user.id %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if user.try(:realname) == ' '%><%= user.login%><% else %><%=user.try(:realname) %><% end %>'>
|
||||
<% if user.try(:realname) == ' '%>
|
||||
<%= link_to(user.login, user_path(user)) %>
|
||||
<% else %>
|
||||
<%= link_to(user.try(:realname), user_path(user)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=link_to(user.login, user_path(user)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<% case user.user_extensions.identity %>
|
||||
<% when 0 %>
|
||||
<%='老师' %>
|
||||
<% when 1 %>
|
||||
<%='学生' %>
|
||||
<% when 2 %>
|
||||
<%='企业' %>
|
||||
<% when 3 %>
|
||||
<%='开发者' %>
|
||||
<% else %>
|
||||
<%='未知身份' %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_latest_login_user_list)) -%>
|
|
@ -0,0 +1,79 @@
|
|||
<h3>
|
||||
<%=l(:label_leave_message_list)%>
|
||||
</h3>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
类型
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
来源
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
留言人
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
留言时间
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
留言内容
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
回复数
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @count=0%>
|
||||
<% for journal in @jour -%>
|
||||
<% @count=@count + 1 %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= @count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%case journal.jour_type %>
|
||||
<% when 'Principal' %>
|
||||
<%='用户主页' %>
|
||||
<% when 'Course' %>
|
||||
<%='课程' %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= journal.jour_id %>
|
||||
</td>
|
||||
<td align="center" title='<%= journal.try(:user).try(:realname)%>'>
|
||||
<%= link_to(journal.try(:user).try(:realname).truncate(6, omission: '...'), user_path(journal.user)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(journal.created_on) %>
|
||||
</td>
|
||||
<td title='<%=journal.notes %>'>
|
||||
<%= journal.notes.truncate(15, omission: '...') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% if(journal.m_reply_count) %>
|
||||
<%=journal.m_reply_count%>
|
||||
<% else %>
|
||||
<%=0 %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @jour_pages, @jour_count %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_leave_message_list)) -%>
|
|
@ -0,0 +1,69 @@
|
|||
<h3>
|
||||
<%=l(:label_message_plural)%>
|
||||
</h3>
|
||||
|
||||
<%= render 'tab_messages' %>
|
||||
<h4><%=l(:label_forum) %></h4>
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
来源
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
作者
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
时间
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
标题
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
回复数
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @count=0%>
|
||||
<% for memo in @memo -%>
|
||||
<% @count=@count + 1 %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= @count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= memo.forum_id %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if memo.try(:author).try(:realname) == ' '%><%= memo.try(:author)%><% else %><%=memo.try(:author).try(:realname) %><% end %>'>
|
||||
<% if memo.try(:author).try(:realname) == ' '%>
|
||||
<%= link_to(memo.try(:author), user_path(memo.author)) %>
|
||||
<% else %>
|
||||
<%= link_to(memo.try(:author).try(:realname), user_path(memo.author)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(memo.created_at) %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title='<%=memo.subject %>'>
|
||||
<%= memo.subject %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%=memo.replies_count %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--<div class="pagination">
|
||||
<ul>
|
||||
<#%= pagination_links_full @memo_pages, @memo_count %>
|
||||
</ul>
|
||||
</div>-->
|
||||
|
||||
<% html_title(l(:label_message_plural)) -%>
|
|
@ -0,0 +1,74 @@
|
|||
<h3>
|
||||
<%=l(:label_notification_list)%>
|
||||
</h3>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
课程id
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名称
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
作者
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
时间
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
标题
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
回复数
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @count=0%>
|
||||
<% for news in @news -%>
|
||||
<% @count=@count + 1 %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= @count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=news.course_id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title="<%=news.course.name %>">
|
||||
<%=link_to(news.course.name, course_path(news.course)) %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title="<%=news.course.try(:teacher).try(:realname) %>">
|
||||
<%=link_to(news.course.try(:teacher).try(:realname), user_path(news.course.teacher)) %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if news.try(:author).try(:realname) == ' '%><%= news.try(:author)%><% else %><%=news.try(:author).try(:realname) %><% end %>'>
|
||||
<% if news.try(:author).try(:realname) == ' '%>
|
||||
<%= link_to(news.try(:author), user_path(news.author)) %>
|
||||
<% else %>
|
||||
<%= link_to(news.try(:author).try(:realname), user_path(news.author)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(news.created_on) %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=news.title %>'>
|
||||
<%= link_to(news.title, news_path(news)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%=news.comments_count %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_notification_list)) -%>
|
|
@ -0,0 +1,66 @@
|
|||
<h3>
|
||||
<%=l(:label_message_plural)%>
|
||||
</h3>
|
||||
|
||||
<%= render 'tab_messages' %>
|
||||
<h4><%=l(:label_borad_project) %></h4>
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
来源
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
作者
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
时间
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
标题
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
回复数
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @count=0%>
|
||||
<% for project in @project_ms -%>
|
||||
|
||||
<% @count=@count + 1 %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= @count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= Board.where('id=?',project.board_id).first.project_id %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if project.try(:author).try(:realname) == ' '%><%= project.try(:author)%><% else %><%=project.try(:author).try(:realname) %><% end %>'>
|
||||
<% if project.try(:author).try(:realname) == ' '%>
|
||||
<%= link_to(project.try(:author), user_path(project.author)) %>
|
||||
<% else %>
|
||||
<%= link_to(project.try(:author).try(:realname), user_path(project.author)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(project.created_on) %>
|
||||
</td>
|
||||
<td title='<%=project.subject %>' style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name">
|
||||
<%= project.subject %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%=project.replies_count %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_message_plural)) -%>
|
|
@ -1,7 +1,7 @@
|
|||
<%= error_messages_for @board %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p style="width:666;">
|
||||
<p style="width:666px;">
|
||||
<%= f.text_field :name, :required => true %>
|
||||
</p><!--by young-->
|
||||
<p>
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
<style type="text/css">
|
||||
div.talk_new .ke-container{margin-left:2px;}
|
||||
/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||
div.ke-toolbar .ke-outline{border:none;}*/
|
||||
.break_word {width:100%;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
@ -16,14 +9,14 @@
|
|||
for (var i=0; i<menuids.length; i++){
|
||||
var div = document.getElementById(menuids[i]);
|
||||
if(div == undefined)continue;
|
||||
var ultags=div.getElementsByTagName("ul")
|
||||
var ultags=div.getElementsByTagName("ul");
|
||||
for (var t=0; t<ultags.length; t++){
|
||||
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
|
||||
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle";
|
||||
ultags[t].parentNode.onmouseover=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="block"
|
||||
this.getElementsByTagName("ul")[0].style.display="block";
|
||||
}
|
||||
ultags[t].parentNode.onmouseout=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="none"
|
||||
this.getElementsByTagName("ul")[0].style.display="none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,46 +39,6 @@
|
|||
|
||||
<script type="text/javascript">//侧导航
|
||||
|
||||
//window.onload = function () {
|
||||
// var topic_id = getParam('topic_id');
|
||||
// document.getElementById(topic_id).focus();
|
||||
//}
|
||||
//
|
||||
//var getParam = function(name){
|
||||
// var search = document.location.search;
|
||||
// var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
|
||||
// var matcher = pattern.exec(search);
|
||||
// var items = null;
|
||||
// if(null != matcher){
|
||||
// try{
|
||||
// items = decodeURIComponent(decodeURIComponent(matcher[1]));
|
||||
// }catch(e){
|
||||
// try{
|
||||
// items = decodeURIComponent(matcher[1]);
|
||||
// }catch(e){
|
||||
// items = matcher[1];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return items;
|
||||
//};
|
||||
//
|
||||
//function show_newtalk()
|
||||
//{
|
||||
// $("#about_newtalk").toggle();
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
//
|
||||
//function show_newtalk1(id)
|
||||
//{
|
||||
// $(id).toggle();
|
||||
// $(id).focus();
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
function nh_check_field(params){
|
||||
var result=true;
|
||||
if(params.subject!=undefined){
|
||||
|
|
|
@ -39,17 +39,17 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @courses.size == 0 %>
|
||||
<%= render :partial => 'layouts/no_content'%>
|
||||
<% if @courses && !@courses.empty? %>
|
||||
<div id="courses-index">
|
||||
<%= render_course_hierarchy(@courses)%>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="courses-index">
|
||||
<%= render_course_hierarchy(@courses)%>
|
||||
</div>
|
||||
<%= render :partial => 'layouts/no_content'%>
|
||||
<% end %>
|
||||
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @course_pages %>
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<%= course_activity_desc activity%>
|
||||
<br />
|
||||
<div class="cl"></div>
|
||||
<%= l :label_activity_time %> : <%= format_time(activity.created_at) %>
|
||||
<%= activity.course_act_type == "Course" ? l(:label_create_time) : l(:label_activity_time) %> : <%= format_time(activity.created_at) %>
|
||||
</p>
|
||||
<%= link_to_attachments_course(activity.course_act) if activity.course_act_type.to_s == "News" %>
|
||||
</div>
|
||||
|
|
|
@ -48,11 +48,12 @@
|
|||
<ul class="ml10">
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </label>
|
||||
<%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<input type="number" value="<%= homework.late_penalty%>" min="0" max="50" class="fl mb10 h26 w70" name="late_penalty" onkeyup="check_late_penalty()">
|
||||
<span class="fl mt5"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<li style="display: none;">
|
||||
<label class="label02" >是否匿评: </label>
|
||||
<%= f.check_box :homework_type, :class => "mb10 mt5 fl" %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -43,7 +43,8 @@
|
|||
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </label>
|
||||
<%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<input type="number" value="<%= homework.late_penalty%>" min="0" max="50" class="fl mb10 h26 w70" name="late_penalty" onkeyup="check_late_penalty()">
|
||||
<span class="fl mt5"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -1,27 +1,17 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= error_messages_for 'homework_common' %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_course_homework_new)%>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="hwork_new" id="hwork_new">
|
||||
<%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%>
|
||||
<input type="hidden" name="course" value="<%= @course.id%>">
|
||||
<h3 class="c_blue f16 mb10">
|
||||
请选择将要发布的作业类型
|
||||
</h3>
|
||||
<input type="radio" class="mb10 fl" name="homework_common_type" value="1" id="homework_detail_manual_radio" checked/>
|
||||
<span class="ml5 fl">
|
||||
人工评分的作业(支持匿名互评、灵活设置评分比例)
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<input type="radio" class="mb20 fl" name="homework_common_type" value="2" id="homework_detail_programing_radio"/>
|
||||
<span class="ml5 fl">
|
||||
自动评测的编程作业(支持C/C++程序的自动评分)
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" orange_btn" onclick="$(this).parent().submit();">
|
||||
下一步
|
||||
</a>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</li><!---level1 end--->
|
||||
<!--消息提醒-->
|
||||
<div class="navHomepageNews">
|
||||
<%= link_to image_tag("/images/news_icon_small.png" ), {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %>
|
||||
<%= link_to image_tag("/images/news_icon_small.png" , :width => "21", :height => "24"), {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %>
|
||||
<% if User.current.count_new_message >0 %>
|
||||
<div class="newsActive"></div>
|
||||
<% end %>
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
<% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>
|
||||
<% if @is_teacher%>
|
||||
<li title="<%= poll.polls_name %>">
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
|
||||
<% else %>
|
||||
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
||||
<% end %>
|
||||
<div style="width: 310px;float: left;">
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
|
||||
<% else %>
|
||||
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<% if poll.polls_status == 1%>
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
|
||||
<a href="<%= url_for(:controller => 'projects', :action => 'new',:host=>Setting.host_name) %>" class="bgreen_n_btn fr ml10 mt2" target="_blank">新建项目</a>
|
||||
<% else %>
|
||||
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
|
||||
<a href="<%= join_project_projects_path %>" data-remote ="true" class="bgreen_n_btn fr mt2">加入项目</a>
|
||||
<% end %>
|
||||
|
||||
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
|
||||
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
|
||||
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class="bgreen_n_btn fr mt2" target="_blank">新建课程</a>
|
||||
<% else %>
|
||||
<!--<a href="<%#= url_for(:controller => 'courses', :action => 'join_private_courses',:host=>Setting.host_course) %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>-->
|
||||
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
|
||||
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="bgreen_n_btn fr mt2">加入课程</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<% if !@user_course_messages.nil? %>
|
||||
<% if !@user_course_messages.blank? %>
|
||||
<% @user_course_messages.each do |ucm| %>
|
||||
<% if ucm.course_message_type == "News" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li>
|
||||
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.author %></a></li>
|
||||
<li class="homepageNewsType fl">发布通知</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to format_activity_title(" #{ucm.course_message.title}"), {:controller => 'news', :action => 'show', :id => ucm.course_message.id} %></a></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "#{ucm.course_message.title}", {:controller => 'news', :action => 'show', :id => ucm.course_message.id },:class =>"#{ucm.viewed == 0 ? "newsBlue" : "newsGrey"}" %></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="flash notice">你没有新消息!</div>
|
||||
<div class="flash notice">暂无消息!</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -33,7 +33,6 @@ zh:
|
|||
label_account_identity_studentID: 请输入学号
|
||||
|
||||
field_brief_introduction_my: 个人签名
|
||||
field_description: 个人简介
|
||||
field_is_required: 必填
|
||||
field_firstname: 名字或组织名
|
||||
firstname_empty: 名字不能为空
|
||||
|
|
|
@ -42,10 +42,10 @@ en:
|
|||
|
||||
label_member: "Members"
|
||||
project_module_attachments: "Resources"
|
||||
label_project_mail_attachments: Project Resources
|
||||
label_project_mail_upload: had uploaded project resources
|
||||
label_project_mail_attachments: "Project Resources"
|
||||
label_project_mail_upload: "had uploaded project resources"
|
||||
|
||||
label_invite: Invitation
|
||||
label_invite: "Invitation"
|
||||
label_invite_new_user: "Send email to invite new user"
|
||||
label_invite_trustie_user: "Invite the Trustie registered user"
|
||||
|
||||
|
|
|
@ -370,7 +370,6 @@ zh:
|
|||
#
|
||||
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
|
||||
field_name: 名称
|
||||
field_description: 描述
|
||||
field_identifier: 标识
|
||||
field_enterprise_name: 组织名称
|
||||
label_organization_choose: --请选择组织--
|
||||
|
|
|
@ -552,6 +552,7 @@ zh:
|
|||
label_registered_on: 注册于
|
||||
label_overall_activity: 活动概览
|
||||
label_new: 新建
|
||||
label_latest_login_user_list: 最近登录用户列表
|
||||
|
||||
label_logged_as: 登录为
|
||||
label_environment: 环境
|
||||
|
@ -1252,6 +1253,7 @@ zh:
|
|||
label_leave_message_to: 给用户 %{name}留言
|
||||
label_leave_message: 留言内容
|
||||
label_message: 留言板
|
||||
label_leave_message_list: 留言列表
|
||||
field_add: 添加于 %{time} 之前
|
||||
|
||||
label_student_response: 作业答疑 # modified by bai
|
||||
|
@ -1748,6 +1750,7 @@ zh:
|
|||
cancel_apply: 取消申请
|
||||
apply_master: 申请成为版主
|
||||
you_are_master: 您是该项目的版主
|
||||
label_notification_list: 通知
|
||||
|
||||
#add by linchun (竞赛相关)
|
||||
label_upload_softwarepackage: 上传软件包
|
||||
|
|
|
@ -681,6 +681,13 @@ RedmineApp::Application.routes.draw do
|
|||
match 'admin/default_configuration', :via => :post
|
||||
get 'admin/organization'
|
||||
get 'admin/schools'
|
||||
get 'admin/leave_messages'
|
||||
match 'admin/messages_list', as: :messages_list
|
||||
match 'admin/project_messages', as: :project_messages
|
||||
match'admin/course_messages', as: :course_messages
|
||||
get 'admin/notices'
|
||||
get 'admin/latest_login_users'
|
||||
get 'admin/homework'
|
||||
|
||||
resources :auth_sources do
|
||||
member do
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
class AddCreatedAtToActivities < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :activities, :created_at, :timestamp
|
||||
end
|
||||
def end
|
||||
remove_column :activities, :created_at
|
||||
end
|
||||
end
|
|
@ -0,0 +1,21 @@
|
|||
class UpdateActivitiesData < ActiveRecord::Migration
|
||||
def up
|
||||
count = Activity.all.count / 10 + 1
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
Activity.all.each do |activity|
|
||||
type = activity.act_type
|
||||
if type=='Contest' || type=='Message' || type=='News'|| type=='Journal'|| type=='Issue'|| type=='Principal'||type=='JournalsForMessage'
|
||||
activity.created_at = activity.act.created_on if activity.act
|
||||
elsif type=='Contestnotification' || type=='HomeworkCommon' || type=='Poll'
|
||||
activity.created_at = activity.act.created_at if activity.act
|
||||
end
|
||||
activity.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -1,22 +0,0 @@
|
|||
class UpdateCourseActivityTime < ActiveRecord::Migration
|
||||
def up
|
||||
count = CourseActivity.all.count / 10 + 1
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
CourseActivity.page(i).per(10).each do |activity|
|
||||
if activity.course_act
|
||||
if activity.course_act.respond_to?("created_at")
|
||||
activity.created_at = activity.course_act.created_at
|
||||
elsif activity.course_act.respond_to?("created_on")
|
||||
activity.created_at = activity.course_act.created_on
|
||||
end
|
||||
activity.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
class ChangeAttachmentTime < ActiveRecord::Migration
|
||||
def up
|
||||
Attachment.where("container_type = 'Course'").each do |attachment|
|
||||
if attachment.container && attachment.container.created_at.to_i > attachment.created_on.to_i
|
||||
attachment.created_on = attachment.container.created_at + 3600 * 24
|
||||
attachment.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
class UpdateCourseActivityTime < ActiveRecord::Migration
|
||||
def up
|
||||
count = CourseActivity.all.count / 10 + 1
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
CourseActivity.page(i).per(10).each do |activity|
|
||||
if activity.course_act
|
||||
if activity.course_act.respond_to?("created_at")
|
||||
activity.created_at = activity.course_act.created_at
|
||||
elsif activity.course_act.respond_to?("created_on")
|
||||
activity.created_at = activity.course_act.created_on
|
||||
end
|
||||
activity.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,9 @@
|
|||
class AddSystemScoreToStudentWork < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :student_works,:system_score,:integer
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :student_works,:system_score
|
||||
end
|
||||
end
|
30
db/schema.rb
30
db/schema.rb
|
@ -11,14 +11,15 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20150811083234) do
|
||||
ActiveRecord::Schema.define(:version => 20150810064247) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
t.string "act_type", :null => false
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "activity_container_id"
|
||||
t.string "activity_container_type", :default => ""
|
||||
t.integer "act_id", :null => false
|
||||
t.string "act_type", :null => false
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "activity_container_id"
|
||||
t.string "activity_container_type", :default => ""
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
|
||||
|
@ -324,15 +325,6 @@ ActiveRecord::Schema.define(:version => 20150811083234) do
|
|||
t.datetime "updated_on", :null => false
|
||||
end
|
||||
|
||||
create_table "course_activities", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "course_id"
|
||||
t.integer "course_act_id"
|
||||
t.string "course_act_type"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "course_attachments", :force => true do |t|
|
||||
t.string "filename"
|
||||
t.string "disk_filename"
|
||||
|
@ -463,13 +455,6 @@ ActiveRecord::Schema.define(:version => 20150811083234) do
|
|||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "documents", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.integer "category_id", :default => 0, :null => false
|
||||
|
@ -872,6 +857,7 @@ ActiveRecord::Schema.define(:version => 20150811083234) do
|
|||
t.datetime "created_on"
|
||||
t.integer "comments_count", :default => 0, :null => false
|
||||
t.integer "course_id"
|
||||
t.datetime "updated_on"
|
||||
end
|
||||
|
||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||
|
|
|
@ -386,6 +386,11 @@ Redmine::MenuManager.map :admin_menu do |menu|
|
|||
:html => {:class => 'server_authentication'}
|
||||
menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true
|
||||
menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true
|
||||
menu.push :leave_messages, {:controller => 'admin', :action => 'leave_messages'}, :caption => :label_leave_message_list
|
||||
menu.push :messages_list, {:controller => 'admin', :action => 'messages_list'}, :caption => :label_message_plural
|
||||
menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list
|
||||
menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list
|
||||
menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework
|
||||
|
||||
end
|
||||
#Modified by young
|
||||
|
|
|
@ -412,6 +412,24 @@ function regex_homework_name()
|
|||
}
|
||||
}
|
||||
|
||||
//处理迟交扣分
|
||||
function check_late_penalty()
|
||||
{
|
||||
var obj = $("input[name='late_penalty']");
|
||||
var regex = /^\d+$/;
|
||||
if(regex.test(obj.val()))
|
||||
{
|
||||
if(obj.val() > 50)
|
||||
{
|
||||
obj.val("50");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.val("0");
|
||||
}
|
||||
}
|
||||
|
||||
//验证匿评数量
|
||||
function regex_evaluation_num()
|
||||
{
|
||||
|
|
|
@ -130,7 +130,7 @@ a:hover.btn_de{ background:#ff5d31;}
|
|||
a.btn_pu{ border:1px solid #3cb761; color:#3cb761; }
|
||||
a:hover.btn_pu{ background:#3cb761;}
|
||||
.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; height:19px; padding-top:3px; }
|
||||
.polls_title_w { width:280px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.polls_title_w { max-width:280px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.polls_title_st { max-width:530px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.polls_de_grey{ color:#b1b1b1; margin-top:3px;}
|
||||
.ml5{ margin-left:5px;}
|
||||
|
|
|
@ -6,8 +6,8 @@ div,img,tr,td,table{ border:0;}
|
|||
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
||||
ol,ul,li{ list-style-type:none}
|
||||
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
|
||||
a:hover,a:active{color:#000;}
|
||||
img{max-width: 100%;}
|
||||
a:hover,a:active{color:#15bccf;}
|
||||
/*img{max-width: 100%;}*/
|
||||
|
||||
/*常用*/
|
||||
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
|
||||
|
@ -587,9 +587,9 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
|
|||
.homepageRightBlock {}
|
||||
.homepageNewsList {width:710px; height:39px; line-height:39px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin:0 auto;}
|
||||
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
|
||||
.homepageNewsPublisher {width:95px; font-size:12px; color:#15bccf; display:block;}
|
||||
.homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
|
||||
.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;}
|
||||
.homepageNewsContent {width:405px; font-size:12px; color:#4b4b4b; display:block;}
|
||||
.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
|
||||
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
|
||||
a.homepageWhite {color:#ffffff;}
|
||||
a.homepageWhite:hover {color:#a1ebff}
|
||||
|
|
Loading…
Reference in New Issue