Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

This commit is contained in:
Tim 2016-10-18 11:30:57 +08:00
commit 622fa382ca
36 changed files with 293 additions and 118 deletions

View File

@ -348,6 +348,7 @@ class AttachmentsController < ApplicationController
@is_history_delete = true
@is_history_destroy = false
@attachment_histories = @attachment.attachment_histories
@attachment_histories_count = @attachment_histories.count
rescue Exception => e
puts e
end
@ -667,6 +668,7 @@ class AttachmentsController < ApplicationController
def attachment_versions_delete
@attachment = Attachment.find(params[:id])
@attachment_histories = @attachment.attachment_histories
@attachment_histories_count = @attachment_histories.count
respond_to do |format|
format.js
end

View File

@ -30,6 +30,9 @@ class CalendarsController < ApplicationController
helper :project_score
def show
# 控制顶部导航样式
@project_menu_type = 8
if params[:year] and params[:year].to_i > 1900
@year = params[:year].to_i
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13

View File

@ -296,12 +296,12 @@ class ForumsController < ApplicationController
#检查forum的名字
def check_forum_name
forum_name_exist = false
# if params[:forum_id]
# forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false
# else
forum_name_exist = true
if params[:forum_id]
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false
else
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false
# end
end
render :text => forum_name_exist
end

View File

@ -32,12 +32,14 @@ class GanttsController < ApplicationController
helper :project_score
def show
# 控制顶部导航样式
@project_menu_type = 9
@gantt = Redmine::Helpers::Gantt.new(params)
@gantt.project = @project
retrieve_query
@query.group_by = nil
@gantt.query = @query if @query.valid?
basename = (@project ? "#{@project.identifier}-" : '') + 'gantt'
respond_to do |format|

View File

@ -1,10 +1,10 @@
#encoding utf-8
class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll]
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll,:save_poll]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result]
before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result,:save_poll]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:save_poll]
include PollHelper
def index
if @course
@ -245,7 +245,7 @@ class PollController < ApplicationController
def publish_poll
@poll.polls_status = 2
@poll.published_at = Time.now
@poll.show_result = params[:show_result]
@poll.show_result = params[:show_result].to_i if params[:show_result]
if @poll.save
if params[:is_remote]
redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
@ -257,6 +257,16 @@ class PollController < ApplicationController
end
end
#保存问卷
def save_poll
@poll.show_result = params[:show_result].to_i
if @poll.save
respond_to do |format|
format.js
end
end
end
#提交答案
def commit_answer
pq = PollQuestion.find(params[:poll_question_id])

View File

@ -358,7 +358,7 @@ class ProjectsController < ApplicationController
def settings
# 顶部导航
@project_menu_type = 9
@project_menu_type = 10
# 修改查看消息状态
applied_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =? and viewed =?", User.current.id, @project, "AppliedProject", 0)
@ -702,11 +702,27 @@ class ProjectsController < ApplicationController
redirect_to settings_project_url(@project, :tab => 'modules')
end
GITLABTYPE = "Repository::Gitlab"
def archive
if request.post?
unless @project.archive
if @project.archive
# 删除版本库信息
begin
g = Gitlab.client
g.delete_project(@project.gpid)
rescue Exception => e
puts e
end
# 删除Trustie班额本库记录
repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first
repoisitory.delete
@project.update_column(:gpid, nil)
else
flash[:error] = l(:error_can_not_archive_project)
end
unless @project.archive
end
end
if params[:type] == "project"
redirect_to user_path(User.current)

View File

@ -1,6 +1,6 @@
<div class="muban_popup_top">
<h3 class="fl">删除资源</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal();"></a>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="attachment_fresh_for_destroy();"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con" >
@ -9,3 +9,10 @@
<%= render :partial => "files/attachment_history_popub_delete" %>
</div>
</div>
<script>
function attachment_fresh_for_destroy(){
hideModal();
$(".re_search").submit();
}
</script>

View File

@ -5,3 +5,6 @@ $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' sty
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
$('#ajax-modal').css("padding","6.6px 13.2px 16px 16px");

View File

@ -10,11 +10,11 @@
</thead>
<tbody>
<tr>
<th ><p class="popup_ziyuan_title"><%= @attachment.filename %><span class="muban_icons_blue ml5">当前版本</span></p></th>
<th ><p class="popup_ziyuan_title fl"><%= @attachment.filename %></p><span class="muban_icons_blue ml5 fl mt12">当前版本</span></th>
<th><%= @attachment.downloads %></th>
<th><%= @attachment.try(:quotes).to_i %></th>
<th><%= format_time(@attachment.created_on) %></th>
<th></th>
<!--<th></th>-->
</tr>
<% @attachment_histories.each do |history| %>
<tr>
@ -24,14 +24,14 @@
<th><%= history.downloads %></th>
<th><%= history.try(:quotes).to_i %></th>
<th><%= format_time(history.created_on) %></th>
<th>
<%= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history"),
:remote => true,
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => "postOptionLink",
<!--<th>-->
<%#= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history"),
# :remote => true,
# :data => {:confirm => l(:text_are_you_sure)},
# :method => :delete,
# :class => "postOptionLink",
:class => "btn") if allow_to_delete_attachment(history) %>
</th>
<!--</th>-->
</tr>
<% end %>
</tbody>
@ -52,8 +52,15 @@
<div class="cl"></div>
<textarea style="resize:none" type="text" placeholder="请在此编辑资源描述" name="description" class="mr15 mb10 muban_textarea" ><%= @attachment.description %></textarea>
<div class="clear mb15">
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="btn fr" onclick="hideModal();">取消</a>
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="btn fr" onclick="attachment_fresh_for_destroy()">取消</a>
<%#= submit_tag '确定', :onclick => 'upload_attachment_version(event);', :onfocus => 'this.blur()', :id => 'upload_files_submit_btn', :class => 'btn btn-blue fr mr5' %>
<a onclick = "upload_attachment_version(event);" onfocus = 'this.blur()' id = 'upload_files_submit_btn' class = 'btn btn-blue fr mr5' >确定</a>
<a href="javascript:void(0);" onclick = "upload_attachment_version(event);" onfocus = 'this.blur()' id = 'upload_files_submit_btn' class = 'btn btn-blue fr mr5' >确定</a>
</div>
<% end %>
<script>
function attachment_fresh_for_destroy(){
hideModal();
$(".re_search").submit();
}
</script>

View File

@ -39,11 +39,11 @@
</table>
<div>
<% if @attachment.container_type == "Project" %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :data => {:confirm => l(:text_history_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5", :onclick =>"hideModal();") if (is_project_manager?(User.current.id, @attachment.container_id) || User.current.id == @attachment.author_id || User.current.admin?) %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :data => {:confirm => @attachment_histories_count.to_i > 0 ? l(:text_history_are_you_sure) : l(:text_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5", :onclick =>"hideModal();") if (is_project_manager?(User.current.id, @attachment.container_id) || User.current.id == @attachment.author_id || User.current.admin?) %>
<% elsif @attachment.container_type == "Course" %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :data => {:confirm => l(:text_history_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5", :onclick =>"hideModal();") if (User.current.allowed_to?(:as_teacher, @attachment.container) || User.current.id == @attachment.author_id || User.current.admin?) %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :data => {:confirm => @attachment_histories_count.to_i > 0 ? l(:text_history_are_you_sure) : l(:text_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5", :onclick =>"hideModal();") if (User.current.allowed_to?(:as_teacher, @attachment.container) || User.current.id == @attachment.author_id || User.current.admin?) %>
<% elsif @attachment.container_type == "OrgSubfield" %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history => true), :data => {:confirm => l(:text_history_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5", :onclick =>"hideModal();") if (User.current.id == @attachment.author_id || User.current.admin_of_org?(@attachment) || User.current.admin?) %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history => true), :data => {:confirm => @attachment_histories_count.to_i > 0 ? l(:text_history_are_you_sure) : l(:text_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5", :onclick =>"hideModal();") if (User.current.id == @attachment.author_id || User.current.admin_of_org?(@attachment) || User.current.admin?) %>
<% end %>
</div>

View File

@ -1,6 +1,9 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>');
showModal('ajax-modal', '311px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 280px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 290px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
$('#ajax-modal').parent().addClass("popbox_polls").removeClass("resourceUploadPopup popbox");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
$('#ajax-modal').css({"padding":"","min-height":""});

View File

@ -87,7 +87,7 @@
<% end %>
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
<li id="project_menu_09">
<li id="project_menu_010">
<%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "pro_new_proname" %>
</li>
<% end %>
@ -97,11 +97,8 @@
<!--新版项目头部结束-->
<script>
$(function(){
if($("#project_menu_0<%= @project_menu_type %>").length > 0){
$("#project_menu_0<%= @project_menu_type %>").addClass('pro_new_topnav_active');
} else {
$("#expand_tools_expand a").addClass('active');
$("#navContentCourse").toggle();
}
})
</script>

View File

@ -230,6 +230,9 @@
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
$('#ajax-modal').css("padding","");
}
// 鼠标经过的时候显示内容
function message_titile_show(obj,e)

View File

@ -43,11 +43,12 @@
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
});
//二级菜单滑动时箭头方向控制
$(".homepageLeftMenuMoreIcon").toggle(function(){
$(this).css("background","url(/images/homepage_icon.png) -74px -240px no-repeat");
},function(){
$(this).css("background","url(/images/homepage_icon.png) 100px -624px no-repeat");
},function(){
$(this).css("background","url(/images/homepage_icon.png) -74px -240px no-repeat");
});
})
</script>
@ -102,15 +103,17 @@
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<!-- link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" -->
<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%= field.id %>').slideToggle();"><%= field.name %></a>
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
<% end %>
</div>
<div class="<%= (field.sub_domains.count == 0) ? 'homepageLeftMenuCourses':'homepageLeftMenuCourses borderBottomNone' %>" id="PostDomain_<%= field.id %>" style="display:block;">
<div class="homepageLeftMenuCourses" id="PostDomain_<%= field.id %>" style="display:<%= field.sub_domains.count == 0 ? 'none' : '' %>">
<ul>
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq.limit(5), :org_subfield_id => field.id, :page=>1, :org_id => organization.id } %>
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
</ul>
</div>

View File

@ -3,10 +3,10 @@
<%= link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => org_subfield_id), :class => "coursesLineGrey hidden", :title => subdomain.name %>
</li>
<% end %>
<% if subdomains.size == 5 %>
<li class="homepageLeftMenuMore" id="show_more_org_submains">
<input type="hidden" value="<%= page %>" id="org_submains_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_submain('<%= more_org_submains_organization_path(org_id, :org_subfield_id => org_subfield_id) %>');"></a>
</li>
<% end%>
<%# if subdomains.size == 5 %>
<!--<li class="homepageLeftMenuMore" id="show_more_org_project">-->
<!--<input type="hidden" value="<%#= page %>" id="org_project_page_num">-->
<!--<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%#= more_org_projects_organization_path(org_id) %>');"></a>-->
<!--</li>-->
<%# end%>

View File

@ -497,7 +497,15 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}else if(forms.length > 0){
alert("请先保存正在编辑的题目。");
} else {
window.location.href = "<%=edit_poll_path(@poll) %>";
if($("#show_result").is(":checked")) {
$.get(
'<%= save_poll_poll_path(@poll.id) %>'+'?show_result=1'
)
} else{
$.get(
'<%= save_poll_poll_path(@poll.id) %>'+'?show_result=0'
)
}
}
}
function poll_submit()

View File

@ -0,0 +1,21 @@
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div>
<ul class="sy_popup_add mt10 mb10">
<li>
<p style="text-align: center">
问卷保存成功
</p>
</li>
<li>
<label style="margin-right: 117px;">&nbsp;</label>
<%= link_to('确 定', edit_poll_path(@poll), :class => "sy_btn_blue fl") %>
<div class="cl"></div>
</li>
</ul>
</div>

View File

@ -0,0 +1,2 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'poll_save', locals: { :poll => @poll,:is_remote => false,:show_result=> 1}) %>";
pop_box_new(htmlvalue,460,190);

View File

@ -41,4 +41,13 @@
</li>
</ul>
<% end %>
<% if User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
<div class="mt30">
<img src="/images/pic_del.gif" class="mr5">
<%= link_to(l(:button_delete_project), { :controller => 'projects', :action => 'archive', :id => @project, :status => params[:status], :type =>"project" },
:data => {:confirm => l(:text_delete_project_are_you_sure)}, :method => :post) unless @project.archived? %>
<%#=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %>
<span>(友情提示:删除该项目后如果您想恢复该项目,请联系系统管理员!)</span>
</div>
<% end %>
<div class="cl"></div>

View File

@ -15,4 +15,9 @@ $('#ajax-modal').parent().css("top","20%").css("left","42%").css("border","3px s
<% end %>
$('#ajax-modal').parent().addClass("popbox_polls");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
$('#ajax-modal').css("padding","");
$('#ajax-modal').parent().removeClass(" popbox resourceUploadPopup shareDP");

View File

@ -23,6 +23,8 @@
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
var val = $("#search_course_input").val();
$("#search_course_input").val("").focus().val(val);
<% else %>

View File

@ -12,6 +12,8 @@ $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' sty
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("shareDP");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
var val = $("#search_org_input").val();
$("#search_org_input").val("").focus().val(val);
<% else %>

View File

@ -12,6 +12,8 @@ $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' sty
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox")
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
//与更新版本弹窗js冲突新增样式代码
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
//$("#search_project_input").focus();
var val = $("#search_project_input").val();
$("#search_project_input").val("").focus().val(val);

View File

@ -189,6 +189,7 @@ zh:
text_are_you_sure: 您确定要删除吗? #js 提示
text_history_are_you_sure: 本资源有多个版本,你确定要全部删除吗?
text_delete_project_are_you_sure: 本项目包含版本库,项目删除后,版本库将被彻底删除。您确定删除吗?
text_are_you_sure_out: 你确定要退出该班级吗?
text_are_you_sure_out_group: 你确定要退出该分班吗?
text_are_you_sure_all: 您确定要删除所有文件吗

View File

@ -263,6 +263,7 @@ RedmineApp::Application.routes.draw do
post 'create_poll_question'
post 'commit_poll'
get 'publish_poll'
get 'save_poll'
get 'republish_poll'
get 'poll_result'
get 'close_poll'

View File

@ -0,0 +1,20 @@
class UpdateHomeworkCommentStatus < ActiveRecord::Migration
def up
homeworks = HomeworkCommon.joins(:homework_detail_manual).where("publish_time is not NULL and publish_time <= '#{Date.today}' and homework_detail_manuals.comment_status = 0")
homeworks.each do |homework|
hw_dm = homework.homework_detail_manual
if hw_dm && hw_dm.comment_status == 0
if hw_dm.evaluation_end < Date.today && homework.anonymous_comment == 0
hw_dm.update_column("comment_status", 3)
elsif homework.anonymous_comment == 0 && hw_dm.evaluation_end >= Date.today && hw_dm.evaluation_start <= Date.today
hw_dm.update_column("comment_status", 2)
else
hw_dm.update_column("comment_status", 1)
end
end
end
end
def down
end
end

View File

@ -0,0 +1,23 @@
class UpdateAllRake < ActiveRecord::Migration
def up
attachments = Attachment.where("is_publish = 0 and publish_time <= '#{Date.today}'")
attachments.update_all(:is_publish => 1)
exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
exercises.update_all(:exercise_status => 2)
end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
end_exercises.each do |exercise|
course = exercise.course
exercise.update_column('exercise_status', 3)
course.student.each do |student|
if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,exercise.id).empty?
ExerciseUser.create(:user_id => student.student_id, :exercise_id => exercise.id, :start_at => exercise.end_time, :status => true,:score=>0)
end
end
end
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20161011012114) do
ActiveRecord::Schema.define(:version => 20161015102324) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -142,7 +142,7 @@ ActiveRecord::Schema.define(:version => 20161011012114) do
t.integer "downloads", :default => 0
t.integer "author_id"
t.datetime "created_on"
t.string "description"
t.text "description"
t.string "disk_directory"
t.integer "attachtype"
t.integer "is_public"

View File

@ -3,6 +3,8 @@
namespace :exercise_publish do
desc "publish exercise and end exercise"
task :publish => :environment do
Rails.logger.info("log--------------------------------exercise_publish start")
puts "--------------------------------exercise_publish start"
exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
exercises.each do |exercise|
exercise.update_column('exercise_status', 2)
@ -11,6 +13,8 @@ namespace :exercise_publish do
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
end
end
Rails.logger.info("log--------------------------------exercise_publish end")
puts "--------------------------------exercise_publish end"
end
task :end => :environment do

View File

@ -8,6 +8,8 @@ namespace :homework_evaluation do
end
#自动开启匿评的任务
task :start_evaluation => :environment do
Rails.logger.info("log--------------------------------start_evaluation start")
puts "--------------------------------start_evaluation start"
homework_detail_manuals = HomeworkDetailManual.where("evaluation_start = '#{Date.today}'")
homework_detail_manuals.each do |homework_detail_manual|
homework_common = homework_detail_manual.homework_common
@ -67,6 +69,9 @@ namespace :homework_evaluation do
end
end
end
Rails.logger.info("log--------------------------------start_evaluation end")
puts "--------------------------------start_evaluation end"
end
#自动关闭匿评的任务

View File

@ -3,6 +3,8 @@
namespace :homework_publishtime do
desc "start publish homework and end homework"
task :publish => :environment do
puts "--------------------------------homework_publish start"
Rails.logger.info("log--------------------------------homework_publish start")
homework_commons = HomeworkCommon.where("publish_time = '#{Date.today}'")
homework_commons.each do |homework|
homework_detail_manual = homework.homework_detail_manual
@ -35,9 +37,13 @@ namespace :homework_publishtime do
Mailer.run.homework_added(homework)
end
end
Rails.logger.info("log--------------------------------homework_publish end")
puts "--------------------------------homework_publish end"
end
task :end => :environment do
puts "--------------------------------homework_publish_end start"
Rails.logger.info("log--------------------------------homework_publish_end start")
homework_commons = HomeworkCommon.where("end_time = '#{Date.today}'")
homework_commons.each do |homework|
if homework.anonymous_comment == 1
@ -47,5 +53,7 @@ namespace :homework_publishtime do
end
end
end
Rails.logger.info("log--------------------------------homework_publish_end end")
puts "--------------------------------homework_publish_end end"
end
end

View File

@ -3,9 +3,13 @@
namespace :resource_publish do
desc "start publish resource"
task :publish => :environment do
puts "--------------------------------resource_publish start"
Rails.logger.info("log--------------------------------resource_publish start")
attachments = Attachment.where("publish_time = '#{Date.today}'")
attachments.each do |attachment|
attachment.update_column('is_publish', 1)
end
Rails.logger.info("log--------------------------------resource_publish end")
puts "--------------------------------resource_publish end"
end
end

View File

@ -1550,6 +1550,7 @@ function pop_box_new(value, Width, Height){
showModal('ajax-modal', Width + 'px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
$('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox");
$('#ajax-modal').css({"padding":"0","overflow":"hidden"});
$('#ajax-modal').parent().attr("id","popupWrap");

View File

@ -265,7 +265,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w557{ width:557px;}
.w570 {width:570px !important;}
.w576{ width:576px;}
.w590{ width:590px; !important;}
.w590{ width:590px !important;}
.w607 {width:607px;}
.w664{ width:664px;}
.w683{ width:683px;}

View File

@ -41,7 +41,6 @@ input.sendSourceText:hover {background-color:#297fb8;}
.resourcesSendTo {float:left; height:20px; margin-top:15px;}
.resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;}
.courseReferContainer {float:left; max-height:120px;margin-right:16px;margin-bottom:10px; overflow:auto; overflow-x:hidden;}
.popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */}
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:fixed; top:50%; left:50%; margin-left:-200px; z-index:1000;}
@ -163,7 +162,6 @@ a:hover.CloseBtn{background:url(/images/CloseBtn.png) 0px -24px no-repeat; }
.popClose {background:url(/images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:2px; top:3px;}
/****评分弹框****/
/*#popbox{width:488px;height:550px;position:absolute;z-index:100;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; }*/
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(/images/close.png) no-repeat;cursor:pointer;}
.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
.ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;}

View File

@ -1512,3 +1512,6 @@ a.syllabusbox_a_blue{
/*20160912问卷调查*/
.dash-block {border:1px dashed #ddd;}
/*历史版本删除功能*/
.popup_ziyuan_title{ display: block; margin-left: 10px; text-align: left; max-width:360px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}