Commit 0ee683a48fef54b5a469e8a78338e1c764ce1d6c
Exists in
master
and in
11 other branches
Merge branch 'plugin-bug-fixes' into 'master'
Newsletter and Sniffer plugins bug fixes Fixes some bugs found: - Check box in newsletter moderation task page wasn't showing up; - Newsletter header in moderation task page wasn't exactly like the preview of the newsletter since a padding was added; - Sniffer plugin wasn't filtering out enterprises based on distance. See merge request !736
Showing
5 changed files
with
11 additions
and
6 deletions
Show diff stats
plugins/newsletter/public/style.css
plugins/newsletter/test/functional/newsletter_plugin_admin_controller_test.rb
plugins/newsletter/test/functional/newsletter_plugin_controller_test.rb
plugins/newsletter/views/tasks/newsletter_plugin/_moderate_newsletter_accept_details.html.erb
| ... | ... | @@ -3,14 +3,14 @@ |
| 3 | 3 | <h1><%= _('Check posts you want to include') %></h1> |
| 4 | 4 | |
| 5 | 5 | <div id='newsletter-moderation-preview'> |
| 6 | - <% newsletter_content = newsletter.body.gsub(/width: 640px;/,'').sub(/#{NewsletterPlugin::Newsletter::CSS['breaking-news-wrap']}/, '') %> | |
| 6 | + <% newsletter_content = newsletter.body.gsub(/width: 640px;/,'').sub(/#{NewsletterPlugin::Newsletter::CSS['breakingnews-wrap']}/, '') %> | |
| 7 | 7 | |
| 8 | 8 | <% newsletter.posts.each do |post| %> |
| 9 | 9 | <% input_name = "tasks[#{task.id}][task][post_ids][]" %> |
| 10 | 10 | <% post_check_box = hidden_field_tag(input_name, '0') +check_box_tag(input_name, post.id, true) %> |
| 11 | 11 | |
| 12 | - <% newsletter_content.gsub!(/<span id="#{post.id}"/, post_check_box+ '<span') %> | |
| 13 | - <% newsletter_content.gsub!(/<img id="#{post.id}"/, post_check_box+ '<img') %> | |
| 12 | + <% newsletter_content.gsub!(/<span([^>]*?) id="#{post.id}"/, post_check_box + '<span\\1')%> | |
| 13 | + <% newsletter_content.gsub!(/<img([^>]*?) id="#{post.id}"/, post_check_box + '<img\\1') %> | |
| 14 | 14 | <% end %> |
| 15 | 15 | |
| 16 | 16 | <%= newsletter_content %> | ... | ... |
plugins/sniffer/lib/sniffer_plugin/helper.rb
| ... | ... | @@ -5,7 +5,7 @@ module SnifferPlugin::Helper |
| 5 | 5 | def filter_visible_attr_profile(profile) |
| 6 | 6 | filtered_profile = {} |
| 7 | 7 | visible_attributes = [:id, :name, :lat, :lng, :sniffer_plugin_distance] |
| 8 | - visible_attributes.each{ |a| filtered_profile[a] = profile[a] || 0 } | |
| 8 | + visible_attributes.each{ |a| filtered_profile[a] = profile.send(a) || 0 } | |
| 9 | 9 | filtered_profile |
| 10 | 10 | end |
| 11 | 11 | ... | ... |