[Git][noosfero/noosfero][master-1.x] 2 commits: [CustomForms] Requires confirmation on form submission

Rodrigo Souto gitlab at mg.gitlab.com
Thu May 3 19:03:58 BRT 2018


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


Commits:
b80ae530 by Gabriel Silva at 2018-05-03T21:21:59Z
[CustomForms] Requires confirmation on form submission

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

- - - - -
af25727d by Rodrigo Souto at 2018-05-03T22:03:44Z
Merge branch 'custom-forms-confirmation' into 'master-1.x'

[CustomFormsPlugin] Improvements on submission page

See merge request noosfero/noosfero!1454
- - - - -


2 changed files:

- plugins/custom_forms/views/shared/_form.html.erb
- plugins/custom_forms/views/shared/_form_submission.html.erb


Changes:

=====================================
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
@@ -12,12 +12,14 @@
 
   <div class="notify"><%= _("Your e-mail will be visible to this form's owners.") %></div>
   <%= button_bar do %>
+    <% label = form.kind == 'poll' ? _('Vote!') : _('Send') %>
     <% if form.expired? %>
-      <%= submit_button :save, c_('Send'), disabled: '', class: 'disabled',
-                        cancel: { controller: :profile, profile:  profile.identifier } %>
+      <%= submit_button :save, label, disabled: '', class: 'disabled',
+                        data: { confirm: _('Are you sure your want to submit your vote?') } %>
     <% else %>
-      <%= submit_button :save, c_('Send'),
-                        cancel: { controller: :profile, profile: profile.identifier } %>
+      <%= submit_button :save, label,
+                        data: { confirm: _('Are you sure your want to submit your vote?') } %>
     <% end %>
+    <%= button :back, _('Go back'), controller: :profile, profile: profile.identifier %>
   <% end %>
 <% end %>


=====================================
plugins/custom_forms/views/shared/_form_submission.html.erb
=====================================
--- a/plugins/custom_forms/views/shared/_form_submission.html.erb
+++ b/plugins/custom_forms/views/shared/_form_submission.html.erb
@@ -1,5 +1,5 @@
 <% self.extend(CustomFormsPlugin::Helper) %>
-<div class='form-submission'>
+<div class='form-submission <%= form.kind %>'>
 
   <% form.fields.each do |field| %>
     <%= display_custom_field(field, submission, f.object_name).html_safe %>



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ba8c120872ee68a73cd03c6bb49367721f395952...af25727dc8894dae3bf35839bf98d4d79173ac20

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ba8c120872ee68a73cd03c6bb49367721f395952...af25727dc8894dae3bf35839bf98d4d79173ac20
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/20180503/59bb7f77/attachment-0001.html>


More information about the Noosfero-dev mailing list