Skip to content

Commit

Permalink
Refactor store fields to current
Browse files Browse the repository at this point in the history
  • Loading branch information
anwolosz committed Aug 24, 2024
1 parent 845d8c6 commit 45d67f0
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 88 deletions.
20 changes: 10 additions & 10 deletions src/components/Citation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default {
},
methods: {
redirectToLeadingCitation(chapterLocation: string, verseLocation: string): void {
for (let i = 0; i < useSynopsisStore().synopsis.chapters.length; i++) {
for (let i = 0; i < useSynopsisStore().currentSynopsis.chapters.length; i++) {
//TODO: think about better name than chapter in .json
const chapter = useSynopsisStore().synopsis.chapters[i]
const chapter = useSynopsisStore().currentSynopsis.chapters[i]
for (let j = 0; j < chapter.subchapters.length; j++) {
const subchapter = chapter.subchapters[j]
for (let k = 0; k < subchapter.sections.length; k++) {
Expand All @@ -53,9 +53,9 @@ export default {
},
redirectToPreviousLeadingCitation() {
let previousSectionId;
for (let i = 0; i < useSynopsisStore().synopsis.chapters.length; i++) {
for (let i = 0; i < useSynopsisStore().currentSynopsis.chapters.length; i++) {
//TODO: think about better name than chapter in .json
const chapter = useSynopsisStore().synopsis.chapters[i]
const chapter = useSynopsisStore().currentSynopsis.chapters[i]
for (let j = 0; j < chapter.subchapters.length; j++) {
const subchapter = chapter.subchapters[j]
for (let k = 0; k < subchapter.sections.length; k++) {
Expand All @@ -78,9 +78,9 @@ export default {
}
},
redirectToNextLeadingCitation() {
for (let i = 0; i < useSynopsisStore().synopsis.chapters.length; i++) {
for (let i = 0; i < useSynopsisStore().currentSynopsis.chapters.length; i++) {
//TODO: think about better name than chapter in .json
const chapter = useSynopsisStore().synopsis.chapters[i]
const chapter = useSynopsisStore().currentSynopsis.chapters[i]
for (let j = 0; j < chapter.subchapters.length; j++) {
const subchapter = chapter.subchapters[j]
for (let k = 0; k < subchapter.sections.length; k++) {
Expand Down Expand Up @@ -123,11 +123,11 @@ export default {
<div class="card h-100" v-if="citation?.content"
:class="{ 'shadow border-dark': citation.leading }">
<div class="card-header sticky-top bg-light">
{{ synopsisStore.dictionary.evangelists[evangelist] }} {{ citation?.citation }}
{{ synopsisStore.currentDictionary.evangelists[evangelist] }} {{ citation?.citation }}
<template v-if="!$route.params.id">
<button v-if="!citation.leading"
@click="redirectToLeadingCitation(citation.content[0].chapter, citation.content[0].verse)" type="button"
class=" float-end btn btn-sm py-0 m-0" :title="synopsisStore.dictionary.tooltips.jumpToMainText">
class=" float-end btn btn-sm py-0 m-0" :title="synopsisStore.currentDictionary.tooltips.jumpToMainText">

<i class="bi bi-compass fs-6 text-secondary"></i>
</button>
Expand All @@ -138,12 +138,12 @@ export default {
|| (evangelist === 'lk' && sectionId === '365')
|| (evangelist === 'jn' && sectionId === '367')
)" @click="redirectToNextLeadingCitation()" type="button" class=" float-end btn btn-sm py-0 m-0"
:title="synopsisStore.dictionary.tooltips.nextMainText">
:title="synopsisStore.currentDictionary.tooltips.nextMainText">
<i class="bi bi-arrow-down fs-6 text-secondary"></i>
</button>
<button v-if="citation.leading && sectionId !== '1'" @click="redirectToPreviousLeadingCitation()"
type="button" class=" float-end btn btn-sm py-0 m-0"
:title="synopsisStore.dictionary.tooltips.previousMainText">
:title="synopsisStore.currentDictionary.tooltips.previousMainText">
<i class="bi bi-arrow-up fs-6 text-secondary"></i>
</button>
</template>
Expand Down
12 changes: 6 additions & 6 deletions src/components/FunctionButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ export default {

<template>
<router-link v-if="$route.name !== 'section'"
:to="{ name: 'section', params: { language: synopsisStore.language, translation: synopsisStore.translation, id: id } }"
:to="{ name: 'section', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation, id: id } }"
target="_blank">
<button type="button" class="float-right btn btn-light btn-sm ms-1 mb-1"
:title="synopsisStore.dictionary.tooltips.openSeparately">
:title="synopsisStore.currentDictionary.tooltips.openSeparately">
<i class="bi bi-arrow-up-right-square fs-6"></i>
</button>
</router-link>
<router-link v-if="$route.name !== 'synopsis'"
:to="{ name: 'synopsis', params: { language: synopsisStore.language, translation: synopsisStore.translation }, hash: '#' + id }">
:to="{ name: 'synopsis', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation }, hash: '#' + id }">
<button type="button" class="float-right btn btn-light btn-sm ms-1 mb-1"
:title="synopsisStore.dictionary.tooltips.openInSynopsis">
:title="synopsisStore.currentDictionary.tooltips.openInSynopsis">
<i class="bi bi-arrow-down-left-square fs-6"></i>
</button>
</router-link>
<button v-if="$route.name === 'synopsis'" @click="copyIdLink(id)" type="button"
class=" float-right btn btn-light btn-sm ms-1 mb-1" :title="synopsisStore.dictionary.tooltips.location">
class=" float-right btn btn-light btn-sm ms-1 mb-1" :title="synopsisStore.currentDictionary.tooltips.location">
<i class="bi fs-6" :class="{ 'bi-link-45deg': !isIdCopied, 'bi-check': isIdCopied }"></i>
</button>
<button v-if="$route.name === 'section'" @click="copyShareLink(id)" type="button"
class="float-right btn btn-light btn-sm ms-1 mb-1" :title="synopsisStore.dictionary.tooltips.share">
class="float-right btn btn-light btn-sm ms-1 mb-1" :title="synopsisStore.currentDictionary.tooltips.share">
<i class="bi fs-6" :class="{ 'bi-link-45deg': !isShareCopied, 'bi-check': isShareCopied }"></i>
</button>
</template>
32 changes: 16 additions & 16 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<router-link
:to="{ name: 'synopsis', params: { language: synopsisStore.language, translation: synopsisStore.translation } }"
:to="{ name: 'synopsis', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation } }"
:class="$route.name == 'synopsis' ? 'active' : ''" class="navbar-brand" aria-current="page">
<img src="/favicon.svg" alt="Szinopszis" width="33" height="33">
</router-link>
Expand All @@ -38,49 +38,49 @@ export default {
<ul class="navbar-nav">
<li class="nav-item">
<router-link
:to="{ name: 'synopsis', params: { language: synopsisStore.language, translation: synopsisStore.translation } }"
:to="{ name: 'synopsis', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation } }"
:class="$route.name == 'synopsis' ? 'active' : ''" class="nav-link" aria-current="page">{{
synopsisStore.dictionary.menu.synopsis }}
synopsisStore.currentDictionary.menu.synopsis }}
</router-link>
</li>
<li class="nav-item">
<router-link
:to="{ name: 'index', params: { language: synopsisStore.language, translation: synopsisStore.translation } }"
:to="{ name: 'index', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation } }"
:class="$route.name == 'index' ? 'active' : ''" class="nav-link" aria-current="page">{{
synopsisStore.dictionary.menu.index }}
synopsisStore.currentDictionary.menu.index }}
</router-link>
</li>
<li class="nav-item">
<router-link :to="{ name: 'about', params: { language: synopsisStore.language } }"
<router-link :to="{ name: 'about', params: { language: synopsisStore.currentLanguage } }"
:class="$route.name == 'about' ? 'active' : ''" class="nav-link" aria-current="page">{{
synopsisStore.dictionary.menu.about }}
synopsisStore.currentDictionary.menu.about }}
</router-link>
</li>
<li class="nav-item">
<router-link :to="{ name: 'sources', params: { language: synopsisStore.language } }"
<router-link :to="{ name: 'sources', params: { language: synopsisStore.currentLanguage } }"
:class="$route.name == 'sources' ? 'active' : ''" class="nav-link" aria-current="page">{{
synopsisStore.dictionary.menu.sources }}
synopsisStore.currentDictionary.menu.sources }}
</router-link>
</li>
<li class="nav-item">
<router-link :to="{ name: 'contact', params: { language: synopsisStore.language } }"
<router-link :to="{ name: 'contact', params: { language: synopsisStore.currentLanguage } }"
:class="$route.name == 'contact' ? 'active' : ''" class="nav-link" aria-current="page">{{
synopsisStore.dictionary.menu.contact }}
synopsisStore.currentDictionary.menu.contact }}
</router-link>
</li>
</ul>
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item dropdown">
<button class="btn btn-sm btn-light border border-light-subtle dropdown-toggle"
data-bs-toggle="dropdown" aria-expanded="false">
{{ synopsisStore.language.toUpperCase() }}
{{ synopsisStore.currentLanguage.toUpperCase() }}
<i class="bi bi-globe2 fs-5 align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<template v-for="synopsis in synopsisStore.synopses">
<li> <a @click="synopsis.language !== synopsisStore.language ? synopsisStore.changeLanguage(synopsis.language) : null"
<li> <a @click="synopsis.language !== synopsisStore.currentLanguage ? synopsisStore.changeLanguage(synopsis.language) : null"
class="dropdown-item hoverable text-black"
:class="synopsis.language === synopsisStore.language ? 'bg-dark-subtle' : ''">
:class="synopsis.language === synopsisStore.currentLanguage ? 'bg-dark-subtle' : ''">
{{ synopsis.language.toUpperCase() }}</a></li>
</template>
</ul>
Expand All @@ -92,9 +92,9 @@ export default {
</button>
<ul class="dropdown-menu dropdown-menu-end">
<template v-for="synopsis in synopsisStore.synopses">
<li> <a @click="synopsis.translation !== synopsisStore.translation ? synopsisStore.changeTranslation(synopsis.translation) : null"
<li> <a @click="synopsis.translation !== synopsisStore.currentTranslation ? synopsisStore.changeTranslation(synopsis.translation) : null"
class="dropdown-item hoverable text-black"
:class="synopsis.translation === synopsisStore.translation ? 'bg-dark-subtle' : ''">
:class="synopsis.translation === synopsisStore.currentTranslation ? 'bg-dark-subtle' : ''">
{{ synopsis.translation}}</a></li>
</template>
</ul>
Expand Down
10 changes: 5 additions & 5 deletions src/components/IndexRecord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export default {
<tr>
<th class="fw-normal text-nowrap" scope="col"># ( <i
class="bi bi-arrow-down-left-square fs-6"></i> )</th>
<th class="fw-normal text-nowrap" scope="col">{{ synopsisStore.dictionary.index.title }} ( <i
<th class="fw-normal text-nowrap" scope="col">{{ synopsisStore.currentDictionary.index.title }} ( <i
class="bi bi-arrow-up-right-square fs-6"></i> )</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.dictionary.evangelists.mt }}
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.mt }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.dictionary.evangelists.mk }}
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.mk }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.dictionary.evangelists.lk }}
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.lk }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.dictionary.evangelists.jn }}
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.jn }}
</th>
</tr>
</thead>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { useSynopsisStore } from "@/stores/SynopsisStore"
//TODO: proper typing
function locateSection(id: string): any {
for (let i = 0; i < useSynopsisStore().synopsis.chapters.length; i++) {
const chapter = useSynopsisStore().synopsis.chapters[i]
for (let i = 0; i < useSynopsisStore().currentSynopsis.chapters.length; i++) {
const chapter = useSynopsisStore().currentSynopsis.chapters[i]
for (let j = 0; j < chapter.subchapters.length; j++) {
const subchapter = chapter.subchapters[j]
for (let k = 0; k < subchapter.sections.length; k++) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/TitleChangeTableSZIT.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default {
<table class="table bg-dark table-sm table-striped table-bordered">
<thead>
<tr>
<th class="text-nowrap" scope="col">{{ synopsisStore.dictionary.sources.originalTitle }}</th>
<th class="text-nowrap" scope="col">{{ synopsisStore.dictionary.sources.unifiedSZITTitle }}</th>
<th class="text-nowrap" scope="col">{{ synopsisStore.currentDictionary.sources.originalTitle }}</th>
<th class="text-nowrap" scope="col">{{ synopsisStore.currentDictionary.sources.unifiedSZITTitle }}</th>
</tr>
</thead>
<tbody class="table-group-divider">
Expand Down
4 changes: 2 additions & 2 deletions src/components/en/AboutEn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
repetitions, in the original
order of the verses. Each section contains maximum one body text, for one evangelist.
In the <router-link
:to="{ name: 'index', params: { language: synopsisStore.language, translation: synopsisStore.translation } }">Table
:to="{ name: 'index', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation } }">Table
of contents</router-link> ther citation appears with bold.
</li>
<li>Boxes with grey frame and no shadow contain parallel text.</li>
Expand Down Expand Up @@ -59,6 +59,6 @@ export default {
</ul>

<p>
More details under <router-link :to="{ name: 'sources', params: { language: synopsisStore.language } }">Sources</router-link>.
More details under <router-link :to="{ name: 'sources', params: { language: synopsisStore.currentLanguage } }">Sources</router-link>.
</p>
</template>
4 changes: 2 additions & 2 deletions src/components/hu/AboutHu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
</p>
<ul>
<li>A törzsszöveg fekete kerettel és árnyékkal jelenik meg. A
<router-link :to="{ name: 'index', params: { language: synopsisStore.language, translation: synopsisStore.translation } }">tartalomjegyzékben</router-link>
<router-link :to="{ name: 'index', params: { language: synopsisStore.currentLanguage, translation: synopsisStore.currentTranslation } }">tartalomjegyzékben</router-link>
vastag kiemeléssel szerepelnek
a hozzá tartozó idézetek. A törzsszöveg a teljes evangéliumot tartalmazza, ismétlődések nélkül, a versek
eredeti sorrendjében. Minden szekcióban egy evangélistához, legfeljebb egy törzsszöveg található.
Expand Down Expand Up @@ -63,6 +63,6 @@ export default {

<p>
További részletekért lásd a <router-link
:to="{ name: 'sources', params: { language: synopsisStore.language } }">Források</router-link> menüpontot.
:to="{ name: 'sources', params: { language: synopsisStore.currentLanguage } }">Források</router-link> menüpontot.
</p>
</template>
Loading

0 comments on commit 45d67f0

Please sign in to comment.