Merge branch 'rep_quality' into dev_newproject
Conflicts: app/controllers/projects_controller.rb app/views/layouts/base_projects.html.erb app/views/projects/settings/_new_edit.html.erb public/stylesheets/css/project.css
This commit is contained in:
commit
fce6c407c8
|
@ -348,6 +348,7 @@ class AttachmentsController < ApplicationController
|
||||||
@is_history_delete = true
|
@is_history_delete = true
|
||||||
@is_history_destroy = false
|
@is_history_destroy = false
|
||||||
@attachment_histories = @attachment.attachment_histories
|
@attachment_histories = @attachment.attachment_histories
|
||||||
|
@attachment_histories_count = @attachment_histories.count
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
puts e
|
puts e
|
||||||
end
|
end
|
||||||
|
@ -667,6 +668,7 @@ class AttachmentsController < ApplicationController
|
||||||
def attachment_versions_delete
|
def attachment_versions_delete
|
||||||
@attachment = Attachment.find(params[:id])
|
@attachment = Attachment.find(params[:id])
|
||||||
@attachment_histories = @attachment.attachment_histories
|
@attachment_histories = @attachment.attachment_histories
|
||||||
|
@attachment_histories_count = @attachment_histories.count
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -296,12 +296,12 @@ class ForumsController < ApplicationController
|
||||||
|
|
||||||
#检查forum的名字
|
#检查forum的名字
|
||||||
def check_forum_name
|
def check_forum_name
|
||||||
forum_name_exist = false
|
forum_name_exist = true
|
||||||
# if params[:forum_id]
|
if params[:forum_id]
|
||||||
# forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false
|
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false
|
||||||
# else
|
else
|
||||||
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false
|
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false
|
||||||
# end
|
end
|
||||||
render :text => forum_name_exist
|
render :text => forum_name_exist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#encoding utf-8
|
#encoding utf-8
|
||||||
class PollController < ApplicationController
|
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 :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_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
|
include PollHelper
|
||||||
def index
|
def index
|
||||||
if @course
|
if @course
|
||||||
|
@ -245,7 +245,7 @@ class PollController < ApplicationController
|
||||||
def publish_poll
|
def publish_poll
|
||||||
@poll.polls_status = 2
|
@poll.polls_status = 2
|
||||||
@poll.published_at = Time.now
|
@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 @poll.save
|
||||||
if params[:is_remote]
|
if params[:is_remote]
|
||||||
redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
|
redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
|
||||||
|
@ -257,6 +257,16 @@ class PollController < ApplicationController
|
||||||
end
|
end
|
||||||
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
|
def commit_answer
|
||||||
pq = PollQuestion.find(params[:poll_question_id])
|
pq = PollQuestion.find(params[:poll_question_id])
|
||||||
|
|
|
@ -702,12 +702,21 @@ class ProjectsController < ApplicationController
|
||||||
redirect_to settings_project_url(@project, :tab => 'modules')
|
redirect_to settings_project_url(@project, :tab => 'modules')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
GITLABTYPE = "Repository::Gitlab"
|
||||||
def archive
|
def archive
|
||||||
if request.post?
|
if request.post?
|
||||||
if @project.archive
|
if @project.archive
|
||||||
# 删除版本库信息
|
# 删除版本库信息
|
||||||
g = Gitlab.client
|
begin
|
||||||
g.delete(@project.gpid)
|
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
|
else
|
||||||
flash[:error] = l(:error_can_not_archive_project)
|
flash[:error] = l(:error_can_not_archive_project)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="muban_popup_top">
|
<div class="muban_popup_top">
|
||||||
<h3 class="fl">删除资源</h3>
|
<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 class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="muban_popup_con" >
|
<div class="muban_popup_con" >
|
||||||
|
@ -9,3 +9,10 @@
|
||||||
<%= render :partial => "files/attachment_history_popub_delete" %>
|
<%= render :partial => "files/attachment_history_popub_delete" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function attachment_fresh_for_destroy(){
|
||||||
|
hideModal();
|
||||||
|
$(".re_search").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/attachment_history_download' )%>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/attachment_history_download' )%>');
|
||||||
showModal('ajax-modal', '452px');
|
showModal('ajax-modal', '452px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
$('#ajax-modal').parent().css("top","40%").css("left","50%");
|
$('#ajax-modal').parent().css("top","40%").css("left","50%");
|
||||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#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");
|
|
@ -10,11 +10,11 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<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.downloads %></th>
|
||||||
<th><%= @attachment.try(:quotes).to_i %></th>
|
<th><%= @attachment.try(:quotes).to_i %></th>
|
||||||
<th><%= format_time(@attachment.created_on) %></th>
|
<th><%= format_time(@attachment.created_on) %></th>
|
||||||
<th></th>
|
<!--<th></th>-->
|
||||||
</tr>
|
</tr>
|
||||||
<% @attachment_histories.each do |history| %>
|
<% @attachment_histories.each do |history| %>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -24,14 +24,14 @@
|
||||||
<th><%= history.downloads %></th>
|
<th><%= history.downloads %></th>
|
||||||
<th><%= history.try(:quotes).to_i %></th>
|
<th><%= history.try(:quotes).to_i %></th>
|
||||||
<th><%= format_time(history.created_on) %></th>
|
<th><%= format_time(history.created_on) %></th>
|
||||||
<th>
|
<!--<th>-->
|
||||||
<%= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history"),
|
<%#= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history"),
|
||||||
:remote => true,
|
# :remote => true,
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
# :data => {:confirm => l(:text_are_you_sure)},
|
||||||
:method => :delete,
|
# :method => :delete,
|
||||||
:class => "postOptionLink",
|
# :class => "postOptionLink",
|
||||||
:class => "btn") if allow_to_delete_attachment(history) %>
|
:class => "btn") if allow_to_delete_attachment(history) %>
|
||||||
</th>
|
<!--</th>-->
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -52,8 +52,15 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<textarea style="resize:none" type="text" placeholder="请在此编辑资源描述" name="description" class="mr15 mb10 muban_textarea" ><%= @attachment.description %></textarea>
|
<textarea style="resize:none" type="text" placeholder="请在此编辑资源描述" name="description" class="mr15 mb10 muban_textarea" ><%= @attachment.description %></textarea>
|
||||||
<div class="clear mb15">
|
<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' %>
|
<%#= 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>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function attachment_fresh_for_destroy(){
|
||||||
|
hideModal();
|
||||||
|
$(".re_search").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -39,11 +39,11 @@
|
||||||
</table>
|
</table>
|
||||||
<div>
|
<div>
|
||||||
<% if @attachment.container_type == "Project" %>
|
<% 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" %>
|
<% 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" %>
|
<% 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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||||
showModal('ajax-modal', '311px');
|
showModal('ajax-modal', '311px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#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().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":""});
|
|
@ -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').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().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#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)
|
function message_titile_show(obj,e)
|
||||||
|
|
|
@ -43,11 +43,12 @@
|
||||||
$(this).prev().css("color","#808080");
|
$(this).prev().css("color","#808080");
|
||||||
$(this).css("z-index", "1");
|
$(this).css("z-index", "1");
|
||||||
});
|
});
|
||||||
|
|
||||||
//二级菜单滑动时箭头方向控制
|
//二级菜单滑动时箭头方向控制
|
||||||
$(".homepageLeftMenuMoreIcon").toggle(function(){
|
$(".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");
|
$(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>
|
</script>
|
||||||
|
@ -55,7 +56,7 @@
|
||||||
<% organization.org_subfields.order("priority").each do |field| %>
|
<% organization.org_subfields.order("priority").each do |field| %>
|
||||||
<% if is_default_field?(field) %>
|
<% if is_default_field?(field) %>
|
||||||
<% case field.name %>
|
<% case field.name %>
|
||||||
<% when 'activity' %>
|
<% when 'activity' %>
|
||||||
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||||
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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();" %>
|
<%= 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 %>
|
<% end %>
|
||||||
<% else %>
|
<% 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 %>
|
<% end %>
|
||||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
<% 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 => "发布帖子" %>
|
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</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>
|
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -136,7 +139,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% elsif field.field_type == "Resource" %>
|
<% elsif field.field_type == "Resource" %>
|
||||||
<div class="homepageLeftMenuBlock">
|
<div class="homepageLeftMenuBlock">
|
||||||
<% if !field.subfield_subdomain_dir.nil? %>
|
<% if !field.subfield_subdomain_dir.nil? %>
|
||||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
|
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
|
||||||
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden" %>
|
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -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 %>
|
<%= 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>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if subdomains.size == 5 %>
|
<%# if subdomains.size == 5 %>
|
||||||
<li class="homepageLeftMenuMore" id="show_more_org_submains">
|
<!--<li class="homepageLeftMenuMore" id="show_more_org_project">-->
|
||||||
<input type="hidden" value="<%= page %>" id="org_submains_page_num">
|
<!--<input type="hidden" value="<%#= page %>" id="org_project_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>
|
<!--<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%#= more_org_projects_organization_path(org_id) %>');"></a>-->
|
||||||
</li>
|
<!--</li>-->
|
||||||
<% end%>
|
<%# end%>
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,15 @@ function insert_MCQ(quest_type,quest_num,quest_id){
|
||||||
}else if(forms.length > 0){
|
}else if(forms.length > 0){
|
||||||
alert("请先保存正在编辑的题目。");
|
alert("请先保存正在编辑的题目。");
|
||||||
} else {
|
} 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()
|
function poll_submit()
|
||||||
|
|
|
@ -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;"> </label>
|
||||||
|
<%= link_to('确 定', edit_poll_path(@poll), :class => "sy_btn_blue fl") %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
@ -40,5 +40,14 @@
|
||||||
<a href="javascript:void(0)" class="sy_btn_blue mr15 fr" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
|
<a href="javascript:void(0)" class="sy_btn_blue mr15 fr" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
<% 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>
|
||||||
|
|
|
@ -15,4 +15,9 @@ $('#ajax-modal').parent().css("top","20%").css("left","42%").css("border","3px s
|
||||||
<% end %>
|
<% end %>
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#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");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#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();
|
var val = $("#search_course_input").val();
|
||||||
$("#search_course_input").val("").focus().val(val);
|
$("#search_course_input").val("").focus().val(val);
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -1,25 +1,27 @@
|
||||||
<% if params[:is_observe].nil? %>
|
<% if params[:is_observe].nil? %>
|
||||||
<% if params[:send_type].present? && params[:send_type] == 'news' %>
|
<% if params[:send_type].present? && params[:send_type] == 'news' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
|
||||||
<% elsif params[:send_type] == 'file' %>
|
<% elsif params[:send_type] == 'file' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids,:type => @type})%>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids,:type => @type})%>');
|
||||||
<% elsif params[:send_type] == 'message' %>
|
<% elsif params[:send_type] == 'message' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
|
||||||
<% end %>
|
<% end %>
|
||||||
showModal('ajax-modal', '452px');
|
showModal('ajax-modal', '452px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||||
$('#ajax-modal').parent().addClass("popbox").addClass("shareDP");
|
$('#ajax-modal').parent().addClass("popbox").addClass("shareDP");
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
var val = $("#search_org_input").val();
|
//与更新版本弹窗js冲突新增样式代码
|
||||||
$("#search_org_input").val("").focus().val(val);
|
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
|
||||||
<% else %>
|
var val = $("#search_org_input").val();
|
||||||
<% if params[:send_type] == 'news' %>
|
$("#search_org_input").val("").focus().val(val);
|
||||||
$("#org_news_form").html("<%= escape_javascript(render :partial => 'users/org_news_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>");
|
<% else %>
|
||||||
<% elsif params[:send_type] == 'file' %>
|
<% if params[:send_type] == 'news' %>
|
||||||
$("#org_file_form").html("<%= escape_javascript(render :partial => 'users/org_file_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>");
|
$("#org_news_form").html("<%= escape_javascript(render :partial => 'users/org_news_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>");
|
||||||
<% elsif params[:send_type] == 'message' %>
|
<% elsif params[:send_type] == 'file' %>
|
||||||
$("#org_message_form").html("<%= escape_javascript(render :partial => 'users/org_message_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>");
|
$("#org_file_form").html("<%= escape_javascript(render :partial => 'users/org_file_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>");
|
||||||
<% end %>
|
<% elsif params[:send_type] == 'message' %>
|
||||||
|
$("#org_message_form").html("<%= escape_javascript(render :partial => 'users/org_message_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>");
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -1,26 +1,28 @@
|
||||||
<% if params[:is_observe].nil? %>
|
<% if params[:is_observe].nil? %>
|
||||||
<% if params[:send_type].present? && params[:send_type] == 'news' %>
|
<% if params[:send_type].present? && params[:send_type] == 'news' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
||||||
<% elsif params[:send_type] == 'file' %>
|
<% elsif params[:send_type] == 'file' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids,:type => @type}) %>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids,:type => @type}) %>');
|
||||||
<% elsif params[:send_type] == 'message' %>
|
<% elsif params[:send_type] == 'message' %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
showModal('ajax-modal', '452px');
|
showModal('ajax-modal', '452px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||||
$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox")
|
$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox")
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
//$("#search_project_input").focus();
|
//与更新版本弹窗js冲突新增样式代码
|
||||||
var val = $("#search_project_input").val();
|
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
|
||||||
$("#search_project_input").val("").focus().val(val);
|
//$("#search_project_input").focus();
|
||||||
<% else %>
|
var val = $("#search_project_input").val();
|
||||||
<% if params[:send_type] == 'news' %>
|
$("#search_project_input").val("").focus().val(val);
|
||||||
$("#project_news_form").html("<%= escape_javascript(render :partial => 'users/project_news_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>");
|
<% else %>
|
||||||
<% elsif params[:send_type] == 'file' %>
|
<% if params[:send_type] == 'news' %>
|
||||||
$("#project_file_form").html("<%= escape_javascript(render :partial => 'users/project_file_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>");
|
$("#project_news_form").html("<%= escape_javascript(render :partial => 'users/project_news_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>");
|
||||||
<% elsif params[:send_type] == 'message' %>
|
<% elsif params[:send_type] == 'file' %>
|
||||||
$("#project_message_form").html("<%= escape_javascript(render :partial => 'users/project_message_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>");
|
$("#project_file_form").html("<%= escape_javascript(render :partial => 'users/project_file_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>");
|
||||||
<% end %>
|
<% elsif params[:send_type] == 'message' %>
|
||||||
<% end %>
|
$("#project_message_form").html("<%= escape_javascript(render :partial => 'users/project_message_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>");
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -189,6 +189,7 @@ zh:
|
||||||
|
|
||||||
text_are_you_sure: 您确定要删除吗? #js 提示
|
text_are_you_sure: 您确定要删除吗? #js 提示
|
||||||
text_history_are_you_sure: 本资源有多个版本,你确定要全部删除吗?
|
text_history_are_you_sure: 本资源有多个版本,你确定要全部删除吗?
|
||||||
|
text_delete_project_are_you_sure: 本项目包含版本库,项目删除后,版本库将被彻底删除。您确定删除吗?
|
||||||
text_are_you_sure_out: 你确定要退出该班级吗?
|
text_are_you_sure_out: 你确定要退出该班级吗?
|
||||||
text_are_you_sure_out_group: 你确定要退出该分班吗?
|
text_are_you_sure_out_group: 你确定要退出该分班吗?
|
||||||
text_are_you_sure_all: 您确定要删除所有文件吗
|
text_are_you_sure_all: 您确定要删除所有文件吗
|
||||||
|
|
|
@ -263,6 +263,7 @@ RedmineApp::Application.routes.draw do
|
||||||
post 'create_poll_question'
|
post 'create_poll_question'
|
||||||
post 'commit_poll'
|
post 'commit_poll'
|
||||||
get 'publish_poll'
|
get 'publish_poll'
|
||||||
|
get 'save_poll'
|
||||||
get 'republish_poll'
|
get 'republish_poll'
|
||||||
get 'poll_result'
|
get 'poll_result'
|
||||||
get 'close_poll'
|
get 'close_poll'
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# 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|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -142,7 +142,7 @@ ActiveRecord::Schema.define(:version => 20161011012114) do
|
||||||
t.integer "downloads", :default => 0
|
t.integer "downloads", :default => 0
|
||||||
t.integer "author_id"
|
t.integer "author_id"
|
||||||
t.datetime "created_on"
|
t.datetime "created_on"
|
||||||
t.string "description"
|
t.text "description"
|
||||||
t.string "disk_directory"
|
t.string "disk_directory"
|
||||||
t.integer "attachtype"
|
t.integer "attachtype"
|
||||||
t.integer "is_public"
|
t.integer "is_public"
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
namespace :exercise_publish do
|
namespace :exercise_publish do
|
||||||
desc "publish exercise and end exercise"
|
desc "publish exercise and end exercise"
|
||||||
task :publish => :environment do
|
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 = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||||
exercises.each do |exercise|
|
exercises.each do |exercise|
|
||||||
exercise.update_column('exercise_status', 2)
|
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)
|
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Rails.logger.info("log--------------------------------exercise_publish end")
|
||||||
|
puts "--------------------------------exercise_publish end"
|
||||||
end
|
end
|
||||||
|
|
||||||
task :end => :environment do
|
task :end => :environment do
|
||||||
|
|
|
@ -8,6 +8,8 @@ namespace :homework_evaluation do
|
||||||
end
|
end
|
||||||
#自动开启匿评的任务
|
#自动开启匿评的任务
|
||||||
task :start_evaluation => :environment do
|
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 = HomeworkDetailManual.where("evaluation_start = '#{Date.today}'")
|
||||||
homework_detail_manuals.each do |homework_detail_manual|
|
homework_detail_manuals.each do |homework_detail_manual|
|
||||||
homework_common = homework_detail_manual.homework_common
|
homework_common = homework_detail_manual.homework_common
|
||||||
|
@ -67,6 +69,9 @@ namespace :homework_evaluation do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Rails.logger.info("log--------------------------------start_evaluation end")
|
||||||
|
puts "--------------------------------start_evaluation end"
|
||||||
end
|
end
|
||||||
|
|
||||||
#自动关闭匿评的任务
|
#自动关闭匿评的任务
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
namespace :homework_publishtime do
|
namespace :homework_publishtime do
|
||||||
desc "start publish homework and end homework"
|
desc "start publish homework and end homework"
|
||||||
task :publish => :environment do
|
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 = HomeworkCommon.where("publish_time = '#{Date.today}'")
|
||||||
homework_commons.each do |homework|
|
homework_commons.each do |homework|
|
||||||
homework_detail_manual = homework.homework_detail_manual
|
homework_detail_manual = homework.homework_detail_manual
|
||||||
|
@ -35,9 +37,13 @@ namespace :homework_publishtime do
|
||||||
Mailer.run.homework_added(homework)
|
Mailer.run.homework_added(homework)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Rails.logger.info("log--------------------------------homework_publish end")
|
||||||
|
puts "--------------------------------homework_publish end"
|
||||||
end
|
end
|
||||||
|
|
||||||
task :end => :environment do
|
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 = HomeworkCommon.where("end_time = '#{Date.today}'")
|
||||||
homework_commons.each do |homework|
|
homework_commons.each do |homework|
|
||||||
if homework.anonymous_comment == 1
|
if homework.anonymous_comment == 1
|
||||||
|
@ -47,5 +53,7 @@ namespace :homework_publishtime do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Rails.logger.info("log--------------------------------homework_publish_end end")
|
||||||
|
puts "--------------------------------homework_publish_end end"
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -3,9 +3,13 @@
|
||||||
namespace :resource_publish do
|
namespace :resource_publish do
|
||||||
desc "start publish resource"
|
desc "start publish resource"
|
||||||
task :publish => :environment do
|
task :publish => :environment do
|
||||||
|
puts "--------------------------------resource_publish start"
|
||||||
|
Rails.logger.info("log--------------------------------resource_publish start")
|
||||||
attachments = Attachment.where("publish_time = '#{Date.today}'")
|
attachments = Attachment.where("publish_time = '#{Date.today}'")
|
||||||
attachments.each do |attachment|
|
attachments.each do |attachment|
|
||||||
attachment.update_column('is_publish', 1)
|
attachment.update_column('is_publish', 1)
|
||||||
end
|
end
|
||||||
|
Rails.logger.info("log--------------------------------resource_publish end")
|
||||||
|
puts "--------------------------------resource_publish end"
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1550,6 +1550,7 @@ function pop_box_new(value, Width, Height){
|
||||||
showModal('ajax-modal', Width + 'px');
|
showModal('ajax-modal', Width + 'px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
|
$('#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').css({"padding":"0","overflow":"hidden"});
|
||||||
$('#ajax-modal').parent().attr("id","popupWrap");
|
$('#ajax-modal').parent().attr("id","popupWrap");
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
||||||
.w557{ width:557px;}
|
.w557{ width:557px;}
|
||||||
.w570 {width:570px !important;}
|
.w570 {width:570px !important;}
|
||||||
.w576{ width:576px;}
|
.w576{ width:576px;}
|
||||||
.w590{ width:590px; !important;}
|
.w590{ width:590px !important;}
|
||||||
.w607 {width:607px;}
|
.w607 {width:607px;}
|
||||||
.w664{ width:664px;}
|
.w664{ width:664px;}
|
||||||
.w683{ width:683px;}
|
.w683{ width:683px;}
|
||||||
|
|
|
@ -41,7 +41,6 @@ input.sendSourceText:hover {background-color:#297fb8;}
|
||||||
.resourcesSendTo {float:left; height:20px; margin-top:15px;}
|
.resourcesSendTo {float:left; height:20px; margin-top:15px;}
|
||||||
.resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;}
|
.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;}
|
.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;}
|
.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;}
|
||||||
|
@ -74,7 +73,7 @@ div.disable_link {background-color: #c1c1c1 !important;}
|
||||||
.homeworkListForm{height: 160px;width: 550px;overflow: scroll;overflow-x: hidden;}
|
.homeworkListForm{height: 160px;width: 550px;overflow: scroll;overflow-x: hidden;}
|
||||||
|
|
||||||
/*引用资源库弹窗*/
|
/*引用资源库弹窗*/
|
||||||
.popbox{position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;}
|
.popbox{position:fixed !important; left:50%; top:50% ;margin:-100px 0 0 -150px; -moz-border-radius:5px;}
|
||||||
.referenceResourcesPopup {width:750px !important; height:500px !important; border:3px solid #269ac9 !important; padding:0 16px 16px 16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
|
.referenceResourcesPopup {width:750px !important; height:500px !important; border:3px solid #269ac9 !important; padding:0 16px 16px 16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
|
||||||
.referenceText {font-size:16px; color:#269ac9; line-height:16px; display:inline-block; font-weight:bold;}
|
.referenceText {font-size:16px; color:#269ac9; line-height:16px; display:inline-block; font-weight:bold;}
|
||||||
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
|
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
|
||||||
|
@ -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;}
|
.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 .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; }
|
.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
|
||||||
.ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
|
.ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
|
||||||
|
|
|
@ -1512,3 +1512,6 @@ a.syllabusbox_a_blue{
|
||||||
|
|
||||||
/*20160912问卷调查*/
|
/*20160912问卷调查*/
|
||||||
.dash-block {border:1px dashed #ddd;}
|
.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;}
|
||||||
|
|
Loading…
Reference in New Issue