Remove row and column divs in debate/proposal form
We don't need any row classes anymore because the <body> already has a maximum width. As for columns, we only have one column in this form, so we don't need them either. Besides, the form's parent element already has a padding.
This commit is contained in:
@@ -38,7 +38,9 @@
|
||||
@import "tags";
|
||||
@import "admin/**/*";
|
||||
@import "budgets/**/*";
|
||||
@import "debates/**/*";
|
||||
@import "layout/**/*";
|
||||
@import "proposals/**/*";
|
||||
@import "sdg/**/*";
|
||||
@import "sdg_management/*";
|
||||
@import "sdg_management/**/*";
|
||||
|
||||
13
app/assets/stylesheets/debates/form.scss
Normal file
13
app/assets/stylesheets/debates/form.scss
Normal file
@@ -0,0 +1,13 @@
|
||||
.debate-form {
|
||||
|
||||
.globalize-languages,
|
||||
.translatable-fields {
|
||||
@include grid-row-nest;
|
||||
@include grid-column-gutter;
|
||||
}
|
||||
|
||||
.sdg-related-list-selector {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
14
app/assets/stylesheets/proposals/form.scss
Normal file
14
app/assets/stylesheets/proposals/form.scss
Normal file
@@ -0,0 +1,14 @@
|
||||
.proposal-form {
|
||||
|
||||
.globalize-languages,
|
||||
.translatable-fields {
|
||||
@include grid-row-nest;
|
||||
@include grid-column-gutter;
|
||||
}
|
||||
|
||||
.sdg-related-list-selector {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,47 @@
|
||||
<%= translatable_form_for(debate) do |f| %>
|
||||
<%= translatable_form_for(debate, html: { class: "debate-form" }) do |f| %>
|
||||
<%= render "shared/errors", resource: debate %>
|
||||
|
||||
<%= render "shared/globalize_locales", resource: debate %>
|
||||
|
||||
<div class="row column">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title,
|
||||
maxlength: Debate.title_max_length,
|
||||
data: suggest_data(debate) %>
|
||||
</div>
|
||||
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div>
|
||||
<%= translations_form.text_field :title,
|
||||
maxlength: Debate.title_max_length,
|
||||
data: suggest_data(debate) %>
|
||||
</div>
|
||||
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :description,
|
||||
maxlength: Debate.description_max_length,
|
||||
class: "html-area" %>
|
||||
</div>
|
||||
<div>
|
||||
<%= translations_form.text_area :description,
|
||||
maxlength: Debate.description_max_length,
|
||||
class: "html-area" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.invisible_captcha :subtitle %>
|
||||
|
||||
<div>
|
||||
<%= f.text_field :tag_list, value: debate.tag_list.to_s,
|
||||
hint: t("debates.form.tags_instructions"),
|
||||
placeholder: t("debates.form.tags_placeholder"),
|
||||
data: { js_url: suggest_tags_path },
|
||||
class: "tag-autocomplete" %>
|
||||
</div>
|
||||
|
||||
<%= render SDG::RelatedListSelectorComponent.new(f) %>
|
||||
|
||||
<div>
|
||||
<% if debate.new_record? %>
|
||||
<%= f.check_box :terms_of_service,
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.invisible_captcha :subtitle %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :tag_list, value: debate.tag_list.to_s,
|
||||
hint: t("debates.form.tags_instructions"),
|
||||
placeholder: t("debates.form.tags_placeholder"),
|
||||
data: { js_url: suggest_tags_path },
|
||||
class: "tag-autocomplete" %>
|
||||
</div>
|
||||
|
||||
<%= render SDG::RelatedListSelectorComponent.new(f) %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<% if debate.new_record? %>
|
||||
<%= f.check_box :terms_of_service,
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="actions small-12 column">
|
||||
<%= f.submit(class: "button", value: t("debates.#{action_name}.form.submit_button")) %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit(class: "button", value: t("debates.#{action_name}.form.submit_button")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,108 +1,106 @@
|
||||
<%= translatable_form_for(proposal, url: url) do |f| %>
|
||||
<%= translatable_form_for(proposal, url: url, html: { class: "proposal-form" }) do |f| %>
|
||||
<%= render "shared/errors", resource: proposal %>
|
||||
|
||||
<%= render "shared/globalize_locales", resource: proposal %>
|
||||
|
||||
<div class="row column">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title,
|
||||
maxlength: Proposal.title_max_length,
|
||||
data: suggest_data(proposal) %>
|
||||
</div>
|
||||
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div>
|
||||
<%= translations_form.text_field :title,
|
||||
maxlength: Proposal.title_max_length,
|
||||
data: suggest_data(proposal) %>
|
||||
</div>
|
||||
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :summary,
|
||||
rows: 4, maxlength: 200,
|
||||
hint: t("proposals.form.proposal_summary_note") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :description,
|
||||
maxlength: Proposal.description_max_length,
|
||||
class: "html-area" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.invisible_captcha :subtitle %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :video_url, hint: t("proposals.form.proposal_video_url_note") %>
|
||||
<div>
|
||||
<%= translations_form.text_area :summary,
|
||||
rows: 4, maxlength: 200,
|
||||
hint: t("proposals.form.proposal_summary_note") %>
|
||||
</div>
|
||||
|
||||
<% if feature?(:allow_images) %>
|
||||
<div class="images small-12 column">
|
||||
<%= render "images/nested_image", imageable: proposal, f: f %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:allow_attached_documents) %>
|
||||
<div class="documents small-12 column">
|
||||
<%= render "documents/nested_documents", documentable: proposal, f: f %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.select :geozone_id, geozone_select_options,
|
||||
include_blank: t("geozones.none") %>
|
||||
<div>
|
||||
<%= translations_form.text_area :description,
|
||||
maxlength: Proposal.description_max_length,
|
||||
class: "html-area" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:map) %>
|
||||
<div class="small-12 column">
|
||||
<%= render "map_locations/form_fields",
|
||||
form: f,
|
||||
map_location: proposal.map_location || MapLocation.new,
|
||||
label: t("proposals.form.map_location"),
|
||||
help: t("proposals.form.map_location_instructions"),
|
||||
remove_marker_label: t("proposals.form.map_remove_marker"),
|
||||
parent_class: "proposal",
|
||||
i18n_namespace: "proposals" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.invisible_captcha :subtitle %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :tag_list, t("proposals.form.tags_label") %>
|
||||
<p class="help-text" id="tag-list-help-text"><%= t("proposals.form.tags_instructions") %></p>
|
||||
<div>
|
||||
<%= f.text_field :video_url, hint: t("proposals.form.proposal_video_url_note") %>
|
||||
</div>
|
||||
|
||||
<div id="category_tags" class="tags">
|
||||
<%= f.label :category_tag_list, t("proposals.form.tag_category_label") %>
|
||||
<% categories.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<%= f.text_field :tag_list, value: proposal.tag_list.to_s,
|
||||
label: false,
|
||||
placeholder: t("proposals.form.tags_placeholder"),
|
||||
class: "js-tag-list tag-autocomplete",
|
||||
aria: { describedby: "tag-list-help-text" },
|
||||
data: { js_url: suggest_tags_path } %>
|
||||
<% if feature?(:allow_images) %>
|
||||
<div class="images">
|
||||
<%= render "images/nested_image", imageable: proposal, f: f %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.unverified? %>
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :responsible_name,
|
||||
hint: t("proposals.form.proposal_responsible_name_note") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if feature?(:allow_attached_documents) %>
|
||||
<div class="documents">
|
||||
<%= render "documents/nested_documents", documentable: proposal, f: f %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render SDG::RelatedListSelectorComponent.new(f) %>
|
||||
<div>
|
||||
<%= f.select :geozone_id, geozone_select_options,
|
||||
include_blank: t("geozones.none") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<% if proposal.new_record? %>
|
||||
<%= f.check_box :terms_of_service,
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
<% if feature?(:map) %>
|
||||
<div>
|
||||
<%= render "map_locations/form_fields",
|
||||
form: f,
|
||||
map_location: proposal.map_location || MapLocation.new,
|
||||
label: t("proposals.form.map_location"),
|
||||
help: t("proposals.form.map_location_instructions"),
|
||||
remove_marker_label: t("proposals.form.map_remove_marker"),
|
||||
parent_class: "proposal",
|
||||
i18n_namespace: "proposals" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= f.label :tag_list, t("proposals.form.tags_label") %>
|
||||
<p class="help-text" id="tag-list-help-text"><%= t("proposals.form.tags_instructions") %></p>
|
||||
|
||||
<div id="category_tags" class="tags">
|
||||
<%= f.label :category_tag_list, t("proposals.form.tag_category_label") %>
|
||||
<% categories.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="actions small-12 column">
|
||||
<%= f.submit(class: "button", value: t("proposals.#{action_name}.form.submit_button")) %>
|
||||
<br>
|
||||
<%= f.text_field :tag_list, value: proposal.tag_list.to_s,
|
||||
label: false,
|
||||
placeholder: t("proposals.form.tags_placeholder"),
|
||||
class: "js-tag-list tag-autocomplete",
|
||||
aria: { describedby: "tag-list-help-text" },
|
||||
data: { js_url: suggest_tags_path } %>
|
||||
</div>
|
||||
|
||||
<% if current_user.unverified? %>
|
||||
<div>
|
||||
<%= f.text_field :responsible_name,
|
||||
hint: t("proposals.form.proposal_responsible_name_note") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render SDG::RelatedListSelectorComponent.new(f) %>
|
||||
|
||||
<div>
|
||||
<% if proposal.new_record? %>
|
||||
<%= f.check_box :terms_of_service,
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit(class: "button", value: t("proposals.#{action_name}.form.submit_button")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="debate-edit row">
|
||||
<div class="debate-edit">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="debate-new row">
|
||||
<div class="debate-new">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= back_link_to debates_path %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="proposal-edit row">
|
||||
<div class="proposal-edit">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="proposal-new row">
|
||||
<div class="proposal-new">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
Reference in New Issue
Block a user