Commit Graph

6128 Commits

Author SHA1 Message Date
decabeza
3817f59f25 Improves styles to show budgets executions images 2018-11-08 11:57:07 +01:00
decabeza
7dd530dad7 Adds missing for to budget exections status label tag 2018-11-07 18:25:18 +01:00
decabeza
1d5335c782 Display last milestones image
Also adds a second order to ensure the order to display milestones with same publication date is always the same
2018-11-07 18:25:02 +01:00
decabeza
ba1a6b4cc8 Display first image available for milestones 2018-11-07 18:09:23 +01:00
decabeza
d698a724ac Moves milestone image to a partial 2018-11-07 18:09:20 +01:00
voodoorai2000
5856af03a5 Fix exception when no available milestones
We were getting an exception when quering[1] for milestones which were not present, due to for example having a publication date later than today

Adding a `try` statement and spec to avoid this situation

[1] 82efc3dd66/app/controllers/budgets/executions_controller.rb (L16)
2018-11-07 18:08:10 +01:00
decabeza
7d55f64aac Adds link to milestones on budgets index page 2018-11-07 18:08:03 +01:00
Alberto
0209957fb4 Merge pull request #3020 from consul/legislation-key-dates
[Backport] Fixes legislation processes key dates active class
2018-11-07 17:42:24 +01:00
Javier Martín
bad750a896 Merge pull request #2864 from consul/backport_1543-budget_execution_list
Budget execution list
2018-11-07 15:44:57 +01:00
decabeza
04ea068f90 Fixes legislation processes key dates active class 2018-11-07 13:14:41 +01:00
decabeza
c049be6dae Improves message when there are no budgets 2018-11-06 18:11:13 +01:00
Javi Martín
9bacf39647 Fix link to create a new budget investment 2018-11-06 13:19:34 +01:00
Javi Martín
ab870c756a Use Date.current to find published milestones
Using `Date.today` caused some milestones to be published before/after
the date defined by `Rails.application.config.time_zone`.

See also commit AyuntamientoMadird/consul@088c76d for a more detailed
explanation.
2018-11-06 13:02:35 +01:00
María Checa
126941a335 Change headings reorder method 2018-11-06 13:02:35 +01:00
Angel Perez
810bdae37a Move 'budget_execution_no_image' file to app/assets/images/ folder 2018-11-06 13:02:35 +01:00
María Checa
b6fdf732f2 Add total Investments in the execution list 2018-11-06 13:02:35 +01:00
María Checa
d089cc14a5 Add logic to handle budget investments with an execution process 2018-11-06 13:02:35 +01:00
Marko Lovic
997db67104 Refactor how headings are ordered 2018-11-06 13:02:35 +01:00
Marko Lovic
375fbf775f Order non-city headings by alphabetical order 2018-11-06 13:02:35 +01:00
Marko Lovic
4758c1b91a Show city heading in first position on executions list 2018-11-06 13:02:35 +01:00
rgarcia
685927116c Query for all investments, not only winner investment
Spending proposals did not have a winner attribute, instead winners
where calculated dynamically looking at votes

Removing this condition, so that we can see investment for the 2016
participatory budget which used spending proposals
2018-11-06 13:02:35 +01:00
Marko Lovic
8376efce3f Hide headings with no investments
The page should not show any headings which don't have any
winning investments. The "no content" message should only be
shown when there are no headings with investments to avoid an
otherwise blank page.

__Note:__ in the main @headings query, _both_ #includes and #joins
are needed to:
 1. eager load all necessary data (#includes)
and
 2. to perform an INNER JOIN on milestones to filter out investments
with no milestones (#joins).
2018-11-06 13:02:35 +01:00
Angel Perez
a3ef662509 Filtering investments are based on the latest milestone status 2018-11-06 13:02:35 +01:00
Angel Perez
749954267d Use Budget::Investment#winners scope to fetch only winner investments 2018-11-06 13:02:34 +01:00
Angel Perez
62b99f01bc Show message for headings without winner investments 2018-11-06 13:02:34 +01:00
Angel Perez
99e4e7ef8a Limit milestones to 1 per investment and sort them by publication date 2018-11-06 13:02:34 +01:00
Angel Perez
448ac7a158 Restore filtering investments by milestone status query
This commit makes 3 changes:

1. Extracts a query into a helper for clarity and DRYness

2. Adds a `.where` clause to filter investments based on their
(current) milestone status

3. Fixes a bug where investments would be rendered as many times as
milestones associated to an investment
2018-11-06 13:02:34 +01:00
decabeza
a07a100828 Fixes image sizes 2018-11-06 13:02:34 +01:00
decabeza
689b25c977 Adds tab-milestones anchor to link and milestone image 2018-11-06 13:02:34 +01:00
decabeza
eb76f644b7 Adds link to heading name on sidebar 2018-11-06 13:02:34 +01:00
decabeza
c7936bacae Adds styles to budgets execution 2018-11-06 13:02:34 +01:00
Angel Perez
2a3ce0b182 Render winner investments under 'Executions' tab 2018-11-06 13:02:34 +01:00
Angel Perez
5de74ea6f1 Load budget headings on budgets/executions#show action 2018-11-06 13:02:34 +01:00
Angel Perez
0a95abc30d Replace budget execution heading route with anchor link 2018-11-06 13:02:34 +01:00
Angel Perez
6559c7212b Add prompt & label for milestones filters under budgets/executions#show 2018-11-06 13:02:34 +01:00
Angel Perez
97809db1b7 Enable filtering of investments by their milestones statuses 2018-11-05 18:04:38 +01:00
Angel Perez
3574bf867c Add default image for investments without picture 2018-11-05 18:04:38 +01:00
Angel Perez
3e6cbc9505 Add basic frontend for budget executions list 2018-11-05 18:04:38 +01:00
Angel Perez
b483ca7f7e Add 'Execution' tab to a finished Budget
This new tab will show all winner investments projects with milestones
2018-11-05 16:33:32 +01:00
Raimond Garcia
8fb0ed7236 Merge pull request #2996 from consul/release-0.17
Release v0.17
2018-10-31 17:32:35 +01:00
voodoorai2000
a303a60f65 Update version number for consul.json 2018-10-31 16:40:34 +01:00
Alberto
d1e40adcbc Merge pull request #2994 from consul/social-meta-tags
[Backport] Social meta tags
2018-10-31 15:01:19 +01:00
decabeza
884580206a Fixes houndci-bot warnings 2018-10-31 14:22:10 +01:00
decabeza
747aec3506 Improves some code format details 2018-10-31 14:22:10 +01:00
decabeza
ab70872a7d Adds new social share partial for proposals 2018-10-31 11:42:00 +01:00
voodoorai2000
7d5b57aee2 Add counter of emails sent to newsletter preview 2018-10-30 17:07:31 +01:00
Javi Martín
ccdbdb26ba Fix poll question with non-underscored locales
Ruby can't have hyphens in method names, so sending something like
`title_pt-BR=` would raise an exception.
2018-10-23 14:23:10 +02:00
Javi Martín
2a1b50beba Extract method to render form fields for a locale 2018-10-22 16:36:18 +02:00
Javi Martín
361a15640f Use detect instead of select.first 2018-10-22 16:36:18 +02:00
Javi Martín
93a7cb6c0f Simplify code checking whether to enable a locale 2018-10-22 16:36:18 +02:00