2014-06-09 14:23:31 +08:00
|
|
|
<% attachmenttypes = @project.attachmenttypes %>
|
|
|
|
<% sufixtypes = @project.contenttypes %>
|
2015-03-06 14:55:21 +08:00
|
|
|
<div class="project_r_h">
|
2015-03-17 18:04:35 +08:00
|
|
|
<h2 class="project_h2"><%= l(:lable_file_sharingarea) %></h2>
|
2015-03-06 14:55:21 +08:00
|
|
|
</div>
|
2014-06-09 14:23:31 +08:00
|
|
|
|
|
|
|
<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(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) %>
|
2014-07-17 15:05:49 +08:00
|
|
|
<p></p>
|
2015-03-11 15:32:50 +08:00
|
|
|
<div id="upload_file_div" class="relation_file_div <%= !@flag.nil?&&@flag=="true" ? '' : 'hidden'%>">
|
2014-06-09 14:23:31 +08:00
|
|
|
<%= render :partial => 'new', locals: {project: @project} %>
|
|
|
|
</div>
|
|
|
|
<div id="relation_file_div" class="relation_file_div hidden">
|
|
|
|
<fieldset>
|
2015-03-17 18:04:35 +08:00
|
|
|
<legend><%= l(:label_search)%></legend>
|
2014-06-09 14:23:31 +08:00
|
|
|
<%= form_tag(
|
|
|
|
attachments_autocomplete_path(:format => 'js'),
|
|
|
|
:remote => true,
|
|
|
|
:method => :post) do %>
|
2015-03-17 18:04:35 +08:00
|
|
|
<%= label_tag(:attach_search, l(:label_search_by_keyword)) %>
|
2014-06-09 14:23:31 +08:00
|
|
|
<%= 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>
|
|
|
|
|
2014-07-21 17:33:13 +08:00
|
|
|
<div class="box" id="files-box">
|
2014-12-18 14:53:21 +08:00
|
|
|
<label for="files-box" style="font-weight:bold;">
|
|
|
|
|
|
|
|
<%= l(:label_files_filter) %>
|
|
|
|
</label>
|
2014-07-21 17:33:13 +08:00
|
|
|
<% if attachmenttypes.any? %>
|
|
|
|
|
2014-12-18 14:53:21 +08:00
|
|
|
<label for="attachment_browse_label">
|
|
|
|
<%= l(:attachment_browse) %>
|
|
|
|
</label>
|
|
|
|
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
|
2014-07-21 17:33:13 +08:00
|
|
|
:onchange => "attachmenttypes_searchex(this.value)" %>
|
|
|
|
<% end %>
|
|
|
|
<% if sufixtypes.any? %>
|
|
|
|
|
2014-12-18 14:53:21 +08:00
|
|
|
<label for="attach_sufix_browse_label">
|
|
|
|
<%= l(:attachment_sufix_browse) %>
|
|
|
|
</label>
|
2014-07-21 17:33:13 +08:00
|
|
|
<%= 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>
|
2014-06-09 14:23:31 +08:00
|
|
|
</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) %>
|
|
|
|
|
|
|
|
<div id="all_browse_div" class="all_browse_div">
|
2014-10-28 23:38:14 +08:00
|
|
|
<%#= render :partial => 'show_all_attachment' %>
|
|
|
|
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
|
2014-12-18 14:53:21 +08:00
|
|
|
<%= render partial: "show_all_attachment"%>
|
2014-10-28 23:38:14 +08:00
|
|
|
<%else%>
|
2014-12-18 14:53:21 +08:00
|
|
|
<%= render partial: "sort_by_attachtypel"%>
|
2014-10-28 23:38:14 +08:00
|
|
|
<%end%>
|
2014-06-09 14:23:31 +08:00
|
|
|
</div>
|
|
|
|
|
2014-10-28 22:34:51 +08:00
|
|
|
<% html_title(l(:label_attachment_plural)) -%>
|