Files
activity-pub/app/templates/assets/detail.html

82 lines
3.8 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ asset.name }} - Asset{% endblock %}
{% block content %}
<div class="max-w-4xl mx-auto">
<div class="mb-6">
<a href="/assets" class="inline-flex items-center text-blue-400 hover:text-blue-300">
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
</svg>
Back to Assets
</a>
</div>
<div class="bg-gray-800 rounded-lg overflow-hidden">
<!-- Asset Preview -->
<div class="aspect-video bg-gray-900 flex items-center justify-center">
{% if asset.asset_type == 'video' %}
<svg class="w-24 h-24 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
{% elif asset.asset_type == 'image' %}
<svg class="w-24 h-24 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
{% else %}
<svg class="w-24 h-24 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"/>
</svg>
{% endif %}
</div>
<!-- Asset Info -->
<div class="p-6">
<div class="flex items-start justify-between mb-4">
<div>
<h1 class="text-2xl font-bold text-white mb-1">{{ asset.name }}</h1>
<p class="text-gray-400">by {{ asset.owner }}</p>
</div>
<span class="px-3 py-1 bg-purple-600 text-white text-sm rounded-full">
{{ asset.asset_type }}
</span>
</div>
{% if asset.description %}
<p class="text-gray-300 mb-6">{{ asset.description }}</p>
{% endif %}
{% if asset.tags %}
<div class="flex flex-wrap gap-2 mb-6">
{% for tag in asset.tags %}
<span class="px-2 py-1 bg-gray-700 text-gray-300 text-sm rounded">{{ tag }}</span>
{% endfor %}
</div>
{% endif %}
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
<div class="bg-gray-900 rounded-lg p-4">
<p class="text-sm text-gray-400 mb-1">Content Hash</p>
<p class="font-mono text-xs text-gray-200 break-all">{{ asset.content_hash }}</p>
</div>
{% if asset.ipfs_cid %}
<div class="bg-gray-900 rounded-lg p-4">
<p class="text-sm text-gray-400 mb-1">IPFS CID</p>
<a href="https://ipfs.io/ipfs/{{ asset.ipfs_cid }}" target="_blank" rel="noopener"
class="font-mono text-xs text-blue-400 hover:text-blue-300 break-all">
{{ asset.ipfs_cid }}
</a>
</div>
{% endif %}
</div>
<div class="text-sm text-gray-500">
Created {{ asset.created_at }}
</div>
</div>
</div>
</div>
{% endblock %}