Javi Martín
8b9a75ee80
Merge pull request #4296 from consul/local_targets_load_resources_with_cancancan
...
Allow SDG managers to manage SDG local targets records
2020-12-23 20:19:36 +01:00
Senén Rodero Rodríguez
db06bb2c9e
Load records using cancancan load_and_authorize_resource method
2020-12-23 16:53:39 +01:00
Senén Rodero Rodríguez
219b4886c4
Allow SDG managers to manage local targets
2020-12-23 16:04:39 +01:00
Javi Martín
a73ab57cef
Add basic header to SDG goals view
2020-12-23 13:18:17 +01:00
Javi Martín
910acff624
Add empty SDG goal show page
...
Note we're using the code instead of the ID to get the goal in the URL.
IMHO this is what most people would expect; visiting a URL with a "7"
takes you to SDG number 7, and not to the one with "7" as a database ID.
In order to avoid tests (either automated tests or manual tests) passing
by coincidence due to the goal ID and the goal code being the same, I'm
shuffling the codes before entering them in the databse.
I've tried using `resolve` in the routes so the code is automatically
taken into account, but it doesn't work since `resolve` cannot be used
inside a namespace, and here we're within the `sdg` namespace.
2020-12-23 13:18:17 +01:00
Javi Martín
de4be15a8d
Add empty SDG index
2020-12-23 13:18:10 +01:00
Javi Martín
46e9d2e5a9
Simplify title on navigation links
2020-12-23 13:18:05 +01:00
Javi Martín
053edefdcb
Merge pull request #4295 from consul/sdg_avoid_mismatch_conflict
...
Avoid conflict between SDG::Manager classes
2020-12-23 13:09:25 +01:00
taitus
11884b685c
Avoid conflict between SDG::Manager classes
...
On production environments the application wasn't loading because
the `SDG::Manager` class was defined in two places. We don't know
the exact reasons for the conflict and why these changes fix it.
2020-12-23 12:51:11 +01:00
Javi Martín
5b6b8f1e7b
Merge pull request #4293 from consul/fix_scss_extension
...
Fix extension in admin search stylesheet
2020-12-22 18:47:23 +01:00
Javi Martín
8ae48e3727
Fix extension in admin search stylesheet
...
It was accidentally left as CSS.
2020-12-22 13:03:47 +01:00
Javi Martín
9f0f4cbb5b
Merge pull request #4269 from consul/sdg_management
...
Add SDG content management section
2020-12-21 18:52:25 +01:00
Javi Martín
74962ef05f
Add filter by target
2020-12-21 18:27:27 +01:00
Javi Martín
c9362ffeb4
Add filter by goal
2020-12-21 18:27:27 +01:00
Javi Martín
791ba73e12
Extract method to display a goal code and title
...
This is a pattern we're going to use in many places.
2020-12-21 18:27:27 +01:00
Javi Martín
cb183b6e15
Add search to SDG managed content
2020-12-21 18:27:27 +01:00
Javi Martín
663fba53db
Group admin search label translations together
...
Since there are two different labels/placeholders for poll officers and
also two different ones for users, we're only grouping one of each.
2020-12-21 18:25:45 +01:00
Javi Martín
948a8b2904
Add search method to legislation processes
...
This way we'll be able to search processes in the SDG Management
section.
2020-12-21 18:04:48 +01:00
Javi Martín
852014e478
Add search method to polls
...
So far the method does not take questions nor answers into account.
This way we'll be able to search polls in the SDG Management section.
2020-12-21 18:04:48 +01:00
Javi Martín
00910b82a3
Rename spec file so it uses the source file path
2020-12-21 18:04:48 +01:00
Javi Martín
ee06dcc05a
Disable SDG sections when settings are disabled
2020-12-21 18:04:48 +01:00
Javi Martín
f76279a4dd
Add form to assign targets to a record
2020-12-21 18:04:48 +01:00
Javi Martín
11c3b3db13
Add link to an (empty) edit action
2020-12-21 18:04:48 +01:00
Javi Martín
ed51c5dcd3
Add basic SDG Management content section
...
Note using `params[:relatable_type].classify` is recognized as a
security risk by some tools. However, it's a false positive, since we've
added constraints to the URL so that paramenter can only have the values
we trust.
2020-12-21 18:04:48 +01:00
Javi Martín
5590ecaaa6
Extract methods to generate SDG management menu
2020-12-21 18:04:48 +01:00
Javi Martín
dae6492c03
Merge pull request #4291 from consul/sdg_translation_interface
...
Enable SDG translation interface by default
2020-12-21 18:02:41 +01:00
taitus
9ac6511d96
Render interface translation by default on SDGManagement
2020-12-21 17:08:39 +01:00
Javi Martín
36d487728e
Merge pull request #4281 from consul/org_name_independent
...
Make tests independent of the organization name
2020-12-17 13:33:08 +01:00
Javi Martín
53d322c957
Merge pull request #4272 from consul/sdg_role
...
Add SDG manager role
2020-12-16 13:42:40 +01:00
taitus
6d5333fc7a
Add generic method for header
...
Unify Header to be able to use it from the admin as from the seg_management.
2020-12-16 13:16:48 +01:00
taitus
dfec661a52
Use human_attribute_name
...
We use this method whenever possible
2020-12-16 13:16:48 +01:00
taitus
9521d87d03
Remove unneeded for_render
...
for_render does is including organizations and there is no need to
render organizations on these controllers
2020-12-16 13:16:48 +01:00
taitus
6a46f68fa6
Improve styles on shared admin login items
2020-12-16 13:16:48 +01:00
taitus
b456606dac
Add sdg_manager to dev_seeds
2020-12-16 13:16:48 +01:00
taitus
d64518d173
Add sdg manager section to admin profile section
2020-12-16 13:16:48 +01:00
taitus
9fe24aec9d
Add sdg manager section to admin
...
Allow a user to become an sdg manager
2020-12-16 13:16:45 +01:00
taitus
fb5965fe63
Add cancancan to SDG content
...
Only allow access to the SDG content section to administrators and sdg managers
2020-12-16 11:43:17 +01:00
taitus
65d6282b51
Allow sdg_manager access to sdg management section
2020-12-16 11:43:17 +01:00
taitus
cd7185f317
Create sdg manager
2020-12-16 11:43:15 +01:00
Javi Martín
599332f26e
Merge pull request #4271 from consul/sdg_local_targets
...
Add SDG local targets
2020-12-16 11:35:12 +01:00
Javi Martín
1a77b59e91
Merge pull request #4264 from consul/cache_i18n_content
...
Cache I18nContent translations
2020-12-15 18:44:33 +01:00
Javi Martín
e38c1d637b
Cache content cache key on a per-request basis
...
We do a similar thing with the settings helper, caching settings on a
per-request basis.
Using an instance variable in a helper reduces the amount of times we
need to calculate the cache key during a single request.
Even if Rails caches SQL queries per request, the test suite is faster
with this change, and we get rid of many redundant queries in the logs.
2020-12-15 12:19:41 +01:00
Javi Martín
41dba842a6
Cache I18nContent translations
...
This way we avoid fetching each translation every time it's requested.
This reduces the amount of queries in the development logs and also
makes the test suite faster.
2020-12-15 11:57:09 +01:00
Javi Martín
df280ffbfe
Make tests independent on mailer settings
...
So tests won't fail when institutions change these default settings.
2020-12-13 15:25:58 +01:00
Senén Rodero Rodríguez
80cac0a7d2
Add SDG relations to development seeds
2020-12-11 16:10:37 +01:00
Senén Rodero Rodríguez
4a8db5e91a
Add SDG local targets to development seeds
2020-12-11 16:10:37 +01:00
Senén Rodero Rodríguez
5fa7503374
Include local_targets controller
2020-12-11 16:10:37 +01:00
Senén Rodero Rodríguez
8f7809ddb4
Allow to destroy SDG local targets
2020-12-11 16:10:37 +01:00
Senén Rodero Rodríguez
a211937744
Add SDG page to update local targets
2020-12-11 16:10:37 +01:00
Senén Rodero Rodríguez
eb0f13018c
Add actions column to SDG local targets index
2020-12-11 16:10:37 +01:00