+ <%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %>
+ 未开启匿评作业将直接进入众评点赞阶段
+
+
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
匿评分配数量不宜太大,否则会影响开启匿评速度
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index acbcbc2fa..036289b0a 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -28,14 +28,17 @@
<% else %>
-
- <%= link_to @bid.comment_status == 2 ? "已评作品" : "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%>
-
+ <% if @bid.open_anonymous_evaluation == 1%>
+
+
+ <%= link_to @bid.comment_status == 2 ? "已评作品" : "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%>
+
+ <% end %>
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',:remote => true}%>
- <% if @bid.comment_status == 2 %>
-
+ <% if @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
+
<%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {id: 'all_homeworks',:remote => true}%>
diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb
index 322b8cdc3..0a2d17e7d 100644
--- a/app/views/bids/edit.html.erb
+++ b/app/views/bids/edit.html.erb
@@ -43,35 +43,66 @@
{
var evaluation_num = $.trim($("#bid_evaluation_num").val());
var regex = /^\d+$/;
- if(evaluation_num=="")
+ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
- $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
- $("#bid_evaluation_num_span").css('color','#ff0000');
- return false;
- }
- else if(regex.test(evaluation_num))
- {
- if(evaluation_num > 0)
+ if(evaluation_num=="")
{
- $("#bid_evaluation_num_span").text("填写正确");
- $("#bid_evaluation_num_span").css('color','#008000');
- return true;
+ $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
+ $("#bid_evaluation_num_span").css('color','#ff0000');
+ return false;
+ }
+ else if(regex.test(evaluation_num))
+ {
+ if(evaluation_num > 0)
+ {
+ $("#bid_evaluation_num_span").text("填写正确");
+ $("#bid_evaluation_num_span").css('color','#008000');
+ return true;
+ }
+ else
+ {
+ $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
+ $("#bid_evaluation_num_span").css('color','#ff0000');
+ return false;
+ }
}
else
{
- $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
+ $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
}
else
{
- $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
- $("#bid_evaluation_num_span").css('color','#ff0000');
- return false;
+ return true;
}
}
+ $(function(){
+ $("#bid_open_anonymous_evaluation").click(function(){
+ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
+ {
+ $("#evaluation_num_p").slideDown();
+ }
+ else
+ {
+ $("#evaluation_num_p").slideUp();
+ }
+ });
+ });
+
+ $(function(){
+ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
+ {
+ $("#evaluation_num_p").show();
+ }
+ else
+ {
+ $("#evaluation_num_p").hide();
+ }
+ });
+
function submitHomework(id)
{
if(regexDeadLine()&®exName()&®exEvaluationNum())
diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb
index fd1dd3e00..cde2019a1 100644
--- a/app/views/boards/_course_show.html.erb
+++ b/app/views/boards/_course_show.html.erb
@@ -19,8 +19,9 @@
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
-
- <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>
+
+ <%= l(:button_submit)%>
+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
<% end %>
diff --git a/app/views/courses/_course_ad.html.erb b/app/views/courses/_course_ad.html.erb
index f8b4781f8..efac79afc 100644
--- a/app/views/courses/_course_ad.html.erb
+++ b/app/views/courses/_course_ad.html.erb
@@ -33,12 +33,11 @@
var xstep=1; // 移动步长,此参数越小,移动越平滑,最小值为1
var delay_time=60; // 每步的时间间隔,此参数越小,移动速度越快
var YY=0;
- var screen_height = $(window).height(); //浏览器当前窗口文档的高度
- var screen_width = $(window).width(); //浏览器当前窗口文档的宽度
window.setInterval(function(){move();},delay_time);
function move()
{
+ var screen_height = $(window).height(); //浏览器当前窗口文档的高度
var floatpoint_height = $("#floatpoint").height();
YY += xstep;
if(YY <= 0){xstep = 1; YY = 0;} //如果浮动层超出了上界,则设定移动方向为向下;并设定层的位置为正好在上界处
@@ -47,9 +46,9 @@
xstep = -1;
YY=(screen_height-floatpoint_height);
}
- $("#floatpoint").css("top",YY);
+ $("#floatpoint").css("margin-top",YY);
}
- function change_size(){var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10);}
+ function change_size(){var screen_width = $(window).width();var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10).css("position", "fixed");}
$(document).ready(function(){change_size();});
- $(window).resize(function(){screen_width = $(window).width();change_size();});
+ $(window).resize(function(){change_size();});
\ No newline at end of file
diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb
index 9d5ad1155..8ce6be3fe 100644
--- a/app/views/courses/_homework_form.html.erb
+++ b/app/views/courses/_homework_form.html.erb
@@ -49,6 +49,10 @@
<%= f.select :proportion, proportion_option %>
+ <%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %>
+ 未开启匿评作业将直接进入众评点赞阶段
+
+
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
匿评分配数量不宜太大,否则会影响开启匿评速度
diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb
index 753aa20c8..7b6784243 100644
--- a/app/views/courses/new_homework.html.erb
+++ b/app/views/courses/new_homework.html.erb
@@ -43,35 +43,55 @@
{
var evaluation_num = $.trim($("#bid_evaluation_num").val());
var regex = /^\d+$/;
- if(evaluation_num=="")
+ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
- $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
- $("#bid_evaluation_num_span").css('color','#ff0000');
- return false;
- }
- else if(regex.test(evaluation_num))
- {
- if(evaluation_num > 0)
+ if(evaluation_num=="")
{
- $("#bid_evaluation_num_span").text("填写正确");
- $("#bid_evaluation_num_span").css('color','#008000');
- return true;
+ $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
+ $("#bid_evaluation_num_span").css('color','#ff0000');
+ return false;
+ }
+ else if(regex.test(evaluation_num))
+ {
+ if(evaluation_num > 0)
+ {
+ $("#bid_evaluation_num_span").text("填写正确");
+ $("#bid_evaluation_num_span").css('color','#008000');
+ return true;
+ }
+ else
+ {
+ $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
+ $("#bid_evaluation_num_span").css('color','#ff0000');
+ return false;
+ }
}
else
{
- $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
+ $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
}
else
{
- $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
- $("#bid_evaluation_num_span").css('color','#ff0000');
- return false;
+ return true;
}
}
+ $(function(){
+ $("#bid_open_anonymous_evaluation").click(function(){
+ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
+ {
+ $("#evaluation_num_p").slideDown();
+ }
+ else
+ {
+ $("#evaluation_num_p").slideUp();
+ }
+ });
+ });
+
function submitHomework()
{
if(regexDeadLine()&®exName()&®exEvaluationNum())
diff --git a/app/views/files/_arrow_show.erb b/app/views/files/_arrow_show.erb
new file mode 100644
index 000000000..d8f094719
--- /dev/null
+++ b/app/views/files/_arrow_show.erb
@@ -0,0 +1,10 @@
+
+<% if sort == current %>
+ <% if order =="asc" %>
+ ↑
+ <% elsif order == "desc" %>
+ ↓
+ <% else %>
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb
new file mode 100644
index 000000000..f65ba8d41
--- /dev/null
+++ b/app/views/files/_attachement_list.html.erb
@@ -0,0 +1,46 @@
+
+
+<% if defined?(container) && container && container.saved_attachments %>
+ <% container.attachments.each_with_index do |attachment, i| %>
+
+ <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
+ <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
+ <%= l(:field_is_public)%>:
+ <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
+ <%= if attachment.id.nil?
+ #待补充代码
+ else
+ link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
+ end
+ %>
+ <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
+
+ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
+
+ <% end %>
+<% end %>
+
+
+
+上传文件
+<%= file_field_tag 'attachments[dummy][file]',
+ :id => '_file',
+ :class => 'file_selector',
+ :multiple => true,
+ :onchange => 'addInputFiles(this);',
+ :style => '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)
+ } %>
+
+
+
+ <%= l(:label_no_file_uploaded)%>
+
+ (<%= l(:label_max_size) %>:
+ <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
+
\ No newline at end of file
diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb
index 46a954746..49747ae11 100644
--- a/app/views/files/_course_file.html.erb
+++ b/app/views/files/_course_file.html.erb
@@ -2,84 +2,43 @@
<% sufixtypes = @course.contenttypes %>
-<%= t(:label_user_course) %>资源共享区
+<%= stylesheet_link_tag 'resource', :media => 'all' %>
+
- <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %>
- <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @course) %>
-
-
- <%= render :partial => 'course_new', locals: {course: @course} %>
-
+
+
+
+ <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
+ <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
+ <%= submit_tag "课内搜索", :class => "re_schbtn b_dblue",:name => "incourse"%>
+ <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite" %>
+ <% end %>
+ <% if is_course_teacher(User.current,@course) %>
+
上传资源
+ <% end %>
+
+
-
-
- 搜索
- <%= form_tag(
- attachments_autocomplete_path(:format => 'js'),
- :remote => true,
- :method => :post) do %>
- <%= label_tag(:attach_search, "按关键字搜索:") %>
- <%= text_field_tag(:attach_search) %>
- <%#= submit_tag("Search") %>
- <% end -%>
- <%= form_tag course_attach_relation_path(:format => 'js'),
- method: :post,
- remote: true,
- id: "relation_file_form",
- :class => 'hidden' do %>
- <%= hidden_field_tag(:class_name, 'course') %>
- <%= hidden_field_tag(:class_id, params[:course_id]) %>
-
-
-
- <%= submit_tag(l(:button_add)) -%>
-
- <% end -%>
-
-
-
-
-
-
- <%= l(:label_files_filter) %>
- <% if attachmenttypes.any? %>
-
- <%= l(:attachment_browse) %>
- <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0' ) +options_from_collection_for_select(attachmenttypes, "id", "typeName", params[:type]),
-
- :onchange => "course_attachmenttypes_searchex(this.value)" %>
- <% end %>
- <% if sufixtypes.any? %>
-
- <%= l(:attachment_sufix_browse) %>
- <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
- :onchange => "course_attachment_contenttypes_searchex(this.value)" %>
- <% end %>
-
+
+<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
+
-<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:course_id => @course.id, :format => 'js') }')" %>
-
-<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
-
-
- <%#= render :partial => 'course_show_all_attachment' %>
- <% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
-
- <%= render partial: "course_show_all_attachment"%>
-
- <%else%>
-
- <%= render partial: "course_sort_by_attachtypel"%>
-
- <%end%>
-
<% html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
new file mode 100644
index 000000000..fa22c404d
--- /dev/null
+++ b/app/views/files/_course_list.html.erb
@@ -0,0 +1,56 @@
+<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
+
+
共有 <%= User.current.member_of_course?(course) ? all_attachments.count : 0 %> 个资源
+
+
+
+<% curse_attachments.each do |file| %>
+ <%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
+ <%next%>
+ <%end%>
+
+
+ <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
+ <% if is_course_teacher(User.current,@course) %>
+ <%= link_to "选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %>
+ <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
+
+ <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
+
+ <% else %>
+ <%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %>
+ <% end %>
+
+ <% else %>
+ <%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %>
+ <% end %>
+
+
+
+
文件大小:<%= number_to_human_size(file.filesize) %>
+ <%= link_to( l(:button_delete), attachment_path(file),
+ :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
+
<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用0
+
+
+
+ <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
+ <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
+
+
+
+<% end %>
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
+
+
\ No newline at end of file
diff --git a/app/views/files/_show_quote_resource.html.erb b/app/views/files/_show_quote_resource.html.erb
new file mode 100644
index 000000000..ef907f40f
--- /dev/null
+++ b/app/views/files/_show_quote_resource.html.erb
@@ -0,0 +1,24 @@
+
+
+
+
将此课件引入我的课程资源库
+
+ <%= form_tag course_attach_relations_path,
+ method: :post,
+ remote: true,
+ id: "relation_file_form" do %>
+ <%= hidden_field_tag(:file_id, file.id) %>
+ <%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
+
引 用 取 消
+ <% end -%>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb
new file mode 100644
index 000000000..a979715de
--- /dev/null
+++ b/app/views/files/_upload_show.html.erb
@@ -0,0 +1,26 @@
+
+
+
上传资源
+
+ <%= error_messages_for 'attachment' %>
+
上传出现错误,请您检查您的网络环境,并刷新页面重新上传。
+ <%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form") do %>
+
文件浏览:
+ <%= render :partial => 'attachement_list',:locals => {:course => course} %>
+
+
上传资源 取 消
+ <% end %>
+
+
+
+ <% content_for :header_tags do %>
+ <%= javascript_include_tag 'attachments' %>
+ <% end %>
+
+
+
\ No newline at end of file
diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb
index 0eca9c1ed..90215c16c 100644
--- a/app/views/files/create.js.erb
+++ b/app/views/files/create.js.erb
@@ -27,6 +27,8 @@ $('#upload_file_div').slideToggle('slow');
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<%elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
+closeModal();
+$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
<%end%>
<% end %>
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index 69b41fc28..fe04c4e3f 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -1,10 +1,11 @@
+
<% if @isproject %>
<%= render :partial => 'project_file', locals: {project: @project} %>
<% else %>
<%= render :partial => 'course_file', locals: {course: @course} %>
<% end %>
-
+
- (<%= l(:label_forums_max_length) %>)
+
+ (<%= l(:label_forums_max_length) %>)
+