Refactor spotlight item param names to be more generic.

This commit is contained in:
Max Goodman
2012-08-16 01:32:10 -07:00
parent c22f9c682b
commit 6dfb00105b
3 changed files with 6 additions and 6 deletions

View File

@@ -308,8 +308,8 @@ class HotController(FixListing, ListingController):
g.log.error("pos = %d" % pos)
raise
s = SpotlightListing(b, spotlight_links = spotlight_links,
visible_link = vislink,
s = SpotlightListing(b, spotlight_items = spotlight_links,
visible_item = vislink,
max_num = self.listing_obj.max_num,
max_score = self.listing_obj.max_score).listing()

View File

@@ -133,8 +133,8 @@ class SpotlightListing(Listing):
self.show_nums = True
self._parent_max_num = kw.get('max_num', 0)
self._parent_max_score = kw.get('max_score', 0)
self.spotlight_links = kw.get('spotlight_links', [])
self.visible_link = kw.get('visible_link', '')
self.spotlight_items = kw.get('spotlight_items', [])
self.visible_item = kw.get('visible_item', '')
@property
def max_score(self):

View File

@@ -31,12 +31,12 @@
lookup = dict((t._fullname, t) for t in thing.things)
seen = set([])
%>
%for name in thing.spotlight_links:
%for name in thing.spotlight_items:
%if name in seen:
<% pass %>
%elif lookup.has_key(name):
<% seen.add(name) %>
${unsafe(lookup[name].render(display = (thing.visible_link == name)))}
${unsafe(lookup[name].render(display = (thing.visible_item == name)))}
%else:
<div class="thing id-${name} stub" style="display:none"></div>
%endif