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

RESOLVED FIXED in Bugzilla 2.18

Status

()

RESOLVED FIXED
15 years ago
6 years ago

People

(Reporter: justdave, Assigned: justdave)

Tracking

2.17.6
Bugzilla 2.18
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

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...
Created attachment 146884 [details] [diff] [review]
Patch v1

prepend what it is we're identifying to the class name
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"?
Created attachment 147010 [details] [diff] [review]
Patch v2

> 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
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
Last Resolved: 15 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.