forked from edavis10/redmine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10977 e93f8b46-1217-0410-a6f0-8f06a7374b81
- Loading branch information
Showing
22 changed files
with
442 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
<span id="attachments_fields"> | ||
<% if defined?(container) && container && container.saved_attachments %> | ||
<% container.saved_attachments.each_with_index do |attachment, i| %> | ||
<span class="icon icon-attachment" style="display:block; line-height:1.5em;"> | ||
<%= h(attachment.filename) %> (<%= number_to_human_size(attachment.filesize) %>) | ||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.id}.#{attachment.digest}" %> | ||
<span id="attachments_p<%= i %>"> | ||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename') + | ||
text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description') + | ||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> | ||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> | ||
</span> | ||
<% end %> | ||
<% end %> | ||
<span id="attachments_fields"> | ||
<span> | ||
<%= file_field_tag 'attachments[1][file]', :id => nil, :class => 'file', | ||
:onchange => "checkFileSize(this, #{Setting.attachment_max_size.to_i.kilobytes}, '#{escape_javascript(l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)))}');" -%> | ||
<%= text_field_tag 'attachments[1][description]', '', :id => nil, :class => 'description', :maxlength => 255, :placeholder => l(:label_optional_description) %> | ||
<%= link_to_function(image_tag('delete.png'), 'removeFileField(this)', :title => (l(:button_delete))) %> | ||
</span> | ||
</span> | ||
<span class="add_attachment"><%= link_to l(:label_add_another_file), '#', :onclick => 'addFileField(); return false;', :class => 'add_attachment' %> | ||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</span> | ||
<span class="add_attachment"> | ||
<%= file_field_tag 'attachments_files', | ||
:id => nil, | ||
:multiple => true, | ||
:onchange => 'addInputFiles(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 => 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> | ||
|
||
<%= javascript_include_tag 'attachments' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$('#attachments_<%= j params[:attachment_id] %>').remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>'); | ||
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan); | ||
fileSpan.find('a.remove-upload') | ||
.attr({ | ||
"data-remote": true, | ||
"data-method": 'delete', | ||
href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>' | ||
}) | ||
.off('click'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<fieldset class="preview"><legend><%= l(:label_preview) %></legend> | ||
<%= textilizable @text, :attachments => @attachements, :object => @previewed %> | ||
<%= textilizable @text, :attachments => @attachments, :object => @previewed %> | ||
</fieldset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<% if @notes %> | ||
<fieldset class="preview"><legend><%= l(:field_notes) %></legend> | ||
<%= textilizable @notes, :attachments => @attachements, :object => @issue %> | ||
<%= textilizable @notes, :attachments => @attachments, :object => @issue %> | ||
</fieldset> | ||
<% end %> | ||
|
||
<% if @description %> | ||
<fieldset class="preview"><legend><%= l(:field_description) %></legend> | ||
<%= textilizable @description, :attachments => @attachements, :object => @issue %> | ||
<%= textilizable @description, :attachments => @attachments, :object => @issue %> | ||
</fieldset> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.