mirror of
https://github.com/wahyd4/links.git
synced 2026-08-09 05:06:16 +10:00
Update page detail style
This commit is contained in:
+11
-3
@@ -13,15 +13,23 @@ WORKDIR /app
|
||||
# Copy pyproject.toml
|
||||
COPY pyproject.toml uv.lock ./
|
||||
|
||||
# Copy project
|
||||
COPY . .
|
||||
|
||||
# Install system dependencies and uv
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
gnupg \
|
||||
chromium \
|
||||
chromium-driver \
|
||||
gcc \
|
||||
nodejs \
|
||||
npm \
|
||||
gettext \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy project
|
||||
COPY . .
|
||||
|
||||
COPY --from=uv /usr/local/bin/uv /usr/local/bin/uv
|
||||
# Install Python dependencies
|
||||
RUN uv sync --no-dev
|
||||
|
||||
@@ -22,6 +22,22 @@ services:
|
||||
- redis
|
||||
networks:
|
||||
- app-network
|
||||
node:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.local
|
||||
command: >
|
||||
sh -c "python manage.py tailwind start"
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- DJANGO_SETTINGS_MODULE=core.settings
|
||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||
depends_on:
|
||||
- redis
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
celery_worker:
|
||||
build:
|
||||
|
||||
@@ -16,43 +16,35 @@
|
||||
{% for page in pages %}
|
||||
<li class="p-4">
|
||||
<div class="flex space-x-4">
|
||||
<!-- Thumbnail Container -->
|
||||
<div class="flex-shrink-0 w-48 h-48 rounded-lg overflow-hidden bg-gray-100 border border-gray-200">
|
||||
<!-- Thumbnail Container - hidden on small screens, visible on sm and up -->
|
||||
<div class="hidden sm:block flex-shrink-0 w-48 h-48 rounded-lg overflow-hidden bg-gray-100 border border-gray-200">
|
||||
<div class="w-full h-full flex items-center justify-center">
|
||||
{% if page.screenshot_path %}
|
||||
<img src="{{ page.get_screenshot_url }}"
|
||||
alt="Page thumbnail"
|
||||
class="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
onerror="this.onerror=null; this.src='{% static 'images/default-screenshot.png' %}';">
|
||||
{% else %}
|
||||
<div class="w-full h-full flex items-center justify-center">
|
||||
<img src="{% static 'images/default-screenshot.png' %}"
|
||||
alt="Default thumbnail"
|
||||
class="w-3/4 h-3/4 object-contain">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if page.screenshot_path %}
|
||||
<img src="{{ page.get_screenshot_url }}"
|
||||
alt="Page thumbnail"
|
||||
class="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
onerror="this.onerror=null; this.src='{% static 'images/default-screenshot.png' %}'; this.classList.add('object-contain', 'p-4')">
|
||||
{% else %}
|
||||
<img src="{% static 'images/default-screenshot.png' %}"
|
||||
alt="Default thumbnail"
|
||||
class="w-3/4 h-3/4 object-contain">
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content Container -->
|
||||
<div class="flex-1 min-w-0 flex flex-col">
|
||||
<!-- Header -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex justify-between items-start">
|
||||
<!-- Title and URL -->
|
||||
<div class="min-w-0 flex-1 pr-4">
|
||||
<h2 class="text-lg font-medium text-blue-600 hover:text-blue-800 truncate">
|
||||
<a href="{{ page.get_absolute_url }}">{{ page.title|default:"Untitled" }}</a>
|
||||
</h2>
|
||||
<a href="{{ page.url }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="mt-1 text-sm text-gray-600 hover:text-gray-900 break-all line-clamp-1">
|
||||
<div class="flex-1 min-w-0 pr-4">
|
||||
<a href="{{ page.get_absolute_url }}" class="text-lg font-medium text-blue-600 hover:text-blue-800">
|
||||
{{ page.title|default:"Untitled" }}
|
||||
</a>
|
||||
<a href="{{ page.url }}" target="_blank" rel="noopener noreferrer"
|
||||
class="block mt-1 text-sm text-gray-600 hover:text-gray-900 break-all">
|
||||
{{ page.url }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Status and Actions -->
|
||||
<div class="flex flex-col items-end space-y-2">
|
||||
<!-- Status Badge -->
|
||||
{% if page.process_status == 'completed' %}
|
||||
@@ -65,7 +57,10 @@
|
||||
</span>
|
||||
{% elif page.process_status == 'failed' %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
|
||||
{% trans "Failed" %}{% if page.retry_count > 0 %} ({{ page.retry_count }}/3){% endif %}
|
||||
{% trans "Failed" %}
|
||||
{% if page.retry_count > 0 %}
|
||||
({{ page.retry_count }}/3)
|
||||
{% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800">
|
||||
@@ -117,8 +112,7 @@
|
||||
<div class="mt-4 flex justify-center">
|
||||
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}"
|
||||
class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
||||
<a href="?page={{ page_obj.previous_page_number }}" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
||||
{% trans "Previous" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -128,8 +122,7 @@
|
||||
</span>
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}"
|
||||
class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
||||
<a href="?page={{ page_obj.next_page_number }}" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
||||
{% trans "Next" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user