Commit Graph

31 Commits

Author SHA1 Message Date
Javi Martín
11816f833d Use a flex layout to render participation processes lists
This way we simplify the HTML, which had some `if...else` blocks that
were hard to follow because there were opening tags inside these blocks
while the closing tags were outside these blocks.

We're also making the CSS container-dependent instead of
window-dependent. Since there are between one and three elements inside
the panel, we accomplish this by making the element with the content
take its own line if the width of the panel is smaller than 35rem.

Note we're trying to keep the layout similar to what it was; since we're
no longer using negative margins (like the ones in the `.row` selector),
the votes element now gets a width of 22.5% instead of 25%.

Also note we're using the column-gap property for flexbox because the
`flex-with-gap` mixin doesn't work so well with elements that have
borders. Since the column-gap property for flexbox is now supperted by
more than 98% of the browsers (which wasn't the case when we started
using the `flex-with-gap` mixin), the `flex-with-gap` mixin has become
obsolete.

Finally, note we're removing the `max-width: 12rem` rule in the images.
I'm not sure why we introduced this rule in the first place, and it
didn't play so well to the new layout. I considered using code like
`max-width: min(100%, 12rem)`, but, since I'm not sure why `12rem` was
there in the first place, I'm not sure whether this approach was better,
and it sure made things more complex.
2025-03-06 18:49:39 +01:00
Javi Martín
3cebce9a29 Extract link to toggle selection to a component 2024-10-25 16:40:32 +02:00
Javi Martín
a1439d0790 Apply Layout/LineLength rubocop rule
Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
2023-08-30 14:46:35 +02:00
Javi Martín
eafb4018bf Apply Style/CollectionMethods rubocop rule
We were already using `map` and `reduce` almost everywhere.
2019-10-26 13:03:49 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
4f5de5be3b Add aria-describedby attribute automatically
We were manually adding the attribute in many places, but not
everywhere. I'm assuming adding it where we didn't have it is doing no
harm.
2019-10-06 19:32:03 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Senén Rodero Rodríguez
bd3bb72370 Add proposals translation interface
* Convert proposal form into translatable one.
 * Adapt translatable shared spec to define an owner when running at
   frontend feature specs.
 * Remove old attributes from strong parameters.
2019-06-27 09:19:37 +02:00
Julian Herrero
6e905c517f Don't show recommented proposals in selected proposals list 2019-05-30 11:19:38 +02:00
Julian Herrero
dfe3764616 Don't show featured proposals in selected proposals list 2019-05-30 11:19:38 +02:00
Julian Herrero
6beb11f0a9 Show completed progress bar for successful proposals
Show a completed progress bar with total supports intead of showing
a message telling the proposal has reached the needed supports.
2019-05-30 11:19:38 +02:00
Julian Herrero
28835a29ef Share helper between class Proposal and Legislation::Proposal 2019-05-30 11:19:38 +02:00
Julian Herrero
ad5f7a06e1 Allow admins to select proposals and users to list them 2019-05-30 11:19:33 +02:00
Javi Martín
2b4e1cf358 Add missing double quotes
We overlooked a few single quotes while we changed thousands of them.
2019-03-25 13:22:35 +01:00
decabeza
bdedb023d1 Adds view mode on proposals 2018-04-02 17:27:52 +02:00
Senén Rodero Rodríguez
92c774cdeb Merge with master 2017-09-28 13:36:20 +02:00
Senén Rodero Rodríguez
2854c0b683 Some fixes and refactor 2017-09-26 13:57:14 +02:00
Senén Rodero Rodríguez
ceabd16d57 Refactor. Create index scope inside imageable shared examples to check index action of any imageable model. Add image to proposals index. 2017-09-26 13:55:03 +02:00
Bertocq
22822aa173 Fix Style/RedundantParentheses rubocop issues 2017-09-25 22:44:58 +02:00
BertoCQ
f67ba62c49 Merge branch 'master' into user-recomendations 2017-09-19 18:56:12 +02:00
decabeza
4ce06fac4e avoids use class variables on helper 2017-09-18 17:52:36 +02:00
decabeza
1c6a873b6d refactors proposal helper and use correctly on proposal show view 2017-09-18 17:31:37 +02:00
decabeza
2b3cbac5bc moves author actions to sidebar on proposal show 2017-09-18 14:21:38 +02:00
taitus
6e2063310f Add empty recommended messages text. 2017-08-04 13:27:03 +02:00
Bertocq
d7b8777395 Fix all Layout/SpaceAroundEqualsInParameterDefault rubocop issues from rubocop_todo list 2017-06-26 18:03:40 +02:00
rgarcia
bb3c4c6399 adds consistency to ruby code style
Keep a blank line before and after private
Keep a blank line before and after protected
Remove extra empty line at class body end
Remove extra blank line
Add final newline
Use 2 (not 3) spaces for indentation
Use 2 (not 4) spaces for indentation
Remove space before comma
Add space after comma
Remove trailing whitespaces
Remove unnecessary spacing
Use snake_case for variable names
Do not use then for multi-line if
Remove unused block argument - i
Use the new Ruby 1.9 hash syntax
Remove unused assignment to variable
Indent when as deep as case
Align attributes
Align end with def
2016-11-15 11:18:43 +01:00
Juanjo Bazán
58a5e2a283 authors can retire proposals now 2016-04-23 13:24:15 +02:00
Juanjo Bazán
cf271fe33a uses proposal total_votes for % helper methods 2015-12-18 13:15:00 +01:00
Juanjo Bazán
2a286c6b33 shows proposal view inside management layout 2015-10-23 12:56:09 +02:00
Juanjo Bazán
a472b4acc8 implements percentage in proposal supports 2015-09-14 19:06:07 +02:00
Juanjo Bazán
9dee1bc8b2 adds helper to show the right progress bar 2015-09-13 19:00:11 +02:00