socialforge/app/views/files/_course_file.html.erb

55 lines
2.6 KiB
Plaintext
Raw Normal View History

<% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %>
2014-10-28 22:34:51 +08:00
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<div class="content-title-top">
2014-10-28 22:34:51 +08:00
<%#= 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 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_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) %>
2014-07-17 15:05:49 +08:00
<p></p>
</div>
2014-07-21 17:33:13 +08:00
<div class="box" id="files-box">
<label for="files-box" style="font-weight:bold;">&nbsp;&nbsp;<%= l(:label_files_filter) %></label>
<% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0' ) +options_from_collection_for_select(attachmenttypes, "id", "typeName", params[:type]),
2014-07-21 17:33:13 +08:00
:onchange => "course_attachmenttypes_searchex(this.value)" %>
<% end %>
<% if sufixtypes.any? %>
&nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
2014-10-28 22:34:51 +08:00
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
2014-07-21 17:33:13 +08:00
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
<% end %>
</div>
</div>
<%= 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) %>
<div id="all_browse_div" class="all_browse_div">
<%#= 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%>
</div>
2014-10-28 22:34:51 +08:00
<% html_title(l(:label_attachment_plural)) -%>