Commit Graph

23 Commits

Author SHA1 Message Date
Julian Herrero
7e3dd47d5a Unify budget landing pages
There was a big difference between the current budget and a specific
budget landing page. This didn't really make too much sense. Also, it
was not possible to know how a draft participatory budget will look
before it was published.

By unifying those two views now they will look quite similar and it
will be possible for administrators to preview any draft budget and to
know how the budget will look like before actually publishing it.
2021-03-18 15:03:21 +01:00
Javi Martín
6bd20ef5ff Extract concern to handle investments filters
We were defining the same filters in three different controllers. We
were also adding a method in the ApplicationController which only made
sense in the same three controllers.
2021-03-15 13:31:28 +01:00
Javi Martín
a7bbdb1bd0 Simplify rendering a banner
Now the banner component accepts either a banner or a section and loads
the banner if it's a section, so we don't have to add the `@banners`
variable in several controllers.
2021-01-20 17:22:05 +01: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
Julian Herrero
b122302c58 Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
2019-06-03 17:54:19 +02:00
rgarcia
998b4d9e39 Load budgets using slugs 2019-06-03 16:54:39 +02:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01:00
Julian Herrero
c9522b424b Show unfeasible and unselected investments for finished budgets
We were filtering by winners investments for finished budget without
having in consideration other filters.
We want the default filter to be `winners` for finished budgets.
2019-02-06 13:50:50 +01:00
iagirre
0d9da5398b Fix banners in user pages
Banners were not been shown in certain pages; now
they are.

Spec to check if the banner is been shown correctly
added. Before it was in admins specs, now it has it's
own spec out of admins folder.
2018-07-12 10:17:25 -04:00
Bertocq
c01c08a3f4 Use current_budget directly instead of instance variable 2018-01-25 00:48:52 +01:00
Bertocq
791f081a91 Rename @budget to @current budget at budget index
Clear instance variable names help understand what's going around when
you're deep 2 or 3 partials. In this case @budget is only used to carry
around the current_budget so @current_budget is more descriptive.

Using `current_budget` directly around would be an alternative, but
maybe not as maintainable in case we want to change which budget is
being shown (for example the drafting one if you're admin).
2018-01-25 00:48:52 +01:00
Bertocq
e62ca48a94 Show only finished budgets at budget's index
We only need finished budget's at budget's index "Finished budgets"
section. So we add the `finished` scope to @budgets variable, and rename
it so its clear what it contains.

Also avoid showing the "Finished budgets" section if there is none
2018-01-25 00:48:52 +01:00
decabeza
0eaba9fc9e changes order for finished budgets on budgets homepage list 2018-01-22 14:46:54 +01:00
Bertocq
304b3941a7 Move current budget's geolocated investments code to helper function 2018-01-18 01:40:58 +01:00
BertoCQ
92eac29da7 Merge branch 'master' into budget_map 2018-01-18 00:36:43 +01:00
Bertocq
a6b06ca730 Improve Budget's homepage
* Add budget's phases number status
* Add budget's headings and groups list
* Placeholders for future improvements
2018-01-17 19:11:58 +01:00
Vicente Mendoza
d0df965487 fix some issues about test and variables name 2018-01-17 17:10:19 +01:00
Vicente Mendoza
91e10e1897 new map on budget homepage 2018-01-17 13:15:35 +01:00
Bertocq
76e05d58b1 Return 404 status for non-published Budget access
Why:

Non-admin users shouldn't be able to access, or know of the existence
of a non-published Budget.

How:

Raising an ActionController::RoutingError (404 error) to simulate the
same behaviour as accesing a non-existing Budget.

We could have used CanCanCan abilities for this but then an user could
be aware of existing but not published Budgets by trying different urls
2018-01-08 22:59:20 +01:00
rgarcia
c0488c3b3c refactors investment filters 2017-05-06 04:57:06 +02:00
rgarcia
5f7269a070 displays unfeasible budgets link from home 2017-01-16 03:09:08 +01:00
Juanjo Bazán
2d56415048 adds feature flag for admin/budgets management 2016-09-07 15:13:39 +02:00
kikito
fa6f34bf5c Adds basic Budget controller / views 2016-05-31 19:26:56 +02:00