Feature #29791
closedHide "Files" section in wiki pages when printing
0%
Description
I do not want to display the Files toggle when printing a wiki page. But, this element does not have a class or id which can be uniquely specified.
So, I'd like you to add "attachments" to the class attribute of this element.
source:trunk/app/views/wiki/show.html.erb#L53
Japanese
私はWikiページを印刷する際にFilesトグルを表示したくないと考えています。しかし、この要素は一意に特定できるclassやidを持っていません。
このため、この要素のclass属性に例えば"attachments"を追加してほしいと思っています。
Files
Updated by Yuichi HARADA about 6 years ago
+1
Since it has no meaning, it should be hidden when printing.
I made a patch, and attach it.
diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb
index 559d5e0e0..507014989 100644
--- a/app/views/wiki/show.html.erb
+++ b/app/views/wiki/show.html.erb
@@ -50,12 +50,12 @@
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
-<fieldset class="collapsible collapsed">
+<fieldset class="collapsible collapsed wiki-attachments">
<legend onclick="toggleFieldset(this);"><%= l(:label_attachment_plural) %> (<%= @page.attachments.length %>)</legend>
<div style="display: none;">
<%= 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',
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index ec5bb57df..c1c6d7600 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -1487,7 +1487,7 @@ img.filecontent.image {background-image: url(../images/transparent.png);}
#top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; }
#main { background: #fff; }
#content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;}
- #wiki_add_attachment { display:none; }
+ #wiki_add_attachment, .wiki-attachments { display:none; }
.hide-when-print, .pagination ul.pages, .pagination .per-page { display: none !important; }
.autoscroll {overflow-x: visible;}
table.list {margin-top:0.5em;}
Updated by Go MAEDA about 6 years ago
- Subject changed from Make it possible to uniquely specify the Files element of the wiki page to Hide "Files" section in wiki pages when printing
- Target version set to 4.1.0
Updated by Go MAEDA about 6 years ago
I think adding "hide-when-print" class is better because it is simpler and can clarify the intention to hide the section when printing.
Index: app/views/wiki/show.html.erb
===================================================================
--- app/views/wiki/show.html.erb (revision 17612)
+++ app/views/wiki/show.html.erb (working copy)
@@ -50,7 +50,7 @@
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
-<fieldset class="collapsible collapsed">
+<fieldset class="collapsible collapsed hide-when-print">
<legend onclick="toggleFieldset(this);"><%= l(:label_attachment_plural) %> (<%= @page.attachments.length %>)</legend>
<div style="display: none;">
Updated by Yuichi HARADA about 6 years ago
Go MAEDA wrote:
I think adding "hide-when-print" class is better because it is simpler and can clarify the intention to hide the section when printing.
I'm sorry, "hide-when-print" class was better.
I rebuilt a patch.
Please delete the previous patch. (29791-hidden-wiki-attachments.patch)
Updated by Go MAEDA about 6 years ago
- Status changed from New to Resolved
- Assignee set to Go MAEDA
- Target version changed from 4.1.0 to 3.4.7
- Resolution set to Fixed
Updated by Go MAEDA about 6 years ago
- Status changed from Resolved to Closed
Committed to the trunk and 3.4-stable branch. Now Files section in wiki pages is hidden when printing.
Thank you for your contribution.