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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1478bb425a77d7e670bc3853f535c8f0ac7b5665
4
- data.tar.gz: dc36f0cb217f3556480a7c067d2028340d44794d
3
+ metadata.gz: 4b3a18e49b3476278af7432c651db18f6a638552
4
+ data.tar.gz: b597d6b4603848e87b467ba3d2dc2871fa01ea85
5
5
  SHA512:
6
- metadata.gz: af9fc5f687098c3c8d29c8e1f6e909a9d67e66df72f95fb0c760cff66d6919f0f389838ada2c35a4b29ab8136da0a7d0687f49d2f05e8613c34e8a48b3487c4a
7
- data.tar.gz: 6b0f22c85e617b3161891db9a1bde09113f89e4e08daa0367f891948de2321b079df6e549c290cf2c6e2795e12aead2e395a635355d753bfd9ac0b44a1082a0f
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
@@ -1,6 +1,6 @@
1
1
  module Ecm
2
2
  module Contact
3
- class Request < MailForm::Base
3
+ class ContactRequest < MailForm::Base
4
4
  attribute :name
5
5
  attribute :email
6
6
  attribute :phone
@@ -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::Request.model_name.human %></h1>
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
- request:
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
- requests:
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
- ecm_contact_requests: kontakt
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
- ecm_contact_request:
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
- request:
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
- requests:
13
+ contact_requests:
14
14
  form:
15
15
  submit: Submit
16
16
  views:
17
17
  actions:
18
18
  back: 'Back'
19
19
  routes:
20
- ecm_contact_requests: contact
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
- ecm_contact_request:
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/request: Kontaktanfrage
4
+ ecm/contact/contact_request: Kontaktanfrage
5
5
  attributes:
6
- ecm/contact/request:
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
- request:
12
+ contact_request:
13
13
  title: "Kontaktanfrage"
@@ -1,13 +1,13 @@
1
1
  en:
2
2
  mail_form:
3
3
  models:
4
- ecm/contact/request: contact request
4
+ ecm/contact/contact_request: contact request
5
5
  attributes:
6
- ecm/contact/request:
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
- request:
12
+ contact_request:
13
13
  title: contact request
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
1
  Ecm::Contact::Engine.routes.draw do
2
- resources :contact_requests, only: [:create, :new]
2
+ localized do
3
+ resources :contact_requests, only: [:create, :index]
4
+ end
3
5
  end
@@ -1,9 +1,7 @@
1
1
  module Ecm
2
2
  module Contact
3
3
  class Engine < ::Rails::Engine
4
- config.to_prepare do
5
- Rails.application.config.assets.precompile += %w(ecm_contact.css)
6
- end
4
+ isolate_namespace Ecm::Contact
7
5
  end
8
6
  end
9
7
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Contact
3
- VERSION = '2.1.1'.freeze
3
+ VERSION = '3.0.0'.freeze
4
4
  end
5
5
  end
data/lib/ecm_contact2.rb CHANGED
@@ -2,7 +2,6 @@ require 'mail_form'
2
2
  require 'simple_form'
3
3
 
4
4
  require 'ecm/contact/engine'
5
- require 'ecm/contact/routing'
6
5
  require 'ecm/contact/configuration'
7
6
 
8
7
  module Ecm
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: 2.1.1
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: 2016-10-07 00:00:00.000000000 Z
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/requests_controller.rb
262
+ - app/controllers/ecm/contact/contact_requests_controller.rb
263
263
  - app/helpers/ecm/contact_helper.rb
264
- - app/mail_forms/ecm/contact/request.rb
265
- - app/views/ecm/contact/requests/_form.erb
266
- - app/views/ecm/contact/requests/_request.erb
267
- - app/views/ecm/contact/requests/index.html.erb
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
@@ -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