From 2fd33c36428ae7684badc43dbe2142152f058b4e Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 8 Oct 2009 22:24:51 +0200 Subject: enabled shadowbox for headline images on public pages. if js is disabled the regular html version is rendered --- app/helpers/content_helper.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index c85fcf5..2eb0c4d 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb @@ -31,16 +31,13 @@ module ContentHelper end def headline_image - image = @page.assets.images.first - if image - link_to_path( - image_tag(image.upload.url(:headline)), - ("galleries/" + @page.node.unique_name) - ) + @images = @page.assets.images + + unless @images.empty? + render :partial => 'content/headline_image' end end - # Returns the published_at attribute of a page if it is not nil, otherwise # it returns the auto-filled value of the created_at attribute def date_for_page page -- cgit v1.3