Closed Bug 241516 Opened 20 years ago Closed 20 years ago

css classes for bug, component, and status on show_bug can easily have name conflicts

Categories

(Bugzilla :: User Interface, defect)

2.17.6
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: justdave, Assigned: justdave)

Details

Attachments

(1 file, 1 obsolete file)

in the show_bug.html.tmpl, we add css classes to the body to let sites use css
to customize by component, status, or bug number.  However, we didn't do
anything to prevent the name of a status or component from causing a name
conflict with something in the site's standard css.  For example, if you have a
component named "Part1" and your normal css for layout stuff happens to have a
"part1" class anyway, your body for the bugs in the "Part1" component wind up
being styled not quite how you intended...
Attached patch Patch v1 (obsolete) — Splinter Review
prepend what it is we're identifying to the class name
Attachment #146884 - Flags: review?(myk)
Comment on attachment 146884 [details] [diff] [review]
Patch v1

>+[% bodyattrs = BLOCK %]class='bz_bug status_[% bug.bug_status 
>+  FILTER css_class_quote %] component_[%+ bug.component 
>+  FILTER css_class_quote %] bug_[%+ bug.bug_id 

You don't need the plus signs anymore.	Also, wouldn't it make sense to prefix
everything with "bz_" or remove "bz_" from "bz_bug"?
Attached patch Patch v2Splinter Review
> Also, wouldn't it make sense to prefix
> everything with "bz_" or remove "bz_" from "bz_bug"?

Hmm, good idea.  I like the bz_ prefix idea because that even further reduces
the likelihood of a namespace collision.
Attachment #146884 - Attachment is obsolete: true
Attachment #147010 - Flags: review?(myk)
Attachment #146884 - Flags: review?(myk)
Comment on attachment 147010 [details] [diff] [review]
Patch v2

r=myk
Attachment #147010 - Flags: review?(myk) → review+
Checking in template/en/default/bug/show.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/show.html.tmpl,v  <--
 show.html.tmpl
new revision: 1.6; previous revision: 1.5
done
Status: NEW → RESOLVED
Closed: 20 years ago
Flags: approval+
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.18
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: