diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-29 19:46:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-29 19:46:58 +0000 |
commit | 9daf39ec5242a6a87efb9c862952e176d4314856 (patch) | |
tree | 78ac3c4012e88e4f907e0d5a075956402af67684 /app/views/attachments | |
parent | 4b15dc10c10d9cb54d156457cc7d6823dac55520 (diff) | |
download | redmine-9daf39ec5242a6a87efb9c862952e176d4314856.tar.gz redmine-9daf39ec5242a6a87efb9c862952e176d4314856.zip |
Adds an optional description to attachments.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1180 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/attachments')
-rw-r--r-- | app/views/attachments/_form.rhtml | 13 | ||||
-rw-r--r-- | app/views/attachments/_links.rhtml | 17 |
2 files changed, 20 insertions, 10 deletions
diff --git a/app/views/attachments/_form.rhtml b/app/views/attachments/_form.rhtml index 18f08c6be..094668f9d 100644 --- a/app/views/attachments/_form.rhtml +++ b/app/views/attachments/_form.rhtml @@ -1,4 +1,9 @@ -<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%> -<%= image_to_function "add.png", "addFileField();return false" %></label> - -<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p> +<span id="attachments_fields"> +<%= file_field_tag 'attachments[1][file]', :size => 30, :id => nil -%> +<%= text_field_tag 'attachments[1][description]', '', :size => 60, :id => nil %> +<em><%= l(:label_optional_description) %></em> +</span> +<br /> +<small><%= link_to l(:label_add_another_file), {}, :onclick => 'addFileField(); return false;' %> +(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) +</small> diff --git a/app/views/attachments/_links.rhtml b/app/views/attachments/_links.rhtml index cce11292e..4d485548b 100644 --- a/app/views/attachments/_links.rhtml +++ b/app/views/attachments/_links.rhtml @@ -1,12 +1,17 @@ <div class="attachments"> <% for attachment in attachments %> - <p><%= link_to attachment.filename, {:controller => 'attachments', :action => 'download', :id => attachment }, :class => 'icon icon-attachment' %> - (<%= number_to_human_size attachment.filesize %>) - <% unless options[:no_author] %> - <span class="author"><%= attachment.author.name %>, <%= format_date(attachment.created_on) %></span> - <% end %> +<p><%= link_to attachment.filename, {:controller => 'attachments', :action => 'download', :id => attachment }, :class => 'icon icon-attachment' -%> +<%= h(" - #{attachment.description}") unless attachment.description.blank? %> + <span class="size">(<%= number_to_human_size attachment.filesize %>)</span> <% if options[:delete_url] %> - <%= link_to image_tag('delete.png'), options[:delete_url].update({:attachment_id => attachment}), :confirm => l(:text_are_you_sure), :method => :post %> + <%= link_to image_tag('delete.png'), options[:delete_url].update({:attachment_id => attachment}), + :confirm => l(:text_are_you_sure), + :method => :post, + :class => 'delete', + :title => l(:button_delete) %> + <% end %> + <% unless options[:no_author] %> + <span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span> <% end %> </p> <% end %> |