Skip to content

Commit

Permalink
Open help links in new tabs by default
Browse files Browse the repository at this point in the history
Every now and then, people click the links while creating or editing a
trip, only to lose their progress. I should better solve that problem
(and the issue of accidentally closing a tab/window) by instead
prompting the user with an "unsaved changes" modal.

However, I looked into doing that before, and I *think* I decided
against it because the trip creation form is still using super legacy
AngularJS forms.

For now, we can at least just force a new tab/window. I don't love this,
and it's somewhat against W3C guidelines (though this is a carve-out for
links on a form page):
https://www.w3.org/TR/WCAG20-TECHS/G200.html
  • Loading branch information
DavidCain committed Jan 6, 2025
1 parent a5322df commit 50a7ffc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ws/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ class Trip(models.Model):
name = models.CharField(max_length=127)
description = models.TextField(
help_text=mark_safe( # noqa: S308
'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">'
'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">'
"Markdown</a> supported! "
"Please use HTTPS images sparingly, and only if properly licensed."
)
Expand Down Expand Up @@ -1111,7 +1111,7 @@ class Trip(models.Model):
("C", "C: above treeline"),
],
help_text=mark_safe( # noqa: S308
'Trip leaders must meet <a href="/help/participants/ws_ratings/">requirements for terrain & activity ratings</a>.',
'Trip leaders must meet <a href="/help/participants/ws_ratings/" target="_blank">requirements for terrain & activity ratings</a>.',
),
db_index=True,
)
Expand Down

0 comments on commit 50a7ffc

Please sign in to comment.