Commit Graph

78 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
8b13daad95 Add and apply rules for multi-line hashes
For the HashAlignment rule, we're using the default `key` style (keys
are aligned and values aren't) instead of the `table` style (both keys
and values are aligned) because, even if we used both in the
application, we used the `key` style a lot more. Furthermore, the
`table` style looks strange in places where there are both very long and
very short keys and sometimes we weren't even consistent with the
`table` style, aligning some keys without aligning other keys.

Ideally we could align hashes to "either key or table", so developers
can decide whether keeping the symmetry of the code is worth it in a
case-per-case basis, but Rubocop doesn't allow this option.
2023-08-18 14:56:16 +02:00
Javi Martín
3f84ab0758 Add test case for adding budget poll results
While writing the test, we noticed it didn't work because the labels
weren't correctly generated, so we're fixing them as well.
2022-03-21 21:33:07 +01:00
Javi Martín
1632540984 Remove redundant placeholders in forms
Using placeholders having similar (or identical) text as already present
as a label has a few issues.

First, it's a distraction. Reading the same information twice is
useless, requires an extra effort, and might even frustrate users.

Second, if users start typing before reading the placeholder and see it
disappear, they might think they're missing relevant information,
delete what they typed, and read the placeholder. That will get them
nowhere.

Finally, we display placeholders using a text offering very low contrast
against the background, so users don't think the placeholder is an
actual value entered in the field. Using such low contrast makes the
text hard to read, particularly for users with visual impairments.

So we're removing these placeholders.

This commit only deals with placeholder texts with similar (or
identical) texts as the label text. There might be other places where we
should replace placeholder texts with labels, but that's a different
topic.
2021-06-23 19:52:45 +02:00
Senén Rodero Rodríguez
588fac6055 Rename method and placeholder
As `residence_in_madrid` is too specific.

We should port this commit to main repo.
2021-03-02 13:15:15 +01:00
Javi Martín
67c6515405 Apply Style/CollectionMethods rule to ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
bdf30aa14e Use CSS to display icons in the admin menu
This way we simplify the HTML and generating similar menus will be
easier. We also improve the experience for screen reader users, who
might have been hearing the icons as text because we weren't using the
`aria-hidden` attribute.

We're still keeping the "icon-" classes for compatibility with CONSUL
installations which might have changed this code.
2020-11-27 12:33:42 +01:00
Javi Martín
f2e32b44b1 Fix blank space in admin content
In some situations where JavaScript makes content disappear, the height
of the element calculated by foundation's equalizer isn't recalculated,
leaving blank space at the bottom of the page. I've seen cases where a
blank vertical space of 2000 pixels is on the page.

Using flexbox solves the problem, since CSS takes care of everything.
2019-12-19 16:02:31 +01:00
Javi Martín
5fe56a62f1 Remove useless label false parameter in select_tag
`select_tag` creates just a select with no label, so there's no need to
specify `label: false`.
2019-10-06 19:32:04 +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
c62da726b8 Apply SpaceAroundErbTag ERB Lint rule 2019-09-10 20:02:15 +02:00
Javi Martín
488461b8ac Remove consecutive blank lines 2019-09-10 20:02:15 +02:00
taitus
230d1a4e9d Not display :year_of_birth when :date_of_birth is present 2019-07-29 13:10:09 +02:00
taitus
3e383d7c1f Add new fields to form
- Add :date_of_birth and :postal_code
- Only display new fields when aplication has configured the
custom census API and contains alias values for fields. Add 2
class Setting methods to check this feature:
  - force_presence_date_of_birth?
  - force_presence_postal_code?
2019-07-29 13:10:09 +02:00
voodoorai2000
e1141d1cd3 Display already voted message for budget polls
Budget polls behave slightly differently to non-budget polls.

In budget polls we use Budget::Ballot::Lines to verify if a user has already voted online. In non-budget polls we use Poll::Voter to verify this.

In this commit we are adding an extra check to make sure that the correct message is displayed if the user has already voted online for a budget poll[1]

[1] https://github.com/AyuntamientoMadrid/consul/blob/master/spec/features/budget_polls/voter_spec.rb#L122
2019-05-24 15:20:54 +02:00
voodoorai2000
5abde6da6e Simplify html tag structure 2019-05-24 15:20:54 +02:00
voodoorai2000
29f5268e42 Display polls for current booth
Polls that were not votable by a user were not being displayed in the officing interface. Creating a confusing situation for officers.

With this commit polls that are not votable by a user will be displayed, with the corresponding message explaining that that poll can only be voted by residents of a certain geozone.
2019-05-24 15:20:54 +02:00
María Checa
394177213c Adds Ballot Sheet model and business logic 2019-04-10 16:04:39 +02:00
María Checa
ccf8d3a8e2 Adds ballot sheets controller and main views 2019-04-10 16:03:47 +02:00
decabeza
17730a41dd Hides not to vote at this time button if already voted 2019-03-28 15:50:34 +01:00
decabeza
170cc45a20 Shows message on index if officer has no shifts 2019-03-28 15:50:34 +01:00
rgarcia
9c59c8b68e displays booth location instead of booth name 2019-03-28 15:47:52 +01:00
rgarcia
b4499321d3 stores officer booth on sign in 2019-03-28 15:47:52 +01:00
rgarcia
cc4eed3500 fixes specs 2019-03-28 15:47:52 +01: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
rgarcia
151239924b Display 'validate document' menu item only when applicable
We are trying to avoid Officers from forgetting to click the “Confirm
vote” button, which is necessary to keep track of who has voted a Poll

To do that, we are not displaying the menu item to go back to the next
person that wants to vote, until the Officer clicks the “Confirm Vote”
button or the “The user has decided not to vote” button

Note: Due to mobile version we have duplicate ids, so using classes for
the menu items to hide them without errors

Note2: We are only hidding the menu item, if there are votable polls,
otherwise the “Confirm vote” button does not appear, and there is no
way of going back to help the next person that wants to vote
2019-03-06 18:33:07 +01:00
Alberto
95f66aefe6 Merge pull request #2726 from consul/officing-no-vote
Officing not to vote
2018-07-05 17:07:10 +02:00
decabeza
2f922e1adb Adds button to officing voters if person decided not to vote 2018-07-05 14:12:22 +02:00
decabeza
16ff5c4400 Hides sidebar menus if officer has no shifts assigned 2018-07-04 17:22:03 +02:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
BertoCQ
c6d683083f Merge pull request #2073 from consul/feature/2072#remove_question_valid_answers
Remove valid answers usage
2017-10-18 11:52:14 +02:00
BertoCQ
98ba367dfd Merge pull request #2069 from consul/chore/fix_officing_final_result_date
Force Officer results to current date instead of datepicker
2017-10-18 10:59:07 +02:00
Bertocq
e9294f2a22 Switch from valid_answers to question_answers usage for Poll Questions 2017-10-18 01:32:15 +02:00
Bertocq
ceec71e558 Remove no actions message for citizen that already voted at officing panel 2017-10-17 21:42:03 +02:00
Bertocq
04910fea5b Remove officing results date picker for current date 2017-10-17 21:00:19 +02:00
rgarcia
200db22cbb only update the poll that was just voted 2017-10-13 15:15:54 +02:00
decabeza
234d4d3f54 hides can vote callout when voted 2017-10-13 14:45:30 +02:00
decabeza
6b721e7750 moves table content to partials 2017-10-13 14:40:39 +02:00
decabeza
5540f130e1 removes unused partials 2017-10-13 14:16:33 +02:00
decabeza
386fe785c7 improves text and layouts for officing voters views 2017-10-13 14:16:21 +02:00
rgarcia
cd6cf3bda1 uses default rails helper to disable submit button 2017-10-13 12:41:33 +02:00
rgarcia
560ff7c51d does not use custom implementation to disable submit button 2017-10-13 12:40:42 +02:00
Bertocq
b5cf28cb35 Swap Poll White/Null/Total usage for Poll Recount 2017-10-02 15:46:49 +02:00
Bertocq
a3bf69e78d Remove final result usage on admin poll officer assignments results 2017-09-19 01:13:04 +02:00
Bertocq
e8d748a881 Add Poll Total recount to officing and admin 2017-09-14 15:33:58 +02:00
Bertocq
f7568a394f Remove officing final recounts controller, spec and view 2017-09-14 13:39:21 +02:00
Bertocq
bae6669165 Remove final recount button from officing 2017-09-14 13:37:47 +02:00
Bertocq
c40294e931 Remove officing recount feature 2017-07-23 23:28:38 +02:00
Alberto Garcia Cabeza
9a03507a0c adds autocomplete off and type number on officing residence form 2017-02-07 20:11:55 +01:00
Juanjo Bazán
2a902c68eb adds creation of null and white results by poll officers 2017-02-03 19:11:04 +01:00