refinerycms-contacts 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,18 @@ module Refinery
8
8
  acts_as_indexed :fields => [:mail]
9
9
 
10
10
  validates_format_of :mail, :with => /.+@.+\..+/i , :allow_blank => false
11
+
12
+ def self.obfuscated
13
+ self.all.each do |m|
14
+ m.mail = self.to_decimal_entities(m.mail).html_safe
15
+ end
16
+ end
17
+
18
+ private
19
+ def self.to_decimal_entities(string)
20
+ string.each_char.collect {|char| "&##{char.unpack('U')[0]};" }.join
21
+ end
22
+
11
23
  end
12
24
  end
13
25
  end
@@ -6,10 +6,9 @@
6
6
  <%= render 'refinery/contacts/contacts/success_info' %>
7
7
  <%= render 'refinery/contacts/contacts/error_info' %>
8
8
 
9
-
10
9
  <div class="field ">
11
10
  <%= f.label :recipient_id %>
12
- <%= f.collection_select :recipient_id, @page.mails, :id, :mail, {:prompt=> true} %>
11
+ <%= f.collection_select :recipient_id, @page.mails.obfuscated, :id, :mail, {:prompt=> true} %>
13
12
  </div>
14
13
 
15
14
 
data/changelog.md CHANGED
@@ -1,2 +1,5 @@
1
+ ## 0.1.1 [22 December 2012]
2
+ * add email obfuscation in selectbox
3
+
1
4
  ## 0.1.0 [21 December 2012]
2
5
  * initial commit
@@ -3,7 +3,7 @@ module Refinery
3
3
  class Version
4
4
  @major = 0
5
5
  @minor = 1
6
- @tiny = '0'
6
+ @tiny = '1'
7
7
 
8
8
  class << self
9
9
  attr_reader :major, :minor, :tiny
data/readme.md CHANGED
@@ -16,6 +16,7 @@ This version supports Rails 3.2.x and Refinery CMS ~> 2.0.9. (Should work with ~
16
16
  * send email
17
17
  * server side validation, client side validation ( optional )
18
18
  * recaptcha
19
+ * email obfuscation in selectbox on frontend
19
20
 
20
21
 
21
22
  ## Screenshots
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-contacts
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Martin Markech