Commit Graph

64 Commits

Author SHA1 Message Date
Javi Martín
a868a5ff35 Change Foundation text direction in RTL languages
This way, when the language is written form right-to-left, elements
using Foundation mixins/classes will float to the opposite direction as
they do in left-to-right languages. The same will apply to text
alignment.

To offer full support for RTL languages, we need to change every single
reference to `float: left`, `float: right`, `text-align: left`,
`text-align: right`, and possible adjust other properties like `left`,
`margin-left`, `padding-left` or `border-left`. In the meantime, we at
least partially support these languages.

Replacing `float` with `flex` when possible would also improve RTL
support.
2021-08-16 17:47:33 +02:00
Javi Martín
bf10cf0c18 Simplify calls to content_block helper
All calls were using `I18n.locale` as the second parameter, so we might
as well make it optional.
2021-06-24 13:15:04 +02:00
Julian Herrero
151aa6009d Allow links and images on legislation drafts
Note we're using a new sanitizer. Ideally we'd reuse the
`AdminWYSIWYGSanitizer`, but then code that would be correctly shown by
markdown-it (like the <h1> tag) wouldn't be shown on the web, which is
confusing. Ideally we would configure markdown-it to only allow the tags
present in the `AdminWYSIWYGSanitizer` and provide some kind of help
showing which tags are allowed.
2020-08-10 12:20:59 +02:00
Javi Martín
749428d93f Replace content_tag with new tag builder syntax
One of the main advantages of this syntax is we can now omit the content
parameter when it's empty.
2020-04-27 19:26:37 +02:00
Javi Martín
31c21ddd42 Keep current host in links to current path
This way we avoid a possible unprotected redirect.
2019-11-12 19:28:35 +01:00
Javi Martín
3eda2de2d5 Remove unused helper methods
They aren't used since commits a6585361, 3752f3a5, 88a7a29d, eef8ad1b,
f67f058b, 04910fea and 9181610d. The method `image_bytes_to_megabytes`
was never used and is a duplicate of the method `bytes_to_megabytes`.
2019-11-10 00:34:45 +01:00
Javi Martín
d0d681a44b Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when
a method starts with a `return` statement.

In other cases, we probably shouldn't have a guard rule in the middle of
a method in any case, but that's a different refactoring.
2019-10-24 17:56:03 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
ae2576020e Extract method to use WYSIWYGSanitizer in views
This is similar to methods we use like `sanitize` or `markdown`.
2019-10-21 21:32:02 +02:00
Javi Martín
11e52dbe98 Remove kaminari_path
The main reason to use it was the `rel` attribute for previous/next
pages not being indexed correctly by certain search engines when using a
relative URL. However, AFAIK that only applied to `<link>` tags, not to
`<a>` tags, and only if a `<base>` tag was defined.

In any case, it looks like the same search engines don't use the `rel`
attribute for previous/next to index pages anymore.
2019-10-20 17:26:14 +02:00
Javi Martín
9eee79f218 Sanitize markdown output
We were using the markdown renderer with the `filter_html` option set to
false, so we weren't removing hypothetical `<script>` tags.
2019-10-08 18:46:21 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
Julian Herrero
7e422f2187 Fix bug management print voted investments
If budget is in balloting phase and there are voted investments, it
was not possible to print budgets investments because the ballot was
never being loaded in the controller and therefore an error was raised
when rendering the view.

Failure/Error: <% if ballot.has_investment?(investment) %>

  ActionView::Template::Error:
    undefined method `has_investment?' for nil:NilClass
      app/views/budgets/investments/_ballot.html.erb:3
      app/views/budgets/investments/_investment.html.erb:88
      app/views/custom/management/budgets/investments/print.html.erb:26
2019-04-17 14:19:32 +02:00
decabeza
91be3cf775 Fix more hound warnings 2019-03-27 15:22:14 +01:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Julian Herrero
b460c024f3 Use double quotes in app/helpers 2019-03-15 09:26:49 +01:00
Alberto
098f4b6c5f Merge pull request #3328 from consul/admin-settings
Improve Admin settings section
2019-02-27 10:49:54 +01:00
decabeza
ccee843da7 Remove unused settings
These settings are customised for Madrid's fork. On CONSUL any user can include new links using site customisation content blocks from admin panel.
2019-02-18 15:40:11 +01:00
Julian Herrero
884274c4ad Add a description for open polls 2019-02-18 13:34:07 +01:00
decabeza
4db54092e6 Removes unrelated dashboard changes 2018-10-18 01:26:07 +02:00
Juan Salvador Pérez García
6412f95e56 Added comments
Added comment to clarify obscure method
2018-09-17 09:10:31 +02:00
Juan Salvador Pérez García
983c108272 Second atempt to fix issue with sprockets 2018-07-31 13:02:57 +02:00
Juan Salvador Pérez García
87d92b2553 Fixed issue with sprockets in production 2018-07-31 12:59:02 +02:00
Juan Salvador Pérez García
6cc1ddb9af Fixes #231
Implements a poster feature for the proposals dashboard
2018-07-31 12:50:25 +02:00
Bertocq
6e843730b0 Replace format_price for Budget#formatted_amount
ApplicationHelper#format_price and Budget#formatted_amount has the same
objective and code, but the Budget#formatted_amount method also uses the
currency of the Budget to correctly give currencies format.

By replacing usage of format_price with formatted_amount we can remove
format_price and have a single location for currency format logic.
2018-03-08 13:26:36 +01:00
Bertocq
b72e43168b Use user locale instead of default locale to format currencies 2018-03-08 10:20:05 +01:00
Bertocq
b2c03192bb Fix kaminari path url helper function 2017-11-19 13:33:49 +01:00
Bertocq
f4af87f8a1 Add kaminari url path helper function 2017-11-18 10:44:30 +01:00
decabeza
bd27767d06 fixes content_tag span on back_link_to helper 2017-07-27 00:50:55 +02:00
Bertocq
10da3dba58 Use content_tag to render span icon on back link helper 2017-07-26 19:13:46 +02:00
decabeza
0b235d69d4 adds consistency for back links 2017-07-26 18:18:30 +02:00
decabeza
5e0d5fc8c3 Merge branch 'legislation-module-stable' of https://github.com/medialab-prado/consul into medialab-legislation 2017-05-22 18:43:49 +02:00
rgarcia
ed5a1cecbb adds budget results 2017-05-19 14:04:46 +02:00
Amaia Castro
c1de2dced4 Custom content blocks for top_links and footer 2017-04-06 17:00:05 +02:00
Amaia Castro
8143fe1037 Site customization: images uploads 2017-04-06 17:00:04 +02:00
Amaia Castro
a2a61341fe Merge branch 'master' into legislation-module-stable 2017-01-11 22:54:41 +01:00
Juanjo Bazán
dd268c18d7 adds back_link_to helper 2017-01-11 13:01:49 +01:00
Amaia Castro
3ba6b409aa Make markdown helper safer to use
Avoid exception if text is nil
2017-01-03 21:41:00 +01:00
Juanjo Bazán
06596ac4d8 adds author_of? helper method 2016-06-15 17:01:50 +02:00
Alberto Garcia Cabeza
e40f411ecc Removes unused header css method 2015-12-15 17:04:03 +01:00
Ana
23cbe7ee9f how to use moved to locale files 2015-12-06 22:13:39 +01:00
Ana
0abe9a7fd9 Eliminated explanation comments about redcarpet options 2015-12-06 18:06:01 +01:00
Ana
ec25d5f6fa how it works page moved tolocale files using markdown 2015-12-05 16:10:19 +01:00
Juanjo Bazán
349288b992 removes provisional transparency page 2015-12-03 12:51:51 +01:00
Juanjo Bazán
26da253a5d moves helper method to votes helper and adds spec 2015-09-15 14:44:12 +02:00
Juanjo Bazán
1c5f77def2 makes percentage votes to sum 100 2015-09-15 14:11:12 +02:00
Juanjo Bazán
0062ea13e9 fixes build 2015-09-13 14:26:09 +02:00
Alberto Garcia Cabeza
3255995ea1 Adds new styles for pages 2015-09-03 14:15:01 +02:00
rgarcia
4897d5df4e makes spaces consistent 2015-09-03 01:29:46 +02:00
kikito
a7929c607d adds a helper to simplify the way selects and filters are rendered 2015-08-28 20:07:45 +02:00