diff --git a/src/components/Article.vue b/src/components/Article.vue index fe7e21fed3b44f3f69897000af8a8c414bb1ded9..0da7cdec8647ef03d3535f4a64372a9b27521c67 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -1,5 +1,6 @@ <template> <article class='v-sheet v-card rounded-xl' v-bind:class="{'collapsable': collapsable, 'collapsed': collapsed}" v-if="article"> + <div v-if="!invalid"> <Header :title_id="title_id" :lemmas="article.lemmas" :dictionary="dictionary" :article_id="article.article_id" @toggle-collapse = "toggle_collapse"/> <InflectionButton :lemmas="article.lemmas" :dictionary="dictionary" :article_id="article.article_id"/> @@ -30,6 +31,8 @@ </section> </div> <ArticleFooter v-if="!collapsed" :article="article"/> + </div> + <div v-else><v-icon left>warning</v-icon> {{$t('error.article', {no: article.article_id, dict: $t('dicts_inline.'+this.dictionary)})}}</div> </article> </template> @@ -81,7 +84,8 @@ export default { }, data: function() { return { - is_collapsed: true + is_collapsed: true, + invalid: false } }, metaInfo() { @@ -153,6 +157,7 @@ export default { } } catch(error) { console.error("link_to_self",this.article.article_id, this.dictionary, error.message) + this.invalid = true //console.error(error) return {ref: "", article: this.article} } @@ -233,6 +238,7 @@ export default { }) } catch(error) { console.error("parse_definitions",this.article.article_id, this.dictionary, error.message) + this.invalid = true //console.error(error) definitionTexts = [] } diff --git a/src/components/Header.vue b/src/components/Header.vue index 895ee4bd17ea95d6d60b808ffacc81829adec25d..c6ef8386c066cfc01446df52b2e8655a93e68ca5 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -204,6 +204,7 @@ export default { } } catch(error) { console.error("lemma_groups",this.article_id, this.dictionary, error.message) + this.$parent.invalid = true //console.error(error) } return groups diff --git a/src/locales/eng.json b/src/locales/eng.json index 51c748fa052b86df47f1fefba910e78e0814439c..3af2b376ce08a7fb872b21a4be77307a402ef00f 100644 --- a/src/locales/eng.json +++ b/src/locales/eng.json @@ -134,6 +134,7 @@ } }, "error": { + "article": "An error has occured in article {no} in {dict}", "404": { "title": "404: Not Found", "description": "The page may have been deleted or moved, or you may have used an invalid link." diff --git a/src/locales/nno.json b/src/locales/nno.json index 12a5a882ecec2b2b8d3c16f34ab2aba99dfa95b9..7d99aed9674ab9a53824fc37c8e5cc13fc949702 100644 --- a/src/locales/nno.json +++ b/src/locales/nno.json @@ -134,6 +134,7 @@ } }, "error": { + "article": "Det har oppstått ein feil i artikkel {no} i {dict}", "404": { "title": "404: Ikkje funne", "description": "Sida kan ha blitt sletta eller flytta, eller du kan ha brukt ei ugyldig lenkje." diff --git a/src/locales/nob.json b/src/locales/nob.json index 1a21ad69332c0dfdf3eed90744e61928d83d35f0..68cae7c1776fad6ef9fbf47116e072a23a390c28 100644 --- a/src/locales/nob.json +++ b/src/locales/nob.json @@ -146,6 +146,7 @@ } }, "error": { + "article": "Det har oppstått en feil i artikkel {no} i {dict}", "404": { "title": "404: Ikke funnet", "description": "Siden kan ha blitt slettet eller flyttet, eller du kan ha brukt en ugyldig lenke."