[Git][noosfero/noosfero][master] 2 commits: Uses modal instead of deprecated colorbox
Bráulio Bhavamitra
gitlab at gitlab.com
Fri Oct 2 16:34:38 BRT 2015
Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero
Commits:
edcc1305 by Larissa Reis at 2015-10-02T12:50:23Z
Uses modal instead of deprecated colorbox
- - - - -
02f45904 by Bráulio Bhavamitra at 2015-10-02T19:34:12Z
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
- - - - -
4 changed files:
- app/helpers/application_helper.rb
- app/helpers/cms_helper.rb
- app/views/cms/_published_media_items.html.erb
- app/views/content_viewer/_article_toolbar.html.erb
Changes:
=====================================
app/helpers/application_helper.rb
=====================================
--- 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
=====================================
app/helpers/cms_helper.rb
=====================================
--- a/app/helpers/cms_helper.rb
+++ b/app/helpers/cms_helper.rb
@@ -30,7 +30,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)
=====================================
app/views/cms/_published_media_items.html.erb
=====================================
--- a/app/views/cms/_published_media_items.html.erb
+++ b/app/views/cms/_published_media_items.html.erb
@@ -4,7 +4,7 @@
<div class='section-title'>
<h3><%= header %></h3>
<% 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 %>
</div>
<%= render :partial => "cms/media_panel/list_published_media_items", :locals => { key: key, show_pagination_links: false } %>
=====================================
app/views/content_viewer/_article_toolbar.html.erb
=====================================
--- 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))) %>
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/90378081fc8c25cff0a4cdd57184ac25ae12991d...02f4590433758a24fe61463d86eef7539789cdb7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151002/1a3cb0b6/attachment.html>
More information about the Noosfero-dev
mailing list