Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New design of the forms for creating debates and proposals #4225

Merged
merged 24 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
755ad33
Move debate form partial to a component
javierm Jul 9, 2021
4150d7f
Move proposals form partial to a component
javierm Jul 9, 2021
ab0fd86
Show globalize locales after the errors
javierm Jul 9, 2021
7a1acf5
Rename proposal-form HTML class to proposal-new
javierm Jul 9, 2021
7bc55f7
Rename debate-form HTML classes
javierm Jul 9, 2021
b162ad5
Remove row and column divs in debate/proposal form
javierm Jul 9, 2021
a14cf4f
Simplify padding rules for SDG selector
javierm Jul 9, 2021
461df61
Fix investment form padding in Internet Explorer
javierm Jul 9, 2021
10f7183
Remove no longer necessary participation icons CSS
javierm Jul 10, 2021
6d03b32
Simplify new investment layout
javierm Jul 9, 2021
937450f
Simplify new investment header HTML
javierm Jul 9, 2021
640a0ba
Move new budget investment view to a component
javierm Jul 10, 2021
9effc10
Include organization name in header title concern
javierm Jul 10, 2021
a71d132
Add a title to the create investment page
javierm Jul 10, 2021
c454245
Group styles setting padding to the main content
javierm Jul 10, 2021
8398d17
Allow more elements in investment form header
javierm Jul 10, 2021
a0ea206
Move new debate view to a component
javierm Jul 10, 2021
211bcb8
Move new proposal view to a component
javierm Jul 10, 2021
909fd00
Update styles and layout for new debates form
decabeza Jun 8, 2020
578f343
Update styles and layout for new proposals form
decabeza Jun 10, 2020
cb800d0
Remove recommendations editing a topic
javierm Jul 10, 2021
932da00
Update new topic form layout
javierm Jul 10, 2021
e7b37ae
Increase font-size in recommendations
javierm Jul 10, 2021
0dfabc8
Use a Font Awesome icon in recommendations
javierm Jul 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/stylesheets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ $table-header: #ecf1f6;
}

.admin-content {
.proposal-form {
.proposal-new {
padding-top: 0;
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
@import "tags";
@import "admin/**/*";
@import "budgets/**/*";
@import "debates/**/*";
@import "layout/**/*";
@import "proposals/**/*";
@import "sdg/**/*";
@import "sdg_management/*";
@import "sdg_management/**/*";
Expand Down
61 changes: 1 addition & 60 deletions app/assets/stylesheets/budgets/investments/form.scss
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
.budget-investment-form {

.required-fields {
@include full-width-background($adjust-padding: true);
background: $light;
margin-bottom: $line-height;
padding-top: $line-height;
}

> fieldset > legend {
float: left;
font-size: rem-calc(36);
font-weight: bold;
margin-bottom: $line-height;
text-transform: uppercase;

+ * {
clear: left;
}
}

select {
min-height: $line-height * 2;

@include breakpoint(medium) {
&:not(.js-add-language):not(.js-select-language) {
width: 50%;
}
}
}

.globalize-languages,
.translatable-fields {
@include grid-row-nest;
@include grid-column-gutter;
}

.sdg-related-list-selector {
padding-left: 0;
padding-right: 0;
}

[type="submit"] {
@include regular-button;
font-size: map-get($button-sizes, large);
margin-top: $line-height;
}

.actions {
border: 6px solid $border;
border-radius: rem-calc(12);
margin-left: auto;
margin-right: auto;
margin-top: $line-height * 2;
padding: $line-height * 2 $line-height;
text-align: center;

@include breakpoint(medium) {
width: 75%;
}
}
@extend %public-form;
}
82 changes: 2 additions & 80 deletions app/assets/stylesheets/budgets/investments/new.scss
Original file line number Diff line number Diff line change
@@ -1,85 +1,7 @@
.budget-investment-new {
$border-width: 4px;
@include grid-column-gutter;

> :first-child:not(.print-info) {
@include full-width-background($adjust-padding: true);
background: $light;
margin-top: -$line-height;
padding-top: $line-height;
}
@extend %public-form-header;

h1 {
margin-bottom: 0;
}

header {
@include has-fa-icon(building, regular, after);
align-items: center;
background-color: $body-background;
border: $border-width solid;
color: $brand-secondary;
border-bottom-right-radius: rem-calc(12);
border-top-right-radius: rem-calc(12);
display: flex;
margin-top: $line-height * 2;

@include breakpoint(large) {
padding-right: $line-height;
}

&::after {
display: none;

@include breakpoint(large) {
display: block;
font-size: rem-calc(100);
margin-left: $line-height;
}
}

h1 {
@include brand-background($brand-secondary);
@include background-till-left-of-screen;
@include has-fa-icon(chart-pie, solid, after);
align-items: center;
display: flex;
flex: 1;
font-size: rem-calc(36);
padding: $line-height * 2 0;

@include breakpoint(large) {
clip-path: polygon(
-100vw -#{$border-width},
100% -#{$border-width},
calc(100% - #{rem-calc(20)}) 50%,
100% calc(100% + #{$border-width}),
-100vw calc(100% + #{$border-width})
);
font-size: rem-calc(44);
}

&::before {
top: -$border-width;
height: calc(100% + 2 * #{$border-width});
}

&::after {
display: none;

@include breakpoint(medium) {
display: block;
font-size: 2em;
margin-left: auto;
margin-right: rem-calc(60);
}
}

span span {
display: block;
font-size: 0.75em;
margin-top: $line-height / 2;
}
}
@include has-fa-icon(chart-pie, solid, after);
}
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/debates/form.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.debate-form {
@extend %public-form;
}
15 changes: 15 additions & 0 deletions app/assets/stylesheets/debates/new.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.debate-new {
@extend %public-form-header;

h1 {
@include has-fa-icon(comment-alt, regular, after);
}

aside {
margin-top: $line-height;
}

.recommendations li::before {
color: $debates;
}
}
14 changes: 14 additions & 0 deletions app/assets/stylesheets/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ body {
}
}

main {
display: block;

&.budget-investment-new,
&.debate-new,
&.proposal-new,
&.sdg-goals-index,
&.sdg-goal-show,
&.topic-edit,
&.topic-new {
@include grid-column-gutter;
}
}

h1,
h2,
h3,
Expand Down
178 changes: 178 additions & 0 deletions app/assets/stylesheets/mixins/forms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
@import "mixins/icons";
@import "mixins/layouts";

@mixin public-form-header {
$border-width: 4px;

h1 {
margin-bottom: 0;
}

header {
$icon-size: $line-height * 4;
$padding-right: rem-calc(20);
$icon-size-with-padding: $icon-size + $padding-right;
$polygon-size: $icon-size / 2;
@include background-till-left-of-screen;
@include brand-background($brand-secondary);
border: $border-width solid $brand-secondary;
border-bottom-right-radius: rem-calc(12);
border-top-right-radius: rem-calc(12);
margin-top: $line-height * 2;
padding: $line-height * 2 0;
position: relative;

@include breakpoint(small) {
&::after {
display: none;
}
}

@include breakpoint(large) {
$rounding-error: 6px;
padding-right: $icon-size-with-padding;
background-image: linear-gradient(
to right,
#{$brand-secondary} 0,
#{$brand-secondary} calc(100% - #{$icon-size-with-padding} - 1px),
#{$body-background} calc(100% - #{$icon-size-with-padding}),
#{$body-background} 100%
);

&::after {
background: $body-background;
content: "";
clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% calc(100% + 1px), 0 50%);
display: block;
position: absolute;
right: calc(#{$icon-size-with-padding} - #{$rounding-error});
top: 0;
height: 100%;
width: $polygon-size;
}
}

&::before {
top: -$border-width;
height: calc(100% + #{$border-width * 2});
}

h1 {
$heading-icon-size: $icon-size * 0.85;
@include has-fa-icon(building, regular);
font-size: rem-calc(36);

@include breakpoint(small) {
&::after,
&::before {
display: none;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}

@include breakpoint(medium) {
padding-right: $heading-icon-size * 2.5;

&::after {
display: block;
font-size: $heading-icon-size;
right: $heading-icon-size;
}
}

@include breakpoint(large) {
font-size: rem-calc(44);

&::after {
right: $icon-size-with-padding + $polygon-size + $heading-icon-size / 2;
}

&::before {
color: $brand-secondary;
display: block;
font-size: $icon-size;
right: $padding-right;
}
}

span {
display: block;
font-size: 0.75em;
margin-top: $line-height / 2;
}
}

a {
color: inherit;
text-decoration: underline;
}
}
}

%public-form-header {
@include public-form-header;
}

@mixin public-form {

.required-fields {
@include full-width-background($adjust-padding: true);
background: $light;
margin-bottom: $line-height;
padding-top: $line-height;
}

> fieldset > legend {
float: left;
font-size: rem-calc(36);
font-weight: bold;
margin-bottom: $line-height;
text-transform: uppercase;

+ * {
clear: left;
}
}

select {
min-height: $line-height * 2;

@include breakpoint(medium) {
&:not(.js-add-language):not(.js-select-language) {
width: 50%;
}
}
}

.globalize-languages,
.translatable-fields {
@include grid-row-nest;
@include grid-column-gutter;
}

[type="submit"] {
@include regular-button;
font-size: map-get($button-sizes, large);
margin-top: $line-height;
}

.actions {
border: 6px solid $border;
border-radius: rem-calc(12);
margin-left: auto;
margin-right: auto;
margin-top: $line-height * 2;
padding: $line-height * 2 $line-height;
text-align: center;

@include breakpoint(medium) {
width: 75%;
}
}
}

%public-form {
@include public-form;
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/mixins/layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
position: relative;

&::before {
background: inherit;
background-color: inherit;
content: "";
height: 100%;
position: absolute;
Expand Down
Loading