Changeset 52158b1
- Timestamp:
- 10/27/11 11:48:12 (19 months ago)
- Branches:
- master, crem, crem2, dev, diadems, forma, generic, instru_search, lam, nlivemulti, production, release/1.4.4, security, social, storage, test, video
- Children:
- ae04490
- Parents:
- fda0645
- git-author:
- yomguy <yomguy@…> (10/27/11 11:48:12)
- git-committer:
- yomguy <yomguy@…> (10/27/11 11:48:12)
- Location:
- telemeta
- Files:
-
- 2 edited
-
templates/telemeta_default/index.html (modified) (4 diffs)
-
web/base.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
telemeta/templates/telemeta_default/index.html
rfda0645 r52158b1 15 15 </div> 16 16 17 {% if sound_pub_item %} 17 18 <div id="module" class="module"> 18 19 <h3><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlist" style="vertical-align:middle" /> … … 24 25 </ul> 25 26 </div> 27 {% endif %} 26 28 27 29 {% include "telemeta/inc/module_revisions.html" %} … … 36 38 </div> 37 39 40 {% if sound_pub_items %} 38 41 <div style="margin-top: 1ex;"> 39 42 <h1><img src="{% url telemeta-images "playlist_title.png" %}" alt="playlists" style="vertical-align:middle" /> 40 43 {% trans "Musical selection" %}</h1> 41 44 <table style="font-size: 90%"><tr> 42 {% for item in sound_ items %}43 <td width="390"><a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>{% if item.alt_title %} ({{ item.alt_title }}){% endif %}<br /><span style="font-size: 90%">{{ item.location.fullnames|to_string }}</span><br />45 {% for item in sound_pub_items %} 46 <td width="390"><a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>{% if item.alt_title %} ({{ item.alt_title }}){% endif %}<br /><span style="font-size: 80%">{{ item.location.fullnames|to_string }}</span><br /> 44 47 <iframe width='376' height='215' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{item.public_id }}/player/362x130/'></iframe></td> 45 48 {% endfor %} … … 47 50 </table> 48 51 </div> 52 {% endif %} 49 53 50 54 </div> -
telemeta/web/base.py
rfda0645 r52158b1 176 176 if not request.user.is_authenticated(): 177 177 template = loader.get_template('telemeta/index.html') 178 ids = [id for id in MediaItem.objects.all().values_list('id', flat=True).order_by('?')[0:3]]179 items = MediaItem.objects.enriched().filter(pk__in=ids)180 178 # ids = [id for id in MediaItem.objects.all().values_list('id', flat=True).order_by('?')[0:3]] 179 # items = MediaItem.objects.enriched().filter(pk__in=ids) 180 # 181 181 sound_items = MediaItem.objects.sound() 182 182 sound_pub_items = [] … … 186 186 sound_pub_items.append(item) 187 187 188 sound_pub_item = sound_pub_items[0]189 188 random.shuffle(sound_pub_items) 190 if len(sound_pub_items) >= 2: 191 sound_pub_items = sound_pub_items[0:2] 192 189 if len(sound_pub_items) != 0: 190 sound_pub_item = sound_pub_items[0] 191 else: 192 sound_pub_item = None 193 if len(sound_pub_items) == 2: 194 sound_pub_items = sound_pub_items[1] 195 if len(sound_pub_items) > 2: 196 sound_pub_items = sound_pub_items[1:3] 197 193 198 revisions = get_revisions(4) 194 199 context = RequestContext(request, { 195 200 'page_content': pages.get_page_content(request, 'home', ignore_slash_issue=True), 196 ' items': items, 'revisions': revisions, 'sound_items': sound_pub_items,201 'revisions': revisions, 'sound_pub_items': sound_pub_items, 197 202 'sound_pub_item': sound_pub_item }) 198 203 return HttpResponse(template.render(context))
Note: See TracChangeset
for help on using the changeset viewer.
