From 6318bf84f822427de93ff2c27c8571d4b3022ffa Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Thu, 29 May 2025 18:26:24 +0200
Subject: [PATCH] WIP

Signed-off-by: Martin Weise <martin.weise@tuwien.ac.at>
---
 dbrepo-ui/components/ResourceStatus.vue    |  5 ++-
 dbrepo-ui/components/identifier/Select.vue | 41 ++++++++++------------
 2 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/dbrepo-ui/components/ResourceStatus.vue b/dbrepo-ui/components/ResourceStatus.vue
index 017908b3af..c2a2f78efc 100644
--- a/dbrepo-ui/components/ResourceStatus.vue
+++ b/dbrepo-ui/components/ResourceStatus.vue
@@ -55,7 +55,10 @@ export default {
       return this.$t(`pages.database.status.${this.mode}`)
     },
     hasIdentifier () {
-      return this.resource.identifiers?.length > 0
+      if (this.resource.identifiers?.length === 0) {
+        return false
+      }
+      return this.resource.identifiers.filter(i => i.status === 'published').length > 0
     },
     color () {
       if (this.hasIdentifier) {
diff --git a/dbrepo-ui/components/identifier/Select.vue b/dbrepo-ui/components/identifier/Select.vue
index e557286614..ea402471fb 100644
--- a/dbrepo-ui/components/identifier/Select.vue
+++ b/dbrepo-ui/components/identifier/Select.vue
@@ -15,27 +15,21 @@
           :identifier="identifier" />
       </v-list-item-subtitle>
       <template v-slot:append>
-        <v-tooltip
-          v-if="identifier.status === 'published'"
-          :text="$t('pages.identifier.pid.title')"
-          left>
-          <template
-            v-slot:activator="{ props }">
-            <v-icon
-              color="primary"
-              v-bind="props">mdi-identifier</v-icon>
-          </template>
-        </v-tooltip>
-        <v-tooltip
-          v-else
-          :text="$t('pages.identifier.draft.title')"
-          left>
-          <template
-            v-slot:activator="{ props }">
-            <v-icon
-              v-bind="props">mdi-pencil-outline</v-icon>
-          </template>
-        </v-tooltip>
+        <v-list-item-action>
+          <v-tooltip
+            :text="identifier.status === 'published' ? $t('pages.identifier.pid.title') : $t('pages.identifier.draft.title')"
+            left>
+            <template
+              v-slot:activator="{ props }">
+              <span class="mr-2">{{ formatTimestampUTCLabel(identifier.created) }}</span>
+              <v-icon
+                :color="identifier.status === 'published' ? 'primary' : null"
+                v-bind="props">
+                {{ identifier.status === 'published' ? 'mdi-identifier' : 'mdi-pencil-outline' }}
+              </v-icon>
+            </template>
+          </v-tooltip>
+        </v-list-item-action>
       </template>
     </v-list-item>
   </div>
@@ -102,6 +96,7 @@ export default {
     this.init()
   },
   methods: {
+    formatTimestampUTCLabel,
     href (identifier) {
       if (!identifier) {
         return null
@@ -128,7 +123,7 @@ export default {
       return identifierService.identifierPreferEnglishTitle(identifier)
     },
     isActive (identifier) {
-      if (!identifier) {
+      if (!identifier || !this.identifier) {
         return false
       }
       return this.identifier.id === identifier.id
@@ -140,7 +135,7 @@ export default {
       return identifier.status === 'published' ? 'primary' : null
     },
     init () {
-      if (!this.identifiers) {
+      if (!this.identifiers || !this.identifier) {
         return null
       }
       this.idx = this.identifiers.map(i => i.id).indexOf(this.identifier.id)
-- 
GitLab