-
<%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;",
- :id => 'attach_files_link' %>
-<%= form_tag({:controller => 'wiki', :action => 'add_attachment',
- :project_id => @project, :id => @page.title},
- :multipart => true, :id => "add_attachment_form",
- :style => "display:none;") do %>
-
-
<%= render :partial => 'attachments/form' %>
+ <%= link_to_attachments @page, :thumbnails => true %>
+
+ <% if @editable && authorize_for('wiki', 'add_attachment') %>
+
+ <%= form_tag({:controller => 'wiki', :action => 'add_attachment',
+ :project_id => @project, :id => @page.title},
+ :multipart => true, :id => "add_attachment_form") do %>
+
+
<%= render :partial => 'attachments/form' %>
+
+ <%= submit_tag l(:button_add) %>
+ <% end %>
-<%= submit_tag l(:button_add) %>
-<%= link_to l(:button_cancel), {}, :onclick => "$('#add_attachment_form').hide(); return false;" %>
-<% end %>
+ <% end %>
-<% end %>
+
<% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index c97f94d9a..acfad4956 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -683,7 +683,7 @@ a.remove-upload:hover {text-decoration:none !important;}
div.fileover { background-color: lavender; }
-div.attachments { margin-top: 12px; }
+div.attachments { margin: 12px 0; }
div.attachments p { margin:4px 0 2px 0; }
div.attachments img { vertical-align: middle; }
div.attachments span.author { font-size: 0.9em; color: #888; }