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

Conversation

decabeza
Copy link
Collaborator

References

⚠️ This PR should be merge after #4198.

Objectives

According to the new designs introduced in #4198 for participatory budgets, this PR includes a new design of the forms for creating debates and proposals.

Visual Changes

New debate form

debates_form

New proposal form

proposals_form

We're going to rewrite most of the code, so we might as well treat it
like we treat new files.
@javierm javierm changed the base branch from admin_budgets to master July 10, 2021 16:30
@javierm javierm force-pushed the forms-design branch 4 times, most recently from 9f1c763 to c23a8b1 Compare July 10, 2021 17:09
@javierm javierm self-assigned this Jul 10, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Jul 10, 2021
@javierm javierm force-pushed the forms-design branch 2 times, most recently from 23e4ec6 to 94e3c4f Compare July 10, 2021 22:34
@taitus taitus self-assigned this Jul 12, 2021
Consul Democracy automation moved this from Reviewing to Testing Jul 13, 2021
javierm and others added 22 commits July 13, 2021 15:25
Just like it's done in the investment form.
So it's consistent with the proposal-edit class we use in the edit
action.
So they follow the same convention used in proposals.

Note the styles are for elements which appear in the "new" view but not
in the "edit" view, so we only have to include them in one place.
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.
Now the padding is only applied in two places (administration forms) so
we can apply it just there instead of applying it everywhere and then
removing it in most places. We're using the `column` class here because
it's what's used in the rest of the fields of these forms and because we
haven't defined (yet) general margin/padding rules for the
administration views.
It looks like Internet Explorer wasn't applying the padding to the
<main> element because it considered it an inline element.
The `icon-budget` hasn't been used in this context for a long time;
maybe since commit d0b8fef.

The `document-form` class was removed in commit 6c1d828.

Finally, the `topic-new` and `topic-form` were removed in commit
c887cb7.
We had an additional `<div>` just to add a background color, when we can
do it by applying the background color to the whole `<main>` element and
then the body background color to the optional fields.

However, I've decided not to do so. The main purpose of changing the
background color is to highlight the required fields. The benefits of
changing the background color of the header as well are unclear. When in
doubt, we're using the solution which requires less code.
In commit 49b4061 we added an extra `<span>` element just so we could
add an icon to the right while maintaining both the title and subtitle
on the left.

We can do the same thing without the extra `<span>` element, absolutely
positioning the element and leaving enough padding.
That way we'll be able to simplify some of the code.
The organization name is helpful to screen reader users when they've got
several tabs/windows open with different sites.
So we don't add the same lines to pretty much every stylesheet we
create.

Eventually we'll remove this code and add a padding to every <main>
element, or (even better) to the <body> element itself.
Since we're going to reuse this pattern in other forms, we shouldn't
rely on the header having just one element. There could be a subtitle.
So we're changing the CSS to be less dependent on a very specific HTML
structure.

Regarding the subtitle, the original idea was to have both an <h1> and
an <h2> element inside the header. However, the W3C advices against it
[1]:

> h1–h6 elements must not be used to markup subheadings, subtitles,
> alternative titles and taglines unless intended to be the heading for
> a new section or subsection.

So we ended up including the subtitle inside he <h1>. We could also add
it in a separate <p> tag. However, in this case I think it's better to
include it in the <h1> (and in the <title> tag) because it helps to
uniquely identify the current page from other pages.

Due to some rounding issues in Firefox, we're manually moving the polygon
6px so there isn't a blank space between it and the icon on the right.
And due to rounding issues in Chrome, we're adding one extra pixel to
the bottom of the polygon defining the clip-path.

[1] https://www.w3.org/TR/html52/common-idioms-without-dedicated-elements.html#common-idioms-without-dedicated-elements
The same way we don't show recommendations when editing a proposal or a
debate.
The same way we did with debates and proposals, we move recommendations
before the form.
Now that we display them in one column, the lines were too long for a
small font size.
We've deprecated the "icons" font since we started using Font Awesome
two years ago and using it caused some screen readers to announce an "l"
before the content of every list item.
@javierm javierm merged commit 3f9614f into master Jul 13, 2021
Consul Democracy automation moved this from Testing to Release 1.4.0 Jul 13, 2021
@javierm javierm deleted the forms-design branch July 13, 2021 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants