Commit Graph

6270 Commits

Author SHA1 Message Date
María Checa
064089926d Add ajax request for marker investment info 2018-03-27 15:26:46 +02:00
María Checa
535a96603a Add budget/investments#json_data method 2018-03-27 15:25:55 +02:00
María Checa
cd1a0548ba Add map_location#json_data method 2018-03-27 15:17:31 +02:00
rgarcia
b35c750865 Remove unrelated budget recommendation's link
During the backport for “Read Notifications”[1] this link was added,
which belongs to a different backport “Budget Recommendations” which is
not quite ready to bring to upstream, yet 😌

[1] https://github.com/AyuntamientoMadrid/consul/pull/1304
2018-03-23 19:31:48 +01:00
Bertocq
92c9ad4e1b Add Notifications partial to admin menu 2018-03-23 11:48:43 +01:00
decabeza
6824086f30 Adds styles for notifications views 2018-03-23 11:48:28 +01:00
rgarcia
09c44ee583 Extend notifications to be marked as read and unread 2018-03-23 11:47:06 +01:00
rgarcia
073cf74818 Fix edge case
The user was able to vote as many investments as wanted in the first
heading voted. However in the second heading voted, only one investment
could be voted

This was due to the previous implementation, where you could only vote
in one heading. Note the `first` call in method
`heading_voted_by_user?(user)`

This commits simplifies the logic and allows voting for any investment
in any heading that the user has previously voted in
2018-03-22 23:08:41 +01:00
rgarcia
5c6eaa76ff Add headings_voted_by_user
This method was used only in Madrid’s fork, but it is now needed to
complete the backport for voting in multiple headings

There wasn’t a test in Madrid, so here goes one too. Even though, the
responsibility should probably be moved soon to the `Budget::Heading`.
For consistency with the related methods and tests it has been left in
the investment_spec
2018-03-22 22:24:58 +01:00
rgarcia
0398bb23cb Consistent spacing
Temporarily… because there are 2 kinds of Ruby developers, those who
indent methods under `private` and does who don’t

https://gist.github.com/joefiorini/1049083#gistcomment-37692
2018-03-22 22:24:58 +01:00
rgarcia
bdffb9765e Allow voting in multiple headings
Now that we have the option of voting in multiple headings per group,
the method of voting in a “different heading assigned” has become
deprecated and thus removed
2018-03-22 22:24:58 +01:00
rgarcia
730072e91e Add max votable headings to groups 2018-03-22 22:24:58 +01:00
Raimond Garcia
c1d7378c92 Merge pull request #2504 from consul/budget_group_name_edit
Allow Budget Group names to be edited
2018-03-22 22:12:04 +01:00
rgarcia
7a980d79e7 Removes use of slugs to edit group name
Changing a group’s `to_param` to return the slug instead of the id,
breaks many tests in the user facing interface

We should use slugs in upstream soon, but it should be done in a
separate PR, bringing the whole slug implementation from Madrid’s fork
and the corresponding test coverage
2018-03-22 20:06:53 +01:00
rgarcia
c908e91f00 Order budget headings by id
To maintain order after editing a heading’s name

We should probably add timestamps to `groups` and `headings` and order
by `created_at` instead

Could have done it in a separate PR, but gotta keep moving to other
priority issues. Creating issue for timestamps to do correctly and with
tests 😌
2018-03-22 10:20:07 +01:00
rgarcia
1083213ac7 Order budget groups by id
To maintain order after editing a group’s name

We should probably add timestamps to `groups` and `headings` and order
by `created_at` instead
2018-03-22 10:19:56 +01:00
rgarcia
86e4a5d853 Find group inside budget
We were having a problem were some groups where not updating correctly.

That was because it was finding the first group with that name. However
we were looking for another group with the same name from another budget

Apart from the group_id, we also get the budget_id in the params for
updating a group. By finding groups within that budget we get the
expected behaviour
2018-03-22 10:19:43 +01:00
decabeza
acebb07ddd Adds link to image and docs on admin budget investment info 2018-03-14 15:14:47 +01:00
decabeza
f05fdb88ea Adds link to username on admin users index view 2018-03-14 15:09:30 +01:00
decabeza
4fbc10d85e Fixes budgets ui for all phases 2018-03-14 15:01:56 +01:00
Bertocq
8fd6f8f1d6 Valuators access to edit/valute on right phase
When a valuator tries to edit/valuate an investment outside valuating
phase, an explanatory message will be shown along with a redirect to
prevent access.
2018-03-12 20:22:53 +01:00
rgarcia
41067b02c0 Update consul.json to v0.14 2018-03-09 16:27:12 +01:00
Alberto García
527e680461 Merge branch 'master' into legislation-proposals 2018-03-09 13:32:03 +01:00
Alberto García
eba4a3c6cb Merge pull request #2528 from consul/budgets-message
Heading link on budgets message
2018-03-09 13:25:39 +01:00
Alberto Calderón Queimadelos
a55218ad9f Merge pull request #2443 from consul/fix_currency_locale
Use user locale instead of default locale to format currencies
2018-03-08 18:03:52 +01:00
Alberto García
8c6c567c76 Merge pull request #2525 from consul/social-share
Fixes social share buttons
2018-03-08 17:46:24 +01:00
Bertocq
6e843730b0 Replace format_price for Budget#formatted_amount
ApplicationHelper#format_price and Budget#formatted_amount has the same
objective and code, but the Budget#formatted_amount method also uses the
currency of the Budget to correctly give currencies format.

By replacing usage of format_price with formatted_amount we can remove
format_price and have a single location for currency format logic.
2018-03-08 13:26:36 +01:00
decabeza
0bc0a2b1e8 Makes smaller text on participation not allowed div 2018-03-08 11:50:30 +01:00
decabeza
d70c46e578 Extract BudgetHeadingsHelper#heading_link & use it
Why:

The logic to construct the link to a heading (if it exists) is in three
different places, this is a clear candidate for a helper method.

How:

Just checking at the helper method if `assigned_heading` and `budget`
has values and composing the link if so.
2018-03-08 11:50:23 +01:00
decabeza
0e9190bc43 Adds heading link on different heading message 2018-03-08 11:50:09 +01:00
decabeza
48c7fb5fc2 Adds legislation processes styles 2018-03-08 11:34:33 +01:00
decabeza
ef53cd0f15 Clean css and views of custom content 2018-03-08 11:30:46 +01:00
Bertocq
b72e43168b Use user locale instead of default locale to format currencies 2018-03-08 10:20:05 +01:00
decabeza
d4b88f1fae Adds description for social share buttons 2018-03-07 17:24:30 +01:00
decabeza
e0480675ed Replaces hardcoded social share buttons tag with correct partial 2018-03-07 17:21:59 +01:00
decabeza
1ab4458785 Adds description to legislation process share buttons 2018-03-07 17:19:01 +01:00
decabeza
ee7ca37d18 Removes unused css 2018-03-07 17:18:27 +01:00
decabeza
d679c1eb79 Removes sandbox folder 2018-03-07 17:18:10 +01:00
decabeza
9186a825a7 Uses rem-calc function instead of explicit units 2018-03-07 17:17:24 +01:00
decabeza
ca0d134c0b Removes unused css 2018-03-07 17:17:17 +01:00
decabeza
4b381eef9b Removes unused js 2018-03-07 17:17:04 +01:00
decabeza
995449d733 Adds share buttons and refactors processes header 2018-03-07 17:16:54 +01:00
decabeza
5b1ac0a6ce Adds correct url on budget investment twitter share 2018-03-07 17:16:43 +01: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
1ef2789640 Trim valuator investment valuation ability scope
Valuators shouldn't be able to valuate an investment which valuation has
already been finished (only admins can)
2018-03-06 20:18:05 +01:00
Bertocq
316c0aab3e Remove unnecesary slug generation trigger 2018-03-02 09:17:34 +01:00
Bertocq
d9a8474793 Refactor Group partial to be easier to read 2018-03-02 09:17:26 +01:00
Bertocq
7c02f9c82e Fix missing I18n.t usage 2018-03-02 09:17:21 +01:00
Raúl Fuentes
78fc4010d0 fixed the style 2018-03-02 09:17:08 +01:00
Raúl Fuentes
6d8d44a5e3 Added interface and methods for edit the name of a Budget::Group if the budget is still inthe drafting phase 2018-03-02 09:16:57 +01:00