This commit is contained in:
huang 2015-08-15 17:09:48 +08:00
commit 07605d2d6d
27 changed files with 679 additions and 130 deletions

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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)) -%>

View File

@ -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)) -%>

View File

@ -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)) -%>

View File

@ -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)) -%>

View File

@ -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)) -%>

View File

@ -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)) -%>

View File

@ -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)) -%>

View File

@ -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>

View File

@ -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){

View File

@ -53,7 +53,7 @@
<span class="fl mt5">&nbsp;分</span>
<div class="cl"></div>
</li>
<li >
<li style="display: none;">
<label class="label02" >是否匿评:&nbsp;</label>
<%= f.check_box :homework_type, :class => "mb10 mt5 fl" %>
<div class="cl"></div>

View File

@ -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>

View File

@ -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%>

View File

@ -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>

View File

@ -33,7 +33,6 @@ zh:
label_account_identity_studentID: 请输入学号
field_brief_introduction_my: 个人签名
field_description: 个人简介
field_is_required: 必填
field_firstname: 名字或组织名
firstname_empty: 名字不能为空

View File

@ -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"

View File

@ -363,7 +363,6 @@ zh:
#
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
field_name: 名称
field_description: 描述
field_identifier: 标识
field_enterprise_name: 组织名称
label_organization_choose: --请选择组织--

View File

@ -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: 上传软件包

View File

@ -679,6 +679,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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -11,14 +11,15 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150814031258) 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 => 20150814031258) 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 => 20150814031258) 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 => 20150814031258) 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"

View File

@ -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

View File

@ -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;}