Commit Graph

118 Commits

Author SHA1 Message Date
Javi Martín
27468b0b7b Use relative URLs where possible
In general, we always use relative URLs (using `_path`), but sometimes
we were accidentally using absolute URLs (using `_url`). It's been
reported i might cause some isuses if accepting both HTTP and HTTPS
connections, although we've never seen the case.

In any case, this change makes the code more consistent and makes the
generated HTML cleaner.
2019-10-20 17:26:14 +02:00
Javi Martín
6b1864fbcd Sanitize translations instead of using _html
Using the `_html` suffix in an i18n key is the same as using `html_safe`
on it, which means that translation could potentially be used for XSS
attacks.
2019-10-09 19:46:47 +02:00
Javi Martín
b66859945e Remove _html suffix from already sanitized texts
Using the `_html` suffix automatically marks texts as HTML safe, so
doing so on sanitized texts is redundant.

Note flash texts are not sanitized the moment they are generated, but
are sanitized when displayed in the view.
2019-10-09 19:46:47 +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
9ddbd01f91 Use active model translations for labels
The same way we did for Active Record, but this time we do it for models
not inheriting fom Active Record.
2019-10-07 01:56:24 +02:00
Javi Martín
3ea9f3cecf Simplify generating form fields with labels
Instead of generating the label and then a field without a label, we can
directly generate a field with a label.
2019-10-05 16:01:58 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Javi Martín
71d9ddd849 Apply rule to end files with a newline character 2019-09-10 20:02:15 +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
Javi Martín
4ab535dec4 Remove comma inside a HTML tag
The typo was detected thanks to erb-lint SpaceInHtmlTag rule.
2019-08-27 17:22:22 +02:00
taitus
ceaf118188 Add new fields to form
- Add :date_of_birth and :postal_code
- Only display new fields when aplication has configured the Remote
  Census API and contains values for fields. Check with Setting Class
  methods:
  - force_presence_date_of_birth?
  - force_presence_postal_code?
2019-07-29 13:10:09 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +02:00
rgarcia
a4f0161aa8 fixes specs related to ActionController params 2019-04-17 17:40:55 +02:00
Javi Martín
3e4e65ead7 Use double quotes inside ERB
We were using single quotes inside ERB code when that code was inside
HTML double quotes.
2019-03-25 14:58:54 +01:00
Julian Herrero
c82b2a975a Add new settings tab for participation processes
- Rename setting keys
- New tab por participation processes
- Hide these settings from features tab
2019-03-19 19:45:32 +01:00
Julian Herrero
0e0462368b Use double quotes in app/views/management 2019-03-19 12:16:50 +01:00
decabeza
b43945ad33 Removes custom content on management and devise views 2018-07-30 17:58:13 +02:00
decabeza
2e8fe65b3d Cleans and improves management views layout 2018-07-02 17:41:39 +02:00
decabeza
57a0aaba97 Reorganizes manager menu and creates helper 2018-07-02 17:41:22 +02:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
iagirre
3a62fc9bda Add UI to let manager change users password
A submenu has been added to the side menu's
'Edit user account' option. This submenu has
two options:

- Reset password via email: an email is send
so that the user can change their password by
themselves.
- Reset password manually: the manager has to
write the password manually (or generate a random
one).

The passwords generated by the random password
generator don't contain characters like $ or !.
It uses some capital letters, some other lower
case letters and some numbers. Ambiguous
characters like 1, l, I has been removed.
2018-04-02 09:43:24 +02:00
rgarcia
01ef439053 Display only current budget to Managers printing investments
In the specs, some investment were missing a heading_id, thus creating
another unexpected budget

By explicitly setting the heading_id we can control better which
budgets are created in each test
2018-01-15 22:02:04 +01:00
Pedro Ríos Flores
87d4fa92b4 Wrapped the last link under the same if clause. 2017-10-09 13:09:09 +02:00
Pedro Ríos Flores
693030ff17 Wrapped two links under the same if clause. 2017-10-09 12:26:34 +02:00
Pedro Ríos Flores
323b05f4de Issue #1901: Budget related entries in Management shouldn't appear if budgets are globally disabled. 2017-09-29 12:30:02 +02:00
decabeza
98961748ad replaces more old back link partial to new back_link_to helper 2017-07-27 00:26:39 +02:00
decabeza
af7807ce9f Updates custom note class to foundation help-text 2017-06-27 10:29:36 +02:00
Juanjo Bazán
315c57929a allows managers to create users without email
allows managers to create users without email

hides email preferences from account page for email-less users

prevents email delivery to users with no email

adds spec for user creation from management

adds specs for user's email requirement

adds spec for no deliveries if no email
2017-06-19 13:02:48 +02:00
decabeza
76b7f66fb3 fixes scss lint warnings 2017-06-16 12:09:01 +02:00
Bertocq
e14a5b2eaf Avoid using Date.today, better to use Date.current that takes timezone into account 2017-06-11 10:41:06 +02:00
decabeza
a9272e6b96 removes unused i18n keys 2017-06-05 16:30:07 +02:00
Alberto Garcia Cabeza
dadfdba1b1 adds date of birth form when manager creates new user 2017-03-20 11:59:22 +01:00
Alberto Garcia Cabeza
5fa6131e28 fixes management layout 2017-01-09 13:37:47 +01:00
kikito
e0c0b18757 Sets partial locals correctly in use and management views 2016-12-16 18:01:20 +01:00
kikito
2a9957cea0 Extracts budget investment form to partial 2016-12-15 19:36:13 +01:00
kikito
869f7b39d6 fixes i18n 2016-12-08 11:49:13 +01:00
kikito
748fd8becf Makes all tests pass in bi management 2016-12-07 19:16:37 +01:00
kikito
b3be1633af Fixes all management bi issues except filtering by geozone 2016-12-07 16:35:27 +01:00
kikito
2760e751e7 fixes several specs 2016-12-06 20:09:17 +01:00
kikito
7afa12fa4e Adds dom_ids to views 2016-12-06 20:09:04 +01:00
kikito
e793a0d8e1 Adapts management::budget_investments to new budgets 2016-12-06 18:05:58 +01:00
kikito
0564392964 Introduces management budgets 2016-12-06 18:02:25 +01:00
kikito
8ef479bf31 Changes routes to use budgets resource instead of namespace 2016-12-06 18:01:37 +01:00
kikito
350d79d20a management menu: use && . Refactor bi conditions 2016-12-06 17:47:45 +01:00
kikito
882565aeca Adds more controller variables and uses them in investment controller 2016-12-05 17:35:40 +01:00
kikito
c64c88da43 Fixes typo 2016-12-05 11:13:57 +01:00
kikito
6aab9f5253 renames _investment to _investment_show 2016-12-02 19:32:56 +01:00
kikito
c1f62dd317 Reimplements several bi views 2016-12-02 19:23:46 +01:00
kikito
bd8d3aaf04 Removes old views 2016-12-02 19:21:28 +01:00
kikito
83d254adae Moves views from one folder to another 2016-12-02 19:19:22 +01:00