Commit Graph

1687 Commits

Author SHA1 Message Date
decabeza
f685020fd0 Show results and stats settings only in budget edit view 2021-02-23 16:11:14 +01:00
decabeza
f27c0f46c3 Adjust styles for large sceens 2021-02-23 16:11:14 +01:00
decabeza
d0534b78da Improve admin budgets form structure
Co-Authored-By: Javi Martín <javim@elretirao.net>
2021-02-23 16:11:13 +01:00
Julian Herrero
6cec263d67 Add help text in budget phases
Co-authored-by: decabeza <alberto@decabeza.es>
2021-02-18 23:40:40 +01:00
Julian Herrero
0019974ccc Add help text in budget headings admin index
Co-authored-by: decabeza <alberto@decabeza.es>
2021-02-18 23:40:40 +01:00
Julian Herrero
ef6940c3e7 Add help text in budget groups admin index
Co-authored-by: decabeza <alberto@decabeza.es>
2021-02-18 23:40:40 +01:00
Julian Herrero
b1cb981980 Add help text in budgets admin index
Co-authored-by: decabeza <alberto@decabeza.es>
2021-02-18 23:40:40 +01:00
Javi Martín
435747764c Group links to create budgets with the heading
We're going to add help content here and having a floating button would
make the button disappear when creating content for mobile phones.

I'm not sure having the link in the <header> tag is semantically
correct, but is consistent to what we did to create local targets in the
SDG content section.

Note we're changing the style of the link to create local targets so
it's consistent with the link to create budgets/groups/headings.
2021-02-18 23:40:40 +01:00
decabeza
16dc5821d1 Add margin to all h3 admin headers 2021-02-18 15:46:16 +01:00
Javi Martín
5569663308 Use aria-expanded on column selector toggle button
This way screen reader users will be informed about what happens when
the button is clicked. We also simplify the HTML/JavaScript a little
bit.
2021-02-08 19:57:42 +01:00
Javi Martín
00dfa95902 Allow toggling the column selector with a keyboard
Using a button tag, it's possible for every user to "click" the element.
Besides, we don't need to call the `preventDefault` function, because
buttons with type "button" don't do anything by default.
2021-02-08 19:57:42 +01:00
Javi Martín
1c2886debb Remove redundant condition
The association `organization.user` returns `nil` when the user is
hidden.

This was discovered thanks to the `Style/AndOr` rule. We were using
`and` and `||` on the same line, which is confusing.
2021-02-05 17:46:23 +01:00
Javi Martín
82200c5d0b Apply ParenthesesAsGroupedExpression rule in ERB 2021-02-05 17:46:23 +01:00
Javi Martín
c1cf9f0c34 Apply Style/SymbolProc rule in ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
2eb255e85a Apply Rails/SafeNavigation rule in ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
0911b89d16 Add name attribute to heading content blocks
This way we can simplify the code and don't have to rely on `.try`
statements which are confusing and so we don't allow them in the
`Rails/SafeNavigation` Rubocop rule.
2021-02-05 17:46:23 +01:00
Javi Martín
2d37a0396b Apply Layout/ExtraSpacing rule in ERB files
Note that in Ruby files this rule allows vertical alignment, but doesn't
seem to do the same in ERB. Since we only used vertical alignment in one
place, and that place also had an unneeded extra space on every aligned
line, I've decided to change the code in that place and follow the rule.
2021-02-05 17:46:23 +01:00
Javi Martín
4809a87a78 Apply Style/HashSyntax rule in ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
67c6515405 Apply Style/CollectionMethods rule to ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
f864156b21 Add and apply ClosingErbTagIndent ERB Lint rule
Note this rule does still allow us to add new lines after opening tags;
it just makes sure that if we do, we also add it in closing tags.
Likewise, if we don't add it in the opening tag, it forces us not to add
it in the closing tag either.

I don't have a strong preference about either style; in these cases I've
chosen the latter because it seemed more common in our code.
2021-02-05 17:39:42 +01:00
Javi Martín
8542e3e3cf Merge pull request #4323 from consul/sdg_stats
Add SDG stats page to admin section
2021-01-25 15:18:03 +01:00
Senén Rodero Rodríguez
9b2d349e21 Create SDG stats page 2021-01-23 12:23:29 +01:00
Javi Martín
e96f45ba39 Merge pull request #4325 from consul/add_related_list_selector
Add related list selector component to forms
2021-01-22 16:34:10 +01:00
taitus
7d2b940ad9 Add SDG::RelatedListSelectorComponent to Legislation Process
Allow to relate SDG and Targets to Legislation Process
2021-01-22 16:14:50 +01:00
taitus
1cbf9a3404 Display Goals and Targets relateds on Admin Legislation Process index 2021-01-22 16:14:50 +01:00
taitus
920631c5b3 Add SDG::RelatedListSelectorComponent to Polls
Allow to relate SDG and Targets to Polls
2021-01-22 16:14:50 +01:00
taitus
6e0158db17 Display Goals and Targets relateds on Admin Poll index 2021-01-22 16:14:49 +01:00
Javi Martín
a7bbdb1bd0 Simplify rendering a banner
Now the banner component accepts either a banner or a section and loads
the banner if it's a section, so we don't have to add the `@banners`
variable in several controllers.
2021-01-20 17:22:05 +01:00
Javi Martín
1e7517d1f6 Extract components to edit and add cards
This way we'll be able to reuse it in the SDG Management section while
reusing the `title` method to set the page title.
2021-01-14 17:38:01 +01:00
Senén Rodero Rodríguez
3aaf5ce151 Add back link to cards form
As we normally do in other places.
2021-01-12 15:34:55 +01:00
Javi Martín
5148919c17 Remove duplication in cards tables
We were using the same code in two places, so we're extracting the code
into a component in order to share it.
2021-01-12 14:50:37 +01:00
Javi Martín
b6f133b6c8 Use human attribute name on cards table
We were defining the same texts in three places: admin.homepage.cards,
admin.site_customization.pages.cards and activerecord attributes.
2021-01-12 14:50:37 +01:00
Javi Martín
4c0bb894eb Use polymorphic routes to manage cards
We use a different logic to load the card depending on the controller
we're using, and then share the rest of the code. This way we simplify
the code a bit, since we don't have to check for the page_id parameter.
2021-01-12 14:50:37 +01:00
Javi Martín
c1c84507b8 Make card title mandatory
We didn't add any validation rules to the card model. At the very least,
the title should be mandatory.

The fact that the label field is marked as optional in the form but the
other fields are not probably means description and link should be
mandatory as well. However, since there might be institutions using
cards with descriptions but no link or cards with links but no
description, so we're keeping these fields optional for compatibility
reasons. We might change our minds in the future, though.
2021-01-12 14:44:29 +01:00
Javi Martín
663fba53db Group admin search label translations together
Since there are two different labels/placeholders for poll officers and
also two different ones for users, we're only grouping one of each.
2020-12-21 18:25:45 +01:00
taitus
dfec661a52 Use human_attribute_name
We use this method whenever possible
2020-12-16 13:16:48 +01:00
taitus
9fe24aec9d Add sdg manager section to admin
Allow a user to become an sdg manager
2020-12-16 13:16:45 +01:00
Javi Martín
190ced4d2a Remove unused views 2020-12-07 15:28:56 +01:00
Javi Martín
cf510043a4 Search on the same URL by default 2020-12-07 14:28:36 +01:00
Javi Martín
e33794e45e Reuse admin search component in other sections
There are some sections where we are not reusing it:

* The budget investments search is completely different, so this
  component isn't appropriate there
* Booth assignment and officers are slightly different, and I'm not
  entirely sure it's safe to refactor these cases
2020-12-04 19:57:05 +01:00
Javi Martín
9b073599f0 Allow different labels in admin search component 2020-12-04 19:57:05 +01:00
Javi Martín
0a3acf3c5f Use a shared translation for search buttons
We were writing the same text over and over for the same translations.
Since they all serve the same function, it's perfectly fine for them to
have the same text, and so we can have a shared translation.
2020-12-04 19:57:05 +01:00
Javi Martín
155da08cf0 Use a generic name for the search parameter
This way we can use it for any model.
2020-12-04 19:57:05 +01:00
Javi Martín
2cf49b28de Extract users search view to a component
We're going to make this search component more generic, but for now,
we're keeping the exact same behavior we had.
2020-12-04 19:57:05 +01:00
taitus
7b6294199c Include the searched term in the search input form 2020-12-04 19:57:05 +01:00
taitus
72e64bd543 Render 'how to enable' when the related feature setting is disabled
Add 'how to enable' information on SDG configuration tab when related
sdg feature setting is disabled.
2020-12-03 18:26:00 +01:00
taitus
0abc82d520 Add new sdg settings on sdg-tab 2020-12-03 18:00:10 +01:00
taitus
5e19f60ba6 Add new sdg-tab on Global Configuration Settings 2020-12-03 18:00:10 +01:00
Javi Martín
d501915954 Extract admin menu to a component
This way adding new methods will be easier.
2020-11-26 12:15:07 +01:00
Javi Martín
a1cae895ba Use the actions component to render phase actions
We forgot to include this table when refactoring in commit 738646a56.
2020-11-03 14:58:02 +01:00