diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e86ecfb..90794a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -945,8 +945,9 @@ module ApplicationHelper content_for(:head) { stylesheet_link_tag(*args) } end - def article_to_html(article) - content = article.to_html(:page => params[:npage]) + def article_to_html(article, options = {}) + options.merge(:page => params[:npage]) + content = article.to_html(options) return self.instance_eval(&content) if content.kind_of?(Proc) content end diff --git a/app/models/article_block.rb b/app/models/article_block.rb index 9250fe5..dabaa3f 100644 --- a/app/models/article_block.rb +++ b/app/models/article_block.rb @@ -12,7 +12,7 @@ class ArticleBlock < Block block = self lambda do block_title(block.title) + - (block.article ? article_to_html(block.article) : _('Article not selected yet.')) + (block.article ? article_to_html(block.article, :gallery_view => false) : _('Article not selected yet.')) end end diff --git a/app/models/uploaded_file.rb b/app/models/uploaded_file.rb index 8918583..e56a01b 100644 --- a/app/models/uploaded_file.rb +++ b/app/models/uploaded_file.rb @@ -58,7 +58,7 @@ class UploadedFile < Article article = self if image? lambda do - if article.display_as_gallery? + if article.display_as_gallery? && options[:gallery_view] images = article.parent.images current_index = images.index(article) total_of_images = images.count diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml index 308039d..e2f4781 100644 --- a/app/views/content_viewer/view_page.rhtml +++ b/app/views/content_viewer/view_page.rhtml @@ -86,7 +86,8 @@ <% cache(@page.cache_key(params, user)) do %>