- Allow to define a link (text and url) on budget form for render on the budget
header.
- Improve styles
Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
In this case, the duration of the budget cannot be determined, and the
application was crashing when trying to do so.
Now we're just returning `nil` as duration.
There's an edge case where the current phase of the budget was disabled.
In this case, the application was crashing.
I'm not sure what we should do regarding this case. Is it OK to allow
disabling the current phase? Is it OK to allow selecting a disabled
phase as the current phase?
Since I'm not sure about it, for now I'm leaving it the same way it was.
Co-authored-by: Julian Herrero <microweb10@gmail.com>
In commit 905ac48bb we activated exceptions when assets were not found,
in order to detect places where we were trying to load non-existent
images.
We got an exception for that reason: we were loading images based on the
current locale, but for some locales there was no images.
We're now using fallbacks and loading another image when the original
one isn't available.
Note we're copying the English images to images with a generic name for
the case where there's no fallback with an image. We're copying the
files instead of using symbolic links to make sure they can be
overwritten independently in other CONSUL installations.
Also note we're updating the HTML so the section gets the ID instead of
the header. That way the system test is simple.
Checking the `style` attribute fails in JavaScript tests because the
browser converts colors to the `rgb()` format.
So we're testing the generated HTML in a component test while
simplifying the system test.
Now it's easier to change the investments filter. Previously we had to
go back to the budget index page, change the filter there, and then
select one heading.
Now the links to change the current filter in the budget index page
aren't needed anymore.
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>
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.
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.
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.
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.
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.
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"...
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.