Open Bug 330600 Opened 18 years ago Updated 10 years ago

Improve CSS rules for printing

Categories

(Bugzilla :: User Interface, enhancement)

enhancement
Not set
normal

Tracking

()

People

(Reporter: after.fallout, Unassigned)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

In order to customize bugzilla, there should be support for print stylesheets so that the pages can be printed and still look decent.

This is a seperation off Bug 110152 (see comment 6 in that bug) and is a step along the way of making a fix for Bug 161535 (which looks old and forgotten right now).

Reproducible: Always

Steps to Reproduce:
Here is a patch that adds a default print.css stylesheet to every page generated from bugzilla.
print.css to be put in skins/standard

Removes the header (mostly doesn't print anyways: see Bug 320254) and footer (useless in printed document) from printed pages.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Bugzilla Printer Stylesheets → Add separate stylesheet for printing
Attachment #215152 - Flags: review?
Attachment #215153 - Flags: review?
I like this patch very much :)

I added a [blocker will fix] notice to bug 161535.

I made this bug depend on bug 322693. This is not because the patch there is some kind of prerequisite, but because I think it should go in first. This is because I really do think skinning is more important than printing style sheets. This will break the patch here, though -- Bill, please be prepared for your patch to bitrot :(
Are you interested to put up an adapted patch afterwards?
Assignee: ui → at18326
Depends on: 322693
(In reply to comment #3)

Yeah, I can do that, it looks like just a couple of lines would change from the patch in that bug (the css file here wouldn't need to change at all, just the diff). Then in header.html.tmpl add this to the patch in bug 322693:
(right after cascade part 1)

+    [% style_urls.unshift('skins/standard/print.css') %]
+
+    [%# CSS cascade, part 1.5: Standard Bugzilla print stylesheet set (persistent).
+      # Always present.
+      #%]
+    [% FOREACH style_url = style_urls %]
+      <link href="[% style_url FILTER html %]"
+            rel="stylesheet"
+            type="text/css"
+            media="print">
+    [% END %]
+

Am I right, or do I not understand that bug?
oops didn't finish that:
(changing cascade part 5 last line)

+    [%# CSS cascade, part 5: Custom Bugzilla stylesheet set (persistent).
+      # Always present. Site administrators may override all other style
+      # definitions, including skins, using custom stylesheets.
+      #%]
+    [% FOREACH style_url = style_urls %]
+      [% IF style_url.match('^skins/standard/') %]
+        <link href="[% style_url.replace('^skins/standard/', "skins/custom/")
+                       FILTER html %]" rel="stylesheet" type="text/css"
+                       [% media="print" IF style_url.match("print.css$") %]>
Attachment #215152 - Flags: review? → review?(justdave)
Attachment #215153 - Flags: review? → review?(justdave)
(In reply to comment #4)

Yes, this makes sense to me from looking at it.
Comment on attachment 215152 [details] [diff] [review]
diff against header.html.tmpl to add print.css

Please update as per comment 4 and comment 5 and request review from me.
Attachment #215152 - Flags: review?(justdave) → review-
Comment on attachment 215153 [details] [diff] [review]
possible default print.css

Looks good, but why have initial contributors other than yourself? That makes no sense. Also, this new file can be attached in one patch (this is not required). See http://developer.mozilla.org/en/docs/Creating_a_patch if you want to know how.
Attachment #215153 - Flags: review?(justdave) → review-
No longer blocks: 110152
I suggest to WONTFIX this bug. We can use the | @media print | rule in existing CSS files, which is understood in Firefox, IE and Opera.
(In reply to comment #9)
> I suggest to WONTFIX this bug. We can use the | @media print | rule in existing
> CSS files, which is understood in Firefox, IE and Opera.
> 

Would this allow for displaying certain text only when printed such as:

"The information contained herein is likely to be outdated.  Please check (url) for the most up-to-date status of this [% terms.bug %]."

If so, then I'm all for it.  Otherwise, I think it's fair to have a printer-friendly version.
I was under the impression that:

@media print {
    #banner, #footer
    {
        display: none;
    }
}

doesn't work properly across browsers (when I last tested it, it didn't work in IE). Is there any site out there that has support information about this?
No longer blocks: 161535
What happened here? Apparently there is now a "Format for Printing" link at the bottom of bugzilla pages, but still no alternative css for printing.

Having a link for printing formatting seems weird to me, given this could be achieved automatically through stylesheets, but if this is the chosen way (chosen in another bug i suppose), shouldn't this bug be WONTFIXed?
This bug should not be WONTFIXed. The link for printing is the old way as has been around for a long time. CSS for printing should come on top at first, then afterwards maybe the link for printing can go away.
I see /skins/standard/global.css contains printing specific styles (line 456). Is a separate stylesheet still needed for for printing?
From my personal point of view, this bug is about taking care that printing a Bugzilla page yields a good result on paper. I don't care very much whether this happens using a separate CSS file or CSS rules.
Assignee: after.fallout → ui
Summary: Add separate stylesheet for printing → Improve CSS rules for printing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: