Closed Bug 414509 Opened 17 years ago Closed 14 years ago

offer View All (non obsolete) attachments

Categories

(Bugzilla :: Attachments & Requests, enhancement)

3.1.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: timeless, Assigned: guy.pyrzak)

References

()

Details

Attachments

(1 file, 2 obsolete files)

bug 413961 has too many attachments, i want to:
1. click "hide obsolete"
2. click "view all"
*see* only the non obsolete attachments.

note: i don't want to break current urls, i just want a new feature &action=viewnonobsolete
Yeah, that sounds like the right implementation and a sensible thing to do.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Mac OS X → All
Hardware: Macintosh → All
Oh, except it should be &hide_obsolete=1, not a new whole action.
Yoink! (the sound of taking a bug)
Assignee: attach-and-request → guy.pyrzak
Attached patch V1 (obsolete) — Splinter Review
I'm attaching this for now but I think I need to add something to the page to indicate that obsolete attachments have been hidden.
Attachment #430979 - Attachment is patch: true
Attachment #430979 - Attachment mime type: application/octet-stream → text/plain
Attached patch V2 (obsolete) — Splinter Review
Attachment #430979 - Attachment is obsolete: true
Attachment #430982 - Flags: review?(LpSolit)
Comment on attachment 430982 [details] [diff] [review]
V2

>=== modified file 'skins/standard/attachment.css'

>+#hidden_obsolete_message{

Missing whitespace before {.


>=== modified file 'template/en/default/attachment/list.html.tmpl'

>+                  [% bugid %]&action=viewall
>+                  [%- "&hide_obsolete=1" IF obsolete_attachments %]">View All</a>

& -> &amp; (must be escaped).



>=== modified file 'template/en/default/attachment/show-multiple.html.tmpl'

>+  Obsolete attachments are hidden. To view all attachments (including obsolete) <a href="attachment.cgi?bugid=[% bug.id %]&action=viewall">click here</a>.

[% bug.id %] must be HTML filtered:

#   Failed test '(en/default) template/en/default/attachment/show-multiple.html.tmpl has unfiltered directives:
#   38: bug.id
# --ERROR'
#   at t/008filter.t line 132.


Otherwise looks good and works great!
Attachment #430982 - Flags: review?(LpSolit) → review-
Target Milestone: --- → Bugzilla 3.8
Target Milestone: Bugzilla 4.0 → ---
Thinking about it again, I think that "View All" should only display non-obsolete attachments, always.
(In reply to comment #7)
> Thinking about it again, I think that "View All" should only display
> non-obsolete attachments, always.

  Or perhaps just whatever is currently being displayed in the table, no?
(In reply to comment #8)
>   Or perhaps just whatever is currently being displayed in the table, no?

Sure, this would work too.
Attached patch v3Splinter Review
Attachment #430982 - Attachment is obsolete: true
Attachment #474179 - Flags: review?(LpSolit)
Comment on attachment 474179 [details] [diff] [review]
v3

>=== modified file 'attachment.cgi'

>+    if ( $cgi->param('hide_obsolete') ) {

Nit: no need for the extra whitespaces in parens.


>+        $attachments = [ grep { ! $_->isobsolete } @$attachments ];

Please write: @$attachments = grep { !$_->isobsolete } @$attachments;



=== modified file 'template/en/default/attachment/list.html.tmpl'

>+            <a id="view_all" href="attachment.cgi?bugid=
>+                  [% bugid %]&amp;action=viewall

Nit: please write [%- bugid %] instead, to make sure no newline is inserted in the URL (those are a pain for Selenium).



>=== modified file 'template/en/default/attachment/show-multiple.html.tmpl'

>+  <div id="hidden_obsolete_message">
>+  Obsolete attachments are hidden. To view all attachments (including obsolete) 
>+  <a href="attachment.cgi?bugid=[% bug.id FILTER html%]&amp;action=viewall">click here</a>.
>+  </div>

Please fix the indentation, and add a whitespace before %].


I like this patch. :) r=LpSolit with my comments fixed.
Attachment #474179 - Flags: review?(LpSolit) → review+
Flags: approval+
Target Milestone: --- → Bugzilla 4.2
Committing to: bzr+ssh://guy.pyrzak%40gmail.com@bzr.mozilla.org/bugzilla/trunk/                                   
modified attachment.cgi
modified skins/standard/attachment.css
modified template/en/default/attachment/list.html.tmpl
modified template/en/default/attachment/show-multiple.html.tmpl
Committed revision 7511.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: