Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
commit
fcc5f220ce
@ -0,0 +1,6 @@
|
||||
#资源类型编辑control
|
||||
class AttachmentTypeEditController < ApplicationController
|
||||
def index
|
||||
|
||||
end
|
||||
end
|
@ -1,4 +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,64 @@
|
||||
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<ul id="all_browse_ul">
|
||||
<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; 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="attach_type"><%= file.attachmentstype.typeName %></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="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>
|
||||
</ul>
|
@ -1,421 +0,0 @@
|
||||
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
|
||||
<%isCategoryBrowser=true%>
|
||||
<% selAttachType =1%>
|
||||
<% attachmenttypes = @project.attachmenttypes %>
|
||||
<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;
|
||||
}
|
||||
#ver-zebra1, .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-zebra1 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-zebra1 td
|
||||
{
|
||||
padding: 8px 15px;
|
||||
border-right: 1px solid #fff;
|
||||
border-left: 1px solid #fff;
|
||||
color: #669;
|
||||
}
|
||||
#ver-zebra1 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: 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;
|
||||
}
|
||||
#ver-zebra1 #vzebra-adventure, #ver-zebra #vzebra-children
|
||||
{
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #c8d4fd;
|
||||
}
|
||||
#ver-zebra1 #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>
|
||||
|
||||
|
||||
<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_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) %>
|
||||
|
||||
<% if attachmenttypes.any? %>
|
||||
<label for="attachment_browse"><%=l(:attachment_browse)%></label>
|
||||
<%= select_tag "attachment_browse", content_tag('option', '') +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
|
||||
:onchange=>"attachmenttypes_search(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 -%>
|
||||
</fieldset>
|
||||
<div class="line_under" style="margin:20px 0px;"></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) %>
|
||||
|
||||
<%if !isCategoryBrowser%>
|
||||
<div id="all_browse_div" class="all_browse_div" >
|
||||
<ul id="all_browse_ul">
|
||||
<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_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
|
||||
<%= 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="attach_type"><%= file.attachmentstype.typeName %></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>
|
||||
</ul>
|
||||
</div>
|
||||
<%else%>
|
||||
<div id="catarory_browse_div" class="catarory_browse_div" >
|
||||
<ul id="catarory_browse_ul">
|
||||
<table class="list files" id="ver-zebra1" >
|
||||
<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_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
|
||||
<%= 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 file.attachtype==selAttachType%>
|
||||
<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="attach_type"><%= file.attachmentstype.typeName %></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 -%>
|
||||
<% end -%>
|
||||
<% reset_cycle %>
|
||||
<% end -%>
|
||||
<!-- %= h downloadAll(@containers) % -->
|
||||
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
</div>
|
||||
<%end%>
|
||||
<% 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')
|
||||
|
||||
var slideHeight = 20; //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');
|
||||
};
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<%inited=false%>
|
||||
<script type="text/javascript">
|
||||
function attachmenttypes_search(value){
|
||||
$.ajax({
|
||||
<%if inited%>
|
||||
<% @isCategoryBrowser=!isCategoryBrowser%>
|
||||
<%@selAttachType=value%>
|
||||
<%= render :partial => 'index', locals: {isCategoryBrowser:@isCategoryBrowser,selAttachType:@selAttachType} %>
|
||||
<%end%>
|
||||
<%inited = true%>
|
||||
/*type :"POST",
|
||||
url :'/files/showbyattachtype/'+encodeURIComponent(value),
|
||||
data :'text',
|
||||
success: function(data){
|
||||
$('#catarory_browse_div').slideUp();
|
||||
$('#all_browse_div').slideToggle();
|
||||
$("#").html(data);
|
||||
} */
|
||||
}
|
||||
|
||||
)
|
||||
}
|
||||
</script>
|
@ -0,0 +1,66 @@
|
||||
<% selAttachType =@attachtype %>
|
||||
<% selContentType =@contenttype %>
|
||||
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<div id="catarory_browse_div" class="catarory_browse_div">
|
||||
<ul id="catarory_browse_ul">
|
||||
<table class="list files" id="ver-zebra1">
|
||||
<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; 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="attach_type"><%= file.attachmentstype.typeName %></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="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 -%>
|
||||
<% end -%>
|
||||
<% reset_cycle %>
|
||||
<% end -%>
|
||||
<!-- %= h downloadAll(@containers) % -->
|
||||
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
<% if @attachtype==0 && @contenttype==l(:attachment_all)%>
|
||||
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
|
||||
<%else%>
|
||||
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>');
|
||||
<%end%>
|
@ -1,421 +0,0 @@
|
||||
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
|
||||
<%isCategoryBrowser=false%>
|
||||
<% selAttachType =1%>
|
||||
<% attachmenttypes = @project.attachmenttypes %>
|
||||
<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;
|
||||
}
|
||||
#ver-zebra1, .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-zebra1 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-zebra1 td
|
||||
{
|
||||
padding: 8px 15px;
|
||||
border-right: 1px solid #fff;
|
||||
border-left: 1px solid #fff;
|
||||
color: #669;
|
||||
}
|
||||
#ver-zebra1 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: 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;
|
||||
}
|
||||
#ver-zebra1 #vzebra-adventure, #ver-zebra #vzebra-children
|
||||
{
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #c8d4fd;
|
||||
}
|
||||
#ver-zebra1 #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>
|
||||
|
||||
|
||||
<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_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) %>
|
||||
|
||||
<% if attachmenttypes.any? %>
|
||||
<label for="attachment_browse"><%=l(:attachment_browse)%></label>
|
||||
<%= select_tag "attachment_browse", content_tag('option', '') +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
|
||||
:onchange=>"attachmenttypes_search(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 -%>
|
||||
</fieldset>
|
||||
<div class="line_under" style="margin:20px 0px;"></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) %>
|
||||
|
||||
<%if !isCategoryBrowser%>
|
||||
<div id="all_browse_div" class="all_browse_div" >
|
||||
<ul id="all_browse_ul">
|
||||
<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_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
|
||||
<%= 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="attach_type"><%= file.attachmentstype.typeName %></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>
|
||||
</ul>
|
||||
</div>
|
||||
<%else%>
|
||||
<div id="catarory_browse_div" class="catarory_browse_div" >
|
||||
<ul id="catarory_browse_ul">
|
||||
<table class="list files" id="ver-zebra1" >
|
||||
<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_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
|
||||
<%= 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 file.attachtype==selAttachType%>
|
||||
<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="attach_type"><%= file.attachmentstype.typeName %></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 -%>
|
||||
<% end -%>
|
||||
<% reset_cycle %>
|
||||
<% end -%>
|
||||
<!-- %= h downloadAll(@containers) % -->
|
||||
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
</div>
|
||||
<%end%>
|
||||
<% 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')
|
||||
|
||||
var slideHeight = 20; //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');
|
||||
};
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<%inited=false%>
|
||||
<script type="text/javascript">
|
||||
function attachmenttypes_search(value){
|
||||
$.ajax({
|
||||
<%if inited%>
|
||||
<% @isCategoryBrowser=!isCategoryBrowser%>
|
||||
<%@selAttachType=value%>
|
||||
<%= render :partial => 'index', locals: {isCategoryBrowser:@isCategoryBrowser,selAttachType:@selAttachType} %>
|
||||
<%end%>
|
||||
<%inited = true%>
|
||||
/*type :"POST",
|
||||
url :'/files/showbyattachtype/'+encodeURIComponent(value),
|
||||
data :'text',
|
||||
success: function(data){
|
||||
$('#catarory_browse_div').slideUp();
|
||||
$('#all_browse_div').slideToggle();
|
||||
$("#").html(data);
|
||||
} */
|
||||
}
|
||||
|
||||
)
|
||||
}
|
||||
</script>
|
@ -1,197 +1,204 @@
|
||||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<%= javascript_include_tag 'welcome' %>
|
||||
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html"
|
||||
xmlns="http://www.w3.org/1999/html">
|
||||
xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
|
||||
|
||||
$(function(){
|
||||
$("#main").find("a").attr("target", "_blank");
|
||||
$("#main").find("a").attr("target", "_blank");
|
||||
});
|
||||
|
||||
// 给主页用户弹新页面
|
||||
$(document).ready(function($) {
|
||||
$("#loggedas").find("a").attr("target", "_blank");
|
||||
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
|
||||
});
|
||||
// 给主页用户弹新页面
|
||||
$(document).ready(function($) {
|
||||
$("#loggedas").find("a").attr("target", "_blank");
|
||||
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class='top_bar'>
|
||||
<div id="identifier-pannel" style="display:none">
|
||||
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
|
||||
<div class="weixin-content">微信扫码</div>
|
||||
</div>
|
||||
<div class="main-content-bar">
|
||||
<div style="float: left">
|
||||
<%= image_tag(@logoLink, size:'75x75') %>
|
||||
<div id="identifier-pannel" style="display:none">
|
||||
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
|
||||
<div class="weixin-content">微信扫码</div>
|
||||
</div>
|
||||
<div class="main-content-bar">
|
||||
<div style="float: left">
|
||||
<%= image_tag(@logoLink, size:'75x75') %>
|
||||
|
||||
</div>
|
||||
<div class="course welcome_left" >
|
||||
<br />
|
||||
</div>
|
||||
<div class="course welcome_left" >
|
||||
<br />
|
||||
<span class="font_welcome_school"> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
|
||||
<% else%>
|
||||
<% else%>
|
||||
<% if params[:school_id] == "0" %>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<% if params[:school_id].nil? %>
|
||||
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course',:school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school',:method => 'get'}%>
|
||||
<br />
|
||||
<br />
|
||||
<% else %>
|
||||
<%= link_to School.find(params[:school_id]).name ,options={:action => 'course',:school_id => params[:school_id]}, html_options={:class => 'font_welcome_school',:method => 'get'}%>
|
||||
<br />
|
||||
<br />
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> </span>
|
||||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span>
|
||||
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
|
||||
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
||||
<% else %>
|
||||
<% if params[:school_id] == "0" %>
|
||||
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span>
|
||||
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
|
||||
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
||||
<% else %>
|
||||
<% if params[:school_id] == "0" %>
|
||||
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
<div style="clear:both"></div>
|
||||
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||
<h3><strong>新开课程</strong></h3>
|
||||
<span><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<h3><strong>新开课程</strong></h3>
|
||||
<% if(find_miracle_course(10, 7,params[:school_id]).map.count == 0) %>
|
||||
<span><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => nil} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
|
||||
</ul>
|
||||
|
||||
<ul class="d-p-projectlist">
|
||||
<% if(find_miracle_course(10, 7,params[:school_id]).map.count == 0) %>
|
||||
<h1></h1>
|
||||
<p id="errorExplanation">
|
||||
该学校未开设任何课程,您可以查看其他学校课程
|
||||
</p>
|
||||
<h1></h1>
|
||||
<% find_all_hot_course(9).map do |project| %>
|
||||
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>>
|
||||
<div class='avatar'>
|
||||
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div class='desc_item text_nowrap' >
|
||||
[<%= get_course_term project %>]
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>)
|
||||
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
|
||||
(<%=link_to "#{files_count}份", project_files_path(project) %>资料)
|
||||
</div>
|
||||
<div class='desc_item' >
|
||||
<span class=''>
|
||||
<% course = Course.find_by_extra(project.identifier)%>
|
||||
<% if(course.school == nil) %>
|
||||
|
||||
<% else %>
|
||||
<%= course.school.name.try(:gsub, /(.+)$/, '\1:') %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class='font_bolder'>
|
||||
<%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
|
||||
<%#=course.try(:teacher).try(:name)%>
|
||||
</span>
|
||||
</div>
|
||||
<!-- <div class='desc_item' style="">
|
||||
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
|
||||
</div> -->
|
||||
<div class='join_course_link'>
|
||||
<% if !course_endTime_timeout?(project)%>
|
||||
<div >
|
||||
<%= join_in_course(project, User.current)%>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% find_miracle_course(10, 7,params[:school_id]).map do |project| %>
|
||||
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>>
|
||||
<div class='avatar'>
|
||||
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div class='desc_item text_nowrap' >
|
||||
[<%= get_course_term project %>]
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>)
|
||||
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
|
||||
(<%=link_to "#{files_count}份", project_files_path(project) %>资料)
|
||||
</div>
|
||||
<div class='desc_item' >
|
||||
<span class=''>
|
||||
<% course = Course.find_by_extra(project.identifier) %>
|
||||
<%= course.school.name.try(:gsub, /(.+)$/, '\1:') %>
|
||||
</span>
|
||||
<span class='font_bolder'>
|
||||
<%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
|
||||
</ul>
|
||||
<ul class="d-p-projectlist">
|
||||
<h1></h1>
|
||||
<p id="errorExplanation">
|
||||
该学校未开设任何课程,您可以查看其他学校课程
|
||||
</p>
|
||||
<h1></h1>
|
||||
<% find_all_new_hot_course(9).map do |project| %>
|
||||
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>>
|
||||
<div class='avatar'>
|
||||
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div class='desc_item' >
|
||||
<span class=''>
|
||||
<% course = Course.find_by_extra(project.identifier)%>
|
||||
<% if(course.school == nil) %>
|
||||
|
||||
<% else %>
|
||||
<%= course.school.name.try(:gsub, /(.+)$/, '\1:') %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class='font_bolder'>
|
||||
<%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
|
||||
<%#=course.try(:teacher).try(:name)%>
|
||||
</span>
|
||||
</div>
|
||||
<!-- <div class='desc_item' style="">
|
||||
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
|
||||
</div> -->
|
||||
<div class='join_course_link'>
|
||||
<% if !course_endTime_timeout?(project)%>
|
||||
<div >
|
||||
<%= join_in_course(project, User.current)%>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% end; reset_cycle %>
|
||||
</span>
|
||||
</div>
|
||||
<div class='desc_item text_nowrap' style="width: 310px;">
|
||||
[<%= get_course_term project %>]
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>)
|
||||
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
|
||||
(<%=link_to "#{files_count}份", project_files_path(project) %>资料)
|
||||
</div>
|
||||
<!-- <div class='desc_item' style="">
|
||||
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
|
||||
</div> -->
|
||||
<div>
|
||||
<% if !course_endTime_timeout?(project)%>
|
||||
<div >
|
||||
<%= new_watcher_link(project, User.current)%>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<span><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
|
||||
</ul>
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_miracle_course(10, 7,params[:school_id]).map do |project| %>
|
||||
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>>
|
||||
<div class='avatar'>
|
||||
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div class='desc_item' >
|
||||
<span class=''>
|
||||
<% course = Course.find_by_extra(project.identifier) %>
|
||||
<%= course.school.name.try(:gsub, /(.+)$/, '\1:') %>
|
||||
</span>
|
||||
<span class='font_bolder'>
|
||||
<%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
|
||||
<%#=course.try(:teacher).try(:name)%>
|
||||
</span>
|
||||
</div>
|
||||
<div class='desc_item text_nowrap' style="width: 310px;">
|
||||
[<%= get_course_term project %>]
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>)
|
||||
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
|
||||
(<%=link_to "#{files_count}份", project_files_path(project) %>资料)
|
||||
</div>
|
||||
<!-- <div class='desc_item' style="">
|
||||
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
|
||||
</div> -->
|
||||
<div class='join_course_link'>
|
||||
<% if !course_endTime_timeout?(project)%>
|
||||
<div >
|
||||
<%= join_in_course(project, User.current)%>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% end; reset_cycle %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h3 style="padding-bottom:0px ;margin-left: 5px; color: #e8770d;">
|
||||
<strong>问题和反馈动态</strong>
|
||||
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
||||
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
||||
</h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_new_forum_topics(10).each do |topic|%>
|
||||
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
|
||||
<div style="display: inline-block; width: 100%;">
|
||||
<h3 style="padding-bottom:0px ;margin-left: 5px; color: #e8770d;">
|
||||
<strong>问题和反馈动态</strong>
|
||||
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
||||
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
||||
</h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_new_forum_topics(10).each do |topic|%>
|
||||
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
|
||||
<div style="display: inline-block; width: 100%;">
|
||||
<span class="memo_activity" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
||||
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
|
||||
</span>
|
||||
<br>
|
||||
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size:9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
|
||||
<br>
|
||||
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size:9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
|
||||
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
|
||||
由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);" %> 发表
|
||||
</span>
|
||||
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size:9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)</span>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size:9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)</span>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="hidden" style="width:100%;">
|
||||
<div style="width:600px;margin:0px auto;margin-top:80px;">
|
||||
<table style="width:600px;font-size:15px; color: #e8770d;">
|
||||
<tr>
|
||||
<td><strong>当前网站状态</strong></td>
|
||||
<td>活跃课程: <%=@courseCount%></td>
|
||||
<td>高校: 2个</td>
|
||||
<td>教师: <%=@teacherCount%> 名</td>
|
||||
<td>学生: <%=@studentCount%> 名<td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:600px;margin:0px auto;margin-top:80px;">
|
||||
<table style="width:600px;font-size:15px; color: #e8770d;">
|
||||
<tr>
|
||||
<td><strong>当前网站状态</strong></td>
|
||||
<td>活跃课程: <%=@courseCount%></td>
|
||||
<td>高校: 2个</td>
|
||||
<td>教师: <%=@teacherCount%> 名</td>
|
||||
<td>学生: <%=@studentCount%> 名<td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in new issue