Changeset 1236
- Timestamp:
- 07/23/08 21:28:58 (6 months ago)
- Files:
-
- trunk/app/models/content.rb (modified) (2 diffs)
- trunk/app/models/episode.rb (modified) (1 diff)
- trunk/app/models/show.rb (modified) (1 diff)
- trunk/app/models/template.rb (modified) (1 diff)
- trunk/config/initializers/liquid_filters.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/models/content.rb
r1230 r1236 3 3 class Content < ActiveRecord::Base 4 4 5 liquid_methods :name, :episode, :duration 5 liquid_methods :name, :episode, :duration, :has_duration? 6 6 7 7 validates_presence_of :name, :message => "Pas de nom défini" … … 111 111 112 112 def url_for 113 @context.registers[:action_view].url_for_content(@object) 113 view.url_for_content(@object) 114 end 115 116 def url_for_playlist 117 view.url_for_content(@object, :mode => :playlist) 114 118 end 115 119 116 120 def embedded_player 117 @context.registers[:action_view].tag(:embed,121 view.tag(:embed, 118 122 :src => "/flash/mediaplayer.swf", :type => "application/x-shockwave-flash", 119 123 :pluginspage => "http://www.macromedia.com/go/getflashplayer", :height => "20", :width => "385", trunk/app/models/episode.rb
r1230 r1236 28 28 29 29 def url_for 30 @context.registers[:action_view].url_for_episode(@object)30 view.url_for_episode(@object) 31 31 end 32 32 trunk/app/models/show.rb
r1230 r1236 45 45 46 46 def url_for 47 @context.registers[:action_view].url_for_show(@object)47 view.url_for_show(@object) 48 48 end 49 49 50 50 def url_for_podcast 51 @context.registers[:action_view].url_for_podcast(@object)51 view.url_for_podcast(@object) 52 52 end 53 53 trunk/app/models/template.rb
r1228 r1236 1 1 class Template < ActiveRecord::Base 2 3 liquid_methods :slug 4 2 5 end 6 7 class Template::LiquidDropClass 8 9 def url_for_assets 10 "/templates/#{@object.slug}" 11 end 12 13 def admin_link_tag 14 account_link = if view.logged_in? 15 view.link_to("Mon compte", :controller => "account", :action => "index") 16 else 17 view.link_to("S'identifier", :controller => "account", :action => "login") 18 end 19 20 "#{account_link} - hébergé par <a href='http://www.bonnes-ondes.fr'>Bonnes Ondes</a>" 21 end 22 23 end trunk/config/initializers/liquid_filters.rb
r1232 r1236 6 6 7 7 Liquid::Template.register_filter(TextFilter) 8 9 class Liquid::Drop 10 11 protected 12 13 def view 14 @context.registers[:action_view] 15 end 16 17 end
