Skip to content

Commit

Permalink
Merge pull request #25 from chnm/refactor/api-data
Browse files Browse the repository at this point in the history
fix: Removed erroneous if statement
hepplerj authored Oct 9, 2024
2 parents 024674a + 4aac4f2 commit f8892b3
Showing 1 changed file with 33 additions and 35 deletions.
68 changes: 33 additions & 35 deletions exhibits/templates/exhibits/exhibit_page.html
Original file line number Diff line number Diff line change
@@ -923,47 +923,45 @@ <h1>{{ page.title }}</h1>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/img-comparison-slider@8/dist/styles.css" />
{% elif page.image %}
{% image page.image original class="w-full max-h-[80vh] object-contain" %}
{% if page.image %}
<div x-data="{ openCaption: false, openImage: false }" class="absolute top-0 right-0 m-4 hidden md:block">
<div class="flex justify-end space-x-2" :class="{ 'hidden': openCaption || openImage }" x-transition x-cloak>
{% if page.image_caption %}
<button @click="openCaption = true" class="bg-slate-500 bg-opacity-50 hover:bg-opacity-100 hover:bg-slate-700 text-white text-sm font-bold py-2 px-4 rounded">
Caption
</button>
{% endif %}
<button @click="openImage = true" class="bg-slate-500 bg-opacity-50 hover:bg-opacity-100 hover:bg-slate-700 text-white text-sm font-bold py-2 px-4 rounded">
View Full Image
<div x-data="{ openCaption: false, openImage: false }" class="absolute top-0 right-0 m-4 hidden md:block">
<div class="flex justify-end space-x-2" :class="{ 'hidden': openCaption || openImage }" x-transition x-cloak>
{% if page.image_caption %}
<button @click="openCaption = true" class="bg-slate-500 bg-opacity-50 hover:bg-opacity-100 hover:bg-slate-700 text-white text-sm font-bold py-2 px-4 rounded">
Caption
</button>
{% endif %}
<button @click="openImage = true" class="bg-slate-500 bg-opacity-50 hover:bg-opacity-100 hover:bg-slate-700 text-white text-sm font-bold py-2 px-4 rounded">
View Full Image
</button>
</div>
{% if page.image_caption %}
<div :class="{ 'hidden': !openCaption }" x-transition x-cloak
class="mt-2 p-4 bg-gray-900 text-white rounded shadow-lg w-64 relative">
<button @click="openCaption = false" class="absolute top-2 right-2 text-white">
&times;
</button>
<p class="text-sm">
{{ page.image_caption }}
</p>
</div>
{% if page.image_caption %}
<div :class="{ 'hidden': !openCaption }" x-transition x-cloak
class="mt-2 p-4 bg-gray-900 text-white rounded shadow-lg w-64 relative">
<button @click="openCaption = false" class="absolute top-2 right-2 text-white">
&times;
</button>
<p class="text-sm">
{% endif %}
<div :class="{ 'hidden': !openImage }" x-transition x-cloak
class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50">
<div class="relative bg-white p-4 rounded shadow-lg w-11/12 lg:w-3/4 max-h-screen overflow-y-auto">
<button @click="openImage = false" class="absolute top-2 right-2 text-black">
<span class="bg-slate-700 hover:bg-red-800 rounded p-2 flex items-center justify-center w-8 h-8 text-white">&times;</span>
</button>
<div class="flex justify-center items-center overflow-hidden">
{% image page.image original class="w-auto max-h-[80vh]" %}
</div>
{% if page.image_caption %}
<p class="text-sm mt-2 text-center">
{{ page.image_caption }}
</p>
</div>
{% endif %}
<div :class="{ 'hidden': !openImage }" x-transition x-cloak
class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50">
<div class="relative bg-white p-4 rounded shadow-lg w-11/12 lg:w-3/4 max-h-screen overflow-y-auto">
<button @click="openImage = false" class="absolute top-2 right-2 text-black">
<span class="bg-slate-700 hover:bg-red-800 rounded p-2 flex items-center justify-center w-8 h-8 text-white">&times;</span>
</button>
<div class="flex justify-center items-center overflow-hidden">
{% image page.image original class="w-auto max-h-[80vh]" %}
</div>
{% if page.image_caption %}
<p class="text-sm mt-2 text-center">
{{ page.image_caption }}
</p>
{% endif %}
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
<div class="absolute top-0 right-0 m-4 hidden md:block mt-16">
<div class="flex flex-col items-center mb-2 space-y-2">
<div class="flex space-x-2">

0 comments on commit f8892b3

Please sign in to comment.