Closed Bug 297213 Opened 20 years ago Closed 12 years ago

Submit button appears without having anything to submit

Categories

(Bugzilla :: Administration, task)

2.19.1
task
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: goobix, Assigned: sjoshi)

Details

Attachments

(1 file, 1 obsolete file)

editproducts.cgi?action=editgroupcontrols&product=TestProduct&classification=Unclassified

If there aren't any groups available in a product, then by visiting the URL
above I get a table header, no rows and a submit button. It's confusing since
there is no data to submit.
But I have doubt in this:
We can remove the Submit button, but it will again look odd displaying just the header of the table.

My Suggestion: if there are no groups then its better not to even display the headers and we can display add group link.through which user can add groups.

Please assign this bug to me with the approach to be followed in this case.
Thanks
I agree that if there is no group, then both the table and the submit button should not be displayed. Adding a link to create a group is a good idea, assuming the user has the privileges to create one.

Sunil: feel free to attach a patch to this bug even if this bug is not assigned to you. We usually wait for a contributor to contribute something before assigning the bug to him, because we often have contributors who say they want to work on a bug but never start working on it for various reasons.
Assignee: administration → joshi_sunil
Severity: normal → minor
Attached patch Patch (obsolete) — Splinter Review
Attachment #653173 - Flags: review?(LpSolit)
Comment on attachment 653173 [details] [diff] [review]
Patch

>+[% IF product.group_controls(1).size %]

This doesn't work. If none of the user groups is available for products, you still get the headers but with no groups listed.


>+[%ELSE%]

Please add spaces around "ELSE" -> [% ELSE %]


>+<p>No group exists.

This message is inaccurate. You should say that "No groups are available for products.", because system groups always exist but are not available for products.


>+    <a href="editgroups.cgi?action=add">Add Group</a>

Maybe "Create a new group", because you are not *adding* a group to this product yet. You must create it first.


>+  [%END%]
>+</p>
>+[%END%]

Also add spaces around "END" -> [% END %]
Attachment #653173 - Flags: review?(LpSolit) → review-
Attached patch Re-PatchSplinter Review
Attachment #661496 - Flags: review?(LpSolit)
Attachment #661496 - Attachment is patch: true
Attachment #653173 - Attachment is obsolete: true
Comment on attachment 661496 [details] [diff] [review]
Re-Patch

>+[% display_group=1 %]

Add whitespaces around "=", else 008filter.t complains. Also, it should be display_groups (plural).


>+  [% IF display_group AND ((!group.group.isactive AND group.bug_count) or group.group.is_active) %]

This can simply be written as:

  [% IF display_group AND (group.group.isactive OR group.bug_count) %]

Or even better:

  [% NEXT UNLESS group.group.isactive OR group.bug_count %]
  [% IF display_group %]


>+      [% display_group =0 %]

Also add a whitespace after "=". Moreover, the indentation is wrong (2 whitespaces for templates).


>+  [% IF !group.group.isactive AND group.bug_count %]

With the [% NEXT UNLESS ... %] check above, you can remove the 2nd part of the test.


>+  [% ELSIF group.group.is_active %]

With the [% NEXT UNLESS ... %] check above, this can simply be [% ELSE %]


>+  [% IF user.in_group('creategroups') %]
>+      <a href="editgroups.cgi?action=add">Create a new group</a>
>+  [% END %]

Wrong indentation.


>+[% ELSE %]
>   </table>
>   <br>
>   <input type=submit name="submit" value="submit">
>   <br>
> </form>
>+[% END %]

Wrong indentation.


Your patch is working fine. I will fix these comments on checkin.
Attachment #661496 - Flags: review?(LpSolit) → review+
Status: NEW → ASSIGNED
Flags: approval4.4+
Flags: approval+
Target Milestone: --- → Bugzilla 4.4
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/admin/products/groupcontrol/edit.html.tmpl
Committed revision 8421.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified template/en/default/admin/products/groupcontrol/edit.html.tmpl
Committed revision 8415.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: