Skip to content

Commit b516fd2

Browse files
committed
feat: Add "Share" button
1 parent 10b49aa commit b516fd2

4 files changed

Lines changed: 57 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<img src="dome/static/img/logo.png" width="180">
3-
<h3 align="center">dome</h3>
3+
<h3 align="center">Dome</h3>
44
<p align="center">⏺️ Comprehensive media tracker</p>
55
</p>
66

dome/static/css/base.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,15 @@
362362
.inline-flex {
363363
display: inline-flex;
364364
}
365+
.table {
366+
display: table;
367+
}
365368
.aspect-\[2\/3\] {
366369
aspect-ratio: 2/3;
367370
}
371+
.h-1 {
372+
height: calc(var(--spacing) * 1);
373+
}
368374
.h-1\.5 {
369375
height: calc(var(--spacing) * 1.5);
370376
}
@@ -401,6 +407,9 @@
401407
.max-h-96 {
402408
max-height: calc(var(--spacing) * 96);
403409
}
410+
.w-1 {
411+
width: calc(var(--spacing) * 1);
412+
}
404413
.w-1\.5 {
405414
width: calc(var(--spacing) * 1.5);
406415
}
@@ -434,6 +443,9 @@
434443
.w-48 {
435444
width: calc(var(--spacing) * 48);
436445
}
446+
.w-fit {
447+
width: fit-content;
448+
}
437449
.w-full {
438450
width: 100%;
439451
}
@@ -461,12 +473,18 @@
461473
.flex-initial {
462474
flex: 0 auto;
463475
}
476+
.flex-shrink {
477+
flex-shrink: 1;
478+
}
464479
.shrink-0 {
465480
flex-shrink: 0;
466481
}
467482
.flex-grow {
468483
flex-grow: 1;
469484
}
485+
.border-collapse {
486+
border-collapse: collapse;
487+
}
470488
.translate-x-full {
471489
--tw-translate-x: 100%;
472490
translate: var(--tw-translate-x) var(--tw-translate-y);
@@ -627,6 +645,9 @@
627645
--tw-border-style: none;
628646
border-style: none;
629647
}
648+
.\!border-white {
649+
border-color: var(--color-white) !important;
650+
}
630651
.border-black {
631652
border-color: var(--color-black);
632653
}
@@ -708,6 +729,9 @@
708729
.p-8 {
709730
padding: calc(var(--spacing) * 8);
710731
}
732+
.px-1 {
733+
padding-inline: calc(var(--spacing) * 1);
734+
}
711735
.px-1\.5 {
712736
padding-inline: calc(var(--spacing) * 1.5);
713737
}
@@ -720,6 +744,9 @@
720744
.px-4 {
721745
padding-inline: calc(var(--spacing) * 4);
722746
}
747+
.py-0 {
748+
padding-block: calc(var(--spacing) * 0);
749+
}
723750
.py-0\.5 {
724751
padding-block: calc(var(--spacing) * 0.5);
725752
}
@@ -828,6 +855,9 @@
828855
.italic {
829856
font-style: italic;
830857
}
858+
.underline {
859+
text-decoration-line: underline;
860+
}
831861
.opacity-0 {
832862
opacity: 0%;
833863
}
@@ -842,6 +872,10 @@
842872
--tw-shadow: 0 0 #0000;
843873
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
844874
}
875+
.outline {
876+
outline-style: var(--tw-outline-style);
877+
outline-width: 1px;
878+
}
845879
.outline-0 {
846880
outline-style: var(--tw-outline-style);
847881
outline-width: 0px;

entities/templates/entities/entities_detail.html

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
{{ object.name }}
55
{% endblock title %}
66
{% block content %}
7-
<!-- Back Button -->
8-
<a href="javascript:history.back()" class="btn btn-outline mb-4 text-xs">
9-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
10-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
11-
</svg>
12-
Back
13-
</a>
7+
<!-- Back Button and Entity Type Badge -->
8+
<div class="flex items-center justify-between mb-4">
9+
<a href="javascript:history.back()" class="btn btn-outline text-xs">
10+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
11+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
12+
</svg>
13+
Back
14+
</a>
15+
<span class="badge text-black" style="background-color: {{ object.COLOR }};">{{ object|verbosename }}</span>
16+
</div>
1417

1518
<div class="flex flex-col md:flex-row gap-6">
1619
<!-- Left Column: Image and Find It On -->
1720
<div class="flex flex-col gap-4 md:w-64 shrink-0">
1821
<!-- Image with neobrutalist border -->
19-
<div class="relative flex justify-center">
22+
<div class="relative flex justify-center w-fit self-center">
2023
<div class="absolute -right-2 -top-2 w-4 h-4 bg-neo-yellow border-2 border-black"></div>
2124
<div class="absolute -left-2 -bottom-2 w-4 h-4 bg-neo-pink border-2 border-black"></div>
2225
<figure class="border-3 border-black overflow-hidden bg-white inline-block max-w-full">
@@ -49,12 +52,18 @@ <h3 class="font-bold text-xs uppercase mb-3">Find It On</h3>
4952

5053
<!-- Right Column: Main Content -->
5154
<div class="flex-1">
52-
<!-- Entity Type Badge and Edit Button -->
53-
<div class="flex items-center gap-2 mb-3">
54-
<span class="badge badge-primary">{{ object|verbosename }}</span>
55+
<!-- Edit and Share Buttons -->
56+
<div class="flex items-center gap-2 mb-3" x-data="{ copied: false }">
5557
{% if user.is_staff %}
5658
<a href="{{ edit_url }}" class="btn btn-outline text-xs py-1 px-2">Edit</a>
5759
{% endif %}
60+
<button @click="navigator.clipboard.writeText(window.location.href); copied = true; setTimeout(() => copied = false, 2000)"
61+
class="btn btn-outline text-xs py-1 px-2 flex items-center gap-1">
62+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24">
63+
<path fill="currentColor" d="M17 22q-1.25 0-2.125-.875T14 19q0-.15.075-.7L7.05 14.2q-.4.375-.925.588T5 15q-1.25 0-2.125-.875T2 12t.875-2.125T5 9q.6 0 1.125.213t.925.587l7.025-4.1q-.05-.175-.062-.337T14 5q0-1.25.875-2.125T17 2t2.125.875T20 5t-.875 2.125T17 8q-.6 0-1.125-.213T14.95 7.2l-7.025 4.1q.05.175.063.338T8 12t-.012.363t-.063.337l7.025 4.1q.4-.375.925-.587T17 16q1.25 0 2.125.875T20 19t-.875 2.125T17 22" />
64+
</svg>
65+
<span x-text="copied ? 'Copied!' : 'Share'"></span>
66+
</button>
5867
</div>
5968

6069
<!-- Title -->

entities/templates/entities/partials/entity_item.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
<div class="bg-black text-white p-2 space-y-1 flex-1 flex flex-col justify-start">
5959
{# Entity type badge #}
6060
<div class="inline-block">
61-
<span class="px-1.5 py-0.5 text-xs font-bold uppercase border border-white"
62-
style="background-color: {{ entity.COLOR }}; color: black;">
61+
<span class="badge text-black"
62+
style="background-color: {{ entity.COLOR }};">
6363
{{ entity|verbosename }}
6464
</span>
6565
</div>

0 commit comments

Comments
 (0)