Closed
Bug 567925
Opened 15 years ago
Closed 15 years ago
Breadcrumbs for add-ons with lengthy names look awkward
Categories
(addons.mozilla.org Graveyard :: Public Pages, defect, P4)
Tracking
(Not tracked)
VERIFIED
FIXED
5.12.3
People
(Reporter: krupa.mozbugs, Assigned: chenba)
References
()
Details
(Whiteboard: [z])
Attachments
(3 files, 1 obsolete file)
steps to reproduce:
Notice the breadcrumb for the add-on-https://preview.addons.mozilla.org/en-US/firefox/addon/9412/
observed behavior:
Breadcrumbs for add-ons with lengthy names look awkward.See screenshot.This would look worse once we add breadcrumbs to EULA and versionHistory pages
Comment 1•15 years ago
|
||
We should truncate long add-on names with an ellipsis in breadcrumbs. A little trail of breadcrumbs within breadcrumbs, if you will.
Let's say 40 characters.
Whiteboard: [z][ddn] → [z]
Updated•15 years ago
|
Target Milestone: 5.11 → 5.11.1
Updated•15 years ago
|
Priority: -- → P4
Comment 2•15 years ago
|
||
Edmund, want to check this out? Looks like jinja has a truncate function:
http://jinja.pocoo.org/2/documentation/templates
Assignee: nobody → ewong
Target Milestone: 5.11.1 → 5.11.2
Updated•15 years ago
|
Status: NEW → ASSIGNED
Comment 3•15 years ago
|
||
Attachment #450657 -
Flags: review?(clouserw)
Comment 4•15 years ago
|
||
Comment on attachment 450657 [details] [diff] [review]
Shortened addon description in the addon breadcrumb up to the 40th character and then used ellipses
> {% block content %}
>-{{ breadcrumbs([(addon.type.get_url_path(), amo.ADDON_TYPES[addon.type_id]), (None, addon.name)]) }}
>+{% set addonname = "%s" % addon.name %}
jinja has the |str filter for this.
>+{% set addonname = addonname | truncate(40, True, '...') %}
You only need to pass in the length; the other arguments can be left with their defaults.
>+{{ breadcrumbs([(addon.type.get_url_path(), amo.ADDON_TYPES[addon.type_id]), (None, addonname )]) }}
It's slightly cleaner to use a {% with %} so your new variable is only in a small scope.
{% with name=addon.name|str|truncate(40) %}
{{ breadcrumbs(...) }}
{% endwith %}
Attachment #450657 -
Flags: review?(clouserw)
Attachment #450657 -
Flags: review-
Comment 5•15 years ago
|
||
Attachment #450657 -
Attachment is obsolete: true
Updated•15 years ago
|
Attachment #450797 -
Flags: review?(clouserw)
Updated•15 years ago
|
Attachment #450797 -
Flags: review?(clouserw) → review+
Comment 6•15 years ago
|
||
Thanks! I made a couple slight adjustments to bring it up to to date with the code. http://github.com/jbalogh/zamboni/commit/9686298a9dd5e17a2c919e96c40be515624fadb6
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 7•15 years ago
|
||
So, it occurs to me after the fact :-/ that this will only work on single add-on pages and not any of the sub pages, etc. Instead of the single fix in the patch above, we should edit apps/amo/helpers.py:breadcrumbs() to add a default truncate=40 kwarg and have it affect all portions of the breadcrumbs.
Updated•15 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•15 years ago
|
Target Milestone: 5.11.2 → 5.11.3
Updated•15 years ago
|
Status: REOPENED → ASSIGNED
Updated•15 years ago
|
Target Milestone: 5.11.3 → ---
Comment 8•15 years ago
|
||
stealing from ewong!
Assignee: ewong → chenba
Severity: normal → trivial
Target Milestone: --- → 5.12.3
| Assignee | ||
Comment 9•15 years ago
|
||
Comment 10•15 years ago
|
||
looks good, please land
| Assignee | ||
Comment 11•15 years ago
|
||
Now in jbalogh/master: https://github.com/jbalogh/zamboni/commit/00efa1df3e279fa6a99a8e59827881fbd226bf1b
Status: ASSIGNED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 12•15 years ago
|
||
verified FIXED at-
https://addons.allizom.org/de/firefox/addon/11166/
https://addons.allizom.org/de/firefox/addon/11166/reviews/
https://addons.allizom.org/en-US/firefox/addon/11166/privacy/
https://addons.allizom.org/en-US/firefox/addon/11166/versions/
https://addons.allizom.org/he/firefox/addon/11166/license/1.0.5
Status: RESOLVED → VERIFIED
| Reporter | ||
Comment 13•15 years ago
|
||
Updated•10 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•