Commit Graph

36 Commits

Author SHA1 Message Date
Javi Martín
b51aa31e6a Use HTML beautifier to indent ERB files
We had inconsistent indentation in many places. Now we're fixing them
and adding a linter to our CI so we don't accidentally introduce
inconsistent indentations again.
2025-03-07 16:31:08 +01:00
Javi Martín
e3a2a42534 Move investments executions view to a component
Note that we're changing the component so it uses `polymorphic_path`;
that way we don't have to pass the `@budget` variable to the component.
We could also use `budget_investment_path investment.budget, investment`
instead.
2024-11-07 14:21:55 +01:00
Javi Martín
1057f41d61 Fix indentation in investments executions partial
We accidentally introduced the wrong indentation in commit 8376efce3.
2024-11-07 14:21:55 +01:00
Sebastia
c816c51787 Merge pull request #5173 from consuldemocracy/budget_results
Replace back link on budget results
2023-11-14 10:08:31 +01:00
Alberto
f563fc0b24 Replace back link on budget executions 2023-11-03 10:57:24 +01:00
Javi Martín
b15512f025 Fix focus outline on budget executions index
The outline was invisible when we had the link containing block
elements, and I didn't manage to fix it, so the easiest solution is to
use an inline link and style the card with CSS.
2023-10-10 15:03:21 +02:00
Javi Martín
629e208e9d Add and apply ArgumentAlignment rubocop rule
We're choosing the default `with_first_argument` style because it's the
one we use the most.
2023-08-18 14:56:16 +02:00
Javi Martín
f0ab7bcfcc Move executions image partial to a component
This way it'll be easier to write tests for it. We also get rid of
another helper file :).
2022-08-03 17:01:57 +02:00
Javi Martín
091abfc944 Use Active Storage to render attachments
This way we fix a bug we mentioned in commit 930bb753c which caused
links to documents to be broken when editing their title because the
title was used to generate the URL of the document.

Note we're still using Paperclip to render cached attachments because
this is the only case where we store files with just Paperclip and not
Active Storage.

With Active Storage, we render attachments just like any other resource,
using `polymorphic_path`. Paperclip included the `url` method in the
model; since the model doesn't have access to the request parameters
(like the host), this was inconvenient because it wasn't possible to
generate absolute URLs with Paperclip.

In order to simplify the code and make it similar to the way we used
Paperclip, we're adding a `variant` method accepting the name of a
variant and returning the variant.
2022-02-23 18:21:38 +01:00
Javi Martín
d8d5b7f60a Extract budget executions filters to a component 2021-06-29 20:07:55 +02:00
Javi Martín
82b0a6a92d Remove new CSV report generation
The new CSV report was more configurable and could work on proposals,
processes and comments. However, it had several issues.

In the public area, by default it generated a blank file.

In the admin section, the report was hard to configure and it generated
a file with less quality than the old system.

So until we improve this system, we're bringing back the old investment
CSV exporter.

This commit reverts most of commit 9d1ca3bf.
2019-11-06 00:04:02 +01:00
German Galia
9d1ca3bfd4 Report generation. Download csv 2019-06-12 10:17:31 +02:00
lalo
be8a0dbe8a Add Milestone tag select filter on executions public page 2019-06-07 14:17:32 +02:00
Javi Martín
eb7dc3ef2d Extract partial to render budget navigation links 2019-06-06 12:17:52 +02:00
Javi Martín
6ad3bc063c Move budget stats translations to stats files
We were using custom translations, but now this code is going to be
included in the main CONSUL repository.
2019-05-21 13:50:17 +02:00
Bertocq
c5a4a427c4 Add links between Budget stats and results routes 2019-05-16 22:01:42 +02:00
Julian Herrero
c87267d34f Use double quotes in app/views/budgets 2019-03-19 12:16:50 +01:00
decabeza
7dd530dad7 Adds missing for to budget exections status label tag 2018-11-07 18:25:18 +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
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
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
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
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
3e6cbc9505 Add basic frontend for budget executions list 2018-11-05 18:04:38 +01:00