71 lines
3.5 KiB
Plaintext
71 lines
3.5 KiB
Plaintext
<%
|
|
# encoding: utf-8
|
|
#
|
|
# Redmine plugin for Document Management System "Features"
|
|
#
|
|
# Copyright (C) 2011-17 Karel Pičman <karel.picman@kontron.com>
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
%>
|
|
|
|
<span id="dmsf_attachments_fields">
|
|
<% if defined?(container) && container && container.saved_dmsf_attachments.present? %>
|
|
<% container.saved_dmsf_attachments.each_with_index do |attachment, i| %>
|
|
<span id="dmsf_attachments_p<%= i %>">
|
|
<%= text_field_tag("dmsf_attachments[p#{i}][filename]", attachment.filename, :class => 'filename') +
|
|
text_field_tag("dmsf_attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description') +
|
|
link_to(' '.html_safe, dmsf_attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload icon icon-del') %>
|
|
<%= hidden_field_tag "dmsf_attachments[p#{i}][token]", "#{attachment.token}" %>
|
|
</span>
|
|
<% end %>
|
|
<% end %>
|
|
</span>
|
|
<span class="dmsf_add_attachment">
|
|
<%= file_field_tag 'dmsf_attachments[dummy][file]',
|
|
:id => nil,
|
|
:class => 'file_selector',
|
|
:multiple => multiple,
|
|
:onchange => "dmsfAddInputFiles(this);",
|
|
:data => {
|
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
|
:upload_path => dmsf_uploads_path(:format => 'js'),
|
|
:description_placeholder => l(:label_optional_description)
|
|
} %>
|
|
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
|
</span>
|
|
<% if container %>
|
|
<br/>
|
|
<span id="dmsf_links_fields">
|
|
<% if container.saved_dmsf_links.present? %>
|
|
<% container.saved_dmsf_links.each_with_index do |dmsf_link, index| %>
|
|
<span id="dmsf_links_<%= index %>">
|
|
<input name="dmsf_links[<%= index %>]" value="<%= dmsf_link.id %>" type="hidden">
|
|
<input type="text" class='filename readonly' value="<%= dmsf_link.name %>">
|
|
<a href="#" class="remove-upload icon icon-del" onclick="$(this).parent('span').remove();return false;"> </a>
|
|
<br/>
|
|
</span>
|
|
<% end %>
|
|
<% end %>
|
|
</span>
|
|
<span class="dmsf_add_link">
|
|
<%= link_to l(:label_link_from),
|
|
new_dmsf_link_path(:project_id => container.project.id, :type => 'link_from', :container => 'issue'),
|
|
:title => l(:title_create_link), :class => 'icon icon-add', :remote => true %>
|
|
</span>
|
|
<% end %>
|
|
|