Javi Martín
c66a5a30ef
Allow using table actions in different namespaces
...
This way we can reuse it in sections like SDGManagement and URLs will be
automatically generated as expected.
2021-01-14 17:35:38 +01:00
Javi Martín
2968275a1c
Add empty SDG homepage configuration page
...
Here we'll eventually display links to edit the homepage and the cards
in it.
2021-01-14 17:35:38 +01:00
Javi Martín
e8e920ee50
Rename Widgets components to Widget
...
So naming is consistent with the way Admin::Widget controllers are
named.
2021-01-12 14:50:37 +01:00
Javi Martín
36037bbc55
Merge pull request #4300 from consul/sdg_filters
...
Add SDG filters to advanced search
2021-01-11 13:11:09 +01:00
Javi Martín
cee4613d87
Merge pull request #4305 from consul/sdg_icons_in_index
...
Add SDG icons to related records
2021-01-11 13:07:11 +01:00
Javi Martín
75fc4315ba
Add goal filter to advanced search
2021-01-10 15:54:23 +01:00
Javi Martín
8024c4bb69
Fix goal order in goal select
2021-01-10 15:54:23 +01:00
Javi Martín
142f9b300b
Add filters by SDG to processes sidebar
...
It appears on every process where a tag cloud appears: debates,
proposals and budget investments.
2021-01-10 15:52:22 +01:00
Javi Martín
c5a6ee74c4
Fix component specs using "within"
...
These specs were passing because the `within` method does not work in
components specs. We have to use `page.find` instead.
2021-01-09 15:48:12 +01:00
Javi Martín
ceed3c18d3
Display SDG icons alongside tags
...
We're using the translation fallbacks for the icons, just like we do for
texts.
Note we use the `render?` method provided by view_component to make sure
the component will not be rendered when certain features are disabled.
Also note the `find_asset` method works differently in development and
production, and so we use different approaches here.
2021-01-09 14:53:54 +01:00
Javi Martín
53af5749b9
Extract class to check SDG rendering conditions
...
This class provides a method which shows whether a certain process is
enabled.
Even if it uses a helper, this class is inside the models folder because
the helper it uses actually only uses model methods. We might eventually
remove/simplify this helper and cache inside the model, like we did with
I18n content translations in commit 41dba842a .
2021-01-09 14:19:00 +01:00
Javi Martín
83400b9ed4
Display a message when feeds have no items
...
This is a scenario which will likely take place for at least some of the
goals.
2020-12-27 21:42:42 +01:00
Javi Martín
cc9ab70fbb
Add processes to goal view
...
Note the link to see all processes does not filter by goal because the
legislation section does not have any search filters.
2020-12-27 21:42:42 +01:00
Javi Martín
2bb0a2dfaf
Make "see all" links filter per goal
2020-12-27 21:42:42 +01:00
Javi Martín
ee06dcc05a
Disable SDG sections when settings are disabled
2020-12-21 18:04:48 +01:00
Senén Rodero Rodríguez
e9d52b5e11
Add subnavigation component to targets and goals
...
Add a new SDG component to make easier to create subnavigation menus.
Co-Authored-By: Javi Martín <35156+javierm@users.noreply.github.com >
2020-12-04 15:15:32 +01:00
Javi Martín
7cb0a4135b
Extract component for admin officers table
...
This way we can remove duplication and simplify the code in the view.
Note we're not using the "within" method in the tests to access a row,
because it doesn't seem to work in components tests when passing the
`text:` option.
2020-10-21 13:19:52 +02:00
Javi Martín
08c2bfc255
Extract component to add/remove admin/mod/manager
...
We remove some duplication by doing so.
2020-10-21 13:19:52 +02:00
Javi Martín
02e27e13dc
Extract component for budget actions
...
We can omit passing a parameter to the helper method thanks to that, and
we group related code together.
2020-10-21 13:19:52 +02:00
Javi Martín
1537f25739
Extract component for organization actions
...
We remove duplication by doing so, and now we only need to add the call
do render Admin::TableActionsComponent once.
2020-10-21 13:19:52 +02:00
Javi Martín
eb3f2bc2ca
Extract component for restore and hide actions
...
By doing so, we remove a lot of duplication.
2020-10-21 13:19:52 +02:00
Javi Martín
fb23df2e5b
Allow additional links in table actions component
...
This way we'll be able to make these links consistent.
2020-10-21 13:19:49 +02:00
Javi Martín
e3753b1ad9
Allow custom options in links to actions
...
Some links were using options like `remote: true`.
2020-10-19 18:56:02 +02:00
Javi Martín
497963817c
Allow different confirmation texts in destroy link
2020-10-19 18:56:02 +02:00
Javi Martín
b1f9ca4ad5
Allow custom URLs in links to actions
...
There were a couple of cases where these links didn't point to the
default actions.
2020-10-19 18:56:02 +02:00
Javi Martín
738646a565
Allow different texts in links to actions
...
The texts were different for a few models, so the component needs to be
updated.
2020-10-19 18:56:02 +02:00
Javi Martín
10c095d821
Move table actions partial to a component
...
This partial was going to get too complex since in some places we've got
different texts, different URLs or different confirmation messages.
While we should probably try to be more consistent and that would make
the partial work in most cases, there'll always be some exceptions, and
using a partial (with, perhaps, some helper methods) will become messy
really quickly.
2020-10-19 18:56:02 +02:00