commit
66a5db5ad3
@ -0,0 +1,11 @@
|
||||
class Attachmentstype < ActiveRecord::Base
|
||||
attr_accessible :typeId, :typeName
|
||||
has_many :attachments, :foreign_key => "attachtype",:primary_key => "id"
|
||||
|
||||
# 当前使用的文件内容分类列表
|
||||
@@SuffixArr = ['pdf','zip','doc','docx','rar','txt','jpg','bmp','xls','xlsx']
|
||||
|
||||
def suffixArr
|
||||
@@SuffixArr
|
||||
end
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<% if attachmenttypes.any? %>
|
||||
<div id="put-tag-form-<%=attachment.id%>" class="hidden">
|
||||
<%= select_tag "attachment_type",
|
||||
options_from_collection_for_select(attachmenttypes, "id",
|
||||
"typeName",attachment.attachtype), :onchange=>"attachmenttypes_change("+attachment.id.to_s + ",this.value)"%>
|
||||
</div>
|
||||
<%= link_to(image_tag('edit/edit.png'), 'javascript:void(0);',:style=>"white-space:nowrap;", :id=>"edit_box"+attachment.id.to_s ,
|
||||
:onclick =>"$('#put-tag-form-" +attachment.id.to_s+ "').show();
|
||||
$('#attach_type_id_label" +attachment.id.to_s+ "').hide();
|
||||
$('#edit_box" +attachment.id.to_s+ "').hide();") if edit_allowed %>
|
||||
|
||||
<% end %>
|
||||
|
@ -0,0 +1,72 @@
|
||||
<% selAttachType =@attachtype %>
|
||||
<% selContentType =@contenttype %>
|
||||
<% 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">
|
||||
<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('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)) %> -->
|
||||
</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 -%>
|
||||
<% container.attachments.each do |file| %>
|
||||
<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="attach_type">
|
||||
<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 class="content_type"><%= file.show_suffix_type %></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 %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='description' colspan="6">
|
||||
<div class="tags_area">
|
||||
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
|
||||
<%= 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>
|
||||
</td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<% reset_cycle %>
|
||||
<% end -%>
|
||||
<!-- %= h downloadAll(@containers) % -->
|
||||
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,71 @@
|
||||
<% selAttachType =@attachtype %>
|
||||
<% selContentType =@contenttype %>
|
||||
<% 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">
|
||||
<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('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)) %> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @containers.each do |container| %>
|
||||
<% next if container.attachments.empty? -%>
|
||||
<% container.attachments.each do |file| %>
|
||||
<% 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="attach_type">
|
||||
<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 class="content_type"><%= file.show_suffix_type %></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 %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='description' colspan="6">
|
||||
<div class="tags_area">
|
||||
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
|
||||
<%= 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>
|
||||
</td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% reset_cycle %>
|
||||
<% end -%>
|
||||
<!-- %= h downloadAll(@containers) % -->
|
||||
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -0,0 +1,5 @@
|
||||
<% if @attachtype==0 && @contenttype=='0' %>
|
||||
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
|
||||
<%else%>
|
||||
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>');
|
||||
<%end%>
|
@ -1,278 +1,188 @@
|
||||
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
|
||||
<style>
|
||||
#ver-zebra, .file_table_des
|
||||
{
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
|
||||
font-size: 12px;
|
||||
margin: 5px 10px;
|
||||
width: 98%;
|
||||
text-align: left;
|
||||
border-collapse: collapse;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
}
|
||||
#ver-zebra th
|
||||
{
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 12px 15px;
|
||||
border-right: 1px solid #fff;
|
||||
border-left: 1px solid #fff;
|
||||
color: #039;
|
||||
text-align: left;
|
||||
}
|
||||
#ver-zebra td
|
||||
{
|
||||
padding: 8px 15px;
|
||||
border-right: 1px solid #fff;
|
||||
border-left: 1px solid #fff;
|
||||
color: #669;
|
||||
}
|
||||
#ver-zebra td.description {
|
||||
background-color: white;
|
||||
padding: 0px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
div.tags_area {
|
||||
padding: 2px 10px 10px 10px;
|
||||
margin: 0px;
|
||||
margin-bottom: 10px;
|
||||
/*border-bottom: 1px dashed #CCCCCC;*/
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.tags_gradint {
|
||||
}
|
||||
.read-more{
|
||||
padding: 5px;
|
||||
border-top: 4px double #ddd;
|
||||
background: #fff;
|
||||
color: #333;
|
||||
}
|
||||
.read-more a{
|
||||
padding-right: 22px;
|
||||
background: url() no-repeat 100% 50%;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
.read-more a:hover{
|
||||
color: #000;
|
||||
}
|
||||
.vzebra-odd
|
||||
{
|
||||
background: #eff2ff;
|
||||
}
|
||||
.vzebra-even
|
||||
{
|
||||
background: #e8edff;
|
||||
}
|
||||
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
|
||||
{
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #c8d4fd;
|
||||
}
|
||||
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
|
||||
{
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #d6dfff;
|
||||
}
|
||||
.filename{
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
div.pagination{
|
||||
margin: 10px 0px;
|
||||
height: 1.5em;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
}
|
||||
.m5p5{
|
||||
display: inline-block;
|
||||
height: auto;
|
||||
color: white !important;
|
||||
margin: 8px;
|
||||
padding: 3px 7px;
|
||||
}
|
||||
.m5p5:hover {
|
||||
text-decoration: none;
|
||||
/*padding-bottom: 3px;*/
|
||||
/*border-bottom: 1px solid #666666;*/
|
||||
border-radius: 4px;
|
||||
border: 1px solid #15bccf;
|
||||
box-shadow: 3px 3px 3px #666666;
|
||||
}
|
||||
.relation_file_div{
|
||||
margin: 0px 25px;
|
||||
}
|
||||
.relation_file_div fieldset{
|
||||
margin: 0px 0px;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
transition: all 2s linear 1s;
|
||||
}
|
||||
.relation_file_div input#attach_search:focus{
|
||||
border: 1px solid #1B95C6;
|
||||
box-shadow: 0px 0px 4px #1B95C6;
|
||||
width: 200px;
|
||||
}
|
||||
.relation_file_div input#attach_search{
|
||||
width: 150px;
|
||||
outline: none;
|
||||
border-radius: 5px;
|
||||
-webkit-transition: 1s width;
|
||||
-moz-transition : 1s width;
|
||||
-o-transition : 1s width;
|
||||
transition : 1s width;
|
||||
}
|
||||
</style>
|
||||
<% attachmenttypes = @project.attachmenttypes %>
|
||||
<% sufixtypes = @project.contenttypes %>
|
||||
|
||||
|
||||
<span class="borad-title"><%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span>
|
||||
<span class="borad-title"><%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</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, @project) %>
|
||||
<div class="clearfix"></div>
|
||||
<div id="file_buttons" class="nhidden">
|
||||
<%#= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
|
||||
<%= 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, @project) %>
|
||||
<%= 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, @project) %>
|
||||
<%= 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, @project) %>
|
||||
<div id="upload_file_div" class="relation_file_div hidden" >
|
||||
<%= render :partial => 'new', locals: {project: @project}%>
|
||||
</div>
|
||||
<div id="relation_file_div" class="relation_file_div hidden" >
|
||||
|
||||
<% if attachmenttypes.any? %>
|
||||
|
||||
<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"),
|
||||
:onchange => "attachmenttypes_searchex(this.value)" %>
|
||||
<% end %>
|
||||
<% if sufixtypes.any? %>
|
||||
|
||||
<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),
|
||||
:onchange => "attachment_contenttypes_searchex(this.value)" %>
|
||||
<% end %>
|
||||
|
||||
<div id="upload_file_div" class="relation_file_div hidden">
|
||||
<%= render :partial => 'new', locals: {project: @project} %>
|
||||
</div>
|
||||
<div id="relation_file_div" class="relation_file_div hidden">
|
||||
<fieldset>
|
||||
<legend>搜索</legend>
|
||||
<%= 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 attach_relation_path(:format => 'js'),
|
||||
method: :post,
|
||||
remote: true,
|
||||
id:"relation_file_form",
|
||||
:class => 'hidden' do %>
|
||||
<%= hidden_field_tag(:class_name, 'Project') %>
|
||||
<%= hidden_field_tag(:class_id, params[:project_id]) %>
|
||||
<div id="relation_file" >
|
||||
</div>
|
||||
<div class="kclearfix" style='margin-top: 10px;' >
|
||||
<%= submit_tag(l(:button_add)) -%>
|
||||
</div>
|
||||
<% 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 attach_relation_path(:format => 'js'),
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "relation_file_form",
|
||||
:class => 'hidden' do %>
|
||||
<%= hidden_field_tag(:class_name, 'Project') %>
|
||||
<%= hidden_field_tag(:class_id, params[:project_id]) %>
|
||||
<div id="relation_file">
|
||||
</div>
|
||||
<div class="kclearfix" style='margin-top: 10px;'>
|
||||
<%= submit_tag(l(:button_add)) -%>
|
||||
</div>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<div class="line_under" style="margin:20px 0px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %>
|
||||
|
||||
|
||||
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<table class="list files" id="ver-zebra" >
|
||||
<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('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)) %> -->
|
||||
</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 -%>
|
||||
<% container.attachments.each do |file| %>
|
||||
<tr class="file <%= cycle("odd", "odd") %>">
|
||||
<td class="filename" style="font-size: 13px; width: 240px; "><%= 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="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 %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='description' colspan="5">
|
||||
<div class="tags_area">
|
||||
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
|
||||
<%= 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>
|
||||
</td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<% reset_cycle %>
|
||||
<% end -%>
|
||||
<!-- %= h downloadAll(@containers) % -->
|
||||
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="all_browse_div" class="all_browse_div">
|
||||
<%= render :partial => 'show_all_attachment' %>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
||||
|
||||
<script type='text/javascript';>
|
||||
var slideHeight = 29;
|
||||
function readmore (aNode) {
|
||||
// console.log(aNode)
|
||||
// var $td_tags_area = $(aNode).parent().parent();
|
||||
var $td_tags_area = $(aNode).parent().parent().parent().parent();
|
||||
var $tags_area = $td_tags_area.find('.tags_area')
|
||||
var $tags_gradint = $td_tags_area.find('.tags_gradint')
|
||||
var $read_more = $td_tags_area.find('.read-more')
|
||||
var $read_more_a = $td_tags_area.find('.read-more a')
|
||||
var $tags = $td_tags_area.find('#tags')
|
||||
var $icona = $td_tags_area.find('.tags_icona')
|
||||
<script type='text/javascript'>
|
||||
var slideHeight = 29;
|
||||
function readmore(aNode) {
|
||||
// console.log(aNode)
|
||||
// var $td_tags_area = $(aNode).parent().parent();
|
||||
var $td_tags_area = $(aNode).parent().parent().parent().parent();
|
||||
var $tags_area = $td_tags_area.find('.tags_area')
|
||||
var $tags_gradint = $td_tags_area.find('.tags_gradint')
|
||||
var $read_more = $td_tags_area.find('.read-more')
|
||||
var $read_more_a = $td_tags_area.find('.read-more a')
|
||||
var $tags = $td_tags_area.find('#tags')
|
||||
var $icona = $td_tags_area.find('.tags_icona')
|
||||
|
||||
var slideHeight = 5; //px
|
||||
var defHeight = $tags.height();
|
||||
|
||||
var curHeight = $tags_area.height();
|
||||
if (curHeight == slideHeight) {
|
||||
$tags_area.animate({
|
||||
height: defHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('隐藏');
|
||||
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
|
||||
$tags_gradint.fadeOut();
|
||||
} else {
|
||||
$tags_area.animate({
|
||||
height: slideHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('更多');
|
||||
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
|
||||
$tags_gradint.fadeIn();
|
||||
}
|
||||
;
|
||||
|
||||
}
|
||||
$(function () {
|
||||
var slideHeight = 20; //px
|
||||
var defHeight = $('.tags_area').height();
|
||||
if (defHeight >= slideHeight) {
|
||||
$('.tags_area').css('height', slideHeight + 'px');
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
function eval_ajax (xhr, textStatus) {
|
||||
if (textStatus == 'success') {
|
||||
eval(xhr.responseText);
|
||||
} else if (textStatus == 'error') {
|
||||
alert('error');
|
||||
}
|
||||
}
|
||||
|
||||
function attachmenttypes_searchex(value) {
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: encodeURIComponent(value),
|
||||
contentType:$('#attach_sufix_browse').val()
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
}
|
||||
|
||||
function attachment_contenttypes_searchex(value) {
|
||||
$.ajax({
|
||||
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
}
|
||||
|
||||
function attachtype_edit(value) {
|
||||
$.ajax({
|
||||
|
||||
var slideHeight = 20; //px
|
||||
var defHeight = $tags.height();
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
var curHeight = $tags_area.height();
|
||||
if (curHeight == slideHeight) {
|
||||
$tags_area.animate({
|
||||
height: defHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('隐藏');
|
||||
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
|
||||
$tags_gradint.fadeOut();
|
||||
}else{
|
||||
$tags_area.animate({
|
||||
height: slideHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('更多');
|
||||
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
|
||||
$tags_gradint.fadeIn();
|
||||
};
|
||||
}).complete(eval_ajax);
|
||||
}
|
||||
|
||||
}
|
||||
$(function () {
|
||||
var slideHeight = 20; //px
|
||||
var defHeight = $('.tags_area').height();
|
||||
if (defHeight >= slideHeight) {
|
||||
$('.tags_area').css('height', slideHeight +'px');
|
||||
};
|
||||
});
|
||||
function attachmenttypes_change(id, type) {
|
||||
$.ajax({
|
||||
url: '<%=updateType_attachments_path%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
if (textStatus == 'success') {
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
}).error(function () {
|
||||
alert('error');
|
||||
});
|
||||
} else if (textStatus == 'error') {
|
||||
alert('error');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,73 @@
|
||||
<!--add by huang-->
|
||||
<div class="clearfix"></div>
|
||||
<<<<<<< HEAD
|
||||
<div id="footer" style="margin-left:-5px;padding-top: 50px;clear: both;font-size: 12px;">
|
||||
<div style="border-top:solid 1px #C6E9F1;width: auto;margin-top: 80px;"></div>
|
||||
<div class="base_footer">
|
||||
<div align="center">
|
||||
|
||||
<!--gcm-->
|
||||
<p>
|
||||
<span>主办单位:</span>
|
||||
<span class="footer_text_link"><%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
|
||||
<span class="footer_text_link"><%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
|
||||
<span id="copyright">版权@2007~2014</span>
|
||||
<span id="contact_us" class="footer_text_link"><%= link_to "联系我们","http://forge.trustie.net/projects/2/member",:target=>"_blank"%></span>
|
||||
<span id="record"class="footer_text_link"><%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%></span>
|
||||
|
||||
</p>
|
||||
<div id="logo_link">
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>"国防科学技术大学计算机学院"),"http://www.nudt.edu.cn/special.asp?classid=12"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>"北京大学信息科学技术学院软件研究所"), "http://eecs.pku.edu.cn"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>"北京航空航天大学计算机学院"), "http://scse.buaa.edu.cn/"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>"中国科学院软件研究所"), "http://www.iscas.ac.cn"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>"山东中创软件商用中间件股份有限公司"), "http://www.inforbus.com"%></span>
|
||||
</div>
|
||||
<!--gcm-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
=======
|
||||
<div id="footer" style="margin-left:-5px;padding-top: 150px;clear: both;font-size: 12px;">
|
||||
<div style="border-top:solid 1px #C6E9F1;"></div>
|
||||
<div class="base_footer">
|
||||
<div align="center">
|
||||
|
||||
<!--gcm-->
|
||||
<p>
|
||||
<span>主办单位:</span>
|
||||
<span class="footer_text_link"><%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
|
||||
<span class="footer_text_link"><%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
|
||||
<span id="copyright">版权@2007~2014</span>
|
||||
<span id="contact_us" class="footer_text_link"><%= link_to "联系我们","http://forge.trustie.net/projects/2/member",:target=>"_blank"%></span>
|
||||
<span id="record"class="footer_text_link"><%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%></span>
|
||||
|
||||
</p>
|
||||
<div id="logo_link">
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>"国防科学技术大学计算机学院"),"http://www.nudt.edu.cn/special.asp?classid=12"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>"北京大学信息科学技术学院软件研究所"), "http://eecs.pku.edu.cn"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>"北京航空航天大学计算机学院"), "http://scse.buaa.edu.cn/"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>"中国科学院软件研究所"), "http://www.iscas.ac.cn"%></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>"山东中创软件商用中间件股份有限公司"), "http://www.inforbus.com"%></span>
|
||||
</div>
|
||||
<!--gcm-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
>>>>>>> develop
|
||||
</div>
|
||||
</div>
|
||||
<div class="debug">
|
||||
<%= debug(params) if Rails.env.development? %>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-46523987-1', 'trustie.net');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
</div>
|
@ -0,0 +1,19 @@
|
||||
# encoding: utf-8
|
||||
class CreateAttachmentstypes < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :attachmentstypes do |t|
|
||||
t.column :typeId, :integer, :null => false
|
||||
t.column :typeName, :string, :limit =>50
|
||||
end
|
||||
Attachmentstype.create(typeId:1,typeName:'源代码')
|
||||
Attachmentstype.create(typeId:1,typeName:'课件')
|
||||
Attachmentstype.create(typeId:1,typeName:'研究报告')
|
||||
Attachmentstype.create(typeId:2,typeName:'源代码')
|
||||
Attachmentstype.create(typeId:2,typeName:'课件')
|
||||
Attachmentstype.create(typeId:2,typeName:'研究报告')
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :attachmentstypes
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddAttachtypeToAttachments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :attachments, :attachtype, :int ,default: 1
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddAttachmenttypeToProject < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :attachmenttype, :int ,default: 1
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 522 B |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
one:
|
||||
typeId:
|
||||
typeName:
|
||||
|
||||
two:
|
||||
typeId:
|
||||
typeName:
|
@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class AttachmentstypeTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
Loading…
Reference in new issue