Commit Graph

17 Commits

Author SHA1 Message Date
karim-semmoud
3a623c070f Add tests for budget images with brackets / quotes 2023-06-27 13:57:51 +02:00
decabeza
10cd182774 Add more images to admin site customization 2022-08-17 13:51:13 +02:00
Javi Martín
8e6df7f5d9 Use Active Storage to render custom images
Just like we did with regular attachments, we're moving the logic to
generate URLs out of the model.

Note we're changing the `image_path_for` helper method in order to
return a `polymorphic_path` because sometimes it's used in combination
with `favicon_link_tag`, and `favicon_link_tag` doesn't automatically
generate a polymorphic URL when given an `ActiveStorage::Attachment`
record.
2022-02-23 18:21:38 +01:00
Javi Martín
701378d02c Add padding to the whole header
Instead of adding the padding to each individual element inside the
container, why not adding padding to the container itself? The answer is
"because we want the background of the children elements to take the
width of the whole screen". But this generates either HTML cluttered
with elements to add padding or repetitive padding definitions in the
CSS.

So now we only define the padding once, and when an element requires a
full width background or border, we use the `full-width-background`
mixin.

In this case the code is a bit more complex because the header is also
used in the dashboard and admin layouts:

* In the public layout, the body has a margin, so we include the mixin
  to take margin into account
* In the dashboard layout, the header itself has a margin, so we include
  the same mixin
* In the admin layout, the headet doesn't have a margin but gets the
  whole width, so in this case we include the mixin which dosen't take
  the margin into account

In the future, the idea is to apply this principle to the <body>
element and remove the `@include grid-column-gutter` in the CSS as well
as the `small-12 column` classes in the HTML.

Note we use the `calc()` function inside the mixin instead of using it
in the `$full-width-margin` variable. That way we avoid nested `calc()`
operations, which don't work in Internet Explorer.

Also note we're using `flex-grow: 1` to make one element appear on the
left of the screen and the other one on the right. It would be easier to
use `justify-content: space-between` (which is actually the default for
the top-bar element). However, there's a bug in Internet Explorer and
old versions of Firefox; they include the absolutely-positioned
`::before` element we use to set the full width background when
calculating where to position the elements. The bug was fixed in Firefox
52 (released in 2017).

Finally, we're removing the padding from our logo. In order to allow
logos like the new one and at the same time provide backwards
compatibility to logos in existing CONSUL installations, we're relaxing
the validation rule for the logo width.
2021-07-09 03:45:55 +02:00
Senén Rodero Rodríguez
ac6260a2ef Mock remote census responses in tests using XML
By using real XML responses developers will be able to understand better
how the integration works (the data flow), and the correspondency between
`remote_census` settings and their place at a real XML response.

As `stubbed_responses` methods were removed from the model layer now the
stubbing part should be managed from the test environment code so also
added a new helper module `RemoteCensusSetup` that can be used anywhere
where we need to call the web service.

Co-Authored-By: Javi Martín <javim@elretirao.net>
2020-11-02 11:42:39 +01:00
Senén Rodero Rodríguez
a150f2161e Validate inclusion of document type in allowed document types
* Add custom message for inclusion validation to include the allowed values.
* Force user to choose document_type from select lik the one shown at verification form.
* Convert stored document_type to a human readable text
2019-11-07 16:26:19 +01:00
Senén Rodero Rodríguez
615bfadca8 Add local_census_records importation model
This model without database allow us to validate incoming file extension and
headers and also does the following during importation process:

* Ignore empty rows
* Classifiy rows in two groups: created_records, invalid_records
2019-07-29 13:07:24 +02:00
decabeza
43dd3d2169 Include mailer header logo on custom images list 2019-05-21 11:22:04 +02:00
decabeza
045c4eca64 Allow change map image from admin site customization
Also adds on site customization image.rb jpeg content type to allow replace this image.
2019-01-24 14:55:01 +01:00
decabeza
c15769ba48 Updates logo header sizes and images for specs 2018-07-30 19:55:43 +02:00
Bertocq
fb1f45ba6b Add two more pdf fixture files for testing 2018-01-03 17:38:44 +01:00
Senén Rodero Rodríguez
c6dabedb4a Add missing image model spec. Add shared specs to check image validations at any imageable model 2017-09-26 13:55:03 +02:00
Senén Rodero Rodríguez
c914c772c0 Add budget investment image dimmensions validator. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
4f5a552486 Added image content type validation to only allowing jpg images. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
34d06dad04 Add document model validations and model shared specs. 2017-08-25 17:27:37 +02:00
decabeza
2844c03e43 adds consistency on social media filenames 2017-07-18 11:40:19 +02:00
Amaia Castro
8143fe1037 Site customization: images uploads 2017-04-06 17:00:04 +02:00