From edcc13059b31341eb78e58079ac2322f1142f206 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Fri, 2 Oct 2015 12:50:23 -0300 Subject: [PATCH] Uses modal instead of deprecated colorbox --- app/helpers/application_helper.rb | 7 ++++++- app/helpers/cms_helper.rb | 2 +- app/views/cms/_published_media_items.html.erb | 2 +- app/views/content_viewer/_article_toolbar.html.erb | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9ebde16..f25a603 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1316,7 +1316,12 @@ module ApplicationHelper options[:class] = (options[:class] || '') + ' disabled' content_tag('a', ' '+content_tag('span', content), options) else - link_to content, url, options + if options[:modal] + options.delete(:modal) + modal_link_to content, url, options + else + link_to content, url, options + end end end diff --git a/app/helpers/cms_helper.rb b/app/helpers/cms_helper.rb index f0bba2e..fdb6f8b 100644 --- a/app/helpers/cms_helper.rb +++ b/app/helpers/cms_helper.rb @@ -35,7 +35,7 @@ module CmsHelper end def display_spread_button(article) - expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:class => 'colorbox'} + expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:class => 'colorbox', :modal => true} end def display_delete_button(article) diff --git a/app/views/cms/_published_media_items.html.erb b/app/views/cms/_published_media_items.html.erb index b9ccdc9..9229670 100644 --- a/app/views/cms/_published_media_items.html.erb +++ b/app/views/cms/_published_media_items.html.erb @@ -4,7 +4,7 @@

<%= header %>

<% if @recent_files[key].total_pages > 1 %> - <%= link_to(_('View all'), {:controller => 'cms', :action => 'view_all_media', :profile => profile.identifier, :key => key}, :class => 'view-all colorbox', 'data-key' => key) %> + <%= modal_link_to(_('View all'), {:controller => 'cms', :action => 'view_all_media', :profile => profile.identifier, :key => key}, { :class => 'view-all', 'data-key' => key }) %> <% end %>
<%= render :partial => "cms/media_panel/list_published_media_items", :locals => { key: key, show_pagination_links: false } %> diff --git a/app/views/content_viewer/_article_toolbar.html.erb b/app/views/content_viewer/_article_toolbar.html.erb index ea9cfad..4669b5f 100644 --- a/app/views/content_viewer/_article_toolbar.html.erb +++ b/app/views/content_viewer/_article_toolbar.html.erb @@ -18,7 +18,7 @@ <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %> <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %> - <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:class => 'colorbox'} if url %> + <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:class => 'colorbox', :modal => true} if url %> <% end %> <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %> -- libgit2 0.21.2