Changeset 1323

Show
Ignore:
Timestamp:
08/07/08 20:30:24 (4 months ago)
Author:
alban
Message:

Utilisation du template cocoa par defaut (plus de views erb)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/public_controller.rb

    r1317 r1323  
    2626  def episode 
    2727    @episode = find_episode 
    28     if @episode.show.template.nil? 
    29       render :layout => "public_render" 
    30     else 
    31       render_template @episode.show, :episode, @episode 
    32     end 
     28    render_template @episode.show, :episode, @episode 
    3329  end 
    3430 
     
    4339  def content 
    4440    @content = find_content 
    45  
    46     if @content.episode.show.template.nil? 
    47       @page_type = :condensed 
    48       render :layout => "public_render" 
    49     else 
    50       render_template @content.episode.show, :content, @content 
    51     end 
     41    render_template @content.episode.show, :content, @content 
    5242  end 
    5343 
    5444  def direct 
    55     unless @show.template.nil? 
    56       render_template @show, :stream, @show 
    57     end 
     45    render_template @show, :stream, @show 
    5846  end 
    5947 
     
    7361  def render_show 
    7462    create_visit @show 
    75     if @show.template.nil? 
    76       render :layout => "public_render", :action => :show 
    77     else 
    78       render_template @show, :show, @show 
    79     end 
     63    render_template @show, :show, @show 
    8064  end 
    8165 
  • trunk/app/models/show.rb

    r1271 r1323  
    3939  end 
    4040 
     41  def template 
     42    self.read_attribute(:template) or Show.default_template 
     43  end 
     44 
     45  def self.default_template 
     46    @@default_template ||= Template.find_by_slug('cocoa') 
     47  end 
     48 
    4149end 
    4250