Javi Martín
1f82c62711
Add SDG icon-only images to SDG header
2020-12-27 21:43:17 +01:00
Javi Martín
418a011f65
Fix typo in SDG 7 Spanish title
2020-12-27 21:43:17 +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
13fbf4e4b3
Use h2 tags in feed headers
...
We were jumping from h1 to h3 and some of these sections (cards and
processes) had h3 tags inside them.
My best guess is we were using h3 so the titles were smaller. So I'm
adding a CSS mixin to easily use a font size of a different heading tag.
2020-12-27 21:42:42 +01:00
Javi Martín
06d29335ff
Separate the header from the feed content
...
We were having some style issues when adding the processes feed to the
goal view because of this lack of separation.
We're using a <section> tag so it's clear where the <header> tag belongs
to.
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
2fcfa7ebd7
Render participation feeds per SDG
2020-12-27 21:42:42 +01:00
Javi Martín
fae52274a4
Reuse code between feed components
...
They were all following the same format.
Note we need to group the `see_all` translation keys together (the same
way it's done with the `most_active` keys) so we don't have an unused
translation warning.
We're also moving the "see all" link in processes outside the feed
content; the same way it's done in debates and proposals and removing
unnecessary classes in the processes feed: the column class is causing
the processes not to be aligned with the debates above them, and the
margin bottom is not needed because the margin of the footer is already
enough.
2020-12-27 21:42:40 +01:00
Javi Martín
be9fc22650
Use flex layout instead of data-equalizer in feeds
...
Using data-equalizer is always hard due to the JavaScript it uses, while
the flex layout works all the time.
2020-12-27 16:44:51 +01:00
Javi Martín
98aea588e5
Simplify debates and proposals feed layout
...
Using the `:only-child` selector we can adjust widths with CSS and don't
have to rely on methods calculating which features are available.
2020-12-27 16:44:51 +01:00
Javi Martín
330efe5a41
Extract components for feeds
2020-12-27 16:44:51 +01:00
Javi Martín
3e7038d06c
Use different backgound colors for different goals
...
The same way it's done by the United Nations.
2020-12-27 16:44:48 +01:00
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