Commit Graph

226 Commits

Author SHA1 Message Date
Javi Martín
d45bf4d5da Remove redundant menu link colors
The color is inherited from the `.top-bar .menu > li a` selector.
2021-06-29 19:41:58 +02:00
Javi Martín
41235f9f02 Remove obsolete menu-text styles
Since commit dcec003d0 we're only using the menu-text class in the admin
layouts. So instead of defining styles for menu-text and then
overwriting them in the admin section, we can define them just in the
admin section.

Since we don't have <img> tags in the menu-text element in the admin
section, we can remove their styles. And we can also remove the styles
we were overriding twice (like `line-height`).
2021-06-29 19:41:58 +02:00
Javi Martín
bc0f040758 Use order links in legislation proposals admin
As mentioned in the previous commits, a `<select>` field which submits
its form on change causes many accessibility and usability issues, so
we're replacing it with the order links we use everywhere else.

Since the links "Id" and "Title" by themselves don't have enough
information to let users know they're used to sort by ID or title, we
have to update them somehow. We could add a "Sort by:" prefix before the
list of links (and associate it with the `aria-labelledby` attribute);
however, we don't do this anywhere else and might look weird depending
on the screen size.

So we're simply adding "Sort by" before each link.

Now that we don't use the `wide_order_selector` partial anymore, we can
remove it alongside the styles for the `select-order` class.
2021-06-28 01:20:39 +02:00
Javi Martín
227a5868b8 Use order links in moderation section
Using order links in this case causes an unusual interface, where we
show filter links, then information about the number of results, and
then order links.

Whether or not this makes sense needs to be confirmed with usability
tests. In any case, this is still way better than using `<select>`
fields which automatically change to a new page, since they cause
problems to keyboard users, are harder to select for touchscreen users,
might confuse screen reader users who will notice a form but no way to
submit it, and are not elements we generally use to let users choose the
order of the records.

For a more detailed explanation of these issues, check the commit
message in the commit "Use order links to sort comments and topics"
(just a few commits ago).
2021-06-28 00:15:08 +02:00
Javi Martín
125f0bc73a Fix font size on column selector label
It was duplicating the `$base-font-size` value, and it was using pixels
as a unit, which we only use in the `$base-font-size` variable.
2021-06-17 01:41:40 +02:00
Javi Martín
7f38f61bc1 Merge pull request #4539 from consul/system_emails_preview
Fix custom system emails preview
2021-06-16 12:25:15 +02:00
Julian Herrero
0b81f7f621 Allow creating a budget in single or multiple mode
Co-Authored-By: decabeza <alberto@decabeza.es>
2021-06-11 00:28:56 +02:00
decabeza
d78f2e03ad Render link to budget header
- Allow to define a link (text and url) on budget form for render on the budget
header.
- Improve styles

Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
2021-06-09 19:16:55 +02:00
Javi Martín
f110e65f80 Allow enabling/disabling phases in budgets wizard
So now there's no need to edit each phase individually to enable/disable
them.

We aren't doing the same thing in the form to edit a budget because we
aren't sure about possible usability issues. On one hand, in some tables
we automatically update records when we mark a checkbox, so users might
expect that. On the other hand, having a checkbox in the middle of a
form which updates the database automatically is counter-intuitive,
particularly when right below that table there are other checkboxes
which don't update the database until the form is submitted.

So, either way, chances are users would think they've updated the phases
(or kept them intact) while the opposite would be true.

In the form within the wizard to create a budget that problem isn't that
important because there aren't any other fields in the form and it's
pretty intuitive that what users do will have no effect until they press
the "Finish" button.

Co-Authored-By: Julian Nicolas Herrero <microweb10@gmail.com>
2021-06-08 18:45:55 +02:00
decabeza
0e0681c0fb Hide border on system emails preview 2021-06-07 12:40:39 +02:00
Javi Martín
cc69b81ec1 Simplify styles for the menu button
Using `currentcolor` and `color: inherit` is IMHO more expressive (we're
saying we want to use the same color as the text) and makes it easier to
customize these colors in other CONSUL installations. We also remove
duplication as we can use the same styles for both the admin and the
public layouts.
2021-06-02 17:06:40 +02:00
Javi Martín
4bb12c573f Fix invisible text selection on brand text
When an element had a text using the brand color and was a child of an
element with a brand background, the selection was invisible.
2021-03-24 15:48:24 +01:00
Javi Martín
a2a6ae7bdd Use a caption to identify budget phases table
This makes the table easier to identify when writing tests and using
screen readers.

Since we do not render any other table captions anywhere else, we're
making the caption invisible so only screen reader users will be
affected by this change.
2021-03-11 19:37:58 +01:00
Javi Martín
cbe3d515b9 Extract file with CSS for budget phases table 2021-03-11 19:37:58 +01:00
Julian Herrero
28caabecdf Refactor participatory budgets in draft mode
Previously the draft mode was a phase of the PB, but that had some
limitations.

Now the phase drafting disappears and therefore the PB can have the
status published or not published (in draft mode).

That will give more flexibility in order to navigate through the
different phases and see how it looks for administrators before
publishing the PB and everybody can see.

By default, the PB is always created in draft mode, so it gives you
the flexibility to adjust and modify anything before publishing it.
2021-02-23 17:05:24 +01:00
Javi Martín
435747764c Group links to create budgets with the heading
We're going to add help content here and having a floating button would
make the button disappear when creating content for mobile phones.

I'm not sure having the link in the <header> tag is semantically
correct, but is consistent to what we did to create local targets in the
SDG content section.

Note we're changing the style of the link to create local targets so
it's consistent with the link to create budgets/groups/headings.
2021-02-18 23:40:40 +01:00
Javi Martín
14b4c6fb85 Merge pull request #4362 from consul/admin_styles
Add new admin tables and forms styles
2021-02-18 19:39:03 +01:00
decabeza
4dad04ae3f Add new styles for admin forms 2021-02-18 15:46:16 +01:00
decabeza
16dc5821d1 Add margin to all h3 admin headers 2021-02-18 15:46:16 +01:00
decabeza
428c1695f2 Add new styles for admin tables 2021-02-18 15:46:16 +01:00
decabeza
a45ab81885 Fix SCSS-Lint QualifyingElement warning 2021-02-18 15:46:16 +01:00
Javi Martín
4c289f2489 Simplify notification item HTML
Other than simplifying the view, we can write tests using `click_link`,
which makes the tests more robust. Clicking the `.icon-notification`
element was causing some tests to fail when defining a window height of
750 pixels in the `admin_budgets` branch.
2021-02-16 23:21:51 +01:00
Javi Martín
5569663308 Use aria-expanded on column selector toggle button
This way screen reader users will be informed about what happens when
the button is clicked. We also simplify the HTML/JavaScript a little
bit.
2021-02-08 19:57:42 +01:00
taitus
6a46f68fa6 Improve styles on shared admin login items 2020-12-16 13:16:48 +01:00
Senén Rodero Rodríguez
3364423698 Update SDG header component
* Add a header element as component markup wrapper
* Allow component to receive an optional block
* Add reusable styles for header links

Co-autored-by: Javi Martín <javim@elretirao.net>
2020-12-11 16:09:43 +01:00
Javi Martín
d501915954 Extract admin menu to a component
This way adding new methods will be easier.
2020-11-26 12:15:07 +01:00
Javi Martín
64b0cc741b Improve table actions layout
In the past we were using some <div> tags surrounding table action
links in order to guarantee these links wouldn't be wider that their
cell's space and wouldn't expand over two lines.

However, while these links didn't expand over two lines, at certain
resolutions the width of their text exceeded the width of the links,
causing part of the text to be outside their borders.

This behavior was also inconsistent: some tables had these <div> tags,
and some tables didn't.

Since we've now introduced the table actions component, the code is more
consistent and we're getting rid of these <div> tags. So now we're again
facing the issue where links could expand over two lines.

Using a flex layout solves this issue and considerably improves the
layout at lower resolutions.
2020-10-21 13:19:52 +02:00
decabeza
c159f9c3b9 Fix icon sortable styles 2020-09-21 16:04:57 +02:00
decabeza
1339885910 Remove admin header box shadow
It has been removed to maintain consistency with the front views.
2020-09-21 16:04:57 +02:00
decabeza
732ad7fd6b Improve styles for admin sidebar
Also add a little animation on arrow when menu opens
2020-09-21 16:04:56 +02:00
Javi Martín
7880573635 Make the admin menu fill the screen vertically
On high-resolution screens where neither the menu nor the main content
were filling the screen, there was a blank space at the bottom which
looked weird.
2020-09-21 15:15:52 +02:00
Javi Martín
a293dc013d Make management layout similar to admin layout
The <main> tag was including the navigation, and now we use the same
flex layout, making it more accessible for mobile phone users.

I'm not sure the <main> tag should actually include the account info and
the flash message. I'm keeping it like this in order to keep the layout
the way it was.
2020-09-21 15:14:20 +02:00
decabeza
2363aa4c76 Avoid using a mixin for side menu and content styles 2020-09-21 15:14:20 +02:00
Javi Martín
42106e6601 Fix double scroll bar in admin content
We were using `overflow: scroll` as a workaround with a problem we had
with the equalizer. But now we never need an extra vertical scroll bar,
and we only need an extra horizontal scroll bar on small screens.

Since the dashboard was using the class `admin-content` as well, we need
to apply to the dashboard the same changes we've done in the admin
section. I've extracted them into a mixin.
2019-12-19 16:02:31 +01:00
Javi Martín
91d4624443 Simplify admin side menu layout
We can move the button to toggle the menu to the main content, and
everything will look the same way while we'll need one div less.
2019-12-19 16:02:31 +01:00
Javi Martín
f2e32b44b1 Fix blank space in admin content
In some situations where JavaScript makes content disappear, the height
of the element calculated by foundation's equalizer isn't recalculated,
leaving blank space at the bottom of the page. I've seen cases where a
blank vertical space of 2000 pixels is on the page.

Using flexbox solves the problem, since CSS takes care of everything.
2019-12-19 16:02:31 +01:00
Javi Martín
edf3ec8c2e Fix typo in selectable columns 2019-11-05 16:23:08 +01:00
Javi Martín
ed223e0bd1 Use audited to track investment changes
Our manual implementation had a few issues. In particular, it didn't
track changes related to associations, which became more of an issue
when we made investments translatable.

Using audited gives us more functionality while at the same time
simplifies our code. However, it adds one more external dependency to
our project.

The reason for choosing audited over paper trail is audited seems to
make it easier to handle associations.
2019-11-05 13:02:37 +01:00
Javi Martín
af7c37634d Remove poll votation types
Unfortunately this feature wasn't properly reviewed and tested, and it
had many bugs, some of them critical and hard to fix, like validations
being skipped in concurrent requests.

So we're removing it before releasing version 1.1. We might add it back
in the future if we manage to solve the critical issues.

This commit reverts commit 836f9ba7.
2019-10-30 18:48:55 +01:00
lalo
23d36835d7 Add Admin changes to create Poll:Questions with votation type 2019-06-12 19:44:14 +02:00
German Galia
16ffa2a259 Add change log in investment participatory budget 2019-06-12 13:06:20 +02:00
lalo
4740aeaddf Add columns selector JS component and change Rails view to use it 2019-06-11 14:33:40 +02:00
Julian Herrero
220bfb065a Add images and documents settings to admin panel 2019-06-04 11:47:22 +02:00
lalo
237a03552f Move admin budget investments tabs filters to advanced filters component 2019-04-03 22:27:48 +02:00
Julian Herrero
00bd7008bb Show all system emails in Admin section 2019-02-22 16:13:49 +01:00
decabeza
9e9eb1359b Add icon to sortable table 2019-02-20 13:07:08 +01:00
Javier Martín
b330de01f6 Merge pull request #3148 from matisnape/budget_investments_sorting_columns
Add sort links to admin tables
2019-02-15 19:19:11 +01:00
decabeza
acc7cf65e3 Replace single quotes to double quotes on scss files 2019-02-11 17:42:58 +01:00
decabeza
7c0fb96b02 Adds styles to admin progress bars views 2019-01-18 14:17:40 +01:00
Anna Anks Nowak
9786b0bf7d Rewrite sorting to support direction param [#2931] 2019-01-10 15:34:33 +01:00