This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Move "lookup" spotlight box var out of template.

  • Loading branch information...
1 parent 6dfb001 commit 754c35da53ad6123061f8e83a31c6df39ea8720b @chromakode chromakode committed Aug 16, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −0 r2/r2/models/listing.py
  2. +2 −3 r2/r2/templates/spotlightlisting.html
View
@@ -149,4 +149,5 @@ def listing(self):
# suppress item numbering
for t in res.things:
t.num = ""
+ self.lookup = {t._fullname : t for t in self.things}
return res
@@ -28,15 +28,14 @@
<div id="siteTable_organic" class="organic-listing">
<%
- lookup = dict((t._fullname, t) for t in thing.things)
seen = set([])
%>
%for name in thing.spotlight_items:
%if name in seen:
<% pass %>
- %elif lookup.has_key(name):
+ %elif name in thing.lookup:
<% seen.add(name) %>
- ${unsafe(lookup[name].render(display = (thing.visible_item == name)))}
+ ${unsafe(thing.lookup[name].render(display = (thing.visible_item == name)))}
%else:
<div class="thing id-${name} stub" style="display:none"></div>
%endif

0 comments on commit 754c35d

Please sign in to comment.