Add View on IPFS button to effect and recipe detail pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-04 17:56:12 +00:00
parent 13415fb420
commit d900df5aa0
2 changed files with 21 additions and 2 deletions

View File

@@ -137,12 +137,18 @@
<!-- Actions --> <!-- Actions -->
<div class="flex items-center space-x-4 mt-8"> <div class="flex items-center space-x-4 mt-8">
{% if effect.cid.startswith('Qm') or effect.cid.startswith('bafy') %}
<a href="https://ipfs.io/ipfs/{{ effect.cid }}"
target="_blank"
class="bg-cyan-600 hover:bg-cyan-700 px-4 py-2 rounded font-medium">
View on IPFS
</a>
{% endif %}
<button hx-post="/effects/{{ effect.cid }}/publish" <button hx-post="/effects/{{ effect.cid }}/publish"
hx-target="#share-result" hx-target="#action-result"
class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded font-medium"> class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded font-medium">
Share to L2 Share to L2
</button> </button>
<span id="share-result"></span>
<button onclick="deleteEffect('{{ effect.cid }}')" <button onclick="deleteEffect('{{ effect.cid }}')"
class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded font-medium"> class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded font-medium">
Delete Delete

View File

@@ -130,6 +130,19 @@
class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded font-medium"> class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded font-medium">
Run Recipe Run Recipe
</button> </button>
{% if recipe.ipfs_cid %}
<a href="https://ipfs.io/ipfs/{{ recipe.ipfs_cid }}"
target="_blank"
class="bg-cyan-600 hover:bg-cyan-700 px-4 py-2 rounded font-medium">
View on IPFS
</a>
{% elif recipe.recipe_id.startswith('Qm') or recipe.recipe_id.startswith('bafy') %}
<a href="https://ipfs.io/ipfs/{{ recipe.recipe_id }}"
target="_blank"
class="bg-cyan-600 hover:bg-cyan-700 px-4 py-2 rounded font-medium">
View on IPFS
</a>
{% endif %}
<button hx-post="/recipes/{{ recipe.recipe_id }}/publish" <button hx-post="/recipes/{{ recipe.recipe_id }}/publish"
hx-target="#action-result" hx-target="#action-result"
class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded font-medium"> class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded font-medium">