Commit ce0714273053641af6725eb167671ac05ba05003

Authored by Antonio Terceiro
1 parent eb930064

custom_forms: make default fields explicit

This will hopefully prevent users who are creating forms for e.g.
registration for an event from adding fields for name and email, which
will already be added by default.

(cherry picked from commit 5ef4eba7cac4a9a075c13218555f84555cfd6f6b)
plugins/custom_forms/public/style.css
... ... @@ -61,10 +61,12 @@
61 61 margin-top: 10px;
62 62 }
63 63  
64   -.field-list {
  64 +.field-list, .default-field-list {
65 65 list-style-type: none;
66 66 margin: 0px;
67 67 padding: 0px;
  68 +}
  69 +.field-list {
68 70 cursor: move;
69 71 }
70 72  
... ...
plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
... ... @@ -22,6 +22,27 @@
22 22  
23 23 <h2><%= c_('Fields') %></h2>
24 24  
  25 +<ul class='default-field-list'>
  26 + <li>
  27 + <fieldset class="field-box">
  28 + <legend>
  29 + <%= _('This field will be added automatically to your form') %>
  30 + </legend>
  31 + <%= required f.label :name, c_('Name:') %>
  32 + <%= _('Name') %>
  33 + </fieldset>
  34 + </li>
  35 + <li>
  36 + <fieldset class="field-box">
  37 + <legend>
  38 + <%= _('This field will be added automatically to your form') %>
  39 + </legend>
  40 + <%= required f.label :name, c_('Name:') %>
  41 + <%= _('Email') %>
  42 + </fieldset>
  43 + </li>
  44 +</ul>
  45 +
25 46 <ul class='field-list'>
26 47 <%= f.fields_for :fields do |builder| %>
27 48 <li>
... ...