Commit 02f4590433758a24fe61463d86eef7539789cdb7
Exists in
master
and in
29 other branches
Merge branch 'fix-remaining-colorbox-uses' into 'master'
Replaces remaining colorbox in the code with modal Colorbox was replaced with modal api, but we still had instances in the code of colorbox uses and they were broken so this patch is to fix those. See merge request !689
Showing
4 changed files
with
9 additions
and
4 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -1316,7 +1316,12 @@ module ApplicationHelper | @@ -1316,7 +1316,12 @@ module ApplicationHelper | ||
1316 | options[:class] = (options[:class] || '') + ' disabled' | 1316 | options[:class] = (options[:class] || '') + ' disabled' |
1317 | content_tag('a', ' '+content_tag('span', content), options) | 1317 | content_tag('a', ' '+content_tag('span', content), options) |
1318 | else | 1318 | else |
1319 | - link_to content, url, options | 1319 | + if options[:modal] |
1320 | + options.delete(:modal) | ||
1321 | + modal_link_to content, url, options | ||
1322 | + else | ||
1323 | + link_to content, url, options | ||
1324 | + end | ||
1320 | end | 1325 | end |
1321 | end | 1326 | end |
1322 | 1327 |
app/helpers/cms_helper.rb
@@ -30,7 +30,7 @@ module CmsHelper | @@ -30,7 +30,7 @@ module CmsHelper | ||
30 | end | 30 | end |
31 | 31 | ||
32 | def display_spread_button(article) | 32 | def display_spread_button(article) |
33 | - expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:class => 'colorbox'} | 33 | + expirable_button article, :spread, _('Spread this'), {:action => 'publish', :id => article.id}, {:class => 'colorbox', :modal => true} |
34 | end | 34 | end |
35 | 35 | ||
36 | def display_delete_button(article) | 36 | def display_delete_button(article) |
app/views/cms/_published_media_items.html.erb
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <div class='section-title'> | 4 | <div class='section-title'> |
5 | <h3><%= header %></h3> | 5 | <h3><%= header %></h3> |
6 | <% if @recent_files[key].total_pages > 1 %> | 6 | <% if @recent_files[key].total_pages > 1 %> |
7 | - <%= link_to(_('View all'), {:controller => 'cms', :action => 'view_all_media', :profile => profile.identifier, :key => key}, :class => 'view-all colorbox', 'data-key' => key) %> | 7 | + <%= modal_link_to(_('View all'), {:controller => 'cms', :action => 'view_all_media', :profile => profile.identifier, :key => key}, { :class => 'view-all', 'data-key' => key }) %> |
8 | <% end %> | 8 | <% end %> |
9 | </div> | 9 | </div> |
10 | <%= render :partial => "cms/media_panel/list_published_media_items", :locals => { key: key, show_pagination_links: false } %> | 10 | <%= render :partial => "cms/media_panel/list_published_media_items", :locals => { key: key, show_pagination_links: false } %> |
app/views/content_viewer/_article_toolbar.html.erb
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | 18 | ||
19 | <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %> | 19 | <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %> |
20 | <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %> | 20 | <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %> |
21 | - <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:class => 'colorbox'} if url %> | 21 | + <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:class => 'colorbox', :modal => true} if url %> |
22 | <% end %> | 22 | <% end %> |
23 | 23 | ||
24 | <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %> | 24 | <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %> |