Skip to content

Commit 6ed9d60

Browse files
committed
Open help links in new tabs by default
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
1 parent a5322df commit 6ed9d60

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Generated by Django 4.2.17 on 2025-01-06 03:58
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("ws", "0006_add_ws_application_question"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="trip",
14+
name="description",
15+
field=models.TextField(
16+
help_text='<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.'
17+
),
18+
),
19+
migrations.AlterField(
20+
model_name="trip",
21+
name="winter_terrain_level",
22+
field=models.CharField(
23+
blank=True,
24+
choices=[
25+
("A", "A: <1 hour to intensive care, below treeline"),
26+
("B", "B: >1 hour to intensive care, below treeline"),
27+
("C", "C: above treeline"),
28+
],
29+
db_index=True,
30+
help_text='Trip leaders must meet <a href="/help/participants/ws_ratings/" target="_blank">requirements for terrain & activity ratings</a>.',
31+
max_length=1,
32+
null=True,
33+
verbose_name="Terrain level",
34+
),
35+
),
36+
]

ws/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ class Trip(models.Model):
10811081
name = models.CharField(max_length=127)
10821082
description = models.TextField(
10831083
help_text=mark_safe( # noqa: S308
1084-
'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">'
1084+
'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">'
10851085
"Markdown</a> supported! "
10861086
"Please use HTTPS images sparingly, and only if properly licensed."
10871087
)
@@ -1111,7 +1111,7 @@ class Trip(models.Model):
11111111
("C", "C: above treeline"),
11121112
],
11131113
help_text=mark_safe( # noqa: S308
1114-
'Trip leaders must meet <a href="/help/participants/ws_ratings/">requirements for terrain & activity ratings</a>.',
1114+
'Trip leaders must meet <a href="/help/participants/ws_ratings/" target="_blank">requirements for terrain & activity ratings</a>.',
11151115
),
11161116
db_index=True,
11171117
)

0 commit comments

Comments
 (0)