Skip to content

Commit 7dbe52a

Browse files
committed
fix: Improves DOI visualization
1 parent a4c9fd1 commit 7dbe52a

2 files changed

Lines changed: 25 additions & 15 deletions

File tree

app/modules/dataset/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ def get_uvlhub_doi(self) -> str:
139139
from app.modules.dataset.services import DataSetService
140140

141141
return DataSetService().get_uvlhub_doi(self)
142+
143+
def get_uvlhub_doi_path(self) -> str:
144+
doi = self.get_uvlhub_doi()
145+
# Si encuentra "/doi", devolver desde ahí
146+
idx = doi.find("/doi")
147+
if idx != -1:
148+
return doi[idx:]
149+
return doi # fallback: devuelve completo si no hay /doi
142150

143151
def is_anonymous(self) -> bool:
144152
return self.ds_meta_data.dataset_anonymous

app/modules/public/templates/public/index.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,23 @@ <h2 class="mb-0">
119119
</span>
120120

121121
<!-- Enlace al DOI -->
122-
<a href="{{ dataset.get_uvlhub_doi() }}"
123-
target="_blank"
124-
class="px-3 py-1 text-white fw-semibold text-decoration-none rounded-end me-2"
125-
style="background: linear-gradient(90deg, #2176bd 0%, #2980b9 100%); font-family: monospace;">
126-
{{ dataset.get_uvlhub_doi() }}
127-
</a>
128-
129-
<!-- Copiar DOI -->
130-
<i data-feather="clipboard"
131-
class="center-button-icon"
132-
style="cursor: pointer"
133-
onclick="copyText('dataset_doi_uvlhub_{{ dataset.id }}')"
134-
data-bs-toggle="tooltip"
135-
title="Copy DOI">
136-
</i>
122+
<div class="d-flex align-items-center flex-wrap">
123+
<a href="{{ dataset.get_uvlhub_doi() }}"
124+
target="_blank"
125+
class="px-3 py-1 text-white fw-semibold text-decoration-none rounded-end me-2"
126+
style="background: linear-gradient(90deg, #2176bd 0%, #2980b9 100%); font-family: monospace; word-break: break-all;">
127+
{{ dataset.get_uvlhub_doi_path() }}
128+
</a>
129+
130+
<!-- Copiar DOI -->
131+
<i data-feather="clipboard"
132+
class="center-button-icon"
133+
style="cursor: pointer"
134+
onclick="copyText('dataset_doi_uvlhub_{{ dataset.id }}')"
135+
data-bs-toggle="tooltip"
136+
title="Copy DOI">
137+
</i>
138+
</div>
137139

138140
<!-- Texto oculto para copiar -->
139141
<div id="dataset_doi_uvlhub_{{ dataset.id }}" style="display: none;">

0 commit comments

Comments
 (0)