[Git][noosfero/noosfero][master] custom_forms: make default fields explicit

Antonio Terceiro gitlab at gitlab.com
Fri Sep 18 15:33:39 BRT 2015


Antonio Terceiro pushed to branch master at Noosfero / noosfero


Commits:
5ef4eba7 by Antonio Terceiro at 2015-09-18T15:26:23Z
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.

- - - - -


2 changed files:

- plugins/custom_forms/public/style.css
- plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb


Changes:

=====================================
plugins/custom_forms/public/style.css
=====================================
--- a/plugins/custom_forms/public/style.css
+++ b/plugins/custom_forms/public/style.css
@@ -61,10 +61,12 @@
   margin-top: 10px;
 }
 
-.field-list {
+.field-list, .default-field-list {
   list-style-type: none;
   margin: 0px;
   padding: 0px;
+}
+.field-list {
   cursor: move;
 }
 


=====================================
plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
=====================================
--- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
+++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
@@ -22,6 +22,27 @@
 
 <h2><%= c_('Fields') %></h2>
 
+<ul class='default-field-list'>
+  <li>
+    <fieldset class="field-box">
+      <legend>
+        <%= _('This field will be added automatically to your form') %>
+      </legend>
+      <%= required f.label :name, c_('Name:') %>
+      <%= _('Name') %>
+    </fieldset>
+  </li>
+  <li>
+    <fieldset class="field-box">
+      <legend>
+        <%= _('This field will be added automatically to your form') %>
+      </legend>
+      <%= required f.label :name, c_('Name:') %>
+      <%= _('Email') %>
+    </fieldset>
+  </li>
+</ul>
+
 <ul class='field-list'>
   <%= f.fields_for :fields do |builder| %>
     <li>



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/5ef4eba7cac4a9a075c13218555f84555cfd6f6b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150918/deb0b7d4/attachment.html>


More information about the Noosfero-dev mailing list