Skip to content

Commit

Permalink
Add citation field to layers
Browse files Browse the repository at this point in the history
  • Loading branch information
bkis committed Oct 4, 2023
1 parent d709900 commit f498c35
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
37 changes: 37 additions & 0 deletions Tekst-API/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3507,6 +3507,19 @@
"description": "Publication status of this layer",
"default": false
},
"citation": {
"anyOf": [
{
"type": "string",
"maxLength": 1000
},
{
"type": "null"
}
],
"title": "Citation",
"description": "Citation details for this layer"
},
"meta": {
"anyOf": [
{
Expand Down Expand Up @@ -3642,6 +3655,19 @@
"description": "Publication status of this layer",
"default": false
},
"citation": {
"anyOf": [
{
"type": "string",
"maxLength": 1000
},
{
"type": "null"
}
],
"title": "Citation",
"description": "Citation details for this layer"
},
"meta": {
"anyOf": [
{
Expand Down Expand Up @@ -3755,6 +3781,17 @@
"type": "boolean",
"title": "Public"
},
"citation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Citation"
},
"meta": {
"anyOf": [
{
Expand Down
4 changes: 4 additions & 0 deletions Tekst-API/tekst/models/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class LayerBase(ModelBase, ModelFactoryMixin):
public: Annotated[
bool, Field(description="Publication status of this layer")
] = False
citation: Annotated[
str | None,
Field(description="Citation details for this layer", max_length=1000),
] = None
meta: Annotated[Metadata | None, Field(description="Arbitrary metadata")] = None
comment: Annotated[
str | None,
Expand Down
1 change: 1 addition & 0 deletions Tekst-API/tekst/sample_data/_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"language": "DE",
},
"comment": "This version includes repetition markers.",
"citation": "Anschütz, Ernst. Warnung. 1824.",
"config": {
"deepl_links": {
"enabled": True,
Expand Down
9 changes: 8 additions & 1 deletion Tekst-Web/src/components/browse/widgets/LayerInfoWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,19 @@ const coveragePercent = computed(
</template>

<template v-if="layer.comment">
<h3>{{ $t('models.meta.comment') }}</h3>
<h3>{{ $t('models.layer.comment') }}</h3>
<div class="layer-comment">
{{ layer.comment }}
</div>
</template>

<template v-if="layer.citation">
<h3>{{ $t('browse.units.widgets.infoWidget.citeAs') }}</h3>
<div>
{{ layer.citation }}
</div>
</template>

<h3>{{ $t('browse.units.widgets.infoWidget.coverage') }}</h3>
<template v-if="coverage">
<p>
Expand Down
4 changes: 3 additions & 1 deletion Tekst-Web/src/i18n/translations/deDE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ browse:
title: DeepL-Übersetzung öffnen
infoWidget:
title: Informationen zu dieser Datenschicht anzeigen
citeAs: Zitieren als
coverage: Abdeckung
coverageStatement: '{present} von {total} Knoten auf Ebene "{level}".'
deactivateWidget:
Expand Down Expand Up @@ -198,6 +199,8 @@ models:
layer:
modelLabel: Datenschicht | Datenschichten
layerType: Datenschicht-Typ
comment: Kommentar
citation: Zitation
unit:
modelLabel: Daten-Einheit | Daten-Einheiten
meta:
Expand All @@ -206,7 +209,6 @@ models:
year: Jahr
language: Sprache
layerType: '@:models.layer.layerType'
comment: Kommentar
providedBy: Bereitgestellt von
onLevel: auf Ebene "{level}"

Expand Down
4 changes: 3 additions & 1 deletion Tekst-Web/src/i18n/translations/enUS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ browse:
title: Open DeepL translation
infoWidget:
title: Show information on this data layer
citeAs: Cite as
coverage: Coverage
coverageStatement: '{present} of {total} nodes on level "{level}".'
deactivateWidget:
Expand Down Expand Up @@ -190,6 +191,8 @@ models:
layer:
modelLabel: Data layer | Data layers
layerType: Datalayer Type
citation: Citation
comment: Comment
unit:
modelLabel: Data unit | Data units
meta:
Expand All @@ -198,7 +201,6 @@ models:
year: Year
language: Language
layerType: '@:models.layer.layerType'
comment: Comment
providedBy: Provided by
onLevel: on level "{level}"

Expand Down

0 comments on commit f498c35

Please sign in to comment.