Skip to content

Commit 4879ec4

Browse files
committed
2 parents 31fba1b + e474642 commit 4879ec4

File tree

11 files changed

+104
-64
lines changed

11 files changed

+104
-64
lines changed

Tekst-Web/i18n/ui/deDE.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ admin:
966966
newPage: Neue Seite
967967
phSelectPage: Seite auswählen
968968
noPage: Bitte wählen Sie eine Info-Seite aus oder erstellen Sie eine neue!
969+
editPage: Diese Seite bearbeiten
969970

970971
search:
971972
quickSearch:

Tekst-Web/i18n/ui/enUS.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ admin:
941941
newPage: New Page
942942
phSelectPage: Select page
943943
noPage: Please select an info page or create a new one!
944+
editPage: Edit this page
944945

945946
search:
946947
quickSearch:

Tekst-Web/src/components/browse/BrowseArchiveWidget.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ function handleSubmit() {
4040

4141
<template>
4242
<n-button
43+
v-bind="$attrs"
44+
circle
4345
secondary
4446
size="tiny"
47+
color="var(--primary-color)"
4548
:focusable="false"
4649
:title="$t('contents.archive.widgetTip')"
4750
@click.stop.prevent="handleWidgetClick"
4851
>
4952
<template #icon>
5053
<n-icon :component="ArchiveIcon" />
5154
</template>
52-
{{ $t('contents.archive.widgetTitle') }}
5355
</n-button>
5456

5557
<generic-modal

Tekst-Web/src/components/content/TextAnnotationContent.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import CopyToClipboardButton from '@/components/generic/CopyToClipboardButton.vu
44
import GenericModal from '@/components/generic/GenericModal.vue';
55
import { $t } from '@/i18n';
66
import {
7-
CheckIcon,
8-
ClearIcon,
9-
ColorIcon,
10-
ColorOffIcon,
11-
CommentIcon,
12-
CopyIcon,
13-
LabelIcon,
7+
CheckIcon,
8+
ClearIcon,
9+
ColorIcon,
10+
ColorOffIcon,
11+
CommentIcon,
12+
CopyIcon,
13+
LabelIcon,
1414
} from '@/icons';
1515
import { useBrowseStore, useStateStore, useThemeStore } from '@/stores';
1616
import {
17-
getFullLocationLabel,
18-
groupAndSortItems,
19-
hashCode,
20-
pickTranslation,
21-
renderIcon,
17+
getFullLocationLabel,
18+
groupAndSortItems,
19+
hashCode,
20+
pickTranslation,
21+
renderIcon,
2222
} from '@/utils';
2323
import { useClipboard, useStorage } from '@vueuse/core';
2424
import { adjustHue, saturate, toRgba, transparentize } from 'color2k';

Tekst-Web/src/components/resource/ResourceInfoTags.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import type { AnyResourceRead } from '@/api';
33
import { $t } from '@/i18n';
44
import {
5-
CommunityIcon,
6-
LevelsIcon,
7-
PatchIcon,
8-
ProposedIcon,
9-
PublicIcon,
10-
PublicOffIcon,
11-
ResourceIcon,
5+
CommunityIcon,
6+
LevelsIcon,
7+
PatchIcon,
8+
ProposedIcon,
9+
PublicIcon,
10+
PublicOffIcon,
11+
ResourceIcon,
1212
} from '@/icons';
1313
import { useAuthStore, useResourcesStore, useStateStore } from '@/stores';
1414
import { pickTranslation } from '@/utils';

Tekst-Web/src/components/resource/ResourceListItem.vue

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ import ResourceInfoTags from '@/components/resource/ResourceInfoTags.vue';
88
import env from '@/env';
99
import { $t } from '@/i18n';
1010
import {
11-
BookIcon,
12-
CorrectionNoteIcon,
13-
DeleteIcon,
14-
DownloadIcon,
15-
EditIcon,
16-
MoreIcon,
17-
PatchIcon,
18-
ProposedIcon,
19-
PublicIcon,
20-
PublicOffIcon,
21-
ReviewIcon,
22-
SettingsIcon,
23-
UnproposedIcon,
24-
UploadIcon,
25-
UserIcon,
11+
BookIcon,
12+
CorrectionNoteIcon,
13+
DeleteIcon,
14+
DownloadIcon,
15+
EditIcon,
16+
MoreIcon,
17+
PatchIcon,
18+
ProposedIcon,
19+
PublicIcon,
20+
PublicOffIcon,
21+
ReviewIcon,
22+
SettingsIcon,
23+
UnproposedIcon,
24+
UploadIcon,
25+
UserIcon,
2626
} from '@/icons';
2727
import { useResourcesStore, useStateStore } from '@/stores';
2828
import { pickTranslation, renderIcon } from '@/utils';
2929
import {
30-
NBadge,
31-
NButton,
32-
NCollapseItem,
33-
NFlex,
34-
NIcon,
35-
type ButtonType,
36-
type DropdownOption,
30+
NBadge,
31+
NButton,
32+
NCollapseItem,
33+
NFlex,
34+
NIcon,
35+
type ButtonType,
36+
type DropdownOption,
3737
} from 'naive-ui';
3838
import { computed, ref } from 'vue';
3939
import { useRouter } from 'vue-router';
@@ -229,8 +229,7 @@ const actionOptions = computed<DropdownOption[]>(() => [
229229
resources.all
230230
.find((r) => r.id === props.resource.patchFor)
231231
?.ownerIds.includes(props.user.id) ||
232-
!resources.all.find((r) => r.id === props.resource.patchFor)?.ownerIds
233-
.length,
232+
!resources.all.find((r) => r.id === props.resource.patchFor)?.ownerIds.length,
234233
action: () => emit('reqPatchIntegrationClick', props.resource),
235234
statusType: 'success',
236235
},

Tekst-Web/src/views/BrowseView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ onMounted(() => {
129129
<icon-heading v-if="!!browse.locationPath.length" level="1" :icon="BookIcon">
130130
<location-label />
131131
<help-button-widget help-key="browseView" data-tour-key="helpButtons" />
132+
<browse-archive-widget :default="archiveTs" @submit="handleArchiveToggle" />
132133
</icon-heading>
133134

134135
<n-flex class="my-lg">
@@ -140,7 +141,6 @@ onMounted(() => {
140141
:text-slug="state.textSlug || undefined"
141142
:explode="state.pf?.state.showLocationAliases"
142143
/>
143-
<browse-archive-widget :default="archiveTs" @submit="handleArchiveToggle" />
144144
</n-flex>
145145

146146
<browse-toolbar v-if="browse.locationPath.length" />

Tekst-Web/src/views/ContentsView.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ const compareResourceOptions = computed(() =>
121121
.filter((r) => r.id !== resource.value?.id && r.level === resource.value?.level)
122122
.sort(
123123
(a, b) =>
124-
(a.patchFor === resource.value?.id ? 1 : 0) +
125-
(b.patchFor === resource.value?.id ? 1 : 0)
124+
(a.patchFor === resource.value?.id ? 1 : 0) + (b.patchFor === resource.value?.id ? 1 : 0)
126125
)
127126
.map((r) => ({
128127
label: pickTranslation(r.title, state.locale),

Tekst-Web/src/views/InfoPageView.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import type { ClientSegmentRead } from '@/api';
33
import HydratedHtml from '@/components/generic/HydratedHtml.vue';
44
import IconHeading from '@/components/generic/IconHeading.vue';
55
import { usePlatformData } from '@/composables/platformData';
6-
import { useStateStore } from '@/stores';
7-
import { NSpin } from 'naive-ui';
6+
import { EditIcon } from '@/icons';
7+
import { useAuthStore, useStateStore } from '@/stores';
8+
import { NButton, NIcon, NSpin } from 'naive-ui';
89
import { ref, watchEffect, type Component } from 'vue';
910
import { useRouter } from 'vue-router';
1011
@@ -14,12 +15,17 @@ const props = defineProps<{
1415
}>();
1516
1617
const state = useStateStore();
18+
const auth = useAuthStore();
1719
const loading = ref(false);
1820
const { getSegment } = usePlatformData();
1921
const router = useRouter();
2022
2123
const page = ref<ClientSegmentRead>();
2224
25+
function handleEditClick() {
26+
router.push({ name: 'adminInfoPages', hash: page.value ? `#page=${page.value.id}` : undefined });
27+
}
28+
2329
watchEffect(async () => {
2430
loading.value = true;
2531
page.value = await getSegment(props.pageKey, state.locale);
@@ -35,6 +41,18 @@ watchEffect(async () => {
3541
<template v-else-if="page">
3642
<icon-heading v-if="page.title" level="1" :icon="icon">
3743
{{ page.title }}
44+
<n-button
45+
v-if="!!auth.user?.isSuperuser"
46+
circle
47+
quaternary
48+
size="small"
49+
:title="$t('admin.infoPages.editPage')"
50+
@click="handleEditClick"
51+
>
52+
<template #icon>
53+
<n-icon :component="EditIcon" />
54+
</template>
55+
</n-button>
3856
</icon-heading>
3957
<div class="content-block" style="padding: 1.2rem">
4058
<hydrated-html :html="page.html" />

Tekst-Web/src/views/ResourcesView.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script setup lang="ts">
22
import {
3-
DELETE,
4-
downloadData,
5-
GET,
6-
PATCH,
7-
POST,
8-
withSelectedFile,
9-
type AnyResourceRead,
3+
DELETE,
4+
downloadData,
5+
GET,
6+
PATCH,
7+
POST,
8+
withSelectedFile,
9+
type AnyResourceRead,
1010
} from '@/api';
1111
import { commonDialogOptions } from '@/common';
1212
import ButtonShelf from '@/components/generic/ButtonShelf.vue';
@@ -21,11 +21,11 @@ import { useTasks } from '@/composables/tasks';
2121
import { $t } from '@/i18n';
2222
import { AddIcon, JumpBackIcon, NoContentIcon, ResourceIcon, SearchIcon, UserIcon } from '@/icons';
2323
import {
24-
useAuthStore,
25-
useBrowseStore,
26-
useResourcesStore,
27-
useStateStore,
28-
useUserMessagesStore,
24+
useAuthStore,
25+
useBrowseStore,
26+
useResourcesStore,
27+
useStateStore,
28+
useUserMessagesStore,
2929
} from '@/stores';
3030
import { pickTranslation } from '@/utils';
3131
import { refDebounced, useUrlSearchParams } from '@vueuse/core';

0 commit comments

Comments
 (0)