Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(agenda): fallback link to plaintext version #4663

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions client/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ n-theme
.app-error(v-if='siteStore.criticalError')
i.bi.bi-x-octagon-fill.me-2
span {{siteStore.criticalError}}
.app-error-link(v-if='siteStore.criticalError && siteStore.criticalErrorLink')
a(:href='siteStore.criticalErrorLink') {{siteStore.criticalErrorLinkText}} #[i.bi.bi-arrow-right-square-fill.ms-2]
.app-container(ref='appContainer')
router-view.meeting
</template>
Expand Down Expand Up @@ -56,4 +58,23 @@ onBeforeUnmount(() => {
padding: 1rem;
text-align: center;
}

.app-error-link {
background-color: lighten($red-100, 5%);
border-radius: 0 0 5px 5px;
color: #FFF;
font-weight: 500;
font-size: .9em;
padding: .7rem 1rem;
text-align: center;

a {
color: $red-700;
text-decoration: none;

&:hover, &:focus {
text-decoration: underline;
}
}
}
</style>
4 changes: 3 additions & 1 deletion client/agenda/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export const useAgendaStore = defineStore('agenda', {
console.error(err)
const siteStore = useSiteStore()
siteStore.$patch({
criticalError: `Failed to load this meeting: ${err.message}`
criticalError: `Failed to load this meeting: ${err.message}`,
criticalErrorLink: meetingNumber ? `/meeting/${meetingNumber}/agenda.txt` : `/meeting/agenda.txt`,
criticalErrorLinkText: 'Switch to text-only agenda version'
})
}

Expand Down
2 changes: 2 additions & 0 deletions client/shared/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { defineStore } from 'pinia'
export const useSiteStore = defineStore('site', {
state: () => ({
criticalError: null,
criticalErrorLink: null,
criticalErrorLinkText: null,
isMobile: /Mobi/i.test(navigator.userAgent),
viewport: Math.round(window.innerWidth)
})
Expand Down
27 changes: 26 additions & 1 deletion ietf/templates/meeting/agenda.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,34 @@
color: #999;
z-index: 2000000000;
}

#app-loading-footer {
position: absolute;
text-align: center;
bottom: 0;
left: 0;
right: 0;
z-index: 1000000000;
}

#app-loading-footer > a {
text-decoration: none;
font-weight: 500;
font-size: .9em;
color: #0aa2c0;
display: inline-block;
padding: 8px 16px;
background-color: #F9F9F9;
border-radius: 5px;
margin-bottom: 12px;
}
{% endblock %}
{% block content %}
{% origin %}
<div id="app"></div>
<div id="app-loading"></div>
<div id="app-loading">
<div id="app-loading-footer">
<a href="/meeting/{{ meetingData.meetingNumber }}/agenda.txt">Switch to text-only version &#11166;</a>
</div>
</div>
{% endblock %}