Commit Graph

15920 Commits

Author SHA1 Message Date
Julian Herrero
d20e521ee9 Display the time a phase ends at in admin section 2021-03-11 19:37:58 +01:00
Javi Martín
b37eaf19c6 Use a time HTML tag to display phases dates
Currently this change is barely beneficial (if at all), but it doesn't
harm and might be useful in some cases. For instance, the `datetime`
attributes generates a date containing time zone information, which the
text shown on the screen does not, and styling dates with CSS is now
easier.
2021-03-11 19:37:58 +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
150fb91686 Simplify test for budget phases table
Even if the test checked all possibilities, it was hard to understand.
Using `have_table with_cols:` to test the order of the rows and testing
one phase is enabled and has a link to edit it es enough IMHO.
2021-03-11 19:37:58 +01:00
Javi Martín
f9ecc583ef Extract methods to show a phase start/end 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
Javi Martín
fb5b067d00 Extract phases edition to a component 2021-03-11 19:37:58 +01:00
decabeza
c4e7bf0938 Improve budget phases form layout
Dates are grouped in a fieldset and activating the phase is more
prominent.
2021-03-11 19:37:58 +01:00
decabeza
c0c458bb38 Remove summary in phases form
Since it does not appear in the phases anymore.

Also, the rake unifies the fields of the budget summary with the budget
description.
2021-03-11 19:37:58 +01:00
decabeza
f35a88cf4f Make finished budgets layout wider 2021-03-11 19:37:58 +01:00
decabeza
c0f9e4f045 Change budget phases design
Co-authored-by: Javi Martín <javim@elretirao.net>
2021-03-11 19:37:58 +01:00
Javi Martín
014d29b991 Extract method to get a budget phase title 2021-03-09 16:37:47 +01:00
Javi Martín
70cf956210 Extract method to check the current phase 2021-03-09 16:37:47 +01:00
Javi Martín
46e80bf430 Extract budget phases to a component 2021-03-09 16:37:47 +01:00
Javi Martín
4f4b2643a7 Merge pull request #4388 from consul/pronto_progress_bar
Do not require Pronto when running the application
2021-03-09 16:37:24 +01:00
Javi Martín
9f394c6c61 Do not require Pronto when running the application
Pronto is an external tool which is use to check code conventions and is
not needed to run the application, just like rubocop or scss-lint.

Loading it caused a couple of issues. First, it loaded BetterHtml, and
we had to disable it in order to avoid crashes in the development
environment.

Second, it loaded ruby-progressbar, which loads the ProgressBar class,
which conflicts with our own ProgressBar class. This made the
application crash whenever the ProgressBar class was used.
2021-03-09 14:31:37 +01:00
Javi Martín
33089d275a Merge pull request #4385 from consul/pronto_eslint
Remove ESLint rules incompatible with Pronto
2021-03-09 14:04:16 +01:00
Javi Martín
f9d04b07c1 Don't install ESLint for github actions
These lines were added when we were trying the pronto-eslint_npm gem,
which isn't maintained anymore and is not compatible with the latest
Pronto version.

Since we're now using the pronto-eslint gem, and this gem depends on the
eslintrb gem (which includes ESLint), we don't need these lines anymore.
2021-03-08 15:49:13 +01:00
Javi Martín
92813be08e Remove ESLint rules incompatible with Pronto
The pronto-eslint gem depends on the eslintrb gem, which uses a very old
version of ESLint which doesn't support some of the rules we use.

The most useful rules here were no-tabs and func-call-spacing. It's a
shame they were added to ESLint just one month after eslintrb stopped
being maintained.
2021-03-08 15:49:13 +01:00
Javi Martín
c2194aeb1f Merge pull request #4386 from consul/sdg-fieldset-fix
Fixing styles for the related list component
2021-03-08 12:56:29 +01:00
Javi Martín
d1675750b8 Fix a chrome bug in versions lower than 86
https://bugs.chromium.org/p/chromium/issues/detail?id=375693
2021-03-08 10:51:22 +01:00
Javi Martín
79efdc6fd3 Merge pull request #4382 from consul/pronto
Use Pronto to check code conventions
2021-03-04 16:05:41 +01:00
Javi Martín
7c4c6d4ee0 Make ESLint configuration compatible with Pronto
pronto-eslint depends on eslintrb, which expects the `.eslintrc` file
in JSON format. So we're migrating the `.eslintrc.yml` file to JSON and
introducing a symbolic link so the `.eslintrc` file points to
`.eslintrc.json`.

We could also use pronto-eslint_npm, but unfortunately it's not
maintained anymore and the latest version is not compatible with Pronto
0.11.
2021-03-04 13:20:08 +01:00
Javi Martín
7cce24961e Don't fail the build on "refactoring" offenses
We're a bit more relaxed about these rules, particularly about the line
length and so the build should still pass when these rules are broken.
2021-03-04 13:20:05 +01:00
Javi Martín
c6a90b266d Use Pronto to check code conventions
This way developers can run the checks on their machines and using
`bundle exec` we guarantee the right versions of all our gems are being
used; with Hound we can only use the versions supported by their
service.

When including the pronto-erb_lint gem, we're getting errors in
development where our ERB does not follow the conventions Better HTML
expects. Since we only use Better HTML because ERB Lint depends on it,
and right now we are not ready to follow its conventions, we're
disabling it.

Note pronto depends on rugged, which requires CMake and pkg-config to
build the `libgit2` library it depends on. CMake and pkg-config are
installed by default in some GNU/Linux distributions like Ubuntu, but
might not be installed on other systems, so we're adding them as
development dependencies.
2021-03-02 15:48:24 +01:00
Javi Martín
94f91a4aba Merge pull request #4353 from consul/sdg-help-page
Add SDG help page
2021-03-02 15:00:36 +01:00
Javi Martín
d67fae0fdc Merge pull request #4381 from consul/remove_residence_in_madrid
Use more generic names for validation rules
2021-03-02 14:54:58 +01:00
Senén Rodero Rodríguez
37faaa9b94 Add canonical link
As we do at other help pages.
2021-03-02 14:45:20 +01:00
Senén Rodero Rodríguez
aa6195abc5 Add link to SDG help page to Other information of interest section at main help 2021-03-02 14:45:19 +01:00
taitus
90f014f639 Allow open link on new window
While trying to add the target="_blank" to this link I noticed that this attribute
no longer works in some places in the application, such as the terms and
conditions  link in the sign_up page.

For the time being I think we can resolve it this way in this case and deal with
this issue in a separate PR.
2021-03-02 14:45:19 +01:00
taitus
e91b52ffe0 Add link to help page to related list selector component 2021-03-02 14:45:18 +01:00
taitus
43b6be575d Avoid SDG subnavigation link as active when visit help page
This help page can only be accessed from either the help page or the forms.
There is no button in the navigation bar related to this page.
For this reason we do not mark any section of the navigation bar as active
when we are on this page..
2021-03-02 14:45:18 +01:00
taitus
d26607183e Add sdg help page
In this page we will render a list of clickable Goals icons that will show their
targets and related local targets

Co-authored-by: Senen <senenrodero@gmail.com>
2021-03-02 14:45:18 +01:00
Javi Martín
d741ccdb36 Extract related list selector styles to mixin 2021-03-02 14:45:17 +01:00
Senén Rodero Rodríguez
588fac6055 Rename method and placeholder
As `residence_in_madrid` is too specific.

We should port this commit to main repo.
2021-03-02 13:15:15 +01:00
taitus
522684cd2f Adapt targets component to render on sdg help page
This component was rendered on different pages so there were no conflicts
with static id's.
Now in the SDG help page we are going to render them all at once, so we
convert the static identifiers to dynamic.
2021-02-26 16:36:40 +01:00
Javi Martín
e1012bca72 Merge pull request #4367 from consul/sdg_header
Allow to add header cards to SDG homepage
2021-02-26 16:35:43 +01:00
taitus
4a880fc1c5 Render header on sdg index page
We no longer show the static header when we have created a
custom header.
2021-02-26 16:20:57 +01:00
taitus
e639cab994 Move specific partial for the homepage to shared
This partial to render the header of the hompage will be used in
the sdg index.
2021-02-26 16:16:51 +01:00
Senén Rodero Rodríguez
1d6490e22f Update sdg management homepage to render header cards 2021-02-26 16:16:51 +01:00
Javi Martín
9cc0ad0ba9 Allow cards table actions to receive options
Just like we sometimes override options in the generic table actions
component, we're going to do the same thing with the cards table
actions.
2021-02-26 16:17:18 +01:00
Senén Rodero Rodríguez
c217af9f4b Add sdg management header controller 2021-02-26 16:16:51 +01:00
Javi Martín
ba4b1a91e1 Allow using a different URL on widget card forms 2021-02-26 16:16:51 +01:00
Senén Rodero Rodríguez
b8073cc764 Update sdg manager role abilities to allow to manage different kind of cards 2021-02-26 16:16:37 +01:00
Javi Martín
683af5de60 Merge pull request #4371 from consul/all_budgets_filter
Add filter to display all budgets in admin section
2021-02-26 14:47:19 +01:00
Javi Martín
da7846c6d5 Merge pull request #4361 from consul/sdg_per_budget_stats
Split investment projects statistics by participatory budget
2021-02-26 14:41:13 +01:00
Senén Rodero Rodríguez
ebe8903c75 Investment projects statistics by participatory budget
The more recent budgets show first.

The current budget will only show the amount of sent investments
until the winner's phase.
2021-02-26 14:08:45 +01:00
Javi Martín
d142033a44 Merge pull request #4375 from consul/sdg_legislation_proposals
Add SDG goals/targets to legislation proposals
2021-02-26 13:38:18 +01:00
Senén Rodero Rodríguez
205cbd7d82 Extract component to render a single stat box 2021-02-26 11:30:46 +01:00
Javi Martín
45517f659e Add SDG goals/targets to legislation proposals 2021-02-24 20:42:53 +01:00