summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-03 07:50:12 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-03 07:50:12 +0000
commit7ec5dd33df40026bb28f396542c1a7c2a2794b20 (patch)
tree9981064d1e213c96d63bcc143f02fca47e5995a3
parent91875688778e936924daa8445513387808d95053 (diff)
downloadredmine-7ec5dd33df40026bb28f396542c1a7c2a2794b20.tar.gz
redmine-7ec5dd33df40026bb28f396542c1a7c2a2794b20.zip
Hide wiki attachments by default and add thumbnails (#22941).
git-svn-id: http://svn.redmine.org/redmine/trunk@15604 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/wiki/show.html.erb32
-rw-r--r--public/stylesheets/application.css2
2 files changed, 18 insertions, 16 deletions
diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb
index 41dd12d10..1cbfcbc65 100644
--- a/app/views/wiki/show.html.erb
+++ b/app/views/wiki/show.html.erb
@@ -46,24 +46,26 @@
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
-<%= link_to_attachments @page %>
+<fieldset class="collapsible collapsed">
+ <legend onclick="toggleFieldset(this);"><%= l(:label_attachment_plural) %></legend>
+ <div style="display: none;">
-<% if @editable && authorize_for('wiki', 'add_attachment') %>
-<div id="wiki_add_attachment">
-<p><%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;",
- :id => 'attach_files_link' %></p>
-<%= form_tag({:controller => 'wiki', :action => 'add_attachment',
- :project_id => @project, :id => @page.title},
- :multipart => true, :id => "add_attachment_form",
- :style => "display:none;") do %>
- <div class="box">
- <p><%= render :partial => 'attachments/form' %></p>
+ <%= link_to_attachments @page, :thumbnails => true %>
+
+ <% if @editable && authorize_for('wiki', 'add_attachment') %>
+ <div id="wiki_add_attachment">
+ <%= form_tag({:controller => 'wiki', :action => 'add_attachment',
+ :project_id => @project, :id => @page.title},
+ :multipart => true, :id => "add_attachment_form") do %>
+ <div class="box">
+ <p><%= render :partial => 'attachments/form' %></p>
+ </div>
+ <%= submit_tag l(:button_add) %>
+ <% end %>
</div>
-<%= submit_tag l(:button_add) %>
-<%= link_to l(:button_cancel), {}, :onclick => "$('#add_attachment_form').hide(); return false;" %>
-<% end %>
+ <% end %>
</div>
-<% end %>
+</fieldset>
<% 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; }