Commit Graph

88 Commits

Author SHA1 Message Date
Javi Martín
629e208e9d Add and apply ArgumentAlignment rubocop rule
We're choosing the default `with_first_argument` style because it's the
one we use the most.
2023-08-18 14:56:16 +02:00
Javi Martín
44e3a393a0 Move navigation and footer partials to components
This way it'll be easier to decide when they should be rendered.

In order to be consistent, we're using the `Layout` module for both
components; previously, the navigation partial was in the `shared`
folder while the footer partial was in the `layout` folder, which IMHO
didn't make much sense.
2023-01-16 14:22:23 +01:00
Javi Martín
2c0ede3aaa Use the dir attribute in dashboard and mailer layouts
We forgot to do so in commit d827768c0. In order to avoid the same
mistake in the future, we're extracting a method to get these
attributes. We're also adding tests, since we didn't have any tests to
check that the `dir` attribute was properly set.
2022-11-11 01:39:29 +01:00
Javi Martín
231a7aa8ee Remove unused code to track events
We forgot to remove it in commit f28a5cc49.

The generated HTML was invalid, with the error:

> Element meta is missing one or more of the following attributes:
> content, property.
2021-12-30 17:05:07 +01:00
Javi Martín
0be6eb9512 Add and apply Style/RedundantParentheses rule
Parentheses make the code harder to read in these cases.
2021-09-03 11:49:52 +02:00
Javi Martín
d827768c07 Set HTML dir attribute in RTL languages
This way properties flex layouts text direction will work properly.
2021-08-16 17:47:34 +02:00
Javi Martín
b5fd875133 Simplify border and background in admin header
Instead of defining them for all headers and then overwriting them, we
can add it just to the body of the public layout.
2021-07-07 15:10:27 +02:00
Javi Martín
2eb255e85a Apply Rails/SafeNavigation rule in ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
bb2e2fa0a3 Move main <h1> tag inside main header
A <header> tag is the natural place to have headings.

Since we already had the logo there, IMHO it makes sense to merge both
the <h1> tag and the logo together. We were already doing so in the
devise layout.

From the sceen reader users' point of view, having a link with the text
"CONSUL logo" is a bit confusing, since it seems to imply the link will
get us to the CONSUL logo. Using the organization name as the text of
the link makes more sense.

One thing changes, though. Before this commit, the first thing on the
page a screen reader user would hear about would be the organization
name. Now the language selector and the top links are announced before
the organization name is read. That's fine, since the actual first thing
these users will hear is the content of the <title> tag, which contains
the organization name as well.
2020-11-23 18:05:43 +01:00
Javi Martín
d4a360c7fb Simplify main layout styles
We were using a "push" div in order to force the footer to the bottom,
and were using a wrapper with a minimum height and negative margins.

The same thing can be accomplished using flex and making the wrapper
fill the empty space, which in my humble opinion simplifies the code and
makes it easier to follow.

We could further simplify the code by removing the wrapper div or the
footer wrapper, although I'm not sure the benefits overcome potential
inconveniences caused to other institutions who might have custom styles
based on the existence of these wrappers.
2020-11-23 18:04:55 +01:00
Javi Martín
442baf8384 Remove browser gem direct dependency
While the browser gem is great, we don't need it in this case for such a
simple usage.

There are a few really small differences between this code and the old
one: matching `/MSIE/` will return true for Opera 12 and false for
certain versions of IE11. Since we're only rendering a comment for IE8
and below, we don't care about IE11, and Opera 12 is six years old and
its users won't be affected by the comment.

Note we're still using the browser gem because ahoy_matey depends on it,
but now it's an indirect dependency.
2019-11-18 13:12:35 +01:00
Javi Martín
89402bdbf6 Use raw instead of html_safe
They do the exact same thing; however `html_safe` might confuse
developers into thinking it will make the HTML safe. Using `raw` makes
it clear that we're inserting the text without escaping it.
2019-10-08 19:10:13 +02:00
Javi Martín
928312e218 Use sanitize in translations with links
Sometimes we're interpolating a link inside a translation, and marking
the whole translations as HTML safe.

However, some translations added by admins to the database or through
crowdin are not entirely under our control.

Although AFAIK crowdin checks for potential cross-site scripting
attacks, it's a good practice to sanitize parts of a string potentially
out of our control before marking the string as HTML safe.
2019-10-08 18:46:21 +02:00
Javi Martín
6b12da7654 Fix ERB being used in an HTML comment
This was causing erb-lint to issue a warning.
2019-10-08 18:46:20 +02:00
Javi Martín
55a190f44a Remove unneeded _html suffix in I18n keys
This suffix does the same thing as calling `.html_safe` on them. So we
don't need to use it in texts that don't use HTML.
2019-10-08 13:20:22 +02:00
Javi Martín
738e9ebc8b Remove code specific to Internet Explorer 8
Internet Explorer 9 was released eight years ago. Besides that, we don't
really support IE8 anyway, since we show a popup to IE8 users saying
we don't support it, we haven't maintained the IE8-specific CSS file for
years, and we don't test our JavaScript against IE8.
2019-09-10 22:43:37 +02:00
Javi Martín
911fe4e481 Simplify calls to render partial
We're also adding a bit of consistency, since most of our calls to
partial rendering omit the `partial` and `locals` keys.
2019-09-04 15:00:36 +02:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Julian Herrero
4df9a1a1b4 Move HTML settings to content blocks settings page
- Rename html settings keys
- Show html settings next to content blocks page
- Hide html settings from configuration tab
2019-03-19 19:45:34 +01:00
Julian Herrero
25ed245689 Use double quotes in app/views/layouts 2019-03-19 12:16:50 +01:00
Juan Salvador Pérez García
89f3da25b9 Implements #138 and #139
Implements graph with supports for the given  period.
2018-07-17 17:52:47 +02:00
Javier Martín
6e4f697cea Extract partial with common <head> tags. 2018-06-24 02:43:59 +02:00
Alessandro Cuoghi
c913687be5 Moved below the header the recomended. Changed orbit-bullets diameter.Align text on the left. Used all width space for each container of the recomended. 2017-08-01 16:28:01 +02:00
decabeza
3bcfaeb61a replaces sr-only class to show-for-sr 2017-06-13 17:51:57 +02:00
Alberto Garcia Cabeza
b29a353ce5 adds rel canonical on main sections 2017-05-08 15:06:18 +02:00
Amaia Castro
9e5324cc1b Merge branch 'master' into site-customization 2017-04-07 17:29:33 +02:00
Amaia Castro
8143fe1037 Site customization: images uploads 2017-04-06 17:00:04 +02:00
Alberto
6bbcc71ecb Merge branch 'master' into polls 2017-04-06 14:16:49 +02:00
Alberto Garcia Cabeza
8f13c0e2ec adds setting to add per page code on <head> and <body> 2017-03-16 17:04:36 +01:00
Juanjo Bazán
08ea4b35eb Merge branch 'master' into polls 2017-01-02 12:14:40 +01:00
Alberto Garcia Cabeza
d8b4af5add adds meta description and keywords 2016-12-30 17:17:46 +01:00
Juanjo Bazán
5ec12e4b5b Merge branch 'master' into redux-polling 2016-12-27 18:22:06 +01:00
Alberto Garcia Cabeza
8cbd39df69 adds styles to wrapper and new partial to filter subnav vertical 2016-12-22 18:31:26 +01:00
Alberto Garcia Cabeza
5d96a75657 adds icon rel on apple-touch-icon image 2016-12-21 12:51:59 +01:00
Alberto Garcia Cabeza
2249fdbdfa improves outline and structure headings 2016-11-14 17:45:20 +01:00
Alberto Garcia Cabeza
0972f5284a Creates new scss file for IE styles 2016-06-23 13:56:57 +02:00
kikito
8bcbe86064 Refactor layout flash usage and move to a partial 2016-04-28 12:46:27 +02:00
palomahnhp
b4ec077f16 Merge remote-tracking branch 'origin/master' into tracking_user_verifications_and_others
Conflicts:
	app/assets/javascripts/application.js
2016-04-20 11:28:06 +02:00
Alberto Garcia Cabeza
f6571662a2 Adds title on links with target blank 2016-03-14 19:32:49 +01:00
palomahnhp
7d4936b577 track user verification and add statistics of verified users who did not vote proposals 2016-03-13 21:38:05 +01:00
Juanjo Bazán
4a888e95c2 disables js fx in specs via poltergeist config 2016-03-04 12:26:47 +01:00
kikito
64fbb8a9df disables slidetoggle when running tests 2016-03-01 18:28:02 +01:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
rgarcia
17d6b55fb3 adds notice with html after spending proposal creation 2016-02-21 18:04:11 +01:00
Juanjo Bazán
0325dd6199 refactors settings/flags helper to memoize values 2016-02-04 17:45:43 +01:00
Josep Jaume Rey Peroy
ba74542c3d Parameterize social links 2016-01-18 12:43:36 +01:00
kikito
9c1990b060 fixes typo in layout.html.erb 2015-12-22 16:37:26 +01:00
kikito
1df5bf582f Renames per_page_javascript to per_page_code 2015-12-22 16:21:37 +01:00
kikito
963e33005b allows nil values in per_page_js setting 2015-12-22 15:38:16 +01:00
kikito
1c71358abe adds a setting allowing including custom javascript on each page header 2015-12-22 13:29:41 +01:00