Changeset 1348
- Timestamp:
- 08/13/08 13:24:49 (5 months ago)
- Files:
-
- trunk/app/models/show.rb (modified) (1 diff)
- trunk/config/initializers/liquid_filters.rb (modified) (2 diffs)
- trunk/templates/re2008/show.liquid (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/models/show.rb
r1329 r1348 61 61 end 62 62 63 def popular_episodes 64 @object.episodes.find(:all, :order => 'rating_avg desc, rating_count desc') 65 end 66 63 67 def tags 64 68 @show_tags ||= ShowTags.new(@object) trunk/config/initializers/liquid_filters.rb
r1312 r1348 2 2 3 3 module TextFilter 4 4 5 def textilize(input) 5 6 RedCloth.new(input).to_html … … 8 9 def strip_tags(input) 9 10 full_sanitizer.sanitize input 11 end 12 13 def integer(input) 14 input.to_i 15 end 16 17 def pluralize(input, word) 18 ActionView::Helpers::TextHelper::pluralize(input, word) 10 19 end 11 20 trunk/templates/re2008/show.liquid
r1316 r1348 26 26 --> 27 27 28 {% for episode in show. broadcasted_episodes limit:5 %}28 {% for episode in show.popular_episodes limit:5 %} 29 29 <div class="hentry entry" id="post-{{forloop.index}}"> 30 30 <h3 class="entry-title">{{episode.title}}</h3> … … 36 36 <div class="entry-content"> 37 37 {{episode.description | textilize | strip_tags | truncate: 400}} 38 38 39 </div> 40 <div class="vote">Note des auditeurs : {{ episode.rating_avg | integer }} sur 5 - {{ episode.rating_count }} votes</div> 39 41 </div> 40 42 {% endfor %}
