[Git][noosfero/noosfero][master] 2 commits: Merge branch 'poll-preselected-alternative-option' into 'master-1.x'

Gabriel Silva gitlab at mg.gitlab.com
Thu May 10 16:58:06 BRT 2018


Gabriel Silva pushed to branch master at Noosfero / noosfero


Commits:
9776e797 by Gabriel Silva at 2018-05-10T19:30:47Z
Merge branch 'poll-preselected-alternative-option' into 'master-1.x'

custom-forms: add alternative preselected option on polls

See merge request noosfero/noosfero!1473

(cherry picked from commit 62b36fa3103093ae6f0b17c63e85266e4dc816f2)

cc03dd24 custom-forms: add alternative preselected option on polls
- - - - -
4d49fecb by Gabriel Silva at 2018-05-10T19:57:57Z
Merge branch 'cherry-pick-62b36fa3' into 'master'

Merge branch 'poll-preselected-alternative-option' into 'master-1.x'

See merge request noosfero/noosfero!1479
- - - - -


2 changed files:

- plugins/custom_forms/public/style.scss
- plugins/custom_forms/views/custom_forms_plugin_myprofile/_poll.html.erb


Changes:

=====================================
plugins/custom_forms/public/style.scss
=====================================
--- a/plugins/custom_forms/public/style.scss
+++ b/plugins/custom_forms/public/style.scss
@@ -161,13 +161,18 @@ tr.addition-buttons {
 }
 
 .poll-option {
-  width: 75%;
+  width: 50%;
   padding-left: 0px;
 }
 
+.poll-preselected {
+  text-align: center;
+  width: 20%;
+}
+
 .poll-remove {
   text-align: center;
-  width: 15%;
+  width: 20%;
 }
 
 .poll-type-icon {


=====================================
plugins/custom_forms/views/custom_forms_plugin_myprofile/_poll.html.erb
=====================================
--- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_poll.html.erb
+++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_poll.html.erb
@@ -25,6 +25,7 @@
       <tr>
         <th class="poll-type"><%= _('Type') %></th>
         <th class="poll-option"><%= _('Option') %></th>
+        <th class="poll-preselected"><%= _('Preselected') %></th>
         <th class="poll-remove"><%= _('Remove') %></th>
       </tr>
     </thead>
@@ -38,6 +39,9 @@
             <%= alternative.text_field(:label, placeholder: _('Add option'), class: 'poll-option-input', 'data-default-placeholder' => _('Option')) %>
             <%= alternative.hidden_field(:position) %>
           </td>
+          <td class="poll-preselected">
+            <%= alternative.check_box(:selected_by_default) %>
+          </td>
           <td class="poll-remove">
             <%= button_without_text :remove, _('Remove field'), '#', class: 'remove-poll-option' %>
             <%= alternative.hidden_field :_destroy, :class => 'destroy-field' %>
@@ -52,6 +56,9 @@
           <%= text_field_tag("form[fields_attributes][0][alternatives_attributes][#{field.alternatives.size}][label]", '', placeholder: _('Add option'), class: 'poll-option-input', 'data-default-placeholder' => _('Option')) %>
           <%= hidden_field_tag("form[fields_attributes][0][alternatives_attributes][#{field.alternatives.size}][position]", field.alternatives.size, class: 'poll-option-position') %>
         </td>
+        <td class="poll-preselected">
+          <%= check_box_tag("form[fields_attributes][0][alternatives_attributes][#{field.alternatives.size}][selected_by_default]", '1', false) %>
+        </td>
         <td class="poll-remove">
           <%= button_without_text :remove, _('Remove field'), '#', class: 'remove-poll-option' %>
         </td>



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/bc6473a5e83b660eeed47a8b52c5b44be854304d...4d49fecbb2c6ad7dcc7401ecea9c19e889c2a815

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/bc6473a5e83b660eeed47a8b52c5b44be854304d...4d49fecbb2c6ad7dcc7401ecea9c19e889c2a815
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180510/c1c307ad/attachment-0001.html>


More information about the Noosfero-dev mailing list