Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
parent
78af80394a
commit
dde40ed3b3
|
@ -84,7 +84,7 @@ class FilesController < ApplicationController
|
||||||
|
|
||||||
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
|
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
|
||||||
@containers += @project.versions.includes(:attachments).reorder(sort).all
|
@containers += @project.versions.includes(:attachments).reorder(sort).all
|
||||||
|
getattachtype
|
||||||
show_attachments @containers
|
show_attachments @containers
|
||||||
|
|
||||||
render :layout => !request.xhr?
|
render :layout => !request.xhr?
|
||||||
|
@ -122,6 +122,7 @@ class FilesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
getattachtype
|
||||||
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
|
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
|
||||||
|
|
||||||
show_attachments @containers
|
show_attachments @containers
|
||||||
|
@ -275,8 +276,7 @@ class FilesController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
format.html
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
<% attachmenttypes = @course.attachmenttypes %>
|
<% attachmenttypes = @course.attachmenttypes %>
|
||||||
<% sufixtypes = @course.contenttypes %>
|
<% sufixtypes = @course.contenttypes %>
|
||||||
|
|
||||||
<span class="borad-title">
|
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
|
||||||
<%= l(:label_coursefile_sharingarea) %>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div class="content-title-top">
|
<div class="content-title-top">
|
||||||
|
|
||||||
|
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div id="file_buttons" class="nhidden">
|
<div id="file_buttons" class="nhidden">
|
||||||
<%= 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_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) %>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
<% if sufixtypes.any? %>
|
<% if sufixtypes.any? %>
|
||||||
|
|
||||||
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
|
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
|
||||||
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') + options_for_select(sufixtypes),
|
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
|
||||||
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
|
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,4 +69,5 @@
|
||||||
<div id="all_browse_div" class="all_browse_div">
|
<div id="all_browse_div" class="all_browse_div">
|
||||||
<%= render :partial => 'course_show_all_attachment' %>
|
<%= render :partial => 'course_show_all_attachment' %>
|
||||||
</div>
|
</div>
|
||||||
<% html_title(l(:label_course_file)) -%>
|
|
||||||
|
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -72,4 +72,4 @@
|
||||||
<%= render :partial => 'show_all_attachment' %>
|
<%= render :partial => 'show_all_attachment' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% html_title(l(:project_module_files)) -%>
|
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<% if @attachtype==0 && @contenttype=='0' %>
|
||||||
|
<% if @project%>
|
||||||
|
<%= render partial: "show_all_attachment"%>
|
||||||
|
<% elsif @course%>
|
||||||
|
<%= render partial: "course_show_all_attachment"%>
|
||||||
|
<%end%>
|
||||||
|
<%else%>
|
||||||
|
<% if @project%>
|
||||||
|
<%= render partial: "sort_by_attachtypel"%>
|
||||||
|
<% elsif @course%>
|
||||||
|
<%= render partial: "course_sort_by_attachtypel"%>
|
||||||
|
<%end%>;
|
||||||
|
<%end%>
|
|
@ -1,13 +1,13 @@
|
||||||
<% if @attachtype==0 && @contenttype=='0' %>
|
<% if @attachtype==0 && @contenttype=='0' %>
|
||||||
<% if @project%>
|
<% if @project%>
|
||||||
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
|
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
|
||||||
<% elsif @course%>
|
<% elsif @course%>
|
||||||
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
|
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
|
||||||
<%end%>
|
<%end%>
|
||||||
<%else%>
|
<%else%>
|
||||||
<% if @project%>
|
<% if @project%>
|
||||||
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
|
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
|
||||||
<% elsif @course%>
|
<% elsif @course%>
|
||||||
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
|
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
|
||||||
<%end%>;
|
<%end%>;
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
if (textStatus == 'success') {
|
if (textStatus == 'success') {
|
||||||
eval(xhr.responseText);
|
eval(xhr.responseText);
|
||||||
} else if (textStatus == 'error') {
|
} else if (textStatus == 'error') {
|
||||||
// alert('error');
|
alert('error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function course_attachmenttypes_searchex(value) {
|
function course_attachmenttypes_searchex(value) {
|
||||||
<% if @course %>
|
<% if @course%>
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
@ -120,15 +120,16 @@
|
||||||
|
|
||||||
function course_attachment_contenttypes_searchex(value) {
|
function course_attachment_contenttypes_searchex(value) {
|
||||||
<% if @course%>
|
<% if @course%>
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
|
||||||
type: "POST",
|
|
||||||
data: {
|
|
||||||
type: $('#attachment_browse').val(),
|
|
||||||
contentType: encodeURIComponent(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
}).complete(eval_ajax);
|
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
type: $('#attachment_browse').val(),
|
||||||
|
contentType: encodeURIComponent(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
}).complete(eval_ajax);
|
||||||
<%end%>
|
<%end%>
|
||||||
}
|
}
|
||||||
function course_attachtype_edit(value) {
|
function course_attachtype_edit(value) {
|
||||||
|
|
Loading…
Reference in New Issue