Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • subugoe/ahiqar/website
1 result
Show changes
Commits on Source (43)
Showing
with 222 additions and 57 deletions
...@@ -9,18 +9,19 @@ PROJECT_ID=${CI_PROJECT_ID} ...@@ -9,18 +9,19 @@ PROJECT_ID=${CI_PROJECT_ID}
ACTIVE_BRANCHES=$(curl --header "PRIVATE-TOKEN: $API_TOKEN" "https://gitlab.gwdg.de/api/v4/projects/${PROJECT_ID}/repository/branches" | jq -r '.[].name') ACTIVE_BRANCHES=$(curl --header "PRIVATE-TOKEN: $API_TOKEN" "https://gitlab.gwdg.de/api/v4/projects/${PROJECT_ID}/repository/branches" | jq -r '.[].name')
# the variable CI_COMMIT_REF_SLUG we use for naming the directories in 'public' escapes # the variable CI_COMMIT_REF_SLUG we use for naming the directories in 'public' escapes
# all non-alpanumeric characters to '-'. This has to be considered for comparing the # all non-alpanumeric characters to '-'. This has to be considered for comparing the
# directry names with the branch names. # directory names with the branch names.
ACTIVE_BRANCHES=$(echo $ACTIVE_BRANCHES | sed -E "s/[^0-9a-z[:space:]]/-/g") echo $ACTIVE_BRANCHES
echo $ACTIVE_BRANCHES | sed "s [^0-9a-zA-Z[:space:]] - g" | sed "s [[:space:]] \n g" > /tmp/branches
echo "compare to:"
cat /tmp/branches
cd public cd public
for ENTRY in * ls > /tmp/list
do
# preserve content of main branch for DIR in $(grep -Fxv -f /tmp/branches /tmp/list); do
if [[ ${ENTRY} = "main" ]]; then echo "removing $DIR"
: rm -rf $DIR
# remove other entries that are no longer active done
elif [[ ! $ACTIVE_BRANCHES =~ $ENTRY ]]; then
rm -r $ENTRY cp --recursive main/* .
fi
done
...@@ -13,15 +13,15 @@ LATEST_JOB_ID=$(echo $JOBS | jq '.[] | select(.stage == "pages").id' | sed -n 1p ...@@ -13,15 +13,15 @@ LATEST_JOB_ID=$(echo $JOBS | jq '.[] | select(.stage == "pages").id' | sed -n 1p
curl --output old-artifact.zip --header "PRIVATE-TOKEN: $API_TOKEN" "https://gitlab.gwdg.de/api/v4/projects/${CI_PROJECT_ID}/jobs/${LATEST_JOB_ID}/artifacts" curl --output old-artifact.zip --header "PRIVATE-TOKEN: $API_TOKEN" "https://gitlab.gwdg.de/api/v4/projects/${CI_PROJECT_ID}/jobs/${LATEST_JOB_ID}/artifacts"
# add current data to artifact # add current data to artifact
unzip -u old-artifact.zip unzip -u -qq old-artifact.zip
# we want the main branch to be available at https://subugoe.pages.gwdg.de/ahiqar/website/ while # we want the main branch to be available at https://subugoe.pages.gwdg.de/ahiqar/website/ while
# the environments of the feature branches should be available at # the environments of the feature branches should be available at
# https://subugoe.pages.gwdg.de/ahiqar/website/${CI_COMMIT_REF_SLUG}/. # https://subugoe.pages.gwdg.de/ahiqar/website/${CI_COMMIT_REF_SLUG}/.
# this has to be considered in the directory structure. # this has to be considered in the directory structure.
if [[ ${CI_COMMIT_REF_SLUG} == "main" ]]; then #if [[ ${CI_COMMIT_REF_SLUG} == "main" ]]; then
cp --recursive public/main/* public/ # cp --recursive public/main/* public/
fi #fi
# [ $? -eq 0 ] && exit 0 # [ $? -eq 0 ] && exit 0
...@@ -52,6 +52,8 @@ variables: ...@@ -52,6 +52,8 @@ variables:
GIT_DEPTH: 2 GIT_DEPTH: 2
MAIN: 'https://ahikar.sub.uni-goettingen.de' MAIN: 'https://ahikar.sub.uni-goettingen.de'
DEVELOP: 'https://ahikar-dev.sub.uni-goettingen.de' DEVELOP: 'https://ahikar-dev.sub.uni-goettingen.de'
TEST: 'https://ahikar-test.sub.uni-goettingen.de'
API_TEST: 'https://ahikar-test.sub.uni-goettingen.de/api'
API_DEV: 'https://ahikar-dev.sub.uni-goettingen.de/api' API_DEV: 'https://ahikar-dev.sub.uni-goettingen.de/api'
API_MAIN: 'https://ahikar.sub.uni-goettingen.de/api' API_MAIN: 'https://ahikar.sub.uni-goettingen.de/api'
BASE_BACKEND: '/website/' BASE_BACKEND: '/website/'
...@@ -84,6 +86,14 @@ build_page-all: ...@@ -84,6 +86,14 @@ build_page-all:
VUE_APP_PUBLIC_PATH: '/ahiqar/website/${CI_COMMIT_REF_SLUG}/' VUE_APP_PUBLIC_PATH: '/ahiqar/website/${CI_COMMIT_REF_SLUG}/'
<<: *build-defaults <<: *build-defaults
build_page-test-backend:
variables:
VUE_APP_BASE_URL_API: "${API_TEST}"
VUE_APP_BASE_URL_VIEWER: "${TEST}"
VUE_APP_PUBLIC_PATH: "${BASE_BACKEND}"
<<: *build-defaults
build_page-develop-backend: build_page-develop-backend:
only: only:
- develop - develop
...@@ -102,29 +112,45 @@ build_page-main-backend: ...@@ -102,29 +112,45 @@ build_page-main-backend:
VUE_APP_PUBLIC_PATH: "${BASE_BACKEND}" VUE_APP_PUBLIC_PATH: "${BASE_BACKEND}"
<<: *build-defaults <<: *build-defaults
deploy-test:
stage: deploy_to_server
image: rsamban/scp-resource:latest
except:
- develop
- main
needs:
- job: build_page-test-backend
artifacts: true
script:
- *ssh
# remove the old version from test
- ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/test/frontend/website/*"
# install new version to test
- scp -o 'StrictHostKeyChecking no' -r public/$CI_COMMIT_REF_SLUG/* $SSH_USER@$SSH_IP:~/test/frontend/website/
deploy-dev: deploy-dev:
stage: deploy_to_server stage: deploy_to_server
image: rsamban/scp-resource:latest image: rsamban/scp-resource:latest
only: only:
- develop - develop
dependencies: needs:
- build_page-develop-backend - job: build_page-develop-backend
artifacts: true
script: script:
- *ssh - *ssh
# remove the old version from dev and test # remove the old version from dev
- ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/website/*" - ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/website/*"
- ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/test/frontend/website/*" # install new version to dev
# install new version to dev and test
- scp -o 'StrictHostKeyChecking no' -r public/$CI_COMMIT_REF_NAME/* $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/website/ - scp -o 'StrictHostKeyChecking no' -r public/$CI_COMMIT_REF_NAME/* $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/website/
- ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "cp -r ~/$CI_COMMIT_REF_NAME/frontend/website/* ~/test/frontend/website/"
deploy-main: deploy-main:
stage: deploy_to_server stage: deploy_to_server
image: rsamban/scp-resource:latest image: rsamban/scp-resource:latest
only: only:
- main - main
dependencies: needs:
- build_page-main-backend - job: build_page-main-backend
artifacts: true
script: script:
- *ssh - *ssh
- ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/website/*" - ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/website/*"
......
...@@ -2,6 +2,48 @@ ...@@ -2,6 +2,48 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.6.0](https://gitlab.gwdg.de/subugoe/ahiqar/website/compare/v1.5.0...v1.6.0) (2021-09-09)
### Features
* add collation results ([87358f9](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/87358f92799db40393856c7fbc6bbc130bad80af))
* returning from tido to the respective search hit list page ([d09ad53](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/d09ad5350a6a2bd41729efb5c23375f5fc71f8a5))
### Continuos Integration
* add build and deploy for test ([cbaa0f8](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/cbaa0f843ef0bc319cc74ce5a4d22b95dbe6c11d))
* add build and deployment for test instane ([eb19de9](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/eb19de9043cc4e392f9d21400783bb9329399c5e))
### Chore
* pictures for stemmata page ([093f6a3](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/093f6a39297193e1f28d424b437229de729110ba)), closes [#112](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/issues/112)
### Styling
* formatting and markdown ([f17a6ee](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/f17a6ee84a2c8870704b78f5088b9f243c0b4a18))
* formatting and styling ([f70c0ec](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/f70c0ec96f86c7177841226d416ad601a958b0d6))
* formatting, markdown and tables ([73e0ee6](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/73e0ee62b8a79ca346dd1514dcc3d010ec29412f))
* minor ([f7df12f](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/f7df12fe2162ae073cbbf3a3ba99b654842330e0))
* minor markdown formatting ([a46dce0](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/a46dce094bd4705cc27109ec61474cc7646994f5))
### Docs
* renaming menu items according to requirements. ([00c38c8](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/00c38c863a76d3bee198e888865add87cf21c0bc))
### Refactoring
* adding some blank spaces. ([d9046f9](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/d9046f9a09e7f54b62ef6dfe157c9034871cd7c0))
* addressing review comments. ([30e5950](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/30e5950c9cf95e777b63442714ca10e21d99c4b1))
* fixing console errors. ([8020773](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/80207739fa1c1185dc41077fd200bf37479bebec))
* optimize back to top arrow on website ([534418c](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/534418c6bafa4771d17d6417d66a8b8f92a6a5d6))
* renaming a method name. ([78c9380](https://gitlab.gwdg.de/subugoe/ahiqar/website/-/commit/78c93807f808a896a9768a79f07186a382b4fdf1))
## [1.5.0](https://gitlab.gwdg.de/subugoe/ahiqar/website/compare/v1.4.0...v1.5.0) (2021-08-31) ## [1.5.0](https://gitlab.gwdg.de/subugoe/ahiqar/website/compare/v1.4.0...v1.5.0) (2021-08-31)
......
{ {
"name": "ahiqar-website", "name": "ahiqar-website",
"version": "1.5.0", "version": "1.6.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "ahiqar-website", "name": "ahiqar-website",
"version": "1.5.0", "version": "1.6.0",
"description": "", "description": "",
"main": "", "main": "",
"authors": { "authors": {
......
...@@ -28,11 +28,22 @@ Images and files can be added too, a description on how to do that is not necess ...@@ -28,11 +28,22 @@ Images and files can be added too, a description on how to do that is not necess
## Content via API ## Content via API
Some pages are prepared form TEI source files. HTML is provided via backend. Some pages are prepared form TEI source files. HTML is provided via backend.
### Manuscripts
To update the [list of manuscripts](src/manuscripts.md), run the following code. To update the [list of manuscripts](src/manuscripts.md), run the following code.
```bash ```bash
head -$(grep " HTML " src/manuscripts.md -n | cut -f1 -d:) src/manuscripts.md >> src/tmp.md head -$(grep " HTML " src/manuscripts.md -n | cut -f1 -d:) src/manuscripts.md >> src/tmp.md
echo "" >> src/tmp.md # newline echo "" >> src/tmp.md # newline
curl https://ahikar-test.sub.uni-goettingen.de/api/website/manuscripts | sed "s#xhtml:##g" >> src/tmp.md curl https://ahikar-dev.sub.uni-goettingen.de/api/website/manuscripts | sed "s#xhtml:##g" >> src/tmp.md
# check result at tmp.md and than # check result at tmp.md and than
mv src/tmp.md src/manuscripts.md mv src/tmp.md src/manuscripts.md
```
### Collation Results
To update the [collation results](src/collation.md), run the following code.
```bash
head -$(grep " HTML " src/collation.md -n | cut -f1 -d:) src/collation.md >> src/tmp.md
echo "" >> src/tmp.md # newline
curl https://ahikar-dev.sub.uni-goettingen.de/api/website/collation | sed "s#xhtml:##g" >> src/tmp.md
# check result at tmp.md and than
mv src/tmp.md src/collation.md
``` ```
\ No newline at end of file
...@@ -86,8 +86,8 @@ export default { ...@@ -86,8 +86,8 @@ export default {
metaEdition: [ metaEdition: [
{ title: 'Manuscripts', to: '/manuscripts.html' }, { title: 'Manuscripts', to: '/manuscripts.html' },
{ title: 'Motifs', to: '/motifs.html' }, { title: 'Motifs', to: '/motifs.html' },
{ title: 'Arabic Translation', to: '/arabictranslation.html' }, { title: 'Translation of the Arabic version', to: '/arabictranslation.html' },
{ title: 'Syriac Translation', to: '/syriacranslation.html' }, { title: 'Translation of the Syriac version', to: '/syriacranslation.html' },
{ title: 'Sayings', to: '/sayings.html' }, { title: 'Sayings', to: '/sayings.html' },
{ title: 'Parables', to: '/parables.html' }, { title: 'Parables', to: '/parables.html' },
{ title: 'Stemmata', to: '/stemmata.html' }, { title: 'Stemmata', to: '/stemmata.html' },
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
cols="12" cols="12"
> >
<!-- TODO: provide translation --> <!-- TODO: provide translation -->
<v-tabs <v-tabs
centered centered
hide-slider hide-slider
background-color="secondary" background-color="secondary"
...@@ -87,13 +87,6 @@ ...@@ -87,13 +87,6 @@
<!-- TODO: provide translation --> <!-- TODO: provide translation -->
© {{ new Date().getFullYear() }} – Ahiqar - The syriac and arabic Ahiqar Texts (<a href="https://gitlab.gwdg.de/subugoe/ahiqar/website/-/blob/main/CHANGELOG.md" class="grey--text text--lighten-3 text-decoration-none" target="_blank">v{{ version }}</a>) © {{ new Date().getFullYear() }} – Ahiqar - The syriac and arabic Ahiqar Texts (<a href="https://gitlab.gwdg.de/subugoe/ahiqar/website/-/blob/main/CHANGELOG.md" class="grey--text text--lighten-3 text-decoration-none" target="_blank">v{{ version }}</a>)
</v-col> </v-col>
<v-col
class="body-2 grey--text text--lighten-3 text-right copyright"
cols="6"
>
<!-- TODO: provide translation -->
<a href="#top" class="grey--text text--lighten-3 text-decoration-none text-uppercase"><v-icon medium class="grey--text text--lighten-3">mdi-arrow-up</v-icon><span class="d-sr-only-focusable">Back to top</span></a>
</v-col>
</v-row> </v-row>
</v-container> </v-container>
</v-footer> </v-footer>
......
<template>
<div
v-if="visible"
class="container"
id="scroll"
>
<button class="scroll-button" @click="scrollToTop">
<v-icon medium class="white--text">mdi-arrow-up</v-icon>
</button>
</div>
</template>
<script>
const SCROLL_HEIGHT = 50;
export default {
data() {
return {
visible:false
}
},
mounted() {
this.handleScroll();
window.addEventListener("scroll", this.handleScroll);
},
destroy() {
window.removeEventListener("scroll", this.handleScroll);
},
methods:{
scrollToTop() {
window.scrollTo(0,0);
},
handleScroll() {
if (window.scrollY > SCROLL_HEIGHT && !this.visible) {
this.visible = true;
} else if (window.scrollY <= SCROLL_HEIGHT && this.visible) {
this.visible = false;
}
}
}
}
</script>
<style lang="scss" scoped>
.container {
display: flex;
justify-content: flex-end;
position: fixed;
right: 100px;
top: 90vh;
width: 100px;
z-index: 100;
}
.scroll-button {
align-items: center;
display: flex;
height: 50px;
justify-content: center;
width: 50px;
background: #1a3771;
border-radius: 25px;
box-shadow:
0 2.8px 2.2px rgba(0, 0, 0, 0.034),
0 6.7px 5.3px rgba(0, 0, 0, 0.048),
0 12.5px 10px rgba(0, 0, 0, 0.06),
0 22.3px 17.9px rgba(0, 0, 0, 0.072),
0 41.8px 33.4px rgba(0, 0, 0, 0.086),
0 100px 80px rgba(0, 0, 0, 0.12);
}
</style>
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
class="d-flex align-top input-container" class="d-flex align-top input-container"
> >
<v-text-field <v-text-field
autofocus
v-model="input" v-model="input"
label="Your Search String" label="Your Search String"
hint="Operators: e.g. 'OR', 'AND', 'NOT', '*' and more" hint="Operators: e.g. 'OR', 'AND', 'NOT', '*' and more"
......
...@@ -42,12 +42,10 @@ ...@@ -42,12 +42,10 @@
:items="items" :items="items"
:message="message" :message="message"
:query="query" :query="query"
:page="page"
/> />
<div <div class="text-center">
class="text-center"
@click="scrollUp()"
>
<v-pagination <v-pagination
v-if="distinctSheets > size" v-if="distinctSheets > size"
v-model="page" v-model="page"
...@@ -85,16 +83,25 @@ export default { ...@@ -85,16 +83,25 @@ export default {
}; };
}, },
watch:{ watch:{
page: function() { page: function(page) {
this.loading = true; this.loading = true;
const from = this.size * (this.page - 1); const from = this.size * (page - 1);
this.updateQueryParameter(this.query.trim(), page || 1);
this.search(this.query.trim(), from, this.size); this.search(this.query.trim(), from, this.size);
}, },
}, },
mounted(){ mounted(){
const page = this.$route.query?.page;
if(page) {
this.page = parseInt(page);
}
if(this.$route.query?.searchTerm) { if(this.$route.query?.searchTerm) {
this.onSearchInput(this.$route.query.searchTerm); this.onSearchInput(this.$route.query.searchTerm, this.page);
} else { } else {
this.showPlaceholder = true; this.showPlaceholder = true;
} }
...@@ -117,9 +124,8 @@ export default { ...@@ -117,9 +124,8 @@ export default {
}, },
}, },
methods: { methods: {
onSearchInput(query) { onSearchInput(query, page) {
this.query = query; this.query = query;
this.page = 1;
this.resetList(); this.resetList();
this.showPlaceholder = false; this.showPlaceholder = false;
...@@ -127,10 +133,19 @@ export default { ...@@ -127,10 +133,19 @@ export default {
this.search(this.query.trim(), 0, this.size); this.search(this.query.trim(), 0, this.size);
if (this.$route.query.searchTerm !== query) { this.updateQueryParameter(query, page || 1);
this.$router.push({ query: { ...this.$route.query, searchTerm:query } });
this.page = page || 1;
},
updateQueryParameter(query, page) {
if(this.$route.query.searchTerm === query && this.$route.query.page === String(page)) {
return;
} }
this.$router.push({ query: { ...this.$route.query, searchTerm:query, page:page || 1 } });
}, },
async search(value, from, size) { async search(value, from, size) {
this.hitCounter = from + 1; this.hitCounter = from + 1;
...@@ -162,13 +177,7 @@ export default { ...@@ -162,13 +177,7 @@ export default {
this.loading = false; this.loading = false;
} }
}, },
scrollUp() {
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth',
});
},
resetList() { resetList() {
this.items = []; this.items = [];
this.distinctSheets = 0; this.distinctSheets = 0;
......
...@@ -54,6 +54,10 @@ export default { ...@@ -54,6 +54,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
page: {
type: Number,
default: () => 1,
},
}, },
computed: { computed: {
viewerBaseUrl() { viewerBaseUrl() {
...@@ -72,7 +76,7 @@ export default { ...@@ -72,7 +76,7 @@ export default {
} else if (item.lang === 'syc') { } else if (item.lang === 'syc') {
language = 'syriac'; language = 'syriac';
} }
return `${this.viewerBaseUrl}/${language}/#/?itemurl=${item.item}&source=external&searchTerm=${item.searchTerm}&redirectUrl=${this.getPath}`; return `${this.viewerBaseUrl}/${language}/#/?itemurl=${item.item}&source=external&searchTerm=${item.searchTerm}&redirectUrl=${this.getPath}&page=${this.page}`;
}, },
}, },
watch: { watch: {
......
src/.vuepress/public/assets/images/stemmata5.png

291 KiB

html {
scroll-behavior: smooth;
}
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
<client-only> <client-only>
<Bar/> <Bar/>
</client-only> </client-only>
<client-only>
<ScrollTo />
</client-only>
<v-main> <v-main>
<v-container> <v-container>
<Content/> <Content/>
......