Closed
Bug 367394
Opened 18 years ago
Closed 17 years ago
show_bug should include a class bz_group_<whatever> so pages can be styled
Categories
(Bugzilla :: User Interface, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.2
People
(Reporter: dveditz, Assigned: reed)
References
Details
(Whiteboard: [applied to b.m.o])
Attachments
(2 files, 4 obsolete files)
4.88 KB,
patch
|
Details | Diff | Splinter Review | |
2.01 KB,
patch
|
Details | Diff | Splinter Review |
I would like to be able to style bugs that are in certain groups so users editing security bugs, for example, are aware of that fact. The style itself can be left up to the installation or even the user, but to accomplish this I'd like a bz_group_SECURITY (or whatever the group) added to the class on the body element just as currently the status, component, and other states have classes.
Assignee | ||
Updated•18 years ago
|
Assignee: general → ui
Component: Bugzilla-General → User Interface
Updated•17 years ago
|
Whiteboard: [wanted-bmo]
Assignee | ||
Comment 2•17 years ago
|
||
Add "bz_group_<group>" to bodyclasses for all active groups on a bug.
You can see this in action at https://landfill.bugzilla.org/prodpatches/show_bug.cgi?id=417.
Assignee | ||
Updated•17 years ago
|
Target Milestone: --- → Bugzilla 3.0
Version: unspecified → 3.0
![]() |
||
Comment 3•17 years ago
|
||
Comment on attachment 307293 [details] [diff] [review]
patch - v1
>+ [% IF bug.groups.size > 0 %]
No need to do this check. If bug.groups is empty, the FOREACH loop will immediately exit.
Moreover, you have to fix attachment/updated.html.tmpl as well.
As an enhancement, it's not something for 3.0.x.
Attachment #307293 -
Flags: review?(LpSolit) → review-
![]() |
||
Updated•17 years ago
|
Target Milestone: Bugzilla 3.0 → Bugzilla 3.2
Assignee | ||
Comment 4•17 years ago
|
||
Address review comments...
Well, it was worth a shot trying to get this tiny change into 3.0.x. We'll still take it downstream on bmo.
Attachment #307293 -
Attachment is obsolete: true
Attachment #307320 -
Flags: review?(LpSolit)
Reporter | ||
Comment 5•17 years ago
|
||
It's very much wanted on BMO to prevent mistakes in handling security bugs.
(In reply to comment #2)
> You can see this in action at
> https://landfill.bugzilla.org/prodpatches/show_bug.cgi?id=417.
I don't. On that bug I only see class="landfill-bugzilla-org-prodpatches". On a typical BMO bug (e.g. this one) I see class="bugzilla-mozilla-org bz_bug bz_status_ASSIGNED bz_component_User_Interface bz_bug_367394"
Assignee | ||
Comment 6•17 years ago
|
||
(In reply to comment #5)
> (In reply to comment #2)
> > You can see this in action at
> > https://landfill.bugzilla.org/prodpatches/show_bug.cgi?id=417.
>
> I don't. On that bug I only see class="landfill-bugzilla-org-prodpatches". On a
> typical BMO bug (e.g. this one) I see class="bugzilla-mozilla-org bz_bug
> bz_status_ASSIGNED bz_component_User_Interface bz_bug_367394"
<body onload=""
class="landfill-bugzilla-org-prodpatches bz_bug bz_status_REOPENED bz_component_SaltSprinkler bz_bug_417 bz_group_taragroup">
That's what I see... you don't see that?
Assignee | ||
Comment 7•17 years ago
|
||
Were you logged in at the time?
Comment 8•17 years ago
|
||
Without logging in, I get:
class="landfill-bugzilla-org-prodpatches"
Once I log into landfill, I'm able to access the bug, and I get:
class="landfill-bugzilla-org-prodpatches bz_bug bz_status_REOPENED bz_component_SaltSprinkler bz_bug_417 bz_group_taragroup"
Makes sense, given the policy of not saying what group an inaccessible bug is in.
![]() |
||
Comment 9•17 years ago
|
||
Comment on attachment 307320 [details] [diff] [review]
patch - v2
Works fine. But I realized you also have to fix attachment/created.html.tmpl which doesn't have bodyclasses set at all. Else these classes would be omitted everytime you add an attachment.
Please fix this template before I a+ it.
Attachment #307320 -
Flags: review?(LpSolit) → review+
Assignee | ||
Comment 10•17 years ago
|
||
Add bodyclasses to created.html.tmpl and carry over review+.
Attachment #307663 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Attachment #307320 -
Attachment is obsolete: true
Assignee | ||
Updated•17 years ago
|
Flags: approval?
Flags: approval3.2?
![]() |
||
Comment 11•17 years ago
|
||
Comment on attachment 307663 [details] [diff] [review]
patch - v3
>Index: template/en/default/attachment/created.html.tmpl
>+[% bodyclasses = ['bz_bug',
>+ "bz_status_$bug.bug_status",
>+ "bz_component_$bug.component",
>+ "bz_bug_$bug.bug_id"
>+ ]
>+%]
>+[% FOREACH group = bug.groups %]
>+ [% bodyclasses.push("bz_group_" _ group.name) IF group.ison %]
>+[% END %]
No, this doesn't work. $bug is undefined. You need to set [% bug = bugs.0 %] as in other templates. Please test your patch! ;)
Attachment #307663 -
Flags: review+ → review-
![]() |
||
Updated•17 years ago
|
Flags: approval?
Flags: approval3.2?
Assignee | ||
Comment 12•17 years ago
|
||
I don't have a tip testing place set up currently, and 3.0 branch doesn't have most of this code.
Attachment #307663 -
Attachment is obsolete: true
Attachment #307758 -
Flags: review?(LpSolit)
![]() |
||
Comment 13•17 years ago
|
||
Comment on attachment 307758 [details] [diff] [review]
patch - v3.1
This one works fine. r=LpSolit
Attachment #307758 -
Flags: review?(LpSolit) → review+
![]() |
||
Updated•17 years ago
|
Flags: approval+
Assignee | ||
Updated•17 years ago
|
Flags: approval3.2?
Comment 14•17 years ago
|
||
This seems overengineered to me. Why put a class for *each group* if all you care about is whether or not the bug is secure? Just put a single class in there that indicates this bug is restricted to a group.
Assignee | ||
Comment 15•17 years ago
|
||
(In reply to comment #14)
> This seems overengineered to me. Why put a class for *each group* if all you
> care about is whether or not the bug is secure? Just put a single class in
> there that indicates this bug is restricted to a group.
I for one would like the ability to do different things based on different groups. Not all groups are "security" group, so it doesn't make sense to just have a "bz_group" class. bmo has 12 groups-used-for-bugs, and only 3 of them are specifically mentioned as security groups.
I wonder if it's possible to do class matching on partial names (i.e., you could possibly match on bz_group yourself even though it's really bz_group_<whatever>). Is that possible?
Comment 16•17 years ago
|
||
You should be able do that with the CSS3 selector[class*="bz_group"].
Reporter | ||
Comment 17•17 years ago
|
||
> Why put a class for *each group* if all you care about is [security]
Currently I use a greasemonkey script to look at the group checkbox states, and it's useful to style various groups differently. Different products might be useful, too (but we don't have that). I don't know why we have a separate class for each component, though -- _that_ seems overkill, and yet someone wanted it enough to add it.
![]() |
||
Comment 18•17 years ago
|
||
(In reply to comment #17)
> > Why put a class for *each group* if all you care about is [security]
I agree that style based on the group a bug is restricted to makes sense, so you need to know the name of the group(s) a bug is restricted to. It's not overengineered, especially when you know that bugs are most of the time restricted to one group only. So I maintain my a+.
> it's useful to style various groups differently. Different products might be
> useful, too (but we don't have that). I don't know why we have a separate class
> for each component, though -- _that_ seems overkill, and yet someone wanted it
> enough to add it.
Good point! Gerv implemented it in bug 223078 in late 2003, and nobody complained. Let's check this in.
Flags: approval3.2?
Comment 19•17 years ago
|
||
(In reply to comment #15)
> Not all groups are "security" group,
Any group a bug is in restricts it to being viewed by only that group.
(In reply to comment #18)
> Good point! Gerv implemented it in bug 223078 in late 2003, and nobody
> complained.
Because I wasn't here.
Also, you should be using bug.groups_in, not bug.groups.
In any case, the "overengineering for little benefit" aspect of this bug isn't so great that I'd deny checkin, so you can go ahead and check it in, yeah.
Assignee | ||
Comment 20•17 years ago
|
||
Use bug.groups_in and drop the |IF group.ison| check.
Attachment #307758 -
Attachment is obsolete: true
Assignee | ||
Comment 21•17 years ago
|
||
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.24; previous revision: 1.23
done
Checking in template/en/default/attachment/created.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/created.html.tmpl,v <-- created.html.tmpl
new revision: 1.20; previous revision: 1.19
done
Checking in template/en/default/attachment/updated.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/updated.html.tmpl,v <-- updated.html.tmpl
new revision: 1.18; previous revision: 1.17
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 22•17 years ago
|
||
(In reply to comment #19)
> (In reply to comment #15)
> > Not all groups are "security" group,
>
> Any group a bug is in restricts it to being viewed by only that group.
Yes, but we don't treat all groups as "security" groups. I purposely put the word "security" in quotes to emphasize this fact. Some groups are used for MoCo-only things while others are security-related. They aren't the same thing, so there should be a way to differentiate the groups themselves, and just having "bz_group" doesn't allow for that.
> Also, you should be using bug.groups_in, not bug.groups.
Done.
> In any case, the "overengineering for little benefit" aspect of this bug
> isn't so great that I'd deny checkin, so you can go ahead and check it in,
> yeah.
I disagree with your thinking about "overengineering" here. It's a perfectly reasonable request, and it makes complete sense for the groups to be listed since they aren't all the same thing.
![]() |
||
Comment 23•17 years ago
|
||
No idea why Tinderbox is burning, but this patch should fix the problem.
Checking in template/en/default/attachment/created.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/created.html.tmpl,v <-- created.html.tmpl
new revision: 1.21; previous revision: 1.20
done
Checking in template/en/default/attachment/updated.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/updated.html.tmpl,v <-- updated.html.tmpl
new revision: 1.19; previous revision: 1.18
done
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.25; previous revision: 1.24
done
Updated•17 years ago
|
Whiteboard: [wanted-bmo] → [applied to b.m.o]
You need to log in
before you can comment on or make changes to this bug.
Description
•