cama_contact_form 0.0.6 → 0.0.7

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: 9deeef61f72f20a110c246f6d9cfd75af0274676
4
- data.tar.gz: ddb095f41dfd64c12e62395e8778608c24f6e861
3
+ metadata.gz: d34af2e79a6abcddad135a29e375332e012150e9
4
+ data.tar.gz: 5917aa3ad8e4f33e9bbea677cb00c938f5d6a592
5
5
  SHA512:
6
- metadata.gz: ca521319894aa64080645e7798affbea4185b7dccda2d2ebbf44b279039dbe87516e8d2f8c6f15d3f8703ac2389fcbfe3019cd1bd0e827106dd562d9ac61b11b
7
- data.tar.gz: 6dd991205b496b73b64b74f4901895492029f008a3f5f0e3f4638c072ec93a811a272f8bdc75afed72e643278f5e63517fdad58197f33b50f5b3bc7618146ea8
6
+ metadata.gz: 178d7bc5dcea9cf56ddcf51a6168ff2f7509e1dc89aa235f4a14b7bf823cde5f84655e573fb95371553d15454bf95e683e2c342f78a10aa0c5d1d159d6a0beba
7
+ data.tar.gz: 99a8059d495aae6caf48a901e7c5de10c351a62068732b7559ba343d971730130ba121d277d44d8774d36bb213abe1bb3a472774997faa588b7a4785d92f9f04
@@ -91,7 +91,7 @@ module Plugins::CamaContactForm::MainHelper
91
91
 
92
92
  case ob[:field_type].to_s
93
93
  when 'paragraph','textarea'
94
- temp2 = "<textarea #{ob[:custom_attrs].to_attr_format} name=\"#{f_name}\" maxlength=\"#{field_options[:maxlength] || 500 }\" class=\"#{ob[:custom_class]} \">#{values[cid]}</textarea>"
94
+ temp2 = "<textarea #{ob[:custom_attrs].to_attr_format} name=\"#{f_name}\" maxlength=\"#{field_options[:maxlength] || 500 }\" class=\"#{ob[:custom_class]} \">#{values[cid] || ob[:default_value]}</textarea>"
95
95
  when 'radio'
96
96
  temp2= cama_form_select_multiple_bootstrap(ob, ob[:label], ob[:field_type],values)
97
97
  when 'checkboxes'
@@ -102,7 +102,7 @@ module Plugins::CamaContactForm::MainHelper
102
102
  class_type = ""
103
103
  class_type = "railscf-field-#{ob[:field_type]}" if ob[:field_type]=="website"
104
104
  class_type = "railscf-field-#{ob[:field_type]}" if ob[:field_type]=="email"
105
- temp2 = "<input #{ob[:custom_attrs].to_attr_format} type=\"#{ob[:field_type]}\" value=\"#{values[cid]}\" name=\"#{f_name}\" class=\"#{ob[:custom_class]} #{class_type}\">"
105
+ temp2 = "<input #{ob[:custom_attrs].to_attr_format} type=\"#{ob[:field_type]}\" value=\"#{values[cid] || ob[:default_value]}\" name=\"#{f_name}\" class=\"#{ob[:custom_class]} #{class_type}\">"
106
106
  when 'captcha'
107
107
  temp2 = cama_captcha_tag(5, {}, {class: "#{ob[:custom_class]} field-captcha required"}.merge(ob[:custom_attrs]))
108
108
  when 'file'
@@ -54,6 +54,12 @@
54
54
  <a class="btn btn-default btn-xs html_btn"><%= t('.html_code', default: 'HTML Code') %> <i class='fa fa-cog'></i></a>
55
55
  <div class="hidden">
56
56
  <hr>
57
+ <% if ['paragraph','textarea','text', 'website', 'email'].include?(field[:field_type]) %>
58
+ <div class="form-group ">
59
+ <label><%= t('.default_value', default: 'Default Value') %></label><br>
60
+ <%= text_field_tag "fields[#{cid}][default_value]", field[:default_value], class: 'form-control' %>
61
+ </div>
62
+ <% end %>
57
63
  <div class="form-group ">
58
64
  <label><%= t('.custom_class', default: 'Custom Class') %></label><br>
59
65
  <%= text_field_tag "fields[#{cid}][field_options][field_class]", field[:field_options][:field_class], class: 'form-control' %>
@@ -66,6 +66,7 @@ es:
66
66
  add_option: 'Agregar opción'
67
67
  html_code: 'Código HTML'
68
68
  custom_class: 'Estilo Personalizado'
69
+ default_value: 'Valor por defecto'
69
70
  template: 'Plantilla'
70
71
  attributes: 'Attributos del campo'
71
72
 
@@ -1,3 +1,3 @@
1
1
  module CamaContactForm
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cama_contact_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo