[Git][noosfero/noosfero][master-1.x] 3 commits: custom-forms: link to results on submission page
Rodrigo Souto
gitlab at mg.gitlab.com
Thu May 10 15:18:17 BRT 2018
Rodrigo Souto pushed to branch master-1.x at Noosfero / noosfero
Commits:
559d8349 by Rodrigo Souto at 2018-05-04T16:10:41Z
custom-forms: link to results on submission page
- - - - -
e4f82697 by Gabriel Silva at 2018-05-04T18:25:45Z
Refactos polls block style
Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>
- - - - -
61212016 by Rodrigo Souto at 2018-05-10T18:18:07Z
Merge branch 'custom-forms-layout' into 'master-1.x'
[CustomFormsPlugin] Layout improvements
See merge request noosfero/noosfero!1461
- - - - -
7 changed files:
- plugins/custom_forms/public/style.scss
- plugins/custom_forms/public/style/form_blocks.scss
- plugins/custom_forms/views/blocks/poll/_list_item.html.erb
- plugins/custom_forms/views/blocks/poll/_submission.html.erb
- plugins/custom_forms/views/custom_forms_plugin_profile/review.html.erb
- plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
- plugins/custom_forms/views/shared/_form_submission.html.erb
Changes:
=====================================
plugins/custom_forms/public/style.scss
=====================================
--- a/plugins/custom_forms/public/style.scss
+++ b/plugins/custom_forms/public/style.scss
@@ -104,6 +104,12 @@ tr.addition-buttons {
}
}
+.partial-results-link {
+ margin: 15px 0;
+ display: block;
+ text-align: center;
+}
+
#content #custom-forms-plugin_submission {
div.form-description {
margin-bottom: 20px;
@@ -147,7 +153,7 @@ tr.addition-buttons {
#custom-forms-plugin_submission .notify {
padding: 8px;
- color: rgba(0,0,0,0.5);
+ color: rgba(0, 0, 0, 0.6);
}
#custom-forms-plugin_submission .custom-form-options {
@@ -390,7 +396,7 @@ font-style: italic;
}
}
- ul.table-of-contents {
+ div.table-of-contents {
margin-top: 30px;
background-color: #eee;
padding-top: 20px;
@@ -398,7 +404,7 @@ font-style: italic;
padding: 20px 30px;
width: calc(50% - 60px);
- li:not(:last-child) {
+ ul li:not(:last-child) {
margin-bottom: 5px;
}
}
=====================================
plugins/custom_forms/public/style/form_blocks.scss
=====================================
--- a/plugins/custom_forms/public/style/form_blocks.scss
+++ b/plugins/custom_forms/public/style/form_blocks.scss
@@ -97,6 +97,7 @@
padding: 2px 3px;
border-radius: 3px;
color: white;
+ margin-right: 5px;
&.closed {
background-color: #ad0d0d;
@@ -140,6 +141,10 @@
flex-direction: column;
justify-content: space-between;
+ .partial-results-link {
+ margin: 0;
+ }
+
.form-submission {
margin-top: 5px;
overflow-y: auto;
@@ -150,13 +155,19 @@
display:flex;
flex-direction: column;
height: 100%;
+
+ div.notify {
+ text-align: center;
+ margin-top: 20px;
+ color: rgba(0, 0, 0, 0.6);
+ }
}
.no-results {
display: flex;
align-items: center;
justify-content: center;
- font-style: italic;
+ font-style: italic;
height: 100%;
text-align: center;
}
@@ -167,6 +178,7 @@
}
.formfield {
+ overflow: scroll;
padding: 10px 10px 3px 0px;
max-height: 120px;
white-space: pre-wrap;
@@ -190,21 +202,18 @@
align-items: flex-end;
display: flex;
- .icon-cancel, br {
+ a.icon-back, br {
display: none;
}
input.button {
+ margin: 0;
background-image: none;
width: 100%;
padding: 2px;
height: auto;
max-height: none;
}
-
- div.notify {
- display: none;
- }
}
}
@@ -261,12 +270,6 @@
margin-top: 15px;
}
-.partial-results-link {
- margin: 15px 0 5px;
- display: block;
- text-align: center;
-}
-
.queries-block-edition {
.queries-filter {
margin: 15px 0;
=====================================
plugins/custom_forms/views/blocks/poll/_list_item.html.erb
=====================================
--- a/plugins/custom_forms/views/blocks/poll/_list_item.html.erb
+++ b/plugins/custom_forms/views/blocks/poll/_list_item.html.erb
@@ -31,6 +31,13 @@
<% if form.expired? %>
<%= render partial: 'blocks/poll/results', locals: { form: form } %>
<% else %>
+ <% if form.show_results_for(user) %>
+ <%= link_to _('See partial results'),
+ { controller: 'custom_forms_plugin_profile', action: 'review',
+ id: form.identifier },
+ class: 'partial-results-link' %>
+ <% end %>
+
<%= render partial: 'blocks/poll/submission', locals: { form: form } %>
<% end %>
</div>
=====================================
plugins/custom_forms/views/blocks/poll/_submission.html.erb
=====================================
--- a/plugins/custom_forms/views/blocks/poll/_submission.html.erb
+++ b/plugins/custom_forms/views/blocks/poll/_submission.html.erb
@@ -9,10 +9,3 @@
<%= render partial: 'shared/form',
locals: { form: form, submission: submission } %>
<% end %>
-
-<% if form.show_results_for(current_person) %>
- <%= link_to _('See partial results'),
- { controller: 'custom_forms_plugin_profile', action: 'review',
- id: form.identifier },
- class: 'partial-results-link' %>
-<% end %>
=====================================
plugins/custom_forms/views/custom_forms_plugin_profile/review.html.erb
=====================================
--- a/plugins/custom_forms/views/custom_forms_plugin_profile/review.html.erb
+++ b/plugins/custom_forms/views/custom_forms_plugin_profile/review.html.erb
@@ -11,13 +11,16 @@
</div>
<% if @query_results.any? { |r| r['field'].present? } %>
- <ul class='table-of-contents'>
- <% @query_results.each do |result| %>
- <li>
- <%= link_to(result['field'], "##{result['field'].to_slug}") %>
- </li>
- <% end %>
- </ul>
+ <div class='table-of-contents'>
+ <span><%= _('Jump to question') %></span>
+ <ul>
+ <% @query_results.each do |result| %>
+ <li>
+ <%= link_to(result['field'], "##{result['field'].to_slug}") %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
<% end %>
<div class="overview">
=====================================
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
@@ -18,6 +18,13 @@
<%= (@form.description || "").html_safe %>
</div>
+ <% if @form.show_results_for(user) %>
+ <%= link_to _('See partial results'),
+ { controller: 'custom_forms_plugin_profile', action: 'review',
+ id: @form.identifier },
+ class: 'partial-results-link' %>
+ <% end %>
+
<% if @submission.id.nil? %>
<% if @form.expired? %>
<% if @form.will_open? %>
=====================================
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,6 +1,5 @@
<% self.extend(CustomFormsPlugin::Helper) %>
<div class='form-submission <%= form.kind %>'>
-
<% form.fields.each do |field| %>
<%= display_custom_field(field, submission, f.object_name).html_safe %>
<% end %>
@@ -8,5 +7,4 @@
<% if submission.id.present? %>
<div class="reply-message"><%= _('This was your answer.')%></div>
<% end %>
-
</div>
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/a97a557e5e7880244d154f982241c16ff2f72150...612120166997945fb84343f1566cf112d5d311da
--
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/a97a557e5e7880244d154f982241c16ff2f72150...612120166997945fb84343f1566cf112d5d311da
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/78b7eb69/attachment-0001.html>
More information about the Noosfero-dev
mailing list