simple_contact 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/simple_contact/message.rb +1 -0
  3. data/app/views/simple_contact/contact/new.html.erb +49 -24
  4. data/app/views/simple_contact/contact_mailer/contact_message.html.erb +2 -4
  5. data/config/locales/en.yml +3 -4
  6. data/config/routes.rb +3 -2
  7. data/lib/simple_contact/engine.rb +2 -4
  8. data/lib/simple_contact/version.rb +1 -1
  9. data/test/dummy/log/development.log +1510 -0
  10. data/test/dummy/log/test.log +561 -0
  11. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  12. data/test/dummy/tmp/cache/assets/test/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
  13. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  14. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  15. data/test/dummy/tmp/cache/assets/test/sprockets/3757a76e4a2601e881a26a95304e148c +0 -0
  16. data/test/dummy/tmp/cache/assets/test/sprockets/40fc2f3d2a468a00e463f1d313cb1683 +0 -0
  17. data/test/dummy/tmp/cache/assets/test/sprockets/98fd2c085a74ec738711317e3165c032 +0 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/9de96c0b793236d6da31b0849d34d881 +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/b2fb5947f127c780362f6f64ba20371e +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/edbef6e0d0a4742346cf479f2c522eb0 +0 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  25. metadata +32 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1873e4e82ff3c48e414f717401f2397a6f8dbf3
4
- data.tar.gz: 34c805ffaf92f29b120da0b239cb8fb3557038bb
3
+ metadata.gz: 143bf10259d2b189eebef503ef9c2091f822b9bf
4
+ data.tar.gz: 4128c655dbb59df3893d296f20369b23668d1136
5
5
  SHA512:
6
- metadata.gz: 479bf934a64664263e72de8362121b993115a8cb4f29d0ee4ecd7b8cef82a6b64b401684a3c8c060d20f75ef053e6df78106a23209be5da72a1aeae565ce850a
7
- data.tar.gz: 58ccc0086b9b038f2bcee67f0f3999418cf14c8961fb278ce6c5927ccf2bbca3f3d833735c9d84f8af20ba640db9249bee8fee26dc2ce9d79dfe4fa9d3cb0faa
6
+ metadata.gz: fa8c9f92bebfbf4152dfb4458749ddd2b34e9427b229099de364711dce8ed8653d078eae9000281a71a11eb01314b851a9e1f71ece66e08182cf7a1dd4ecf1bd
7
+ data.tar.gz: 9de72ccfff9f76735b3eef9f55a6b2c813f9d21b1b5ca74acf68f71c28eabc8d1a58bdd3290d805c491f64233b5e04d548e9caa406bb0c9aef8459ac2a946670
@@ -19,3 +19,4 @@ class SimpleContact::Message
19
19
  false
20
20
  end
21
21
  end
22
+
@@ -1,31 +1,56 @@
1
- <div class='page-header'>
1
+ <div class="page-header">
2
2
  <h1>
3
3
  <%= t(:contact_me) %>
4
- <small> <%= t(:get_in_touch) %></small>
5
4
  </h1>
6
- <%= form_for @message, url: simple_contact.contact_path do |f| %>
7
- <% if @message.errors.any? %>
8
- <p><%= t(:message_errors_present) %></p>
9
- <ul>
10
- <% @message.errors.full_messages.each do |error| %>
11
- <li><%= error %></li>
5
+ </div>
6
+ <div class="row">
7
+ <div class="col-sm-8 col-sm-offset-2">
8
+ <%= form_for @message, url: simple_contact.create_contact_path, html: {class: "form-horizontal" } do |f| %>
9
+ <% if @message.errors.any? %>
10
+ <script>
11
+ $(document).ready(function() {
12
+ $('.field_with_errors').parent().addClass('has-error');
13
+ });
14
+ </script>
15
+ <p><%= t(:message_errors_present) %></p>
16
+ <ul class='list-unstyled'>
17
+ <% @message.errors.full_messages.each do |error| %>
18
+ <li><%= error %></li>
19
+ <% end %>
20
+ </ul>
12
21
  <% end %>
13
- </ul>
14
- <% end %>
15
- <div class="form-inputs">
16
- <%= f.label :email, "#{t(:email_address_label)}" %>
17
- <%= f.text_field :email, placeholder: "#{t(:email_address_placeholder)}" %> <br />
18
- <%= f.label :name, "#{t(:email_name_label)}" %>
19
- <%= f.text_field :name, placeholder: "#{t(:email_name_placeholder)}" %> <br />
20
- <%= f.label :subject, "#{t(:email_subject_label)}" %>
21
- <%= f.text_field :subject, placeholder: "#{t(:email_subject_placeholder)}" %> <br />
22
- <%= f.label :body, "#{t(:email_body_label)}" %>
23
- <%= f.text_area :body, placeholder: "#{t(:email_body_placeholder)}", as: :text, input_html: {rows: 8} %> <br />
24
- </div>
25
- <br />
26
- <div class='text-center'>
27
- <%= f.submit :submit, class: 'btn btn-primary' %>
22
+ <div class="form-inputs">
23
+ <div class="form-group">
24
+ <%= f.label :email, t(:email_address_label).html_safe, class: "col-xs-2 control-label" %>
25
+ <div class="col-xs-10">
26
+ <%= f.email_field :email, placeholder: t(:email_address_placeholder).html_safe, class: "form-control" %>
27
+ </div>
28
+ </div>
29
+ <div class="form-group">
30
+ <%= f.label :name, t(:email_name_label).html_safe, class: "col-xs-2 control-label" %>
31
+ <div class="col-xs-10">
32
+ <%= f.text_field :name, placeholder: t(:email_name_placeholder).html_safe, class: "form-control" %>
33
+ </div>
34
+ </div>
35
+ <div class="form-group">
36
+ <%= f.label :subject, t(:email_subject_label).html_safe, class: "col-xs-2 control-label" %>
37
+ <div class="col-xs-10">
38
+ <%= f.text_field :subject, placeholder: t(:email_subject_placeholder).html_safe, class: "form-control" %>
39
+ </div>
40
+ </div>
41
+ <div class="form-group">
42
+ <%= f.label :body, t(:email_body_label).html_safe, class: "col-xs-2 control-label" %>
43
+ <div class="col-xs-10">
44
+ <%= f.text_area :body, placeholder: t(:email_body_placeholder).html_safe, as: :text, rows: 10, class: "form-control" %>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ <br />
49
+ <div class="text-center">
50
+ <button name='commit' class='btn btn-primary btn-lg'><%= t(:submit_message).html_safe %></button>
51
+ </div>
52
+ <% end %>
28
53
  </div>
29
- <% end %>
54
+ </div>
30
55
  </div>
31
56
 
@@ -1,9 +1,7 @@
1
1
  <h3> You've received a new message from: <%= mail_to @message.email, @message.name %> </h3>
2
2
  <hr />
3
3
  <h3> <%=@message.subject %> </h3>
4
-
5
4
  <%= simple_format(@message.body) %>
6
-
5
+ <br />
7
6
  <hr />
8
-
9
- <p> Please respond to them within the next 24 hours </p>
7
+ <p> Please respond to <%= @message.name %> as soon as possible. </p>
@@ -1,7 +1,5 @@
1
1
  en:
2
2
  contact_me: "Contact Me"
3
- get_in_touch: "Get in touch"
4
-
5
3
  email_address_label: "Email Address"
6
4
  email_address_placeholder: "Please enter your email address"
7
5
  email_name_label: "Your Name"
@@ -10,6 +8,7 @@ en:
10
8
  email_subject_placeholder: "Tell us what you want to know about"
11
9
  email_body_label: "Message"
12
10
  email_body_placeholder: "Please write your message..."
13
- message_errors_present: "Please correct the following errors"
11
+ message_errors_present: "Please correct the following errors:"
14
12
  mailer_success_message: "Thanks for contacting us. We'll be in touch soon!"
15
- mailer_error_message: "Please correct the errors below"
13
+ mailer_error_message: "Please correct the errors below"
14
+ submit_message: "<i class='glyphicon glyphicon-envelope'></i> Send Message"
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  SimpleContact::Engine.routes.draw do
2
- root to: 'contact#new'
2
+
3
3
  get "/", to: 'contact#new', as: :contact
4
- post "/", to: 'contact#create', as: :contact
4
+ post "/", to: 'contact#create', as: :create_contact
5
+ root to: 'contact#new'
5
6
  end
@@ -1,5 +1,3 @@
1
- module SimpleContact
2
- class Engine < ::Rails::Engine
3
- isolate_namespace SimpleContact
4
- end
1
+ class SimpleContact::Engine < ::Rails::Engine
2
+ isolate_namespace SimpleContact
5
3
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleContact
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end