Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/anwolosz/synopsis
Browse files Browse the repository at this point in the history
  • Loading branch information
awolosz committed Sep 2, 2024
2 parents 5d2061f + 782c303 commit d766597
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 35 deletions.
17 changes: 16 additions & 1 deletion src/components/Citation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import type { PropType } from 'vue';
import type { PartScheme, CitationScheme, SectionScheme, SubpartScheme } from '@/interfaces/synopsisInterface';
import type { EvangelistsScheme } from '@/interfaces/dictionaryInterface';
import { useSynopsisStore } from "@/stores/SynopsisStore"
export default {
Expand All @@ -25,19 +26,33 @@ export default {
},
methods: {
redirectToLeadingCitation(chapterLocation: string, verseLocation: string): void {
console.log("A")
for (let i = 0; i < useSynopsisStore().currentSynopsis.parts.length; i++) {
console.log("B")
const part: PartScheme = useSynopsisStore().currentSynopsis.parts[i]
console.log("C")
for (let j = 0; j < part.subparts.length; j++) {
console.log("D")
const subpart: SubpartScheme = part.subparts[j]
console.log("E")
for (let k = 0; k < subpart.sections.length; k++) {
console.log("F")
const section: SectionScheme = subpart.sections[k]
console.log("G")
for (let l = 0; l < section[this.evangelist as keyof SectionScheme].length; l++) {
console.log("H")
const citation = section[this.evangelist as keyof SectionScheme][l] as CitationScheme
console.log("I")
if (citation?.leading) {
console.log("J")
for (let m = 0; m < citation.content.length; m++) {
console.log("K")
const content = citation.content[m]
console.log("L")
const formattedVerse = content.verse.slice(-1) === "a" || content.verse.slice(-1) === "b" ? content.verse.slice(0, -1) : content.verse
console.log("M")
if (content.chapter === chapterLocation && formattedVerse === verseLocation) {
console.log("N")
this.$router.push({ name: "synopsis", params: { language: this.synopsisStore.currentLanguage, translation: this.synopsisStore.currentTranslation }, hash: "#" + section.id })
return
}
Expand Down Expand Up @@ -95,7 +110,7 @@ export default {
<template>
<div class="card h-100" v-if="citation?.content" :class="{ 'shadow border-dark': citation.leading }">
<div class="card-header sticky-top bg-light">
{{ synopsisStore.currentDictionary.evangelists[evangelist] }} {{ synopsisStore.getCitation(citation.content[0].chapter, citation.content[0].verse, citation.content[citation.content.length - 1].chapter, citation.content[citation.content.length - 1].verse) }}
{{ synopsisStore.currentDictionary.evangelists[evangelist as keyof EvangelistsScheme] }} {{ synopsisStore.getCitation(citation.content[0].chapter, citation.content[0].verse, citation.content[citation.content.length - 1].chapter, citation.content[citation.content.length - 1].verse) }}
<template v-if="!$route.params.id">
<button v-if="!citation.leading"
@click="redirectToLeadingCitation(citation.content[0].chapter, citation.content[0].verse)" type="button"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
<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">
<span class="align-middle me-1">{{ synopsisStore.currentLanguage.toUpperCase() }}</span>
<span class="align-middle me-2">{{ synopsisStore.currentLanguage.toUpperCase() }}</span>
<i class="bi bi-globe2 fs-5 align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
Expand Down
3 changes: 2 additions & 1 deletion src/components/IndexRecord.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script lang="ts">
import IndexCitation from '@/components/IndexCitation.vue';
import type { SubpartScheme } from '@/interfaces/synopsisInterface';
import { useSynopsisStore } from "@/stores/SynopsisStore"
export default {
props: {
partTitle: String,
subparts: Object //TODO: proper typing
subparts: Array<SubpartScheme>
},
data() {
return {
Expand Down
12 changes: 7 additions & 5 deletions src/components/Part.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ export default {
</script>

<template>
<div class="row">
<h2 class="event text-center display-4 mt-5">
{{ part?.part_title }}
</h2>
<div>
<div class="row">
<h2 class="event text-center display-4 mt-5">
{{ part?.part_title }}
</h2>
</div>
<Subpart v-for="subpart in part?.subparts" :subpart="subpart" />
</div>
<Subpart v-for="subpart in part?.subparts" :subpart="subpart" />
</template>
19 changes: 11 additions & 8 deletions src/components/en/ContactEn.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<template>
<p>Development takes place on GitHub. The repo can be found on <a
href="https://github.com/anwolosz/synopsis" target="_blank">this</a> link.
<p>Please send any comments, questions or suggestions to:</p>
<p><b>[email protected]</b></p>
<p>synopticus.org is an open source project. It is developed on GitHub. The repository is available at
<a href="https://github.com/anwolosz/synopsis" target="_blank">this</a> link.
</p>
<p>Currently, the aim is to integrate the different Gospel translations. The translations processed so far (in <code
class="text-dark">.json</code> format) are the following:
<a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_szit.json"
target="_blank">SZIT</a>,
<a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_esv.json"
target="_blank">ESV</a>.
</p>
<p>The .json databases of the Synopsis are available at the links below.</p>
<ul>
<li><a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_szit.json" target="_blank">SZIT</a>
</li>
<li><a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_esv.json" target="_blank">ESV</a></li>
</ul>
</template>
19 changes: 12 additions & 7 deletions src/components/hu/ContactHu.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<template>
<p>A fejlesztés GitHubon zajlik. A repo <a href="https://github.com/anwolosz/synopsis" target="_blank">ezen</a> a linken érhető el.
<p>Bármilyen észrevétel, kérdés vagy javaslat esetén várom az üzeneteket az alábbi címen:</p>
<p><b>[email protected]</b></p>
<p>A synopticus.org nyíltforráskódú project. A fejlesztés GitHubon zajlik, a repository <a
href="https://github.com/anwolosz/synopsis" target="_blank">ezen</a> a
linken érhető el.
</p>
<p>Jelenleg a különböző evangélium fordítások integrációja a cél. Az Szinopszis struktúrájában eddig feldolgozott
fordtások <code class="text-dark">.json</code> formátumban elérhetők itt:
<a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_szit.json"
target="_blank">SZIT</a>,
<a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_esv.json"
target="_blank">ESV</a>.
</p>
<p>A Szinopszis vázát képező .json adatbázisok az alábbi linkeken érhetők el.</p>
<ul>
<li><a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_szit.json" target="_blank">SZIT</a>
</li>
<li><a href="https://raw.githubusercontent.com/anwolosz/synopsis/main/src/assets/synopsis_esv.json" target="_blank">ESV</a></li>
</ul>
</template>
2 changes: 1 addition & 1 deletion src/interfaces/dictionaryInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface TooltipsScheme {
jumpToMainText: string
}

interface EvangelistsScheme {
export interface EvangelistsScheme {
mt: string,
mk: string,
lk: string,
Expand Down
18 changes: 7 additions & 11 deletions src/stores/SynopsisStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import synopsis_szit from '@/assets/synopsis_szit.json'
import synopsis_esv from '@/assets/synopsis_esv.json'
import dictionary_en from '@/assets/translation/en.json'
import dictionary_hu from '@/assets/translation/hu.json'
import type { SynopsisScheme } from '@/interfaces/synopsisInterface'
import type { SectionScheme, SynopsisScheme } from '@/interfaces/synopsisInterface'
import type { DictionaryScheme } from '@/interfaces/dictionaryInterface'
import router from '../router';
const synopsisSZIT: SynopsisScheme = synopsis_szit
const synopsisESV: SynopsisScheme = synopsis_esv
//TODO: proper typing
const dictionaryEn: DictionaryScheme = dictionary_en
const dictionaryHu: DictionaryScheme = dictionary_hu
const dictionary: any = {
Expand Down Expand Up @@ -51,8 +50,7 @@ export const useSynopsisStore = defineStore('synopsis', {
}
}
},
//TODO: proper typing
locateSection(id: string): any {
locateSection(id: string): SectionScheme {
for (let i = 0; i < this.currentSynopsis.parts.length; i++) {
const part = this.currentSynopsis.parts[i]
for (let j = 0; j < part.subparts.length; j++) {
Expand All @@ -65,6 +63,7 @@ export const useSynopsisStore = defineStore('synopsis', {
}
}
}
return this.currentSynopsis.parts[0].subparts[0].sections[0]
},
setupLanguage(language: any) {
for (let synopsisIndex = 0; synopsisIndex < this.synopses.length; synopsisIndex++) {
Expand All @@ -82,18 +81,15 @@ export const useSynopsisStore = defineStore('synopsis', {
}
}
},
getCitation(firstChapter: string, firstVerse: string, lastChapter : string, lastVerse : string)
{
getCitation(firstChapter: string, firstVerse: string, lastChapter: string, lastVerse: string) {
let citation = firstChapter + "," + firstVerse
if (lastChapter !== firstChapter)
{
if (lastChapter !== firstChapter) {
return citation + "-" + lastChapter + "," + lastVerse
}
if (lastChapter === firstChapter && lastVerse !== firstVerse)
{
if (lastChapter === firstChapter && lastVerse !== firstVerse) {
return citation + "-" + lastVerse
}
return citation
return citation
}
}
})

0 comments on commit d766597

Please sign in to comment.