spree_easy_contact 1.0.2 → 1.0.3
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.
- data/README.md +1 -1
- data/app/mailer/contact_mailer.rb +2 -2
- data/app/models/contact.rb +3 -5
- data/app/views/admin/contacts/show.html.erb +3 -3
- data/config/locales/en.yml +3 -1
- data/config/locales/fr-FR.yml +3 -1
- data/config/routes.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
SpreeEasyContact
|
2
2
|
================
|
3
3
|
|
4
|
-
Easy to implement contact form with
|
4
|
+
Easy to implement contact form with honeypot-captcha, with a topic selection management in admin.
|
5
5
|
It stores all messages in DB for an easy recall of messages.
|
6
6
|
|
7
7
|
This extension is based on joshnuss spree-contact-form (thank you BTW) : https://github.com/joshnuss/spree-contact-form
|
@@ -2,9 +2,9 @@ class ContactMailer < ActionMailer::Base
|
|
2
2
|
helper "spree/base"
|
3
3
|
|
4
4
|
def message_email(message)
|
5
|
-
subject = "#{Spree::Config[:site_name]} -
|
5
|
+
subject = "#{Spree::Config[:site_name]} - #{t('message_from')} #{message.email}"
|
6
6
|
|
7
7
|
@message = message
|
8
8
|
mail(:to => message.topic.email, :subject => subject, :reply_to => message.email)
|
9
9
|
end
|
10
|
-
end
|
10
|
+
end
|
data/app/models/contact.rb
CHANGED
@@ -4,8 +4,6 @@ class Contact < ActiveRecord::Base
|
|
4
4
|
validates :email, :format => {:with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i}
|
5
5
|
validates :order_number, :format => {:with => /(^$)|(^R\d{9}$)/i, :message => I18n.t("invalid_order_number")}
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
7
|
+
belongs_to :topic
|
8
|
+
|
9
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1><%= t(
|
1
|
+
<h1><%= "#{t('contacts')} #{t('from')} #{@contact.name}" %></h1>
|
2
2
|
|
3
3
|
<%= render :partial => 'admin/shared/contact_tabs', :locals => {:current => "Contact Details"} %>
|
4
4
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<div class="adr">
|
14
14
|
<h4><%= t("topic") %></h4>
|
15
15
|
<p>
|
16
|
-
|
16
|
+
<%= @contact.topic.name %>
|
17
17
|
</p>
|
18
18
|
</div>
|
19
19
|
<% if @contact.order_number %>
|
@@ -30,4 +30,4 @@
|
|
30
30
|
<%= @contact.message %>
|
31
31
|
</p>
|
32
32
|
</div>
|
33
|
-
<% end %>
|
33
|
+
<% end %>
|
data/config/locales/en.yml
CHANGED
data/config/locales/fr-FR.yml
CHANGED
@@ -16,4 +16,6 @@ fr-FR:
|
|
16
16
|
topics: Objet des demandes de contact
|
17
17
|
topic: Objet
|
18
18
|
topics_description: "Créez les objets de demandes de contact, choisissez l'adresse email qui doit lui correspondre"
|
19
|
-
new_topic: Ajouter un objet
|
19
|
+
new_topic: Ajouter un objet
|
20
|
+
from: de
|
21
|
+
message_from: Message de
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_easy_contact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mathias Standaert
|