cama_contact_form 0.0.21 → 0.0.22
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.
- checksums.yaml +4 -4
- data/app/controllers/plugins/cama_contact_form/admin_forms_controller.rb +8 -0
- data/app/helpers/plugins/cama_contact_form/main_helper.rb +1 -0
- data/app/views/plugins/cama_contact_form/admin_forms/responses.html.erb +7 -0
- data/config/locales/es.yml +2 -0
- data/config/routes.rb +1 -0
- data/lib/cama_contact_form/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e857bfd46d47e32d37dbbae8d46117d36d3a2e79
|
4
|
+
data.tar.gz: 8b82e5eac78c251375927f40ff745e71d1025c3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c657a6a584448301ed06e4046eefd93e5a87e1d5de0ba23cf47ac7ba1e644485bcd099e1c983c42f018e3a2b045a05d70818977a9677cf121142a1745b5c260e
|
7
|
+
data.tar.gz: 9f0a1b3b02df99b2cb76073bab6e2f6d4d6c1d0b9c908f1b7c6d03cbcdf81cfc7b1bb85f42cebe55d93978496323a3aa697ff36a12f92fcbf6a76eb3b5452c7c
|
@@ -54,6 +54,14 @@ class Plugins::CamaContactForm::AdminFormsController < CamaleonCms::Apps::Plugin
|
|
54
54
|
@forms = @forms.paginate(:page => params[:page], :per_page => current_site.admin_per_page)
|
55
55
|
end
|
56
56
|
|
57
|
+
def del_response
|
58
|
+
response = current_site.contact_forms.find_by_id(params[:response_id])
|
59
|
+
if response.present? && response.destroy
|
60
|
+
flash[:notice] = "#{t('.actions.msg_deleted', default: 'The response has been deleted')}"
|
61
|
+
end
|
62
|
+
redirect_to action: :responses
|
63
|
+
end
|
64
|
+
|
57
65
|
def manual
|
58
66
|
|
59
67
|
end
|
@@ -82,6 +82,7 @@ module Plugins::CamaContactForm::MainHelper
|
|
82
82
|
ob = r[:field]
|
83
83
|
ob[:custom_class] = r[:custom_class]
|
84
84
|
ob[:custom_attrs] = r[:custom_attrs]
|
85
|
+
ob[:custom_attrs][:required] = 'true' if ob[:required].present? && ob[:required].to_bool
|
85
86
|
field_options = ob[:field_options]
|
86
87
|
for_name = ob[:label].to_s
|
87
88
|
f_name = "fields[#{ob[:cid]}]"
|
@@ -22,6 +22,7 @@
|
|
22
22
|
<th><%= f[:label].to_s.translate %></th>
|
23
23
|
<% end %>
|
24
24
|
<th><%= t('.created_at', default: 'Registered at') %></th>
|
25
|
+
<th></th>
|
25
26
|
</tr>
|
26
27
|
</thead>
|
27
28
|
<tbody>
|
@@ -39,6 +40,12 @@
|
|
39
40
|
<% end %>
|
40
41
|
<% end %>
|
41
42
|
<td><%= value[:created_at] %></td>
|
43
|
+
<td>
|
44
|
+
<%= link_to raw('<i class="fa fa-times"></i>'),
|
45
|
+
{ action: :del_response, response_id: form.id },
|
46
|
+
method: :delete, data: { confirm: t('.actions.confirm_delete', default: 'Are you sure?') },
|
47
|
+
class: 'btn btn-danger btn-xs', title: t('.actions.delete', default: 'Delete') %>
|
48
|
+
</td>
|
42
49
|
</tr>
|
43
50
|
<% end %>
|
44
51
|
</tbody>
|
data/config/locales/es.yml
CHANGED
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cama_contact_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Peredo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|