ecm_contact2 2.1.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ecm/contact/contact_requests_controller.rb +27 -0
- data/app/mail_forms/ecm/contact/{request.rb → contact_request.rb} +1 -1
- data/app/views/ecm/contact/{requests/_request.erb → contact_requests/_contact_request.erb} +0 -0
- data/app/views/ecm/contact/{requests → contact_requests}/_form.erb +0 -0
- data/app/views/ecm/contact/{requests → contact_requests}/index.html.erb +1 -1
- data/config/initializers/assets.rb +1 -0
- data/config/locales/ecm.contact.de.yml +4 -4
- data/config/locales/ecm.contact.en.yml +4 -4
- data/config/locales/ecm.contact.request.de.yml +3 -3
- data/config/locales/ecm.contact.request.en.yml +3 -3
- data/config/routes.rb +3 -1
- data/lib/ecm/contact/engine.rb +1 -3
- data/lib/ecm/contact/version.rb +1 -1
- data/lib/ecm_contact2.rb +0 -1
- metadata +8 -8
- data/app/controllers/ecm/contact/requests_controller.rb +0 -23
- data/lib/ecm/contact/routing.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3a18e49b3476278af7432c651db18f6a638552
|
4
|
+
data.tar.gz: b597d6b4603848e87b467ba3d2dc2871fa01ea85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d16539b4e18c86ea99a21bd6042010e4578c68e55edc6be472a4d235b1d9ae0bfd9a9eeea852c2b8507b9823bd9ccdd942cb5508b30e81c7fec4626290700d18
|
7
|
+
data.tar.gz: 82b1874e06c3228f02961b6a439f613051d54b17947885eccd2d99c9140fb1106411fc73f52a3f032dcc041a5fa9434f021f6a9062e820b656f0673caf16512a
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Ecm
|
2
|
+
module Contact
|
3
|
+
class ContactRequestsController < Ecm::Contact::Configuration.base_controller.constantize
|
4
|
+
def index
|
5
|
+
@title = I18n.t('ecm.contact.request.index.title')
|
6
|
+
@contact_request = ContactRequest.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def create
|
10
|
+
@title = I18n.t('ecm.contact.request.index.title')
|
11
|
+
@contact_request = ContactRequest.new(params[:contact_request])
|
12
|
+
|
13
|
+
if @contact_request.deliver
|
14
|
+
redirect_to(after_create_url, notice: -> { I18n.t('ecm.contact.form.messages.delivered') }.call)
|
15
|
+
else
|
16
|
+
render :index
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def after_create_url
|
23
|
+
Ecm::Contact::Configuration.after_create_url.call(self)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% content_for :title do %><%= I18n.t('ecm.contact.request.index.page_title') %><% end %>
|
2
2
|
<% content_for :meta_description do %><%= I18n.t('ecm.contact.request.index.meta_description') %><% end %>
|
3
|
-
<h1><%= Ecm::Contact::
|
3
|
+
<h1><%= Ecm::Contact::ContactRequest.model_name.human %></h1>
|
4
4
|
|
5
5
|
<%= Ecm::Contact::Configuration.additional_contact_information.call(self) if Ecm::Contact::Configuration.additional_contact_information.respond_to?(:call) %>
|
6
6
|
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile += %w(ecm_contact.css)
|
@@ -4,20 +4,20 @@ de:
|
|
4
4
|
form:
|
5
5
|
messages:
|
6
6
|
delivered: "Ihre Kontaktanfrage wurde versandt."
|
7
|
-
|
7
|
+
contact_request:
|
8
8
|
index:
|
9
9
|
page_title: Kontaktanfrage
|
10
10
|
meta_description: Kontaktieren Sie uns über unser Kontaktformular
|
11
11
|
title: Kontaktanfrage
|
12
12
|
subject: "[%{application_name}] Neue Kontaktanfrage"
|
13
|
-
|
13
|
+
contact_requests:
|
14
14
|
form:
|
15
15
|
submit: Abschicken
|
16
16
|
views:
|
17
17
|
actions:
|
18
18
|
back: 'Zurück'
|
19
19
|
routes:
|
20
|
-
|
20
|
+
contact_requests: kontakt
|
21
21
|
simple_form:
|
22
22
|
"yes": 'Ja'
|
23
23
|
"no": 'Nein'
|
@@ -25,7 +25,7 @@ de:
|
|
25
25
|
text: 'Pflichtfeld'
|
26
26
|
mark: '*'
|
27
27
|
placeholders:
|
28
|
-
|
28
|
+
contact_request:
|
29
29
|
name: "Max Mustermann"
|
30
30
|
email: "max.mustermann@example.com"
|
31
31
|
message: "Hi Dave..."
|
@@ -4,20 +4,20 @@ en:
|
|
4
4
|
form:
|
5
5
|
messages:
|
6
6
|
delivered: "Your contact request has been delivered."
|
7
|
-
|
7
|
+
contact_request:
|
8
8
|
index:
|
9
9
|
page_title: Contact request
|
10
10
|
meta_description: Contact us
|
11
11
|
title: Contact request
|
12
12
|
subject: "[%{application_name}] New contact request"
|
13
|
-
|
13
|
+
contact_requests:
|
14
14
|
form:
|
15
15
|
submit: Submit
|
16
16
|
views:
|
17
17
|
actions:
|
18
18
|
back: 'Back'
|
19
19
|
routes:
|
20
|
-
|
20
|
+
contact_requests: contact
|
21
21
|
simple_form:
|
22
22
|
"yes": 'Yes'
|
23
23
|
"no": 'No'
|
@@ -25,7 +25,7 @@ en:
|
|
25
25
|
text: 'required'
|
26
26
|
mark: '*'
|
27
27
|
placeholders:
|
28
|
-
|
28
|
+
contact_request:
|
29
29
|
name: "John Doe"
|
30
30
|
email: "john.doe@example.com"
|
31
31
|
message: "Hi Dave..."
|
@@ -1,13 +1,13 @@
|
|
1
1
|
de:
|
2
2
|
mail_form:
|
3
3
|
models:
|
4
|
-
ecm/contact/
|
4
|
+
ecm/contact/contact_request: Kontaktanfrage
|
5
5
|
attributes:
|
6
|
-
ecm/contact/
|
6
|
+
ecm/contact/contact_request:
|
7
7
|
email: E-Mail
|
8
8
|
name: Name
|
9
9
|
message: Nachricht
|
10
10
|
phone: Telefon
|
11
11
|
terms_of_service: Hiermit erlaube ich dem Seitenbetreiber die Nutzung meiner Daten zwecks Beantwortung dieser Kontaktanfrage.
|
12
|
-
|
12
|
+
contact_request:
|
13
13
|
title: "Kontaktanfrage"
|
@@ -1,13 +1,13 @@
|
|
1
1
|
en:
|
2
2
|
mail_form:
|
3
3
|
models:
|
4
|
-
ecm/contact/
|
4
|
+
ecm/contact/contact_request: contact request
|
5
5
|
attributes:
|
6
|
-
ecm/contact/
|
6
|
+
ecm/contact/contact_request:
|
7
7
|
email: email
|
8
8
|
name: name
|
9
9
|
message: message
|
10
10
|
phone: phone
|
11
11
|
terms_of_service: I hereby allow the site owner to use my personal data for the purpose of answering this request.
|
12
|
-
|
12
|
+
contact_request:
|
13
13
|
title: contact request
|
data/config/routes.rb
CHANGED
data/lib/ecm/contact/engine.rb
CHANGED
data/lib/ecm/contact/version.rb
CHANGED
data/lib/ecm_contact2.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_contact2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -259,13 +259,14 @@ files:
|
|
259
259
|
- README.rdoc
|
260
260
|
- Rakefile
|
261
261
|
- app/assets/stylesheets/ecm_contact.css
|
262
|
-
- app/controllers/ecm/contact/
|
262
|
+
- app/controllers/ecm/contact/contact_requests_controller.rb
|
263
263
|
- app/helpers/ecm/contact_helper.rb
|
264
|
-
- app/mail_forms/ecm/contact/
|
265
|
-
- app/views/ecm/contact/
|
266
|
-
- app/views/ecm/contact/
|
267
|
-
- app/views/ecm/contact/
|
264
|
+
- app/mail_forms/ecm/contact/contact_request.rb
|
265
|
+
- app/views/ecm/contact/contact_requests/_contact_request.erb
|
266
|
+
- app/views/ecm/contact/contact_requests/_form.erb
|
267
|
+
- app/views/ecm/contact/contact_requests/index.html.erb
|
268
268
|
- app/views/mail_form/contact.erb
|
269
|
+
- config/initializers/assets.rb
|
269
270
|
- config/locales/ecm.contact.de.yml
|
270
271
|
- config/locales/ecm.contact.en.yml
|
271
272
|
- config/locales/ecm.contact.request.de.yml
|
@@ -273,7 +274,6 @@ files:
|
|
273
274
|
- config/routes.rb
|
274
275
|
- lib/ecm/contact/configuration.rb
|
275
276
|
- lib/ecm/contact/engine.rb
|
276
|
-
- lib/ecm/contact/routing.rb
|
277
277
|
- lib/ecm/contact/version.rb
|
278
278
|
- lib/ecm_contact2.rb
|
279
279
|
- lib/generators/ecm/contact/install/install_generator.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
class Ecm::Contact::RequestsController < Ecm::Contact::Configuration.base_controller.constantize
|
2
|
-
def index
|
3
|
-
@title = I18n.t('ecm.contact.request.index.title')
|
4
|
-
@contact_request = Ecm::Contact::Request.new
|
5
|
-
end
|
6
|
-
|
7
|
-
def create
|
8
|
-
@title = I18n.t('ecm.contact.request.index.title')
|
9
|
-
@contact_request = Ecm::Contact::Request.new(params[:ecm_contact_request])
|
10
|
-
|
11
|
-
if @contact_request.deliver
|
12
|
-
redirect_to(after_create_url, notice: -> { I18n.t('ecm.contact.form.messages.delivered') }.call)
|
13
|
-
else
|
14
|
-
render :index
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def after_create_url
|
21
|
-
Ecm::Contact::Configuration.after_create_url.call(self)
|
22
|
-
end
|
23
|
-
end
|
data/lib/ecm/contact/routing.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
module Ecm
|
2
|
-
module Contact
|
3
|
-
class Routing
|
4
|
-
def self.routes(router, options = {})
|
5
|
-
options.reverse_merge!(
|
6
|
-
contact_request_actions: [:index, :create]
|
7
|
-
)
|
8
|
-
|
9
|
-
router.resources :ecm_contact_requests, only: options[:contact_request_actions], controller: 'ecm/contact/requests'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|