Commit Graph

65 Commits

Author SHA1 Message Date
taitus
d26607183e Add sdg help page
In this page we will render a list of clickable Goals icons that will show their
targets and related local targets

Co-authored-by: Senen <senenrodero@gmail.com>
2021-03-02 14:45:18 +01:00
taitus
522684cd2f Adapt targets component to render on sdg help page
This component was rendered on different pages so there were no conflicts
with static id's.
Now in the SDG help page we are going to render them all at once, so we
convert the static identifiers to dynamic.
2021-02-26 16:36:40 +01:00
taitus
4a880fc1c5 Render header on sdg index page
We no longer show the static header when we have created a
custom header.
2021-02-26 16:20:57 +01:00
Javi Martín
da7846c6d5 Merge pull request #4361 from consul/sdg_per_budget_stats
Split investment projects statistics by participatory budget
2021-02-26 14:41:13 +01:00
Senén Rodero Rodríguez
ebe8903c75 Investment projects statistics by participatory budget
The more recent budgets show first.

The current budget will only show the amount of sent investments
until the winner's phase.
2021-02-26 14:08:45 +01:00
Javi Martín
45517f659e Add SDG goals/targets to legislation proposals 2021-02-24 20:42:53 +01:00
decabeza
7eda4be219 Add link to preview budget on budgets table 2021-02-23 17:05:24 +01:00
Javi Martín
7d4e49a090 Reorganize SDG tag list components
So now we've got a component receiving records (goals or targets) and a
related model (Debate, Proposal, ...), with optionally a link to see
more tags.

This way we simplify some logic since the `TagList` classes were dealing
with too many cases (a record is passed, a class name is passed, a limit
is passed), ... Now `TagList` only deal with the natural `TagList` case,
which is listing the tags for a record. The case where a class name is
passed is used in the `TagCloud` class.
2021-02-02 22:22:40 +01:00
Javi Martín
999d1a2cfd Rename goals FilterLinks component to TagCloud
This is more consistent with the "tag_cloud" partial name.
2021-02-02 22:22:39 +01:00
taitus
35db41827c Add tag list component to process feed
Remember that this component (widget/feeds/process) is displayed both in
the home page and in the target index.
2021-01-31 13:53:57 +01:00
taitus
ca36dd56f0 Add tag list component to proposal feed 2021-01-31 13:53:57 +01:00
taitus
edbef4fd88 Add tag list component to debate feed 2021-01-31 13:53:57 +01:00
Senén Rodero Rodríguez
bb1315def1 Prepare SDG tag list component to render list with or without links
Now the tag list can render tags with or without links, so we need
to adapt the styles slightly.

We want to use the same text color for tags without links.

The hover style is only needed when using tags with links.
2021-01-31 13:33:26 +01:00
Senén Rodero Rodríguez
cc2ce38d13 Create SDG target component to render plain tags 2021-01-31 13:33:25 +01:00
Senén Rodero Rodríguez
54843c1e53 Create SDG goal component to render plain tags 2021-01-31 13:33:25 +01:00
taitus
857a6aa228 Add targets component to render all targets in tabs section 2021-01-29 14:15:58 +01:00
Javi Martín
5044c424b6 Merge pull request #4334 from consul/sdg_show_section_header
New header section on SDG Goals Index
2021-01-29 14:14:44 +01:00
taitus
7a02ce9c08 Add sdg section header on SDG IndexComponent
Co-Authored-By: Javi Martín <javim@elretirao.net>
2021-01-28 20:02:46 +01:00
Javi Martín
5f3279b9db Extract search form component in SDG Management
We're going to add some JavaScript which affect this component, and IMHO
it will be easier to know the JavaScript affects this form if both have
their own separate file.
2021-01-28 13:41:23 +01:00
Javi Martín
3018de2847 Merge pull request #4324 from consul/sdg_target_filter
Add SDG target tags and filter
2021-01-27 16:48:12 +01:00
Javi Martín
1fefc910d6 Add list of targets to SDG tag list
Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
2021-01-27 16:21:40 +01:00
taitus
6c7a8d31b1 Add read more and real less on long description
In the spec we added in system/sdg/goals_spec.rb we couldn't use
either click_link or find_link, because the link to show/hide the
long description doesn't have the href attribute.
2021-01-27 15:56:08 +01:00
Javi Martín
b0a6c20bc0 Add long description to goals 2021-01-27 15:49:46 +01:00
Javi Martín
3ec628a63b Add SDG target filter to advanced search 2021-01-26 19:30:58 +01:00
taitus
7fa594e3e3 Rename sdg_related_list to related_sdg_list
To maintain consistency with the current names in the database with fields:
:related_sdg_type and :related_sdg_id
2021-01-26 19:18:11 +01:00
taitus
41ead2b37c Allow add local targets to RelatedListSelectorComponent 2021-01-26 19:16:57 +01:00
Javi Martín
8542e3e3cf Merge pull request #4323 from consul/sdg_stats
Add SDG stats page to admin section
2021-01-25 15:18:03 +01:00
Senén Rodero Rodríguez
4c2d918bb5 Create component to render goal stats 2021-01-23 12:23:29 +01:00
Javi Martín
e96f45ba39 Merge pull request #4325 from consul/add_related_list_selector
Add related list selector component to forms
2021-01-22 16:34:10 +01:00
taitus
189c299a6e Do not render component when the feature is disabled 2021-01-22 16:03:53 +01:00
Javi Martín
a979a2225d Merge pull request #4315 from consul/sdg_relation_tags
Add SDG goal/target selector
2021-01-20 19:33:32 +01:00
taitus
fce844261a Add help section
In the help section we show the titles of the Goals and Targets that we have added
2021-01-20 19:18:55 +01:00
taitus
c18ab66cc7 Add new suggestion attribute to render custom text on tags
Add "display_text" to allow customize the text that we want render on tag.
For Goals we render "SDG1", "SDG2"..
For Targets we render the code "1.1", "1.A"...
2021-01-20 19:18:03 +01:00
taitus
25501c74bb Add suggestions list with goals and targets
This will allow autocomplete for the loaded values in suggestions settings.
We remove commas on tag to allow to jquery.amsify.suggestag.js use comma
as delimiter.
2021-01-20 19:18:02 +01:00
taitus
334d803332 Add related list selector component
This component allows you to add Goals and Targets in a single
input to relate it to any resource.
We use the new added library to render them as tags.
2021-01-20 19:18:01 +01:00
Javi Martín
a7bbdb1bd0 Simplify rendering a banner
Now the banner component accepts either a banner or a section and loads
the banner if it's a section, so we don't have to add the `@banners`
variable in several controllers.
2021-01-20 17:22:05 +01:00
Javi Martín
c3147a1bb6 Simplify conditions to render a banner 2021-01-19 15:35:18 +01:00
Senén Rodero Rodríguez
c6407d82e3 Add filters to SDG relations controller
We have three filters: "pending", "all" and "reviewed". Where "pending"
is the default one.

Now we are rendering the `shared/_filter_subnav` partial we need to stub
helper methods defined at the controller and the helper methods that
rely on the request parameters to test the component.
2021-01-19 14:56:30 +01:00
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