Commit Graph

58 Commits

Author SHA1 Message Date
Bertocq
e0871e5dc6 Only update slug if empty or model condition is met 2018-02-04 23:04:48 +01:00
iagirre
846898f3ec New phase "Information" added and UI modified to not show the links.
Specs to test the functionality added.
2018-01-23 15:42:01 +01:00
Bertocq
7599eb4c35 Refactor budget phases step progress functions and usage 2018-01-18 17:18:05 +01:00
Bertocq
2e883db283 Refactor budget phases current step & total steps 2018-01-18 16:53:36 +01:00
BertoCQ
01d7b86d42 Merge pull request #2331 from consul/current-budget-polish
Add current_budget to management controllers
2018-01-18 00:27:56 +01:00
rgarcia
21cdddcbae Order budgets by created_at instead of by id
This is a preventive change which will be useful once the rake to
migrate from `spending_proposals` to `budget_investments` is complete

As after running that migration, old `spending_proposal` budgets will
have a newer `id` than the existing budgets. And therefore the last
budget will be one of those migrated from the old `spending_proposal`
model

By ordering by `created_at` and probably updating the `created_at`
attribute in the rake that migrates `spending_proposals` to
`budget_investments`, we will have a coherent order for budgets
2018-01-16 19:44:11 +01:00
BertoCQ
d44db9cec4 Merge branch 'master' into feature/budget_phases 2018-01-16 17:47:47 +01:00
Bertocq
313d8d2e11 Adjust date ranges of prev/next phases when enabling/disabling a Budget::Phase, with model specs 2018-01-16 15:20:18 +01:00
Bertocq
59fb0b562c Create all Phases after a Budget creation 2018-01-16 12:18:13 +01:00
Bertocq
10f5cc0d3b Add phases relation at Budget model, as well as current_phase helper method 2018-01-16 12:18:13 +01:00
Bertocq
ca3d759d9f Refactor Budget publishing prices phases constant to Budget::Phase model 2018-01-16 12:18:13 +01:00
Bertocq
66691b644a Refactor Budget::PHASES constant to Budget::Phase::PHASE_KINDS 2018-01-16 12:18:13 +01:00
Bertocq
f2228a908b Refactor budget's phase max description lenght from Budget to Phase model 2018-01-16 12:18:13 +01:00
Bertocq
153b46b468 Create description_for_phase helper method at Budget, to make it easier to get non-active-phase description 2018-01-16 12:18:13 +01:00
Bertocq
5016568b8a Correctly indent private function at budget model 2018-01-16 12:18:13 +01:00
rgarcia
349780922d Add Budget.open scope
Before Budget.current could return multiple budgets, now there can only
be a single current_budget.

Adding the concept of open, which better reflects what the admin sees
in this page: A tab for open budgets and a tab for finished budgets
2018-01-15 22:01:59 +01:00
rgarcia
9176de949a Refactor concept of current budget
When there was only one budget this implementation worked fine

Nowadays there can be multiple budgets, and therefore the definition of
the current_budget has changed. It is no longer a budget that has not
finished, but rather, the last budget created that is not in the
initial drafting phase.

Budgets in the drafting phase are not considered the current_budget,
but rather a budget that is still being prepared and that soon will
become the current_budget
2018-01-15 19:13:37 +01:00
Bertocq
7179dbbba0 Remove deprecated on hold budget phase group, no longer used in code 2018-01-14 20:41:24 +01:00
Bertocq
21d6ce57c5 Add published_prices? helper method and phases constant at Budget model 2018-01-10 01:15:07 +01:00
Bertocq
922318b978 Add publishing prices phase to budget model, plus translation texts 2018-01-10 01:10:57 +01:00
Bertocq
d8ceff1a53 Refactor Budget's on hold phases to constant, plus alignments 2018-01-10 01:09:13 +01:00
Bertocq
f9803ce9ca Add drafting phase to budget model & translations 2018-01-08 22:56:11 +01:00
BertoCQ
e990568895 Merge pull request #1721 from consul/feature/add_slugs_to_budget_related
Add slugs to budget related
2017-07-05 13:16:24 +02:00
Bertocq
e3d89261a6 Add Sluggable concern and unique validation to Budget, Group and Heading
* What: We need to generate slug on Budget, Group and Heading classes, validating its unique for its scope

* How: Adding a presence and unique validation using Budget always as scope.
2017-07-05 12:33:16 +02:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
154cdac332 Add calculate_winners on Admin Budget controller, route and ability for admins 2017-06-25 15:47:04 +02:00
rgarcia
712e576e75 adds email delivery of selected and unselected investments 2017-05-12 13:57:31 +02:00
Juanjo Bazán
33e8ebf043 adds balloting_or_later? method to Budget 2017-05-09 17:27:58 +02:00
Juanjo Bazán
8654517743 changes budget name max length 2017-04-27 17:04:25 +02:00
Alberto Garcia Cabeza
8722699cd8 fixes typos and spec for budgets investments 2017-01-08 22:17:14 +01:00
kikito
248755a801 Modifies the investment orders shown by phase 2017-01-05 17:38:36 +01:00
kikito
9e4b2fda89 Adds phases to form 2017-01-01 15:03:58 +01:00
kikito
ecb3461a97 Renames Budget::VALID_PHASES to just PHASES 2017-01-01 13:16:22 +01:00
kikito
d80dedaad8 Adds sanitized descriptions for all phases to budget model 2017-01-01 12:51:17 +01:00
kikito
c17dcf1bab replaces array of strings with %w 2017-01-01 12:50:40 +01:00
kikito
f6e4443437 Removes sanitizable from budget, replacing it by custom impl 2017-01-01 12:34:15 +01:00
kikito
cb4803f2f9 Replaces %w by %W 2017-01-01 12:33:43 +01:00
kikito
fa50e3f215 Adds new phases to budget and fixes specs 2016-12-30 18:43:15 +01:00
kikito
34ee8c1c48 Makes Budgets editable, and makes their description editable with html 2016-12-29 16:21:42 +01:00
kikito
316c0cff62 Adds missing method to budget 2016-12-16 17:59:03 +01:00
kikito
4434a601d3 Implements several helper methods for formatting amounts 2016-12-14 11:49:16 +01:00
kikito
d5065fe021 fixes typo: ammount -> amount 2016-12-14 11:11:06 +01:00
kikito
b3be1633af Fixes all management bi issues except filtering by geozone 2016-12-07 16:35:27 +01:00
kikito
5538c70931 Introduces budget.translated_phase 2016-12-06 17:52:14 +01:00
kikito
703cc72953 Replace helper function by decorator methods 2016-12-05 17:28:30 +01:00
kikito
00cfb95913 Starts fixing management budget investments 2016-12-01 16:31:05 +01:00
Juanjo Bazán
0fc31b1259 adds budget/budget_investment indexes to valuators 2016-09-09 13:39:08 +02:00
rgarcia
c2c7cdb18d Merge branch 'budget' into budget-public-controllers 2016-09-02 13:15:40 +02:00
Juanjo Bazán
9014de2693 adds budgets_helper 2016-07-29 13:34:11 +02:00
Juanjo Bazán
baddfdb3d1 adds phase scopes to budget 2016-07-28 12:35:22 +02:00