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 CHANGED
@@ -1,7 +1,7 @@
1
1
  SpreeEasyContact
2
2
  ================
3
3
 
4
- Easy to implement contact form with honyepot-captcha, with a topic selection management in admin.
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]} - Message from #{message.email}"
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
@@ -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
- def topic
8
- @topic ||= Topic.find(topic_id)
9
- end
10
-
11
- end
7
+ belongs_to :topic
8
+
9
+ end
@@ -1,4 +1,4 @@
1
- <h1><%= t("contacts")%> de <%= @contact.name %></h1>
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
- Ici le sujet
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 %>
@@ -16,4 +16,6 @@ en:
16
16
  topics: Contact Form Topic
17
17
  topic: Topic
18
18
  topics_description: "Setup topics for the contact form, choose wich email should be routed to"
19
- new_topic: Add a topic
19
+ new_topic: Add a topic
20
+ from: from
21
+ message_from: Message from
@@ -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
@@ -1,5 +1,5 @@
1
1
  Rails.application.routes.draw do
2
- # Add your extension routes here
2
+ match '/contact-us' => 'contacts#new', :as => :contact
3
3
 
4
4
  resources :contacts, :controller => 'contacts'
5
5
 
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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mathias Standaert