Commit Graph

461 Commits

Author SHA1 Message Date
Julian Herrero
29a704bd60 Show headings in budgets landing page when translations are missing 2019-02-13 13:35:09 +01:00
Julian Herrero
922600252c Make budget headings translatable 2019-02-13 13:35:07 +01:00
Julian Herrero
1c35ec99c1 Make budget groups translatable 2019-02-13 12:30:37 +01:00
Julian Herrero
90d0a6e416 Make budget phases translatable 2019-02-13 11:44:56 +01:00
Julian Herrero
d76782f150 Make budgets translatable 2019-02-13 11:41:58 +01:00
Marko Lovic
e47cbe2a10 Extract "supported headings" logic to User method
In preparation to use this method from views where
it doesn't make sense for it to be associated with
a specific investment.
2019-02-12 17:16:29 +01:00
Javi Martín
f8e9566699 Simplify return statement
Just the way is usually done in the rest of the code.
2019-01-10 16:11:51 +01:00
Javi Martín
d5d800f75c Simplify SORTING_OPTIONS usage
Using a hash instead of an array of hashes makes accessing its keys and
values much easier.
2019-01-10 16:11:51 +01:00
Anna Anks Nowak
e88acb8905 Make params handling case insensitive 2019-01-10 16:11:51 +01:00
Anna Anks Nowak
e264490bca Styling and refactor sorting methods and helpers 2019-01-10 16:11:51 +01:00
Anna Anks Nowak
3ab70ff0d8 Move validating params to model 2019-01-10 16:11:51 +01:00
Anna Anks Nowak
37b2226432 Make the link_to helper more readable 2019-01-10 16:11:51 +01:00
Anna Anks Nowak
101292d303 Rename allowed sort option variable 2019-01-10 16:11:51 +01:00
Anna Anks Nowak
35cebe0eef Use symbols in sorting and set direction properly 2019-01-10 15:35:54 +01:00
Anna Anks Nowak
12484ed4fd Change SORTING_OPTIONS to has 2019-01-10 15:35:54 +01:00
Anna Anks Nowak
9786b0bf7d Rewrite sorting to support direction param [#2931] 2019-01-10 15:34:33 +01:00
María Checa
650fe2553e Add default order for admin budget investments list
When there's no sorting option selected, by default it orders the investment list by supports and, for those with the same number of supports, by ID.
2019-01-02 12:52:28 +01:00
Javier Martín
4782ca37d6 Merge pull request #3111 from consul/backport-customize_toda_la_ciudad
Remove custom "toda la ciudad" code
2018-12-18 13:03:51 +01:00
Julian Nicolas Herrero
2175339609 Merge pull request #3106 from consul/2918-crud_budget_groups_headings
Change CRUD for budget groups and headings
2018-12-18 10:23:24 +01:00
Javi Martín
e6a609e6e5 Extract method to filter investments by status 2018-12-14 18:15:51 +01:00
Javi Martín
b4b0b18a2d Extract method to get investment milestone status 2018-12-14 18:15:51 +01:00
Julian Herrero
25e1afea48 fix map rendering for budget headings 2018-12-14 15:37:22 +01:00
Javi Martín
6f342baf7d Move milestones scope to milestoneable concern 2018-12-11 19:22:55 +01:00
Julian Nicolas Herrero
6aa54d6c62 Merge branch 'master' into content_blocks_for_headings 2018-12-11 16:40:25 +01:00
Julian Nicolas Herrero
9aab3ddd7b Merge pull request #3038 from MatheusMiranda/add_map_to_heading_page
Add map to sidebar on Heading's page
2018-12-11 16:32:35 +01:00
Julian Nicolas Herrero
6ee8b328ef Merge pull request #3067 from microweb10/issue-3051
Fix failing spec: Budget::Investment Reclassification store_reclassified_votes stores the votes for a reclassified investment
2018-12-05 17:21:38 +01:00
Julian Herrero
0fc1e0503e store reclassified votes in order
Make sure we create Budget::ReclassifiedVotes for an investment in the
same order that the previous Budget::Ballot:Lines were previously created.
2018-12-05 13:13:49 +01:00
Marko Lovic
c0f6fa182f Make Milestones general, and not specific to Budget Investments
Generalize the Budget::Investment::Milestone model to a
polymorphic Milestone model so it can be used for entities
other than Budget::Investment.
2018-11-30 14:15:21 +01:00
Marko Lovic
81f516efd7 Change BudgetInvestmentStatus to Milestone::Status
Generalize the BudgetInvestmentStatus model to Milestone::Status so it
is not specific to budget investments, but can be used for any entity
which has milestones. This is in preparation to make the Milestone
model polymorphic and usable by entities other than budget investments.
2018-11-30 14:15:21 +01:00
Milber Champutiz Burbano
9f455b9165 Added feature to add content block to headings in sidebar -- rebase 2018-11-27 09:37:35 -05:00
Matheus Miranda
06f07b1139 Add map to sidebar on Heading's page
Signed-off-by: Matheus Miranda <matheusmirandalacerda@gmail.com>
2018-11-16 09:05:23 +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
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
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
Javi Martín
2ab49a1832 Refactor globalize models code using a concern
I've chosen the name "Globalizable" because "Translatable" already
existed.
2018-10-22 16:28:53 +02:00
Javi Martín
01a254545f Update milestones translatable fields
Note the title field was hidden since commit 01b9aa8, even though it was
required and translatable. I've removed the required validation rule,
since it doesn't seem to make much sense and made the translatable
tests harder to write.

Also note the method `I18n.localize`, which is used to set the
milestone's title, uses `I18n.locale` even if it's inside a
`Globalize.with_locale` block, and so the same format is generated for
every locale.
2018-10-22 15:44:14 +02:00
Marko Lovic
c7fcdd9b0e Use standard locale names for Globalize
It turns out it is not necessary to downcase and underscore
locale names to use the globalize-accessor gem. The gem
will automatically underscore the locale name when defining and
calling the accessor methods.
2018-09-11 18:48:14 +02:00
Marko Lovic
3f277c5cdf Avoid duplicating list of locales 2018-09-11 18:46:58 +02:00
Alberto
fb19aafee7 Merge pull request #2778 from wairbut-m2c/backport/investments-moderation
Allow budget investments to be moderated
2018-07-27 12:34:17 +02:00
Alberto
d17b628426 Merge branch 'master' into backport-2588-fix_supports_filter 2018-07-26 13:44:20 +02:00
María Checa
5dfefbbe2f Change admin budget investments list order by supports from less to more
Sorting by id is in descending order and by title ascending

Backported from AyuntamientoMadrid/consul
2018-07-26 12:24:53 +02:00
Alberto
7b8003dcb9 Merge pull request #2790 from wairbut-m2c/backport-1421-investments_csv_fixes
Add visible_to_valuators and author_username to admin investments CSV
2018-07-25 18:41:29 +02:00
María Checa
e9d73eb687 Fix max_per_heading filter in Admin budget investments list
Also changed the name of the param to `min_total_supports`, which is more descriptive on what it actually does.

Backport of 75f20d5 and 07f0806 from AyuntamientoMadrid/consul fork
2018-07-25 15:44:51 +02:00
Marko Lovic
601e3058d8 Add visible_to_valuators and author username to admin investments CSV
Backport based on 012e4be by María Checa from AyuntamientoMadrid/consul fork
2018-07-25 15:10:56 +02:00
Marko Lovic
5413c34458 Restructure and rename translations
Based on 012e4be by María Checa from AyuntamientoMadrid/consul fork
2018-07-25 15:10:09 +02:00
Angel Perez
c64e93867a Allow moderators to moderate investments 2018-07-20 18:42:34 -04:00
Angel Perez
7bb1da1804 Adapt backend to enable flagging/unflagging investments 2018-07-20 18:42:33 -04:00
Raúl Fuentes
df899cde6e Fixed html, now it reflects the current search also added serach by name or id to the Budget::Invesment search function 2018-07-04 11:55:13 +02:00
María Checa
551e2bb1c4 Changed Budget::Investment::Milestones model
Added relation with Status and set condition to validate milestone's description presence if there's no status set.
2018-06-27 18:19:33 +02:00