Closed Bug 311258 Opened 19 years ago Closed 18 years ago

use objects methods in templates of edit[product,components,milestones,versions]

Categories

(Bugzilla :: User Interface, enhancement)

2.21
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: batosti, Assigned: batosti)

References

Details

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050725 Firefox/1.0.6 (Ubuntu package 1.0.6)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050725 Firefox/1.0.6 (Ubuntu package 1.0.6)

use the object methods instead pass an attribute of object as template variable.

Reproducible: Always
Assignee: myk → batosti
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → 2.21
Attached patch batosti_v1 (obsolete) — Splinter Review
Attachment #198643 - Flags: review?(LpSolit)
Comment on attachment 198643 [details] [diff] [review]
batosti_v1

bitrotten
Attachment #198643 - Flags: review?(LpSolit) → review-
Attached patch batosti_v1_fix_bitrott (obsolete) — Splinter Review
Attachment #198643 - Attachment is obsolete: true
Attachment #198736 - Flags: review?(LpSolit)
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.24
This patch should land before its blockers. First use objects everywhere in templates, then add new methods. This will make reviews much easier.

Landing this patch will also bitrot all existing patches on blockers of this bug.
Blocks: 295933
Comment on attachment 198736 [details] [diff] [review]
batosti_v1_fix_bitrott

editcomponents.cgi:
- remove 'deleted_bug_count' in the 'delete' section.

editmilestones.cgi:
- remove 'sortkey' in section 'update';
- remove 'default_milestone' in section '!$action';
- fix ThrowUserError() in section 'del' and 'delete';

components/edit.html.tmpl:
- fix INTERFACE

components/list.html.tmpl:
- fix INTERFACE;
- product -> product.name in the "redisplay table with bug counts";

components/deleted.html.tmpl:
- remove 'deleted_bug_count'

milestones/confirm-delete.html.tmpl:
- fix INTERFACE;
- bug_count -> milestone.bug_count;

milestones/create.html.tmpl:
- fix INTERFACE

milestones/created.html.tmpl:
- fix INTERFACE;
- name -> milestone.name;
- product -> product.name

milestones/deleted.html.tmpl:
- fix INTERFACE

milestones/edit.html.tmpl:
- fix INTERFACE

milestones/footer.html.tmpl:
- fix INTERFACE;
- product.name -> milestone.name in "Edit milestone...";
- [%- instead of [% alone in long URLs after newlines;

milestones/list.html.tmpl:
- fix INTERFACE;
- "$product.default_milestone" -> product.default_milestone;

milestones/updated.html.tmpl:
- fix INTERFACE

versions/confirm-delete.html.tmpl:
- fix INTERFACE;
- there is a missing whitespace in a " FILTER none%] ". I let you find it;
- [% version.bug_count FILTER none %] can be replace by "1" on one place (there is 1 bug...);

versions/create.html.tmpl:
- fix INTERFACE

versions/created.html.tmpl:
- fix INTERFACE

versions/deleted.html.tmpl:
- fix INTERFACE

versions/edit.html.tmpl:
- fix INTERFACE

versions/footer.html.tmpl:
- fix INTERFACE;
- name -> version.name;
- product.name -> version.name in "Edit version...";
- [%- instead of [% alone in long URLs after newlines;

versions/list.html.tmpl:
- fix INTERFACE

versions/updated.html.tmpl:
- fix INTERFACE
Attachment #198736 - Flags: review?(LpSolit) → review-
Attached patch batosti_v1_fix_fix (obsolete) — Splinter Review
Attachment #198736 - Attachment is obsolete: true
Attachment #210912 - Flags: review?(LpSolit)
Comment on attachment 210912 [details] [diff] [review]
batosti_v1_fix_fix

>Index: template/en/default/admin/components/create.html.tmpl

>-  <input type="hidden" name='nonopen_name' value='All Closed'>
>+  <input type="hidden" name='closed_name' value='All Closed'>

Wrong! The name of this field is really 'nonopen_name'.



>Index: template/en/default/admin/components/deleted.html.tmpl

>+[% IF comp.bug_count %]
>+  [% comp.bug_count %]

You have to use 'FILTER none' here. Else ./runtests.pl fails.


>+  [%- IF comp.bug_count > 1 %] 
>     [% terms.bugs %]
>   [% ELSE %]
>     [% terms.bug %]

You have to write [%+ for both 'bugs' and 'bug', else you read '1bug' with no whitespace. Also, remove [%- in IF, because you are removing this whitespace.



>Index: template/en/default/admin/milestones/confirm-delete.html.tmpl

>+    [% IF milstone.bug_count > 1 %] 
>+      are [% milestone.bug_count FILTER none %] [%+ terms.bugs %] 

Must be mil*E*stone.bug_count. 'milstone' doesn't exist and errors appear in the Apache error log.



>Index: template/en/default/admin/milestones/footer.html.tmpl

>+  # milestone: object; Bugzilla::Milestone object representing the
>+  #                    milestone the user wants to delete.

Huh? Who said we were removing the milestone? This template is used everywhere.



>Index: template/en/default/admin/milestones/list.html.tmpl

> [%# We want to override the usual 'Delete' link for the default
>     milestone %]
> [% overrides.action = [ {
>+     match_value => $product.default_milestone

You have to write 'product.default_milestone', without the dollar $ symbol. Else it fails (I tested).



>Index: template/en/default/admin/milestones/updated.html.tmpl

>   # Variables called just 'XXX' are strings, and are the _new_ contents
>   # of the fields.

This is from the INTERFACE, and is now obsolete.
Attachment #210912 - Flags: review?(LpSolit) → review-
Attached patch batosti_v2Splinter Review
Attachment #210912 - Attachment is obsolete: true
Attachment #213614 - Flags: review?(LpSolit)
Comment on attachment 213614 [details] [diff] [review]
batosti_v2

'deleted_bug_count' must be removed from filterexceptions.pl. This  can be done on checkin. r=LpSolit


not ok 38 - (en/default) template/en/default/admin/components/deleted.html.tmpl - filterexceptions.pl has extra members:
#   deleted_bug_count
# --WARNING
Attachment #213614 - Flags: review?(LpSolit) → review+
Flags: approval?
Flags: approval? → approval+
Checking in editcomponents.cgi;
/cvsroot/mozilla/webtools/bugzilla/editcomponents.cgi,v  <--  editcomponents.cgi
new revision: 1.70; previous revision: 1.69
done
Checking in editmilestones.cgi;
/cvsroot/mozilla/webtools/bugzilla/editmilestones.cgi,v  <--  editmilestones.cgi
new revision: 1.52; previous revision: 1.51
done
Checking in editversions.cgi;
/cvsroot/mozilla/webtools/bugzilla/editversions.cgi,v  <--  editversions.cgi
new revision: 1.45; previous revision: 1.44
done
Checking in template/en/default/filterexceptions.pl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/filterexceptions.pl,v  <--  filterexceptions.pl
new revision: 1.65; previous revision: 1.64
done
Checking in template/en/default/admin/components/confirm-delete.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/confirm-delete.html.tmpl,v  <--  confirm-delete.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/admin/components/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.6; previous revision: 1.5
done
Checking in template/en/default/admin/components/created.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/created.html.tmpl,v  <--  created.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/components/deleted.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/deleted.html.tmpl,v  <--  deleted.html.tmpl
new revision: 1.4; previous revision: 1.3
done
Checking in template/en/default/admin/components/edit.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/edit.html.tmpl,v  <--  edit.html.tmpl
new revision: 1.7; previous revision: 1.6
done
Checking in template/en/default/admin/components/footer.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/footer.html.tmpl,v  <--  footer.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/components/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/admin/components/updated.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/updated.html.tmpl,v  <--  updated.html.tmpl
new revision: 1.3; previous revision: 1.2
done
Checking in template/en/default/admin/milestones/confirm-delete.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/confirm-delete.html.tmpl,v  <--  confirm-delete.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/admin/milestones/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.3; previous revision: 1.2
done
Checking in template/en/default/admin/milestones/created.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/created.html.tmpl,v  <--  created.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/milestones/deleted.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/deleted.html.tmpl,v  <--  deleted.html.tmpl
new revision: 1.4; previous revision: 1.3
done
Checking in template/en/default/admin/milestones/edit.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/edit.html.tmpl,v  <--  edit.html.tmpl
new revision: 1.4; previous revision: 1.3
done
Checking in template/en/default/admin/milestones/footer.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/footer.html.tmpl,v  <--  footer.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/milestones/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.4; previous revision: 1.3
done
Checking in template/en/default/admin/milestones/updated.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/milestones/updated.html.tmpl,v  <--  updated.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/versions/confirm-delete.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/confirm-delete.html.tmpl,v  <--  confirm-delete.html.tmpl
new revision: 1.4; previous revision: 1.3
done
Checking in template/en/default/admin/versions/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/versions/created.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/created.html.tmpl,v  <--  created.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/versions/deleted.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/deleted.html.tmpl,v  <--  deleted.html.tmpl
new revision: 1.3; previous revision: 1.2
done
Checking in template/en/default/admin/versions/edit.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/edit.html.tmpl,v  <--  edit.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/versions/footer.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/footer.html.tmpl,v  <--  footer.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/admin/versions/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.3; previous revision: 1.2
done
Checking in template/en/default/admin/versions/updated.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/versions/updated.html.tmpl,v  <--  updated.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v  <--  user-error.html.tmpl
new revision: 1.150; previous revision: 1.149
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Blocks: 332142
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: