spree_easy_contact 1.0.5 → 1.3.2
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 +11 -20
- metadata +165 -94
- data/LICENSE +0 -23
- data/app/controllers/admin/contacts_controller.rb +0 -3
- data/app/controllers/admin/topics_controller.rb +0 -11
- data/app/controllers/contacts_controller.rb +0 -28
- data/app/helpers/admin/contacts_helper.rb +0 -5
- data/app/mailer/contact_mailer.rb +0 -10
- data/app/models/contact.rb +0 -9
- data/app/models/topic.rb +0 -6
- data/app/views/admin/contacts/index.html.erb +0 -33
- data/app/views/admin/contacts/show.html.erb +0 -33
- data/app/views/admin/shared/_contact_tabs.html.erb +0 -15
- data/app/views/admin/topics/_form.html.erb +0 -19
- data/app/views/admin/topics/edit.html.erb +0 -4
- data/app/views/admin/topics/index.html.erb +0 -39
- data/app/views/admin/topics/new.html.erb +0 -4
- data/app/views/contact_mailer/message_email.text.erb +0 -8
- data/app/views/contacts/new.html.erb +0 -32
- data/config/locales/en.yml +0 -21
- data/config/locales/fr-FR.yml +0 -21
- data/config/routes.rb +0 -10
- data/db/migrate/20110203113622_create_contact_table.rb +0 -16
- data/db/migrate/20110207101837_create_topic_table.rb +0 -14
- data/lib/spree_easy_contact.rb +0 -18
- data/lib/spree_easy_contact_hooks.rb +0 -11
- data/lib/tasks/install.rake +0 -25
- data/lib/tasks/spree_easy_contact.rake +0 -1
- data/public/images/admin/icons/view.png +0 -0
data/README.md
CHANGED
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
SpreeEasyContact
|
|
2
2
|
================
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
It stores all messages in DB for an easy recall of messages.
|
|
4
|
+
Introduction goes here.
|
|
6
5
|
|
|
7
|
-
This extension is based on joshnuss spree-contact-form (thank you BTW) : https://github.com/joshnuss/spree-contact-form
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Example
|
|
8
|
+
=======
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
Example goes here.
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
Testing
|
|
13
|
+
-------
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
|
|
17
16
|
|
|
18
|
-
bundle
|
|
17
|
+
$ bundle
|
|
18
|
+
$ bundle exec rake test_app
|
|
19
|
+
$ bundle exec rspec spec
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rake db:migrate
|
|
23
|
-
|
|
24
|
-
Set properly the mail method in the admin area (/admin/mail_methods)
|
|
25
|
-
|
|
26
|
-
And you're done !
|
|
27
|
-
=================
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Copyright (c) 2011 [Mathias Standaert for Organic Web], released under the New BSD License
|
|
21
|
+
Copyright (c) 2013 [name of extension creator], released under the New BSD License
|
metadata
CHANGED
|
@@ -1,123 +1,194 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_easy_contact
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.3.2
|
|
5
5
|
prerelease:
|
|
6
|
-
segments:
|
|
7
|
-
- 1
|
|
8
|
-
- 0
|
|
9
|
-
- 5
|
|
10
|
-
version: 1.0.5
|
|
11
6
|
platform: ruby
|
|
12
|
-
authors:
|
|
7
|
+
authors:
|
|
13
8
|
- Mathias Standaert
|
|
14
9
|
autorequire:
|
|
15
10
|
bindir: bin
|
|
16
11
|
cert_chain: []
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- !ruby/object:Gem::Dependency
|
|
12
|
+
date: 2013-07-17 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
21
15
|
name: spree_core
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
hash: 191
|
|
29
|
-
segments:
|
|
30
|
-
- 0
|
|
31
|
-
- 40
|
|
32
|
-
- 0
|
|
33
|
-
version: 0.40.0
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.3.2
|
|
34
22
|
type: :runtime
|
|
35
|
-
version_requirements: *id001
|
|
36
|
-
- !ruby/object:Gem::Dependency
|
|
37
|
-
name: honeypot-captcha
|
|
38
23
|
prerelease: false
|
|
39
|
-
|
|
40
|
-
none: false
|
|
41
|
-
requirements:
|
|
42
|
-
- -
|
|
43
|
-
- !ruby/object:Gem::Version
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 1.3.2
|
|
30
|
+
- !ruby/object:Gem::Dependency
|
|
31
|
+
name: spree_i18n
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
34
|
+
requirements:
|
|
35
|
+
- - ! '>='
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
48
38
|
type: :runtime
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
prerelease: false
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: capybara
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ~>
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: 1.1.2
|
|
54
|
+
type: :development
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ~>
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 1.1.2
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
63
|
+
name: coffee-rails
|
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
|
65
|
+
none: false
|
|
66
|
+
requirements:
|
|
67
|
+
- - ! '>='
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
70
|
+
type: :development
|
|
71
|
+
prerelease: false
|
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ! '>='
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0'
|
|
78
|
+
- !ruby/object:Gem::Dependency
|
|
79
|
+
name: factory_girl
|
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - ~>
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: 2.6.4
|
|
86
|
+
type: :development
|
|
87
|
+
prerelease: false
|
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
+
none: false
|
|
90
|
+
requirements:
|
|
91
|
+
- - ~>
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: 2.6.4
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: ffaker
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
none: false
|
|
98
|
+
requirements:
|
|
99
|
+
- - ! '>='
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '0'
|
|
102
|
+
type: :development
|
|
103
|
+
prerelease: false
|
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
+
none: false
|
|
106
|
+
requirements:
|
|
107
|
+
- - ! '>='
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: rspec-rails
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
none: false
|
|
114
|
+
requirements:
|
|
115
|
+
- - ~>
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '2.9'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
none: false
|
|
122
|
+
requirements:
|
|
123
|
+
- - ~>
|
|
124
|
+
- !ruby/object:Gem::Version
|
|
125
|
+
version: '2.9'
|
|
126
|
+
- !ruby/object:Gem::Dependency
|
|
127
|
+
name: sass-rails
|
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
|
129
|
+
none: false
|
|
130
|
+
requirements:
|
|
131
|
+
- - ! '>='
|
|
132
|
+
- !ruby/object:Gem::Version
|
|
133
|
+
version: '0'
|
|
134
|
+
type: :development
|
|
135
|
+
prerelease: false
|
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
137
|
+
none: false
|
|
138
|
+
requirements:
|
|
139
|
+
- - ! '>='
|
|
140
|
+
- !ruby/object:Gem::Version
|
|
141
|
+
version: '0'
|
|
142
|
+
- !ruby/object:Gem::Dependency
|
|
143
|
+
name: sqlite3
|
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
|
145
|
+
none: false
|
|
146
|
+
requirements:
|
|
147
|
+
- - ! '>='
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '0'
|
|
150
|
+
type: :development
|
|
151
|
+
prerelease: false
|
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
153
|
+
none: false
|
|
154
|
+
requirements:
|
|
155
|
+
- - ! '>='
|
|
156
|
+
- !ruby/object:Gem::Version
|
|
157
|
+
version: '0'
|
|
158
|
+
description: Simple contact from manager for Spree
|
|
159
|
+
email: contactorganicweb.fr
|
|
52
160
|
executables: []
|
|
53
|
-
|
|
54
161
|
extensions: []
|
|
55
|
-
|
|
56
|
-
extra_rdoc_files:
|
|
162
|
+
extra_rdoc_files:
|
|
57
163
|
- README.md
|
|
58
|
-
files:
|
|
164
|
+
files:
|
|
59
165
|
- README.md
|
|
60
|
-
- LICENSE
|
|
61
|
-
- lib/spree_easy_contact.rb
|
|
62
|
-
- lib/spree_easy_contact_hooks.rb
|
|
63
|
-
- lib/tasks/install.rake
|
|
64
|
-
- lib/tasks/spree_easy_contact.rake
|
|
65
|
-
- app/controllers/admin/contacts_controller.rb
|
|
66
|
-
- app/controllers/admin/topics_controller.rb
|
|
67
|
-
- app/controllers/contacts_controller.rb
|
|
68
|
-
- app/helpers/admin/contacts_helper.rb
|
|
69
|
-
- app/mailer/contact_mailer.rb
|
|
70
|
-
- app/models/contact.rb
|
|
71
|
-
- app/models/topic.rb
|
|
72
|
-
- app/views/admin/contacts/index.html.erb
|
|
73
|
-
- app/views/admin/contacts/show.html.erb
|
|
74
|
-
- app/views/admin/shared/_contact_tabs.html.erb
|
|
75
|
-
- app/views/admin/topics/_form.html.erb
|
|
76
|
-
- app/views/admin/topics/edit.html.erb
|
|
77
|
-
- app/views/admin/topics/index.html.erb
|
|
78
|
-
- app/views/admin/topics/new.html.erb
|
|
79
|
-
- app/views/contact_mailer/message_email.text.erb
|
|
80
|
-
- app/views/contacts/new.html.erb
|
|
81
|
-
- public/images/admin/icons/view.png
|
|
82
|
-
- db/migrate/20110203113622_create_contact_table.rb
|
|
83
|
-
- db/migrate/20110207101837_create_topic_table.rb
|
|
84
|
-
- config/locales/en.yml
|
|
85
|
-
- config/locales/fr-FR.yml
|
|
86
|
-
- config/routes.rb
|
|
87
166
|
homepage: https://github.com/organicweb/spree-easy-contact
|
|
88
|
-
licenses:
|
|
89
|
-
- BSD
|
|
167
|
+
licenses: []
|
|
90
168
|
post_install_message:
|
|
91
169
|
rdoc_options: []
|
|
92
|
-
|
|
93
|
-
require_paths:
|
|
170
|
+
require_paths:
|
|
94
171
|
- lib
|
|
95
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
173
|
none: false
|
|
97
|
-
requirements:
|
|
98
|
-
- -
|
|
99
|
-
- !ruby/object:Gem::Version
|
|
100
|
-
hash: 57
|
|
101
|
-
segments:
|
|
102
|
-
- 1
|
|
103
|
-
- 8
|
|
104
|
-
- 7
|
|
174
|
+
requirements:
|
|
175
|
+
- - ! '>='
|
|
176
|
+
- !ruby/object:Gem::Version
|
|
105
177
|
version: 1.8.7
|
|
106
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
179
|
none: false
|
|
108
|
-
requirements:
|
|
109
|
-
- -
|
|
110
|
-
- !ruby/object:Gem::Version
|
|
111
|
-
|
|
112
|
-
segments:
|
|
180
|
+
requirements:
|
|
181
|
+
- - ! '>='
|
|
182
|
+
- !ruby/object:Gem::Version
|
|
183
|
+
version: '0'
|
|
184
|
+
segments:
|
|
113
185
|
- 0
|
|
114
|
-
|
|
115
|
-
requirements:
|
|
186
|
+
hash: -1293865696201976932
|
|
187
|
+
requirements:
|
|
116
188
|
- none
|
|
117
189
|
rubyforge_project:
|
|
118
190
|
rubygems_version: 1.8.24
|
|
119
191
|
signing_key:
|
|
120
192
|
specification_version: 3
|
|
121
|
-
summary:
|
|
193
|
+
summary: Simple contact from manager for Spree
|
|
122
194
|
test_files: []
|
|
123
|
-
|
data/LICENSE
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Redistribution and use in source and binary forms, with or without modification,
|
|
2
|
-
are permitted provided that the following conditions are met:
|
|
3
|
-
|
|
4
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
5
|
-
this list of conditions and the following disclaimer.
|
|
6
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
|
7
|
-
this list of conditions and the following disclaimer in the documentation
|
|
8
|
-
and/or other materials provided with the distribution.
|
|
9
|
-
* Neither the name of the Rails Dog LLC nor the names of its
|
|
10
|
-
contributors may be used to endorse or promote products derived from this
|
|
11
|
-
software without specific prior written permission.
|
|
12
|
-
|
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
14
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
15
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
16
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
17
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
18
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
19
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
20
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
21
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
22
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
23
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
class Admin::TopicsController < Admin::BaseController
|
|
2
|
-
resource_controller
|
|
3
|
-
|
|
4
|
-
create.wants.html {redirect_to collection_path}
|
|
5
|
-
update.wants.html {redirect_to collection_path}
|
|
6
|
-
|
|
7
|
-
new_action.response do |wants|
|
|
8
|
-
wants.html {render :action => :new, :layout => !request.xhr?}
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
class ContactsController < Spree::BaseController
|
|
2
|
-
before_filter :load_topics
|
|
3
|
-
|
|
4
|
-
def new
|
|
5
|
-
@contact = Contact.new
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def edit
|
|
9
|
-
redirect_to new_contact_path
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def create
|
|
13
|
-
@contact = Contact.new(params[:contact] || {})
|
|
14
|
-
respond_to do |format|
|
|
15
|
-
if @contact.valid? && @contact.save
|
|
16
|
-
ContactMailer.message_email(@contact).deliver
|
|
17
|
-
format.html { redirect_to(root_path, :notice => t("message_sended")) }
|
|
18
|
-
else
|
|
19
|
-
format.html { render :action => "new" }
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
def load_topics
|
|
26
|
-
@topics = Topic.all
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
class ContactMailer < ActionMailer::Base
|
|
2
|
-
helper "spree/base"
|
|
3
|
-
|
|
4
|
-
def message_email(message)
|
|
5
|
-
subject = "#{Spree::Config[:site_name]} - #{t('message_from')} #{message.email}"
|
|
6
|
-
|
|
7
|
-
@message = message
|
|
8
|
-
mail(:to => message.topic.email, :subject => subject, :reply_to => message.email)
|
|
9
|
-
end
|
|
10
|
-
end
|
data/app/models/contact.rb
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
class Contact < ActiveRecord::Base
|
|
2
|
-
|
|
3
|
-
validates :name, :presence => true
|
|
4
|
-
validates :email, :format => {:with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i}
|
|
5
|
-
validates :order_number, :format => {:with => /(^$)|(^R\d{9}$)/i, :message => I18n.t("invalid_order_number")}
|
|
6
|
-
|
|
7
|
-
belongs_to :topic
|
|
8
|
-
|
|
9
|
-
end
|
data/app/models/topic.rb
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<h1><%= t("contacts")%></h1>
|
|
2
|
-
|
|
3
|
-
<table class="index">
|
|
4
|
-
<tr>
|
|
5
|
-
<%= hook :admin_contact_index_headers do %>
|
|
6
|
-
<th><%= t("name") %></th>
|
|
7
|
-
<th><%= t("email") %></th>
|
|
8
|
-
<th><%= t("topic") %></th>
|
|
9
|
-
<th><%= t("sent") %></th>
|
|
10
|
-
<% end %>
|
|
11
|
-
<th>
|
|
12
|
-
<%= hook :admin_contact_index_header_actions %>
|
|
13
|
-
</th>
|
|
14
|
-
</tr>
|
|
15
|
-
<% @contacts.each do |contact| %>
|
|
16
|
-
<tr id="<%= dom_id contact %>">
|
|
17
|
-
<%- locals = {:contact => contact} %>
|
|
18
|
-
<%= hook :admin_contact_index_rows, locals do %>
|
|
19
|
-
<td><%= contact.name %></td>
|
|
20
|
-
<td><%= contact.email %></td>
|
|
21
|
-
<td><%= contact.try(:topic).try(:name) %></td>
|
|
22
|
-
<td><%= contact.created_at %></td>
|
|
23
|
-
<% end %>
|
|
24
|
-
<td class="actions">
|
|
25
|
-
<%= hook :admin_contact_index_row_actions, locals do %>
|
|
26
|
-
<%= link_to_view contact %>
|
|
27
|
-
|
|
28
|
-
<%= link_to_delete contact %>
|
|
29
|
-
<% end %>
|
|
30
|
-
</td>
|
|
31
|
-
</tr>
|
|
32
|
-
<% end %>
|
|
33
|
-
</table>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<h1><%= "#{t('contacts')} #{t('from')} #{@contact.name}" %></h1>
|
|
2
|
-
|
|
3
|
-
<%= render :partial => 'admin/shared/contact_tabs', :locals => {:current => "Contact Details"} %>
|
|
4
|
-
|
|
5
|
-
<%= hook :admin_contact_show do %>
|
|
6
|
-
<div class="adr">
|
|
7
|
-
<h4><%= t("name_and_mail") %></h4>
|
|
8
|
-
<p>
|
|
9
|
-
<%= @contact.name %><br />
|
|
10
|
-
<%= @contact.email %>
|
|
11
|
-
</p>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="adr">
|
|
14
|
-
<h4><%= t("topic") %></h4>
|
|
15
|
-
<p>
|
|
16
|
-
<%= @contact.topic.name %>
|
|
17
|
-
</p>
|
|
18
|
-
</div>
|
|
19
|
-
<% if @contact.order_number %>
|
|
20
|
-
<div class="adr">
|
|
21
|
-
<h4><%= t("order_number") %></h4>
|
|
22
|
-
<p>
|
|
23
|
-
<%= @contact.order_number %>
|
|
24
|
-
</p>
|
|
25
|
-
</div>
|
|
26
|
-
<% end %>
|
|
27
|
-
<div class="adr">
|
|
28
|
-
<h4><%= t("message") %></h4>
|
|
29
|
-
<p>
|
|
30
|
-
<%= @contact.message %>
|
|
31
|
-
</p>
|
|
32
|
-
</div>
|
|
33
|
-
<% end %>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<% content_for :sidebar do %>
|
|
2
|
-
<ul class="sidebar">
|
|
3
|
-
<%= hook :admin_contact_tabs do %>
|
|
4
|
-
<li<%== ' class="active"' if current == 'Contact List' %>>
|
|
5
|
-
<%= link_to t("contact_list"), collection_url() %>
|
|
6
|
-
</li>
|
|
7
|
-
<li<%== ' class="active"' if current == 'Contact Details' %>>
|
|
8
|
-
<%= link_to t("contact_details"), object_url(@contact) %>
|
|
9
|
-
</li>
|
|
10
|
-
<li<%== ' class="active"' if current == 'ContactResend' %>>
|
|
11
|
-
<%= link_to t("resend"), "#" %>
|
|
12
|
-
</li>
|
|
13
|
-
<% end %>
|
|
14
|
-
</ul>
|
|
15
|
-
<% end %>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<%- locals = {:f => f} %>
|
|
2
|
-
|
|
3
|
-
<%= render "shared/error_messages", :target => f.object %>
|
|
4
|
-
|
|
5
|
-
<%= hook :admin_topic_form, locals do %>
|
|
6
|
-
|
|
7
|
-
<%= f.field_container :name do %>
|
|
8
|
-
<%= f.label :name, t("name") %> <span class="required">*</span><br />
|
|
9
|
-
<%= f.text_field :name, :class => 'fullwidth title' %>
|
|
10
|
-
<%= f.error_message_on :name %>
|
|
11
|
-
<% end %>
|
|
12
|
-
|
|
13
|
-
<%= f.field_container :email do %>
|
|
14
|
-
<%= f.label :email, t("emails") %> (<%= t('comma_delimited') %>) <span class="required">*</span><br />
|
|
15
|
-
<%= f.text_field :email, :class => 'fullwidth title' %>
|
|
16
|
-
<%= f.error_message_on :email %>
|
|
17
|
-
<% end %>
|
|
18
|
-
|
|
19
|
-
<% end %>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<div class="toolbar">
|
|
2
|
-
<ul class="actions">
|
|
3
|
-
<li id="new_topic_link">
|
|
4
|
-
<%= button_link_to t("new_topic"), new_object_url, {:remote => true, :icon => "add"} %>
|
|
5
|
-
</li>
|
|
6
|
-
</ul>
|
|
7
|
-
<br class="clear" />
|
|
8
|
-
</div>
|
|
9
|
-
<h1><%= t("topics") %></h1>
|
|
10
|
-
|
|
11
|
-
<div id="new_topic"></div>
|
|
12
|
-
|
|
13
|
-
<table class="index">
|
|
14
|
-
<tr>
|
|
15
|
-
<%= hook :admin_topic_index_header do %>
|
|
16
|
-
<th><%= t("name") %></th>
|
|
17
|
-
<th><%= t("email") %></th>
|
|
18
|
-
<% end %>
|
|
19
|
-
<th>
|
|
20
|
-
<%= hook :admin_topic_index_header_actions %>
|
|
21
|
-
</th>
|
|
22
|
-
</tr>
|
|
23
|
-
<% @topics.each do |topic| %>
|
|
24
|
-
<tr id="dom_id topic">
|
|
25
|
-
<%- locals = {:topic => topic} %>
|
|
26
|
-
<%= hook :admin_topics_index_rows, locals do %>
|
|
27
|
-
<td><%= topic.name %></td>
|
|
28
|
-
<td><%= topic.email %></td>
|
|
29
|
-
<% end %>
|
|
30
|
-
<td class="actions">
|
|
31
|
-
<%= hook :admin_topics_index_rows_actions, locals do %>
|
|
32
|
-
<%= link_to_edit topic %>
|
|
33
|
-
|
|
34
|
-
<%= link_to_delete topic %>
|
|
35
|
-
<% end %>
|
|
36
|
-
</td>
|
|
37
|
-
</tr>
|
|
38
|
-
<% end %>
|
|
39
|
-
</table>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<%= t('name') %>: <%= @message.name %>
|
|
2
|
-
<%= t('email') %>: <%= @message.email %>
|
|
3
|
-
<%= t('topic') %>: <%= @message.topic.name %>
|
|
4
|
-
<% unless @message.order_number.blank? %>
|
|
5
|
-
<%= t('order') %>: <%= @message.order_number.upcase %> <%= "http://#{Spree::Config[:site_url]}/admin/orders/#{@message.order_number.upcase}"%>
|
|
6
|
-
<% end %>
|
|
7
|
-
|
|
8
|
-
<%= @message.message %>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<% @body_id = 'contact_us' %>
|
|
2
|
-
<div id="contact-us">
|
|
3
|
-
<h1><%= t("contact_us") %></h1>
|
|
4
|
-
<%= hook :contact do %>
|
|
5
|
-
<%= render "shared/error_messages", :target => @contact %>
|
|
6
|
-
<%= form_for(@contact, :html => {:honeypot => true}) do |f| %>
|
|
7
|
-
<%= hook :contact_inside_form do %>
|
|
8
|
-
<div class="field">
|
|
9
|
-
<%= f.label :topic_id, t("topic") %>
|
|
10
|
-
<%= f.collection_select :topic_id, @topics, :id, :name %>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="field">
|
|
13
|
-
<%= f.label :name, t("name") %><br />
|
|
14
|
-
<%= f.text_field :name %>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="field">
|
|
17
|
-
<%= f.label :email, t("email") %><br />
|
|
18
|
-
<%= f.text_field :email %>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="field">
|
|
21
|
-
<%= f.label :order_number, t("order_number") %> (<%= t("optionnal") %>)<br />
|
|
22
|
-
<%= f.text_field :order_number %>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="field">
|
|
25
|
-
<%= f.label :message, t("message") %><br />
|
|
26
|
-
<%= f.text_area :message %>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="action"><%= f.submit t("send_message"), :class => "button primary" %></div>
|
|
29
|
-
<% end %>
|
|
30
|
-
<% end %>
|
|
31
|
-
<% end %>
|
|
32
|
-
</div>
|
data/config/locales/en.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
en:
|
|
2
|
-
contacts: Contacts
|
|
3
|
-
contact_us: Contact us
|
|
4
|
-
name: Name
|
|
5
|
-
email: Email
|
|
6
|
-
sent: Sent
|
|
7
|
-
view: View
|
|
8
|
-
message: Message
|
|
9
|
-
order_number: Order number
|
|
10
|
-
optionnal: optional
|
|
11
|
-
name_and_mail: Name and mail
|
|
12
|
-
contact_details: Contact details
|
|
13
|
-
contact_list: Contacts list
|
|
14
|
-
send_message: Send message
|
|
15
|
-
message_sended: Message sended
|
|
16
|
-
topics: Contact Form Topic
|
|
17
|
-
topic: Topic
|
|
18
|
-
topics_description: "Setup topics for the contact form, choose wich email should be routed to"
|
|
19
|
-
new_topic: Add a topic
|
|
20
|
-
from: from
|
|
21
|
-
message_from: Message from
|
data/config/locales/fr-FR.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
fr-FR:
|
|
2
|
-
contacts: Demandes de contact
|
|
3
|
-
contact_us: Contactez-nous
|
|
4
|
-
name: Nom
|
|
5
|
-
email: Email
|
|
6
|
-
sent: Envoyé le
|
|
7
|
-
view: Voir
|
|
8
|
-
message: Message
|
|
9
|
-
order_number: Numero de commande
|
|
10
|
-
name_and_mail: Nom et email
|
|
11
|
-
contact_details: Détail de la demande
|
|
12
|
-
contact_list: Liste des demandes
|
|
13
|
-
optionnal: optionnel
|
|
14
|
-
send_message: Envoyer le message
|
|
15
|
-
message_sended: Message envoyé
|
|
16
|
-
topics: Objet des demandes de contact
|
|
17
|
-
topic: Objet
|
|
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
|
|
20
|
-
from: de
|
|
21
|
-
message_from: Message de
|
data/config/routes.rb
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
class CreateContactTable < ActiveRecord::Migration
|
|
2
|
-
def self.up
|
|
3
|
-
create_table :contacts do |t|
|
|
4
|
-
t.string :name
|
|
5
|
-
t.string :email
|
|
6
|
-
t.string :order_number
|
|
7
|
-
t.text :message
|
|
8
|
-
t.references :topic
|
|
9
|
-
t.timestamps
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def self.down
|
|
14
|
-
drop_table :messages
|
|
15
|
-
end
|
|
16
|
-
end
|
data/lib/spree_easy_contact.rb
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
require 'spree_core'
|
|
2
|
-
require 'honeypot-captcha'
|
|
3
|
-
require 'spree_easy_contact_hooks'
|
|
4
|
-
|
|
5
|
-
module SpreeEasyContact
|
|
6
|
-
class Engine < Rails::Engine
|
|
7
|
-
|
|
8
|
-
config.autoload_paths += %W(#{config.root}/lib)
|
|
9
|
-
|
|
10
|
-
def self.activate
|
|
11
|
-
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
|
|
12
|
-
Rails.env.production? ? require(c) : load(c)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
config.to_prepare &method(:activate).to_proc
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
class SpreeEasyContactHooks < Spree::ThemeSupport::HookListener
|
|
2
|
-
# custom hooks go here
|
|
3
|
-
insert_after :admin_tabs do
|
|
4
|
-
%(<%= tab(:contacts) %>)
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
insert_after :admin_configurations_menu do
|
|
8
|
-
"<%= configurations_menu_item(I18n.t('topics'), admin_topics_path, I18n.t('topics_description')) %>"
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
end
|
data/lib/tasks/install.rake
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
namespace :spree_easy_contact do
|
|
2
|
-
desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
|
|
3
|
-
task :install do
|
|
4
|
-
Rake::Task['spree_easy_contact:install:migrations'].invoke
|
|
5
|
-
Rake::Task['spree_easy_contact:install:assets'].invoke
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
namespace :install do
|
|
9
|
-
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
|
|
10
|
-
task :migrations do
|
|
11
|
-
source = File.join(File.dirname(__FILE__), '..', '..', 'db')
|
|
12
|
-
destination = File.join(Rails.root, 'db')
|
|
13
|
-
Spree::FileUtilz.mirror_files(source, destination)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
|
|
17
|
-
task :assets do
|
|
18
|
-
source = File.join(File.dirname(__FILE__), '..', '..', 'public')
|
|
19
|
-
destination = File.join(Rails.root, 'public')
|
|
20
|
-
puts "INFO: Mirroring assets from #{source} to #{destination}"
|
|
21
|
-
Spree::FileUtilz.mirror_files(source, destination)
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# add custom rake tasks here
|
|
Binary file
|