Conflicts: app/views/student_work/new.html.erb app/views/users/_user_homework_form.html.erb db/schema.rb public/stylesheets/courses.cssdev_hjq
commit
b61a0a98e5
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the org_subfields controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,20 @@
|
|||||||
|
class OrgSubfieldsController < ApplicationController
|
||||||
|
def create
|
||||||
|
@subfield = OrgSubfield.create(:name => params[:name])
|
||||||
|
@organization = Organization.find(params[:organization_id])
|
||||||
|
@organization.org_subfields << @subfield
|
||||||
|
@subfield.update_attributes(:priority => @subfield.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@subfield = OrgSubfield.find(params[:id])
|
||||||
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
|
@subfield.destroy
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@subfield = OrgSubfield.find(params[:id])
|
||||||
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
|
@subfield.update_attributes(:name => params[:name])
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module OrgSubfieldsHelper
|
||||||
|
end
|
@ -0,0 +1,4 @@
|
|||||||
|
class EditorOfDocument < ActiveRecord::Base
|
||||||
|
belongs_to :user, :class_name => 'User', :foreign_key => 'editor_id'
|
||||||
|
belongs_to :org_document_comment
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class OrgSubfield < ActiveRecord::Base
|
||||||
|
belongs_to :organization, :foreign_key => :organization_id
|
||||||
|
end
|
@ -1,3 +1,6 @@
|
|||||||
|
<% if @course %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% else %>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% end %>
|
||||||
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%");
|
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%");
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
window.location.href='<%= forum_memo_path(:forum_id=>@memo.forum_id,:id=>@memo.id ) %>'
|
@ -0,0 +1,5 @@
|
|||||||
|
<% if @flag%>
|
||||||
|
window.location.href='<%= forum_memo_path(:forum_id=>@memo.forum_id,:id=>@memo.id ) %>'
|
||||||
|
<%else%>
|
||||||
|
$("#error").html('内容填写存在错误');
|
||||||
|
<% end %>
|
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>");
|
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
|
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
|
@ -0,0 +1,4 @@
|
|||||||
|
$("#org_subfield_list").html("");
|
||||||
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields }) %>");
|
||||||
|
$("#sub_field_left_lists").html("");
|
||||||
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,4 @@
|
|||||||
|
$("#org_subfield_list").html("");
|
||||||
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields }) %>");
|
||||||
|
$("#sub_field_left_lists").html("");
|
||||||
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,3 @@
|
|||||||
|
$("#subfield_show_<%= @subfield.id %>").html("<%= @subfield.name %>");
|
||||||
|
$("#sub_field_left_lists").html("");
|
||||||
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,32 @@
|
|||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<%= link_to "组织首页",organization_path(@organization, :show_homepage => 1), :class => 'homepageMenuText' %>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
|
||||||
|
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
|
||||||
|
<ul >
|
||||||
|
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||||
|
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
||||||
|
<ul >
|
||||||
|
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% organization.org_subfields.each do |field| %>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses_#{field.id}').slideToggle();"><%= field.name %></a>
|
||||||
|
<%=link_to "", :title => "关联#{field.name}"%>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
||||||
|
</div>
|
||||||
|
<% end %>
|
@ -0,0 +1,71 @@
|
|||||||
|
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
|
||||||
|
<div class="homepagePostDes" style="width:690px;">
|
||||||
|
|
||||||
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||||
|
|
||||||
|
<% unless document.content.blank? %>
|
||||||
|
<div class="homepagePostIntro" >
|
||||||
|
<%= document.content.html_safe %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if params[:show_homepage].nil? %>
|
||||||
|
<div class="homepagePostDate" style="float:right;">
|
||||||
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostDate" style="float:right;">
|
||||||
|
最后编辑:<%= User.find(EditorOfDocument.where("org_document_comment_id =?", document.id).order("created_at desc").first.editor_id).realname %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<!-- <%# if defined?(home_id) %>
|
||||||
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||||
|
<%# end %>-->
|
||||||
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
||||||
|
<div class="homepagePostSetting">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li>
|
||||||
|
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
|
||||||
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to "编辑首页", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 2), :class => "postOptionLink" %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to "删除首页", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:remote => true, :class => 'postOptionLink' %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function expand_reply(container, btnid) {
|
||||||
|
var target = $(container);
|
||||||
|
var btn = $(btnid);
|
||||||
|
if (btn.data('init') == '0') {
|
||||||
|
btn.data('init', 1);
|
||||||
|
btn.html('收起回复');
|
||||||
|
target.show();
|
||||||
|
} else {
|
||||||
|
btn.data('init', 0);
|
||||||
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser fb">已有栏目</li>
|
||||||
|
<li class="orgListRole fb">状态</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">组织首页</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">动态</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">项目</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">课程</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<% subfields.each do |field| %>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser"><div id="subfield_show_<%= field.id %>"><%= field.name %></div><div id="subfield_edit_<%= field.id %>" style="display:none;">
|
||||||
|
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;" /></div></li>
|
||||||
|
<li class="orgListUser">新增</li>
|
||||||
|
<%= link_to "删除",org_subfield_path(field), :method => 'delete',:remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr5" %>
|
||||||
|
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function edit(show_id, edit_id){
|
||||||
|
$(show_id).toggle();
|
||||||
|
$(edit_id).toggle();
|
||||||
|
$(edit_id).find('input').focus();
|
||||||
|
$(edit_id).find('input').on('keypress',function(e){
|
||||||
|
if(e.keyCode == 13){
|
||||||
|
this.blur();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function update_subfield(show_id, edit_id, field_id, input_value) {
|
||||||
|
if ($(show_id).html().trim() != input_value.trim()) {
|
||||||
|
if (confirm('确定修改为' + input_value + "?"))
|
||||||
|
$.ajax({
|
||||||
|
url :"/org_subfields/" + field_id + "?name=" + input_value,
|
||||||
|
type :'put'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$(show_id).show();
|
||||||
|
$(edit_id).hide();
|
||||||
|
// $(edit_id).focus();
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1 @@
|
|||||||
|
window.location.href = "<%= organization_path(@org) %>";
|
@ -0,0 +1,35 @@
|
|||||||
|
<div class="resources mt10" id="user_activity_<%= user_activity_id %>">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<div class="homepagePostTo break_word mt-4">
|
||||||
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
<% end %> TO
|
||||||
|
<%= link_to activity.project.name.to_s+" | 项目附件", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostTitle break_word hidden fl m_w600">
|
||||||
|
<%= link_to format_activity_title("#{l(:label_attachment)}: #{activity.filename}"), {:controller => 'attachments', :action => 'show', :id => activity.id}, :class => "problem_tit fl fb" %>
|
||||||
|
<%#= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostDate">
|
||||||
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
|
</div>
|
||||||
|
<p class="mt5 break_word"><%= textAreailizable act, :description %><br/></p>
|
||||||
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||||
|
<div id="intro_content_<%= user_activity_id %>">
|
||||||
|
<%#= activity.description.html_safe %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,38 @@
|
|||||||
|
<% project = Project.find(activity.project_id) %>
|
||||||
|
<% user = User.find(project.user_id)%>
|
||||||
|
<div class="resources mt10">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<div class="homepagePostTo break_word mt-4">
|
||||||
|
<% if user.try(:realname) == ' ' %>
|
||||||
|
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
|
||||||
|
<% end %>
|
||||||
|
TO
|
||||||
|
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostTitle break_word" >
|
||||||
|
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDate">
|
||||||
|
创建时间:<%= format_time(project.created_on) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1 @@
|
|||||||
|
$("#show_more_forge_activities").replaceWith("<%= escape_javascript( render :partial => 'projects/project_activities',:locals => {:forge_acts => @events_pages, :page => @page,:type => @type} )%>");
|
@ -0,0 +1,28 @@
|
|||||||
|
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
||||||
|
<% if @homework.end_time < Date.today %>
|
||||||
|
<% if revise_attachment && @is_teacher %>
|
||||||
|
<div class="resubAtt mb15">
|
||||||
|
<span class="resubTitle">追加修订附件</span>
|
||||||
|
</div>
|
||||||
|
<div class="mb10">
|
||||||
|
<span class="tit_fb"> 追加附件:</span>
|
||||||
|
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
||||||
|
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %> (<%=revise_attachment_status @homework,revise_attachment %>)
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if work.user == User.current %>
|
||||||
|
<div class="resubAtt mb15">
|
||||||
|
<span class="resubTitle">追加修订附件</span>
|
||||||
|
</div>
|
||||||
|
<% if revise_attachment %>
|
||||||
|
<div class="mb10">
|
||||||
|
<span class="tit_fb"> 追加附件:</span>
|
||||||
|
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
||||||
|
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="mb10">
|
||||||
|
<a href="javascript:void(0);" onclick="show_upload();" class="blueCir ml5" title="请选择文件上传">上传附件</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -0,0 +1,50 @@
|
|||||||
|
<!--<div class="resourceUploadPopup">-->
|
||||||
|
<span class="uploadDialogText">上传附件</span>
|
||||||
|
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||||
|
<div class="uploadBoxContainer">
|
||||||
|
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||||
|
<div>
|
||||||
|
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="uploadBox" id="uploadReviseBox">
|
||||||
|
<input type="hidden" name="attachment_type" value="7">
|
||||||
|
<a href="javascript:void(0);" class="uploadIcon f14" name="button" id="choose_revise_attach" onclick="_file.click();" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">
|
||||||
|
<span class="chooseFile">选择文件</span></a>
|
||||||
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
|
:id => '_file',
|
||||||
|
:class => ie8? ? '':'file_selector',
|
||||||
|
:multiple => true,
|
||||||
|
:onchange => 'addReviseInputFiles(this,"'+'upload_files_submit_btn'+'");',
|
||||||
|
:style => ie8? ? '': 'display:none',
|
||||||
|
:data => {
|
||||||
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||||
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||||
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||||
|
:upload_path => uploads_path(:format => 'js'),
|
||||||
|
:description_placeholder => l(:label_optional_description),
|
||||||
|
:field_is_public => l(:field_is_public),
|
||||||
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
|
:file_count => l(:label_file_count),
|
||||||
|
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||||
|
:delete_all_files => l(:text_are_you_sure_all)
|
||||||
|
} %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||||
|
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||||
|
</div>
|
||||||
|
<div class="uploadResourceIntr">
|
||||||
|
<div class="uploadResourceName">最多只能上传一个小于<span class="c_red">50MB</span>的附件</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div style="margin-top: 10px" >
|
||||||
|
<div class="courseSendSubmit">
|
||||||
|
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
||||||
|
</div>
|
||||||
|
<div class="courseSendCancel">
|
||||||
|
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
@ -0,0 +1,33 @@
|
|||||||
|
<div id="popbox02">
|
||||||
|
<div class="ni_con">
|
||||||
|
<span class="f16 fontBlue fb">请您确认刚刚上传的作品信息</span>
|
||||||
|
<p class="f14 mt5">
|
||||||
|
<span class="fb">作品名称:</span><%=@student_work.name%>
|
||||||
|
</p>
|
||||||
|
<p class="f14 mt5">
|
||||||
|
<span class="fb">作品描述:</span><%=@student_work.description%>
|
||||||
|
</p>
|
||||||
|
<p class="mt5">
|
||||||
|
<span class="fl fb mr30">附</span><span class="fb fl">件:</span>
|
||||||
|
<% if @student_work.attachments.empty? %>
|
||||||
|
<span class="fl c_red"><%= "无附件"%></span>
|
||||||
|
<% else %>
|
||||||
|
<div class="fl grey_c">
|
||||||
|
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="ni_btn mt10">
|
||||||
|
<a href="javascript:" class="tijiao" onclick="clickOK();" style="margin-bottom: 15px; margin-left: 55px;" >
|
||||||
|
确 定
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function clickOK() {
|
||||||
|
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,2 @@
|
|||||||
|
closeModal();
|
||||||
|
$("#revise_attachment").html('<%= escape_javascript( render :partial => 'revise_attachment' ,:locals=>{ :work => @work})%>');
|
@ -0,0 +1,12 @@
|
|||||||
|
class CreateOrgDocumeEditor < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :editor_of_documents do |t|
|
||||||
|
t.integer :editor_id
|
||||||
|
t.integer :org_document_comment_id
|
||||||
|
t.timestamp :created_at
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,12 @@
|
|||||||
|
class CopyDocumentCreatedAtForEditorOfDocument < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
OrgDocumentComment.all.each do |doc|
|
||||||
|
if doc.parent.nil?
|
||||||
|
EditorOfDocument.create(:editor_id => doc.creator_id, :org_document_comment_id => doc.id, :created_at => doc.updated_at)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
class AddAttachmentType < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Attachmentstype.create(typeId:3,typeName:'修订附件')
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddForkedFromProjectIdToProjects < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :forked_from_project_id, :integer
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class CreateOrgSubfields < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :org_subfields do |t|
|
||||||
|
t.integer :organization_id
|
||||||
|
t.integer :priority
|
||||||
|
t.string :name
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddForkedCountToProjects < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :forked_count, :integer
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,21 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
#需要在0点以后执行
|
||||||
|
namespace :exercise_deadline_warn do
|
||||||
|
desc "exercise deadline warn"
|
||||||
|
task :deadline_warn => :environment do
|
||||||
|
#exercise_status 1 未发布 2 已发布 3已截止
|
||||||
|
exercises = Exercise.where("exercise_status = 2 and date_format(end_time,'%Y-%m-%d')= '#{Date.today}'") #截止日期都是当天 23.59分,所以年月日相等的一定是今晚会截止的测验
|
||||||
|
exercises.each do |exercise|
|
||||||
|
course = exercise.course
|
||||||
|
course.members.each do |m|
|
||||||
|
#CourseMessage status 1 未发布 status 2 已发布 status 3 已发布快截止了
|
||||||
|
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 3) unless m.user.allowed_to?(:as_teacher,m)
|
||||||
|
end
|
||||||
|
# if homework.course_acts.size == 0
|
||||||
|
# homework.course_acts << CourseActivity.new(:user_id => homework.user_id,:course_id => homework.course_id)
|
||||||
|
# end
|
||||||
|
# 邮件通知
|
||||||
|
#Mailer.run.homework_added(homework)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,22 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
namespace :exercise_publish do
|
||||||
|
desc "publish exercise and end exercise"
|
||||||
|
task :publish => :environment do
|
||||||
|
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)
|
||||||
|
course = exercise.course
|
||||||
|
course.members.each do |m|
|
||||||
|
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
task :end => :environment do
|
||||||
|
exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||||
|
exercises.each do |exercise|
|
||||||
|
exercise.update_column('exercise_status', 3)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe OrgSubfieldsController, :type => :controller do
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in new issue