プロジェクト

全般

プロフィール

Vote #79599

完了

Hide "Files" section in wiki pages when printing

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
1
version_id:
143
issue_org_id:
29791
author_id:
4
assigned_to_id:
332
comments:
7
status_id:
5
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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"を追加してほしいと思っています。


journals

+1
Since it has no meaning, it should be hidden when printing.

I made a patch, and attach it.
<pre><code class="diff">
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;}
</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I think adding "hide-when-print" class is better because it is simpler and can clarify the intention to hide the section when printing.

<pre><code class="diff">
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;">

</code></pre>
--------------------------------------------------------------------------------
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)
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed to the trunk and 3.4-stable branch. Now Files section in wiki pages is hidden when printing.

Thank you for your contribution.
--------------------------------------------------------------------------------
Thank you for All!
Happy Halloween!! XD
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリWiki_1 にセット
  • 対象バージョン3.4.7_143 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0