Commit Graph

36 Commits

Author SHA1 Message Date
Javi Martín
5c7d87f763 Open admin links in the same window
In the admin section, when clicking on a link that leads to a page in
the public area, sometimes the page was opened in the same window and
sometimes it would open in a new window, with no clear criteria
regarding when either scenario would take place.

This was really confusing, so now we're more consistent and open
(almost) every link in the same window. The main reason behind it is
simple: if we add `target: _blank`, people who want to open those links
in the same window can no longer do so, so we're taking control away
from them. However, if we don't add this attribute, people can choose
whether to open the link on the same tab or to open it on a new one,
since all browsers implement a method to do so.

More reasons behind this decision can be found in "Opening Links in New
Browser Windows and Tabs" [1].

We're keeping some exceptions, though:

* Opening the link to edit an investment on the same tab would result in
  losing all the investment filters already applied when searching for
  investments, so until we implement a way to keep these filters, we're
  also opening the link to edit an investment in a new tab
* For now, we're also opening links to download files in a new window;
  we'll deal with this case in the future

[1] https://www.nngroup.com/articles/new-browser-windows-and-tabs/
2023-10-24 16:31:39 +02:00
Javi Martín
6a2c01b119 Extract method to render an admin table action
This way it will be easier to change the behavior of all table actions,
like adding ARIA attributes. In the past, when we changed the behavior
of the `link_to` method, we had to change all table action classes.
2021-09-20 20:27:37 +02:00
decabeza
16dc5821d1 Add margin to all h3 admin headers 2021-02-18 15:46:16 +01:00
Javi Martín
2eb255e85a Apply Rails/SafeNavigation rule in ERB files 2021-02-05 17:46:23 +01:00
Javi Martín
8c1140a1bf Use semantic HTML classes in table actions
Note the CSS could probably be improved to avoid duplication with other
button style definitions. However, that's fine because we're going to
change the style of the links soon.

For the same reason, I haven't bothered to style every single link the
way it was until now.
2020-11-03 14:58:02 +01:00
Javi Martín
99dad7a7b6 Don't mix links and actions in an admin table
In some tables, we had "actions", and some columns were also links
pointing to some places. Having both of them at the same time is
confusing, particularly since traditionally the links in the columns
pointed to the same place as some of the actions (although that's not
the case since commit 48db31cd).

We're still keeping links in tables which don't have an action column.
For instance, the proposals table has a "select" button which would be
harder to use if we had action buttons next to it.
2020-11-03 14:58:02 +01:00
Javi Martín
10c095d821 Move table actions partial to a component
This partial was going to get too complex since in some places we've got
different texts, different URLs or different confirmation messages.
While we should probably try to be more consistent and that would make
the partial work in most cases, there'll always be some exceptions, and
using a partial (with, perhaps, some helper methods) will become messy
really quickly.
2020-10-19 18:56:02 +02:00
Javi Martín
4e60424678 Extract partial for edit and destroy links 2020-10-19 18:48:01 +02:00
Javi Martín
a3534e1f93 Use presence to simplify code 2019-11-05 23:15:17 +01: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
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
lalo
c2860dda0e Add can_comment and can_edit_dossier abilities to valuators 2019-06-11 16:24:02 +02:00
voodoorai2000
24dde9c35e Delete valuation 2019-05-31 15:43:06 +02:00
Julian Herrero
0bb2633c7a Use double quotes in app/views/admin 2019-03-19 12:16:50 +01:00
Julian Herrero
3975e5145a improve action buttons aspect for small screens 2018-11-08 16:45:36 +01:00
decabeza
bcd678c646 Removes hollow class on moderators and valuators buttons 2018-06-08 18:40:26 +02:00
decabeza
56f64779ba Fixes actions buttons on admin valuators index table 2018-04-27 18:24:53 +02:00
rgarcia
00c965b715 Clean up 2018-04-04 13:19:01 +02:00
rgarcia
fcb377c9e5 Remove description when creating valuator from index 2018-04-03 20:56:31 +02:00
decabeza
13d0b08cb4 Adds styles and missing i18n for valuator groups 👨🏻‍🎨 2018-04-03 20:56:31 +02:00
rgarcia
1dbbe331c9 Assign valuators to groups 2018-04-03 20:55:44 +02:00
rgarcia
cddfdf4b84 Add valuator groups 2018-04-03 20:55:44 +02:00
Angel Perez
4e086de493 Add 'Delete' button to Valuators index/search views 2017-11-17 13:12:26 -04:00
decabeza
2542b2c695 improves admin valuators search form 2017-10-25 19:02:04 +02:00
decabeza
2131c651f6 improves admin valuators views 2017-10-25 18:47:26 +02:00
decabeza
9ba96becd2 Merge branch 'master' into admin-profiles 2017-10-25 18:29:01 +02:00
Angel Perez
cd8cf42294 'Add to valuators' option added to Valuators search view 2017-10-25 10:38:54 -04:00
Angel Perez
59c97b4db7 Enable search by name/email for Valuators 2017-10-25 10:16:21 -04:00
decabeza
53046dfd4a improves styles for admin valuators views 2017-10-20 11:52:03 +02:00
decabeza
98961748ad replaces more old back link partial to new back_link_to helper 2017-07-27 00:26:39 +02:00
Alberto Garcia Cabeza
fb6dbdf2f9 Improves all pages for admin section 2016-06-01 13:23:57 +02:00
rgarcia
4bbd3d7233 adds summary of spending proposals by valuator 2016-04-26 22:06:02 +02:00
Juanjo Bazán
ccdff65f13 adds missing i18n 2016-03-16 11:19:40 +01:00
Juanjo Bazán
4546af5be1 redux of valuators creation form 2016-03-15 15:33:00 +01:00
rgarcia
6281f4195b cleans up 2016-03-02 01:04:24 +01:00
rgarcia
b38558f2f3 adds index and create of valuators 2016-03-01 20:10:52 +01:00