Commit Graph

56 Commits

Author SHA1 Message Date
Javi Martín
fd681c17df Fix crash in valuation when there are no budgets 2018-12-21 17:24:34 +01:00
Javi Martín
b0f1b6245e Simplify scope usage
Rails automatically calls the `id` method inside scopes and the variable
name makes more sense if it represents investments instead of the number
of investments.
2018-12-21 17:17:35 +01:00
decabeza
2b958de992 Fixes valuation budget investments ui 2018-07-05 18:14:08 +02:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
iagirre
b8cc10d218 Fix conflics after rebase 2018-04-09 15:02:35 +02:00
Bertocq
09fb4701b8 Fix Valuation Investment index heading filters
Why:

Heading filter where not being correctly displayed

How:

Increasing scenario to cover all possible combinations, and fixing the
heading_filters method of the Valuation Budget Investment Controller to
correctly:
  * Find how many investments the valuator can access
  * Count investments for each heading
2018-04-06 00:42:36 +02:00
Bertocq
0516bc3e91 Prevent valuators from editing finished valuation
Valuators should not be able to edit a finished valuation (only admins
should).

The valuation form is only shown to the valuator if he has that ability
(we've previously modified app/models/abilities/valuator.rb to be able
to rely on `valuate` over an investment to check that)

If the valuator can't see the form, we present him just the data in
plain text.
2018-03-06 20:18:05 +01:00
Bertocq
9cb4b03276 Disallow valuation comment creation on finished budget 2018-01-31 17:07:56 +01:00
Bertocq
528c9be925 Refactor valuation comments into its own partial
It's going to be used at valuation and admin panels
2018-01-31 16:34:11 +01:00
Bertocq
a15e372f7e Rename written_by_authors partial to dossier
Its more descriptive in the contexts where its rendered
2018-01-31 16:30:39 +01:00
BertoCQ
05a6406189 Merge branch 'master' into remove_investments_internal_comments 2018-01-31 13:47:15 +01:00
Bertocq
149c81371b Allow valuation internal comments to be created
How:

Using a local variable at partials to set a hidden true/false value for
`valuation` parameter on the comment creation form.

Allowing that new param at the comment controller and using it when
building a new Comment.
2018-01-31 02:03:02 +01:00
Bertocq
dff966d9b3 Show valuation comment thread @ Valuation show/edit
Why:

Budget Investment's valuators should be able to see internal valuation
comments thread at both show and edit views.

How:

At Valuation::BudgetInvestmentsController:
* Include CommentableActions to gain access to the entire feature, with
required resource_model & resource_name methods.
* Add the only possible order (oldest to newest)
* Load comments on both show & edit actions, passing `valuations` flag
to the CommentTree in order to only list those.

At CommentTree:
* Use `valuations` flag as instance variable to decide wich
comment threat to load: valuations (if relation exists) or comments.
2018-01-31 01:53:33 +01:00
Bertocq
d280c254c8 Remove usage of Investment's internal_comments attr 2018-01-29 21:15:28 +01:00
Bertocq
9b2aebc8c2 Remove closing </li>'s without opening <li> 2018-01-25 17:54:15 +01:00
María Checa
14b62601f6 Added alerts data 2018-01-17 19:11:47 +01:00
rgarcia
5086314bee Display only current budget for Valuators
Before we could have multiple current budgets, as we now only have one
current_budget, some specs broke.

As there is no need to display multiple budgets to Valuators, only the
current budget is necessary, we can remove arrays and assume that only
a single budget, the current budget, is displayed to Valuators
2018-01-15 22:02:04 +01:00
María Checa
5161988844 Removed external_url input 2018-01-08 23:22:46 +01:00
decabeza
6c5513ab38 replaces back_link partial to back_link_to helper 2017-07-26 18:22:45 +02:00
Alberto Garcia Cabeza
13c5eb9812 improves valuation budget investment form 2017-04-24 13:03:09 +02:00
Juanjo Bazán
bdb55805a1 uses back_link_helper all around 2017-01-11 13:03:12 +01:00
Alberto Garcia Cabeza
8722699cd8 fixes typos and spec for budgets investments 2017-01-08 22:17:14 +01:00
kikito
635de83f86 prints the right value in budgets table 2017-01-04 18:48:01 +01:00
kikito
0835a7aba6 fixes valuation subtitle in budget investments index 2017-01-04 18:24:15 +01:00
kikito
cc00af31b9 Merge branch 'budgets-admin-views' into budgets-gaspar 2017-01-04 17:57:46 +01:00
Alberto Garcia Cabeza
fa7d6c18fd fixes back links on valuation budgets 2017-01-04 17:33:59 +01:00
Alberto Garcia Cabeza
74a361690d improves styles for valuation budgets 2017-01-04 17:33:09 +01:00
kikito
9c66fa0dc8 removes filter from valuation index page 2017-01-04 16:31:16 +01:00
Juanjo Bazán
42c705e1e3 adds dossier editing of investments to valuation 2016-09-09 15:09:06 +02:00
Juanjo Bazán
0fc31b1259 adds budget/budget_investment indexes to valuators 2016-09-09 13:39:08 +02:00
Juanjo Bazán
8890380804 adds investment editing to admin 2016-09-07 14:13:40 +02:00
Alberto Garcia Cabeza
7320d17bea Moves back links inside a partial 2016-04-26 13:04:57 +02:00
Alberto Garcia Cabeza
a887b78787 Improves styles for valuation geozones select menu 2016-04-07 10:52:43 +02:00
kikito
d03864adb2 replaces the select in the valuators index with a list of links + pending count 2016-04-07 10:49:58 +02:00
Juanjo Bazán
3c815217f0 changes visible fields in dossier form
depending on feasibility value
2016-03-16 20:16:22 +01:00
Alberto Garcia Cabeza
9dce52a69a Adds title on input checkboxes 2016-03-14 19:32:49 +01:00
Alberto Garcia Cabeza
3ec0971b37 Replaces icons i tags for span 2016-03-14 19:32:48 +01:00
Juanjo Bazán
32c155999e adds radio to mark feasibility as undefined (nil) 2016-03-09 12:37:22 +01:00
Juanjo Bazán
7f97b9ef2c uses _html i18n keys for html_safe values 2016-03-08 20:50:36 +01:00
Juanjo Bazán
e732f88f46 adds info on public visibility for dossier fields 2016-03-08 20:32:23 +01:00
Juanjo Bazán
7f5e79da6b improves spending_proposal back link 2016-03-08 20:10:19 +01:00
Juanjo Bazán
7d31528239 moves feasibility fields to top 2016-03-08 20:07:00 +01:00
Juanjo Bazán
a37e6afa7d sets max limit for price form fields 2016-03-08 20:07:00 +01:00
rgarcia
0eca4d5d48 fixes specs 2016-03-08 16:26:02 +01:00
rgarcia
a646d5ae6b removes duplication between admin and valuators spending proposals 2016-03-08 16:07:24 +01:00
rgarcia
13fea09613 adds indentation to spending proposals show 2016-03-08 15:43:13 +01:00
Juanjo Bazán
2f4621ab09 adds helper for explanation fields 2016-03-08 14:01:16 +01:00
Juanjo Bazán
4d1b65c714 fixes admin spec 2016-03-08 13:42:28 +01:00
Juanjo Bazán
7231f72e01 cleans up show view 2016-03-08 13:40:35 +01:00
Juanjo Bazán
1cbd1f9324 moves assigned valuators info to helper 2016-03-08 13:33:03 +01:00