#1381修复选择相关内容类型、文件类型后,资源列表表头显示异常的BUG

2.格式化页面代码
 3.项目资源列表也有相关问题,一并修复
This commit is contained in:
sw 2014-10-21 16:38:16 +08:00
parent 87788ab34c
commit c76439c515
9 changed files with 142 additions and 155 deletions

View File

@ -2,11 +2,11 @@
<% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %>
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<span class="borad-title">
<%= l(:label_coursefile_sharingarea) %>
</span>
<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 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) %>
@ -55,7 +55,7 @@
<% if sufixtypes.any? %>
&nbsp;
<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)" %>
<% end %>
</div>

View File

@ -9,57 +9,55 @@
<col class="vzebra-even"/>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<!-- <col class="vzebra-odd"/> -->
</colgroup>
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
<tbody>
<%# @containers.each do |container| %>
<%# next if container.attachments.empty? -%>
<%# if container.is_a?(Version) -%>
<!--<tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%#= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th>
</tr>-->
<%# end -%>
<% if @curse_attachments != nil %>
<% @curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize">
<%= number_to_human_size(file.filesize) %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName unless file.attachmentstype.nil? %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.typeName unless file.attachmentstype.nil? %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type">
<%= file.show_suffix_type %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads">
<%= file.downloads %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -77,13 +75,6 @@
</tr>
<% end -%>
<% end %>
<%# reset_cycle %>
<%# end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>
<!--分页-->

View File

@ -3,25 +3,22 @@
<% attachmenttypes = @course.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @course) %>
<table class="list files" id="ver-zebra">
<table class="list files" id="ver-zebra" style="table-layout: fixed;">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<!-- <col class="vzebra-odd"/> -->
</colgroup>
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
</tr>
</thead>
<tbody>
@ -33,28 +30,36 @@
<% end %>
<% if isTypeOk(file, selAttachType, selContentType) %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %></span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %>
</span>
&nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type">
<%= file.show_suffix_type %>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td class="downloads">
<%= file.downloads %>
</td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -75,9 +80,6 @@
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>

View File

@ -15,52 +15,51 @@
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure",:class => "tableth") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",:class => "tableth") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
<tbody>
<%# @containers.each do |container| %>
<%# next if container.attachments.empty? -%>
<%# if container.is_a?(Version) -%>
<!--tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%#= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th>
</tr-->
<%# end -%>
<% if @curse_attachments != nil %>
<% @curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of?(@project)%>
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize">
<%= number_to_human_size(file.filesize) %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.typeName %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type">
<%= file.show_suffix_type %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads">
<%= file.downloads %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -73,15 +72,13 @@
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
<div class="read-more hidden">
<a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
</div>
</td>
</tr>
<% end -%>
<%# reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>
</div>

View File

@ -3,7 +3,7 @@
<% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra">
<table class="list files" id="ver-zebra" style="table-layout: fixed;">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
@ -13,15 +13,13 @@
</colgroup>
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
</tr>
</thead>
<tbody>
@ -33,28 +31,38 @@
<% end %>
<% if isTypeOk(file, selAttachType, selContentType) %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td class="filesize">
<%= number_to_human_size(file.filesize) %>
</td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %></span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %>
</span>
&nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type">
<%= file.show_suffix_type %>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td class="downloads">
<%= file.downloads %>
</td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -67,7 +75,8 @@
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
<div class="read-more hidden">
<a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
</div>
</td>
</tr>
@ -75,9 +84,6 @@
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>

View File

@ -1,13 +1,13 @@
<% if @attachtype==0 && @contenttype=='0' %>
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
<%end%>
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
<%end%>
<%else%>
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
<%end%>;
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
<%end%>;
<%end%>

View File

@ -120,16 +120,15 @@
function course_attachment_contenttypes_searchex(value) {
<% if @course%>
$.ajax({
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
}).complete(eval_ajax);
<%end%>
}
function course_attachtype_edit(value) {

View File

@ -1,12 +1,3 @@
<%= error_messages_for 'bid' %>
<!--[form:project]-->
<!-- % unless @memo.parent_id %>
<%# if @memo.safe_attribute? 'sticky' %>
<%#= f.check_box :sticky %> <lable><%= l(:label_board_sticky) %></lable>
<%# end %>
<%# if @memo.safe_attribute? 'locked' %>
<%#= f.check_box :locked %> <%#= label_tag 'memo_locked', l(:label_board_locked) %>
<%# end %>
<%# end %> -->
<p><%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %></p>
<p><%= hidden_field_tag 'subject', ||=@memo.subject %>

View File

@ -2163,3 +2163,4 @@ zh:
lable_teacher_evaluation: 作业综评
lable_course_teacher: 主讲老师
lable_course_end: 课程学期已结束
lable_file_sharingarea: 资源共享区