Commit Graph

922 Commits

Author SHA1 Message Date
Julian Herrero
6439be44f1 change CRUD for budget groups and headings
To make it more consistent with the rest of the Admin panel,
the CRUD for budget groups and headings has been changed
from the old "all-in-one" form to a separate form for each resource.
2018-12-14 16:34:54 +01:00
Javier Martín
8bcf713d10 Merge pull request #3100 from consul/backport-2743-add_milestones_to_legislation_processes
Add milestones to legislation processes
2018-12-12 15:12:36 +01:00
Javi Martín
03dc43a500 Manage legislation process milestones 2018-12-11 20:18:53 +01:00
Javi Martín
2fcbee6261 Manage proposal milestones 2018-12-11 20:09:47 +01:00
Javi Martín
d3f11c3b55 Add search form to proposals admin index 2018-12-11 20:09:30 +01:00
Javi Martín
4770217373 Add proposals index in admin 2018-12-11 20:09:30 +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
Javier Martín
feb4af21c7 Merge pull request #3083 from consul/backport-milestone_polymorphic_path
Make milestones controller polymorphic
2018-12-10 18:37:15 +01:00
Javier Martín
fc5a5e58de Merge pull request #3073 from consul/backport-rename_hidden_proposals
[Backport] Rename Admin::Proposals to Admin::HiddenProposals
2018-12-05 13:30:23 +01:00
Javi Martín
35c18688e5 Remove obsolete method
It was used in the `Translatable` concern, but it isn't used there
anymore.
2018-12-05 12:28:36 +01:00
Javi Martín
ae22cd247a Use milestoneable to find/create a milestone
This way we simplify the code and avoid strange cases like `params[:id]`
having an ID which doesn't belong to the current milestoneable.
2018-12-05 12:28:36 +01:00
Javi Martín
c4448faf70 Move milestones code to admin/milestones
All milestone controllers will inherit from `AdminMilestonesController`,
and all views will render the same content.
2018-12-05 12:28:34 +01:00
Javi Martín
2e778b4073 Use milestoneable instead of investment 2018-12-05 12:23:57 +01:00
Javi Martín
2c2831beb0 Use polymorphic paths for milestones 2018-12-05 12:23:52 +01:00
Javi Martín
5cfc1592e4 Use %w[] instead of %w{}
As defined in our rubocop rules.
2018-11-30 18:04:55 +01:00
Javi Martín
45a41a7528 Rename Admin::Proposals to Admin::HiddenProposals
The same way we do it with users and budget investments.
2018-11-30 18:04:55 +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
Raimond Garcia
ed9e501ae7 Merge branch 'master' into add_map_to_heading_page 2018-11-27 11:07:16 +01:00
Raimond Garcia
2ef83619c3 Merge pull request #3048 from jaflutz/2930-draft-phase-processes
Adds draft phase functionality in legislation processes
2018-11-27 11:01:27 +01:00
decabeza
3670859fa3 Removes unused admin poll officers views, routes and controller 2018-11-22 11:40:11 +01:00
João Lutz
34b58a5208 Adds draft phase functionality in legislation processes 2018-11-19 22:18:50 -02: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
Javi Martín
08c043425a Remove reference to site customization page locale
We don't use that attribute since we added translations for this model.
2018-10-22 16:36:18 +02:00
Javi Martín
01315f2695 Fix rubocop line too long warning 2018-10-22 16:36:17 +02:00
Javi Martín
f1ccdb87b1 Fix removing an option for legislation questions
We were allowing the `_destroy` field for translations, but not for the
options themselves.
2018-10-22 16:36:17 +02:00
Javi Martín
6952c9c9db Fix legislation options not being updated
We broke this behaviour by introducing translations and not allowing the
`id` parameter anymore.
2018-10-22 16:36:17 +02:00
Javi Martín
00983200d4 Update information texts translatable fields
This part used the code we deleted in order to make it easier to
refactor the rest of the translatable models. Now we add the code back.
2018-10-22 16:36:12 +02:00
Angel Perez
1835bac7e4 Avoid ternary operator usage when appending/creating I18n keys
When using the OR operator, if the left side of the expression evaluates
to false, its right side is taken into consideration. Since in Ruby nil
is false, we can avoid using conditionals for this particular scenario
2018-10-22 16:35:01 +02:00
Angel Perez
05890602fd Fix Rubocop warnings [ci skip] 2018-10-22 16:34:57 +02:00
Raúl Fuentes
bdf12ebdfb Move flat_hash to I18nContent model
also add unit tests for this function and a description
into the model of the behaviour of the function
2018-10-22 16:33:01 +02:00
Javi Martín
139cf769c6 Update widget cards translatable fields 2018-10-22 16:28:49 +02:00
Javi Martín
3c170f47d2 Update site customization pages translatable fields 2018-10-22 16:13:48 +02:00
Javi Martín
e0b9c1bfdd Update poll question answers translatable fields
We needed to bring back support for CKEditor in our translatable form,
which we had temporarily remove.

And now we support CKEditor in our translatable specs, and so we can
remove the duplicated specs for poll question answers.
2018-10-22 16:13:48 +02:00
Javi Martín
d1249d0b4f Update poll questions translatable fields
We need to replace ".title=" by ".title_#{locale}=" in one place because
for some reason globalize builds a new translation record when using the
latter but it doesn't build one when using the former.
2018-10-22 16:13:30 +02:00
Javi Martín
759de935ee Update polls translatable fields
The `:name` attribute is still allowed in the controller because some
forks use it when creating a poll from a budget.
2018-10-22 15:52:58 +02:00
Javi Martín
85701bd754 Update legislation questions translatable fields 2018-10-22 15:46:24 +02:00
Javi Martín
5bfc7ca2e3 Update legislation process translatable fields 2018-10-22 15:46:16 +02:00
Javi Martín
6278175f57 Update legislation drafts translatable fields
Updating it required reorganizing the form so translatable fields are
together.

We also needed to add a `hint` option to the form label and input
methods so the hint wouldn't show up for every language.

Finally, the markdown editor needed to use the same globalize attributes
as inputs, labels and hints, which adds a bit of duplication.
2018-10-22 15:44:14 +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
Javi Martín
a326bcb0a1 Update admin notifications translatable fields
The same way we did for banners.

We needed to add new translation keys so the labels are displayed in the
correct language. I've kept the original `title` and `body` attributes
so they can be used in other places.

While backporting, we also added the original translations because they
hadn't been backported yet.
2018-10-22 15:43:56 +02:00
Javi Martín
71601bd3f8 Validate translations in banners
This change forces us to use nested attributes for translations, instead
of using the more convenient `:"title_#{locale}"` methods.

On the other hand, we can use Rails' native `_destroy` attribute to
remove existing translations, so we don't have to use our custom
`delete_translations`, which was a bit buggy since it didn't consider
failed updates.
2018-10-22 15:43:28 +02:00
decabeza
546105d989 Merge branch 'master' into dashboard-master 2018-10-19 01:48:37 +02:00
Javi Martín
9352585e14 Ease customization in processes controller
By extracting a method just for the allowed parameters, forks can
customize this method by reopening the class.
2018-10-18 16:52:40 +02:00
Javi Martín
2fb5fb5fb2 Add missing newline characters 2018-10-04 16:31:00 +02:00
Javi Martín
ec2b4fe7ff Use %w[] instead of %w{}
As agreed when discussing our rubocop rules.
2018-10-04 16:30:59 +02:00
Javi Martín
75d1ab1e52 Use AJAX requests to select legislation proposals
Now the interface is more similar to the one in budget investments.
2018-10-04 16:29:01 +02:00
Javi Martín
667c2c82b5 Use toggle_select action for legislation proposals
The `update` action is usually expected to behave the same way it does
everywhere else, which is updating a record using the `params` hash.

The name `toggle_select` comes from the name we use in a similar
situation for budget investments.
2018-10-04 16:29:01 +02:00