diff options
author | Jeff Balogh <jbalogh@mozilla.com> | 2010-09-02 06:00:19 (GMT) |
---|---|---|
committer | Jeff Balogh <jbalogh@mozilla.com> | 2010-09-02 06:11:16 (GMT) |
commit | 635d25e5805c926fc6896dee87fa239fe2376563 (patch) | |
tree | 28e37b7713c32aefb76e01bf52f29563a6d96c83 /apps | |
parent | b98b439987745f22a186e4c2e321cec366e23b05 (diff) |
hide the date unless we're sorting by it (bug 589363)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/addons/helpers.py | 6 | ||||
-rw-r--r-- | apps/addons/templates/addons/home.html | 2 | ||||
-rw-r--r-- | apps/addons/templates/addons/listing/items.html | 5 | ||||
-rw-r--r-- | apps/addons/templates/addons/listing/items_compact.html | 2 | ||||
-rw-r--r-- | apps/addons/templates/addons/listing/macros.html | 6 | ||||
-rw-r--r-- | apps/bandwagon/helpers.py | 6 | ||||
-rw-r--r-- | apps/bandwagon/templates/bandwagon/collection_listing.html | 3 | ||||
-rw-r--r-- | apps/bandwagon/templates/bandwagon/collection_listing_items.html | 10 | ||||
-rw-r--r-- | apps/bandwagon/templates/bandwagon/following.html | 26 | ||||
-rw-r--r-- | apps/browse/templates/browse/extensions.html | 2 | ||||
-rw-r--r-- | apps/browse/templates/browse/search_tools.html | 2 | ||||
-rw-r--r-- | apps/search/templates/search/results.html | 4 |
12 files changed, 25 insertions, 49 deletions
diff --git a/apps/addons/helpers.py b/apps/addons/helpers.py index e118c0f..284ca2b 100644 --- a/apps/addons/helpers.py +++ b/apps/addons/helpers.py @@ -109,17 +109,15 @@ def tags_box(context, addon, dev_tags, user_tags, current_user_tags=[]): @register.inclusion_tag('addons/listing/items.html') @jinja2.contextfunction -def addon_listing_items(context, addons, show_added_date=False, src=None, +def addon_listing_items(context, addons, show_date=False, src=None, notes={}): - """`show_added_date` will show the added versus the updated date.""" return new_context(**locals()) @register.inclusion_tag('addons/listing/items_compact.html') @jinja2.contextfunction -def addon_listing_items_compact(context, addons, show_added_date=False, +def addon_listing_items_compact(context, addons, show_date=False, src=None): - """`show_added_date` will show the added versus the updated date.""" return new_context(**locals()) diff --git a/apps/addons/templates/addons/home.html b/apps/addons/templates/addons/home.html index 20ec283..29c6882 100644 --- a/apps/addons/templates/addons/home.html +++ b/apps/addons/templates/addons/home.html @@ -81,7 +81,7 @@ <div class="addon-listing addon-listing-{{ filter.field }}"> {% for key, addons in addon_sets.items() %} <div id="list-{{ key }}"> - {{ addon_listing_items_compact(addons, show_added_date=(key=='new'), + {{ addon_listing_items_compact(addons, show_date=key, src='homepagebrowse') }} <div class="listing-footer"> <a class="subscribe" href="{{ view_all[key]['feed'] }}"> diff --git a/apps/addons/templates/addons/listing/items.html b/apps/addons/templates/addons/listing/items.html index f069e23..3bc8ec1 100644 --- a/apps/addons/templates/addons/listing/items.html +++ b/apps/addons/templates/addons/listing/items.html @@ -1,12 +1,13 @@ {% from "addons/listing/macros.html" import heading, item_info %} {% set collection = collection or None %} -{% cache addons, extra=[collection] %} +{% set username = request.amo_user.username if request.user.is_authenticated() else '' %} +{% cache addons, extra=[collection, username] %} {% for addon in addons %} <div class="item"> {{ heading(addon, collection=collection) }} <div class="item-info"> {{ install_button(addon, collection=collection) }} - {{ item_info(addon, amo, show_added_date) }} + {{ item_info(addon, amo, show_date) }} {% if request.user.is_authenticated() %} <div class="collection_widgets widgets condensed"> {{ favorites_widget(addon, condensed=True) }} diff --git a/apps/addons/templates/addons/listing/items_compact.html b/apps/addons/templates/addons/listing/items_compact.html index f3cb384..bef1e04 100644 --- a/apps/addons/templates/addons/listing/items_compact.html +++ b/apps/addons/templates/addons/listing/items_compact.html @@ -9,7 +9,7 @@ <div>{{ addon.summary|truncate(250)|nl2br }}</div> </blockquote> <div class="meta"> - {{ item_info(addon, amo, show_added_date) }} + {{ item_info(addon, amo, show_date) }} </div> {{ support_addon(addon) }} </div> diff --git a/apps/addons/templates/addons/listing/macros.html b/apps/addons/templates/addons/listing/macros.html index 6b63915..61f47ad 100644 --- a/apps/addons/templates/addons/listing/macros.html +++ b/apps/addons/templates/addons/listing/macros.html @@ -18,7 +18,7 @@ </h3> {% endmacro %} -{% macro item_info(addon, amo, show_added_date) %} +{% macro item_info(addon, amo, show_date) %} {{ addon|reviews_link }} {% if addon.status != amo.STATUS_LISTED %} <p class="downloads"> @@ -30,9 +30,9 @@ {% endwith %} </p> <p class="updated"> - {% if show_added_date %} + {% if show_date in ['created', 'new', 'newest'] %} {{ _('Added {0}')|f(addon.created|datetime) }} - {% else %} + {% elif show_date == 'updated' %} {{ _('Updated {0}')|f(addon.last_updated|datetime) }} {% endif %} </p> diff --git a/apps/bandwagon/helpers.py b/apps/bandwagon/helpers.py index b224305..dbbd25b 100644 --- a/apps/bandwagon/helpers.py +++ b/apps/bandwagon/helpers.py @@ -11,9 +11,11 @@ from amo.urlresolvers import reverse @register.inclusion_tag('bandwagon/collection_listing_items.html') @jinja2.contextfunction -def collection_listing_items(context, collections, show_weekly=False): +def collection_listing_items(context, collections, show_weekly=False, + show_date=None): c = dict(context.items()) - c.update(collections=collections, show_weekly=show_weekly) + c.update(collections=collections, show_weekly=show_weekly, + show_date=show_date) return c diff --git a/apps/bandwagon/templates/bandwagon/collection_listing.html b/apps/bandwagon/templates/bandwagon/collection_listing.html index bdcc078..1b73226 100644 --- a/apps/bandwagon/templates/bandwagon/collection_listing.html +++ b/apps/bandwagon/templates/bandwagon/collection_listing.html @@ -43,7 +43,8 @@ show_unreviewed=False) }} <div class="featured-inner"> {{ collection_listing_items(collections.object_list, - show_weekly=filter.field == 'popular') }} + show_weekly=filter.field == 'popular', + show_date=filter.field) }} </div> {% if collections.has_other_pages() %} <div class="listing-footer">{{ collections|paginator }}</div> diff --git a/apps/bandwagon/templates/bandwagon/collection_listing_items.html b/apps/bandwagon/templates/bandwagon/collection_listing_items.html index 92fd8c4..f760168 100644 --- a/apps/bandwagon/templates/bandwagon/collection_listing_items.html +++ b/apps/bandwagon/templates/bandwagon/collection_listing_items.html @@ -20,10 +20,12 @@ {% endtrans %} {% endif %} </li> - <li class="modified"> - {# L10n: {0} is a date. #} - {{ _('Updated {0}')|f(c.modified|datetime) }} - </li> + {% if show_date == 'created' %} + <li class="modified"> + {# L10n: {0} is a date. #} + {{ _('Added {0}')|f(c.created|datetime) }} + </li> + {% endif %} </ul> {{ collection_widgets(c, condensed=True) }} </div> diff --git a/apps/bandwagon/templates/bandwagon/following.html b/apps/bandwagon/templates/bandwagon/following.html deleted file mode 100644 index 1d4d182..0000000 --- a/apps/bandwagon/templates/bandwagon/following.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "base.html" %} - -{% set title = _("Collections I'm Following") %} -{% block title %}{{ page_title(title) }}{% endblock %} - -{% block content %} -<div class="primary"> - <header> - {{ breadcrumbs([(url('collections.list'), _('Collections')), - (None, title)]) }} - <h2>{{ title }}</h2> - </header> - <div class="featured listing"> - <div class="featured-inner"> - {{ collection_listing_items(collections.object_list) }} - </div> - {% if collections.has_other_pages() %} - <div class="listing-footer">{{ collections|paginator }}</div> - {% endif %} - </div> -</div> - -<div class="secondary"> - {% include 'bandwagon/includes/collection_sidebar.html' %} -</div> -{% endblock %} diff --git a/apps/browse/templates/browse/extensions.html b/apps/browse/templates/browse/extensions.html index 9eff557..c5d5dfe 100644 --- a/apps/browse/templates/browse/extensions.html +++ b/apps/browse/templates/browse/extensions.html @@ -26,7 +26,7 @@ {% endif %} {{ addon_listing_header(url_base, sort_opts, sorting, unreviewed) }} {{ addon_listing_items(addons.object_list, src='category', - show_added_date=(sorting=='created')) }} + show_date=sorting) }} <div class="listing-footer"> {{ addons|paginator }} </div> diff --git a/apps/browse/templates/browse/search_tools.html b/apps/browse/templates/browse/search_tools.html index b2f9260..99ab9c5 100644 --- a/apps/browse/templates/browse/search_tools.html +++ b/apps/browse/templates/browse/search_tools.html @@ -41,7 +41,7 @@ {{ addon_listing_header(url('browse.search-tools', category.slug), filter.opts, filter.field, unreviewed) }} {{ addon_listing_items(addons.object_list, src='category', - show_added_date=(filter.field=='created')) }} + show_date=filter.field) }} <div class="listing-footer"> {{ addons|paginator }} </div> diff --git a/apps/search/templates/search/results.html b/apps/search/templates/search/results.html index 0a6c2ee..62f79cb 100644 --- a/apps/search/templates/search/results.html +++ b/apps/search/templates/search/results.html @@ -32,9 +32,7 @@ {% endfor %} </ul> </div> - {{ addon_listing_items(pager.object_list, - show_added_date=(sort == 'newest'), - src='search') }} + {{ addon_listing_items(pager.object_list, show_date=sort, src='search') }} </div> <div class="listing-footer"> |