Skip to content

Commit 9f8fd90

Browse files
authored
feat: agenda fallback link to plaintext version (ietf-tools#4663)
1 parent a5f0259 commit 9f8fd90

4 files changed

Lines changed: 52 additions & 2 deletions

File tree

client/App.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ n-theme
44
.app-error(v-if='siteStore.criticalError')
55
i.bi.bi-x-octagon-fill.me-2
66
span {{siteStore.criticalError}}
7+
.app-error-link(v-if='siteStore.criticalError && siteStore.criticalErrorLink')
8+
a(:href='siteStore.criticalErrorLink') {{siteStore.criticalErrorLinkText}} #[i.bi.bi-arrow-right-square-fill.ms-2]
79
.app-container(ref='appContainer')
810
router-view.meeting
911
</template>
@@ -56,4 +58,23 @@ onBeforeUnmount(() => {
5658
padding: 1rem;
5759
text-align: center;
5860
}
61+
62+
.app-error-link {
63+
background-color: lighten($red-100, 5%);
64+
border-radius: 0 0 5px 5px;
65+
color: #FFF;
66+
font-weight: 500;
67+
font-size: .9em;
68+
padding: .7rem 1rem;
69+
text-align: center;
70+
71+
a {
72+
color: $red-700;
73+
text-decoration: none;
74+
75+
&:hover, &:focus {
76+
text-decoration: underline;
77+
}
78+
}
79+
}
5980
</style>

client/agenda/store.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ export const useAgendaStore = defineStore('agenda', {
183183
console.error(err)
184184
const siteStore = useSiteStore()
185185
siteStore.$patch({
186-
criticalError: `Failed to load this meeting: ${err.message}`
186+
criticalError: `Failed to load this meeting: ${err.message}`,
187+
criticalErrorLink: meetingNumber ? `/meeting/${meetingNumber}/agenda.txt` : `/meeting/agenda.txt`,
188+
criticalErrorLinkText: 'Switch to text-only agenda version'
187189
})
188190
}
189191

client/shared/store.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { defineStore } from 'pinia'
33
export const useSiteStore = defineStore('site', {
44
state: () => ({
55
criticalError: null,
6+
criticalErrorLink: null,
7+
criticalErrorLinkText: null,
68
isMobile: /Mobi/i.test(navigator.userAgent),
79
viewport: Math.round(window.innerWidth)
810
})

ietf/templates/meeting/agenda.html

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,34 @@
6565
color: #999;
6666
z-index: 2000000000;
6767
}
68+
69+
#app-loading-footer {
70+
position: absolute;
71+
text-align: center;
72+
bottom: 0;
73+
left: 0;
74+
right: 0;
75+
z-index: 1000000000;
76+
}
77+
78+
#app-loading-footer > a {
79+
text-decoration: none;
80+
font-weight: 500;
81+
font-size: .9em;
82+
color: #0aa2c0;
83+
display: inline-block;
84+
padding: 8px 16px;
85+
background-color: #F9F9F9;
86+
border-radius: 5px;
87+
margin-bottom: 12px;
88+
}
6889
{% endblock %}
6990
{% block content %}
7091
{% origin %}
7192
<div id="app"></div>
72-
<div id="app-loading"></div>
93+
<div id="app-loading">
94+
<div id="app-loading-footer">
95+
<a href="/meeting/{{ meetingData.meetingNumber }}/agenda.txt">Switch to text-only version &#11166;</a>
96+
</div>
97+
</div>
7398
{% endblock %}

0 commit comments

Comments
 (0)