cama_contact_form 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/plugins/cama_contact_form/contact_form_controller_concern.rb +2 -2
- data/app/controllers/plugins/cama_contact_form/front_controller.rb +10 -7
- data/app/views/plugins/cama_contact_form/admin_forms/index.html.erb +1 -1
- data/config/locales/zh-CN.yml +101 -0
- data/lib/cama_contact_form/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 560352aa1bbdfa399683e71252fbd68444c5ce2d
|
4
|
+
data.tar.gz: 1e41fb350ba427b2fb53911931e56a1f14d99abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76367942977c6c816a36f34eec99f259903e5747303120d102b494906276861a50b9d217e84d286b5dbc2ce1db1a7dfa43f901bd81038ac7bf04d4d4842e8e45
|
7
|
+
data.tar.gz: 9899a0e9bfd0527dec7ecf2747f670639c591fc18cf91af2b825cc0b2a28e37a6530f8b7a7681ec9bfd60425dabf55a389a6f3ee402b2fffd4da5a377cc0589b
|
@@ -71,7 +71,7 @@ module Plugins::CamaContactForm::ContactFormControllerConcern
|
|
71
71
|
elsif field[:field_type] == 'file'
|
72
72
|
values[label] << fields[cid].split('/').last if fields[cid].present?
|
73
73
|
elsif field[:field_type] == 'captcha'
|
74
|
-
values[label] << '
|
74
|
+
values[label] << "--<span style='display:none;'>#{fields[cid]}</span>"
|
75
75
|
elsif field[:field_type] == 'radio' || field[:field_type] == 'checkboxes'
|
76
76
|
values[label] << fields[cid].map { |f| f.to_s.translate }.join(', ') if fields[cid].present?
|
77
77
|
else
|
@@ -80,4 +80,4 @@ module Plugins::CamaContactForm::ContactFormControllerConcern
|
|
80
80
|
end
|
81
81
|
return values
|
82
82
|
end
|
83
|
-
end
|
83
|
+
end
|
@@ -10,14 +10,17 @@ class Plugins::CamaContactForm::FrontController < CamaleonCms::Apps::PluginsFron
|
|
10
10
|
errors = []
|
11
11
|
success = []
|
12
12
|
|
13
|
-
|
14
|
-
if
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
args = {form: @form, values: fields, flag: true}; hooks_run("contact_form_before_submit", args)
|
14
|
+
if args[:flag]
|
15
|
+
perform_save_form(@form, fields, success, errors)
|
16
|
+
if success.present?
|
17
|
+
flash[:contact_form][:notice] = success.join('<br>')
|
18
|
+
else
|
19
|
+
flash[:contact_form][:error] = errors.join('<br>')
|
20
|
+
flash[:values] = fields.delete_if{|k, v| v.class.name == 'ActionDispatch::Http::UploadedFile' }
|
21
|
+
end
|
19
22
|
end
|
20
23
|
params[:format] == 'json' ? render(json: flash.discard(:contact_form).to_hash) : (redirect_to :back)
|
21
24
|
end
|
22
25
|
|
23
|
-
end
|
26
|
+
end
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<thead>
|
26
26
|
<tr>
|
27
27
|
<th><%= t('.name', default: 'Name') %></th>
|
28
|
-
<th><%= t('.
|
28
|
+
<th><%= t('.description', default: 'Description') %></th>
|
29
29
|
<th><%= t('.slug', default: 'Slug') %></th>
|
30
30
|
<th><%= t('.shortcode', default: 'Shortcode') %></th>
|
31
31
|
<th><%= t('.count', default: 'Items') %></th>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
zh-CN:
|
2
|
+
plugins:
|
3
|
+
cama_contact_form:
|
4
|
+
title: '联系方式表单'
|
5
|
+
list_responses: '联系方式表单记录'
|
6
|
+
edit_view: '编辑联系方式表单'
|
7
|
+
admin_forms:
|
8
|
+
index:
|
9
|
+
title: '联系方式表单'
|
10
|
+
list_forms: '表单列表'
|
11
|
+
title_form: '新建表单'
|
12
|
+
name: '标题'
|
13
|
+
slug: 'Slug'
|
14
|
+
description: '描述'
|
15
|
+
shortcode: '代码片段'
|
16
|
+
count: '条目'
|
17
|
+
actions: '操作'
|
18
|
+
list_responses: '联系方式表单记录'
|
19
|
+
edit: '编辑表单'
|
20
|
+
delete: '删除表单'
|
21
|
+
msg_confirm: '您是否确定要删除这个表单?'
|
22
|
+
|
23
|
+
edit:
|
24
|
+
shortcode_msg: '复制代码片段'
|
25
|
+
submit_btn: '保存'
|
26
|
+
back_btn: '返回列表'
|
27
|
+
html_code: 'HTML代码'
|
28
|
+
before_code: '表单之前的代码'
|
29
|
+
after_code: '表单之后的代码'
|
30
|
+
form_notification_email_settings: '提醒邮箱设置'
|
31
|
+
to: '邮箱地址'
|
32
|
+
subject: '主题'
|
33
|
+
body: '邮件前缀'
|
34
|
+
confirmation_email_settings: '确认邮箱设置'
|
35
|
+
confirmation_email_descr: '您可以使用字段的代码来表示此字段的值,比如 Sample: Hello [c1]'
|
36
|
+
body_answer: '邮件信息'
|
37
|
+
|
38
|
+
form_settings_messages: '表单消息设置'
|
39
|
+
success_form_msg: '成功消息'
|
40
|
+
error_form_msg: '错误消息'
|
41
|
+
error_required_msg: '必填字段错误消息'
|
42
|
+
email_invalid_msg: '电子邮件无效消息'
|
43
|
+
captch_error_msg: '验证码无效消息'
|
44
|
+
|
45
|
+
my_fields: '字段'
|
46
|
+
all_fields: '可用字段'
|
47
|
+
|
48
|
+
fields:
|
49
|
+
submit: '提交按钮'
|
50
|
+
captcha: '验证码输入框'
|
51
|
+
checkboxes: '复选框'
|
52
|
+
radio: '单选框'
|
53
|
+
dropdown: '下拉框'
|
54
|
+
website: '站点链接'
|
55
|
+
email: '邮件输入框'
|
56
|
+
text: '文本框'
|
57
|
+
paragraph: '文本区域'
|
58
|
+
file: '文件上传'
|
59
|
+
button: '普通按钮'
|
60
|
+
reset_button: '重置按钮'
|
61
|
+
item_field:
|
62
|
+
label: '名称'
|
63
|
+
descr: '描述'
|
64
|
+
is_required: '是否必填?'
|
65
|
+
options: '选项字段'
|
66
|
+
here_label: '这是你的标签'
|
67
|
+
default: '缺省'
|
68
|
+
add_option: '添加选项'
|
69
|
+
html_code: 'HTML 代码'
|
70
|
+
custom_class: '自定义类名'
|
71
|
+
default_value: '默认值'
|
72
|
+
template: '模板'
|
73
|
+
attributes: '属性'
|
74
|
+
|
75
|
+
|
76
|
+
form:
|
77
|
+
name: '标题'
|
78
|
+
slug: 'Slug'
|
79
|
+
description: '描述'
|
80
|
+
back_btn: '返回'
|
81
|
+
submit_btn: '创建表单'
|
82
|
+
|
83
|
+
responses:
|
84
|
+
back_btn: '返回列表'
|
85
|
+
created_at: '创建于'
|
86
|
+
list_responses: '联系方式表单记录'
|
87
|
+
|
88
|
+
create:
|
89
|
+
created: '成功创建表单'
|
90
|
+
destroy:
|
91
|
+
deleted: '成功删除表单'
|
92
|
+
update:
|
93
|
+
updated_success: '成功更新表单'
|
94
|
+
|
95
|
+
front:
|
96
|
+
save_form:
|
97
|
+
error_validation_val: '该值是必须的!'
|
98
|
+
email_invalid_val: '错误的电子邮件格式!'
|
99
|
+
captch_error_val: '验证码错误!'
|
100
|
+
success_form_val: '你的消息已经成功发送,非常感谢您!'
|
101
|
+
error_form_val: '引发了一个错误,请重试!'
|
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.20
|
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-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- config/camaleon_plugin.json
|
64
64
|
- config/initializers/custom_models.rb
|
65
65
|
- config/locales/es.yml
|
66
|
+
- config/locales/zh-CN.yml
|
66
67
|
- config/routes.rb
|
67
68
|
- db/migrate/20160517143441_create_db_structure.rb
|
68
69
|
- lib/cama_contact_form.rb
|