[Git][noosfero/noosfero][master-1.x] 2 commits: Improves custom forms query layout

Rodrigo Souto gitlab at mg.gitlab.com
Mon Apr 30 19:47:55 BRT 2018


Rodrigo Souto pushed to branch master-1.x at Noosfero / noosfero


Commits:
8d5a759d by Gabriel Silva at 2018-04-30T22:11:23Z
Improves custom forms query layout

Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>

- - - - -
916c7ef1 by Rodrigo Souto at 2018-04-30T22:47:34Z
Merge branch 'custom-forms-view' into 'master-1.x'

[CustomFormsPlugin] Improves form layout

See merge request noosfero/noosfero!1448
- - - - -


4 changed files:

- plugins/custom_forms/lib/custom_forms_plugin/helper.rb
- plugins/custom_forms/public/style.scss
- plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
- plugins/custom_forms/views/shared/_form.html.erb


Changes:

=====================================
plugins/custom_forms/lib/custom_forms_plugin/helper.rb
=====================================
--- a/plugins/custom_forms/lib/custom_forms_plugin/helper.rb
+++ b/plugins/custom_forms/lib/custom_forms_plugin/helper.rb
@@ -110,12 +110,14 @@ module CustomFormsPlugin::Helper
     when 'check_box'
       field.alternatives.map do |alternative|
         default = answer.present? ? answer.value.split(',').include?(alternative.id.to_s) : alternative.selected_by_default
-        labelled_check_box alternative.label, form.to_s + "[#{field.id}][#{alternative.id}]", '1', default, :disabled => display_disabled?(field, answer)
+        alternative = labelled_check_box alternative.label, form.to_s + "[#{field.id}][#{alternative.id}]", '1', default, :disabled => display_disabled?(field, answer)
+        content_tag(:div, alternative, class: 'field-alternative-row')
       end.join("\n")
     when 'radio'
       field.alternatives.map do |alternative|
         default = answer.present? ? answer.value == alternative.id.to_s : alternative.selected_by_default
-        labelled_radio_button alternative.label, form.to_s + "[#{field.id}]", alternative.id, default, :disabled => display_disabled?(field, answer)
+        alternative = labelled_radio_button alternative.label, form.to_s + "[#{field.id}]", alternative.id, default, :disabled => display_disabled?(field, answer)
+        content_tag(:div, alternative, class: 'field-alternative-row')
       end.join("\n")
     end
   end


=====================================
plugins/custom_forms/public/style.scss
=====================================
--- a/plugins/custom_forms/public/style.scss
+++ b/plugins/custom_forms/public/style.scss
@@ -104,6 +104,47 @@ tr.addition-buttons {
   }
 }
 
+#content #custom-forms-plugin_submission {
+  div.form-description {
+    margin-bottom: 20px;
+  }
+
+  .query-form .form-submission {
+    border-top: 1px solid #777;
+    padding-top: 10px;
+
+    .formfieldline {
+      margin-bottom: 25px;
+
+      label {
+        font-size: 16px;
+      }
+
+      .formfield {
+        margin-top: 10px;
+
+        input[type=text] {
+          width: 100%;
+          height: 24px;
+        }
+
+        select {
+          width: 50%;
+          height: 30px;
+        }
+
+        .field-alternative-row {
+          margin-top: 5px;
+
+          label {
+            margin-left: 10px;
+          }
+        }
+      }
+    }
+  }
+}
+
 #custom-forms-plugin_submission .notify {
   padding: 8px;
   color: rgba(0,0,0,0.5);


=====================================
plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
=====================================
--- a/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
+++ b/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
@@ -14,7 +14,9 @@
     </div>
   <% end %>
 
-  <%= (@form.description || "").html_safe %>
+  <div class='form-description'>
+    <%= (@form.description || "").html_safe %>
+  </div>
 
   <% if @submission.id.nil? %>
     <% if @form.expired? %>


=====================================
plugins/custom_forms/views/shared/_form.html.erb
=====================================
--- a/plugins/custom_forms/views/shared/_form.html.erb
+++ b/plugins/custom_forms/views/shared/_form.html.erb
@@ -10,6 +10,7 @@
   <%= render :partial => 'shared/form_submission',
              :locals => { form: form, submission: submission, f: f } %>
 
+  <div class="notify"><%= _("Your e-mail will be visible to this form's owners.") %></div>
   <%= button_bar do %>
     <% if form.expired? %>
       <%= submit_button :save, c_('Send'), disabled: '', class: 'disabled',
@@ -18,7 +19,5 @@
       <%= submit_button :save, c_('Send'),
                         cancel: { controller: :profile, profile: profile.identifier } %>
     <% end %>
-    <div class="notify"><%= _("Your e-mail will be visible to this form's owners.") %></div>
   <% end %>
-
 <% end %>



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/e18fc02434ba82049f962e13ab5904a2a8b59cc6...916c7ef1430c6fb562119763f15ad90824b15a69

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/e18fc02434ba82049f962e13ab5904a2a8b59cc6...916c7ef1430c6fb562119763f15ad90824b15a69
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/20180430/f4356d01/attachment-0001.html>


More information about the Noosfero-dev mailing list