mirror of
https://github.com/wahyd4/links.git
synced 2026-08-09 05:06:16 +10:00
295 lines
18 KiB
HTML
295 lines
18 KiB
HTML
{% load i18n %}
|
|
{% load static %}
|
|
<!DOCTYPE html>
|
|
<html lang="{{ LANGUAGE_CODE }}">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% trans "GoLinks" %}</title>
|
|
<link href="{% static 'css/dist/styles.css' %}" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.2/css/all.min.css" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
|
<link rel="shortcut icon" type="image/x-icon" href="{% static 'favicon.ico' %}">
|
|
<style>
|
|
#search-results {
|
|
background-color: white;
|
|
border: 1px solid #e2e8f0;
|
|
border-top: none;
|
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
}
|
|
#search-results div {
|
|
padding: 0.5rem 1rem;
|
|
cursor: pointer;
|
|
color: #4a5568;
|
|
}
|
|
#search-results div:hover, #search-results div.active {
|
|
background-color: #e2e8f0;
|
|
}
|
|
|
|
/* Scroll-responsive navigation styles */
|
|
.nav-hidden {
|
|
transform: translateY(-100%);
|
|
}
|
|
|
|
.nav-visible {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
nav {
|
|
transition: transform 0.3s ease-in-out;
|
|
}
|
|
|
|
/* Line clamp utilities for truncating text */
|
|
.line-clamp-2 {
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|
|
{{ form.media }}
|
|
{% block extra_css %}{% endblock %}
|
|
{% block extra_head %}{% endblock %}
|
|
<script src="{% static 'js/common.js' %}"></script>
|
|
</head>
|
|
<body class="bg-gray-100">
|
|
<nav id="main-nav" class="bg-custom-blue text-white p-4 fixed w-full top-0 z-10 nav-visible">
|
|
<div class="container mx-auto flex justify-between items-center">
|
|
<a href="{% url 'link_list' %}" class="text-xl font-bold">{% trans "GoLinks" %}</a>
|
|
<div class="flex items-center space-x-4">
|
|
<!-- "Menus" 下拉菜单 -->
|
|
<div class="relative group">
|
|
<button id="more-menu-button" class="flex items-center text-white hover:text-gray-200">
|
|
<i class="fas fa-bars mr-2"></i>
|
|
{% trans "Menu" %}
|
|
</button>
|
|
<div id="more-menu-dropdown" class="absolute right-0 mt-2 py-2 w-48 bg-white rounded-md shadow-xl z-20 hidden">
|
|
<a href="{% url 'search' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
|
</svg>
|
|
{% trans "Search" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'page-list' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9.5a2 2 0 00-2-2h-2"/>
|
|
</svg>
|
|
{% trans "Pages" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'post-list' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9.5a2 2 0 00-2-2h-2"/>
|
|
</svg>
|
|
{% trans "Posts" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'screenshot-gallery' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" 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>
|
|
{% trans "Screenshots" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'collection-list' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" 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>
|
|
{% trans "Images" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'tag-list' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
|
|
</svg>
|
|
{% trans "Tags" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'api-docs' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
|
</svg>
|
|
{% trans "APIs" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'netscan-dashboard' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
|
|
</svg>
|
|
{% trans "NetScan" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'nginxmon-dashboard' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
|
|
</svg>
|
|
{% trans "Nginx Monitor" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'routermon-dashboard' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.142 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"/>
|
|
</svg>
|
|
{% trans "Router Monitor" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'file-list' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
|
|
</svg>
|
|
{% trans "Files" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'mini-apps-list' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M19 11H5m14-4H5a2 2 0 00-2 2v6a2 2 0 002 2h14M9 7h1m4 0h1M9 17h1m4 0h1"/>
|
|
</svg>
|
|
{% trans "Mini Apps" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'tools' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
|
</svg>
|
|
{% trans "Tools" %}
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{% url 'help' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{% trans "Help" %}
|
|
</div>
|
|
</a>
|
|
|
|
|
|
<a href="{% url 'jobs' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"/>
|
|
</svg>
|
|
{% trans "Jobs" %}
|
|
</div>
|
|
</a>
|
|
<a href="{% url 'site-settings' %}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"/>
|
|
</svg>
|
|
{% trans "Settings" %}
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<!-- 语言选择器 -->
|
|
<div class="relative">
|
|
<button id="language-selector-button" class="flex items-center text-white hover:text-gray-200">
|
|
<i class="fas fa-globe mr-2"></i>
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
{% get_language_info for LANGUAGE_CODE as current_language %}
|
|
{{ current_language.code|upper }}
|
|
</button>
|
|
<div id="language-options" class="absolute right-0 mt-2 py-2 w-48 bg-white rounded-md shadow-xl z-20 hidden">
|
|
<form action="{% url 'set_language' %}" method="post" id="language-form">
|
|
{% csrf_token %}
|
|
<input name="next" type="hidden" value="{{ request.path }}">
|
|
{% get_available_languages as LANGUAGES %}
|
|
{% get_language_info_list for LANGUAGES as languages %}
|
|
{% for language in languages %}
|
|
<button type="submit" name="language" value="{{ language.code }}" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {% if language.code == LANGUAGE_CODE %}font-bold{% endif %}">
|
|
{{ language.name_local }} ({{ language.code|upper }})
|
|
</button>
|
|
{% endfor %}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container mx-auto mt-20 p-2">
|
|
{% if messages %}
|
|
{% for message in messages %}
|
|
<div class="flash-message bg-{{ message.tags }}-100 bg-yellow-100 border border-{{ message.tags }}-400 text-{{ message.tags }}-700 border-yellow-500 text-yellow-700 px-4 py-3 rounded relative mb-4 transition-all duration-500 ease-in-out" role="alert">
|
|
<span class="block sm:inline">{{ message }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% block content %}
|
|
<h1 class="text-2xl font-bold mb-4">Welcome to GoLinks</h1>
|
|
<p>If you can see this message, the base template is working correctly.</p>
|
|
{% endblock %}
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.15.9/dist/cdn.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js"></script>
|
|
<script src="{% static 'js/navbar.js' %}"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.select2').select2({
|
|
theme: 'classic',
|
|
width: '100%'
|
|
});
|
|
|
|
// Auto-dismiss flash messages after 5s with fade + collapse animation
|
|
setTimeout(function() {
|
|
$('.flash-message').each(function() {
|
|
$(this).css({'opacity': '0', 'max-height': $(this).outerHeight(true) + 'px', 'overflow': 'hidden', 'margin-bottom': $(this).css('margin-bottom')});
|
|
$(this).animate({'opacity': 0, 'max-height': 0, 'marginBottom': 0, 'paddingTop': 0, 'paddingBottom': 0}, 500, function() {
|
|
$(this).remove();
|
|
});
|
|
});
|
|
}, 5000);
|
|
});
|
|
</script>
|
|
{% block extra_js %}{% endblock %}
|
|
{% if BUILD_TIME %}
|
|
<footer class="text-center text-gray-400 text-xs py-3 mt-4 border-t border-gray-100">
|
|
Built at: {{ BUILD_TIME }} with ver: {{ BUILD_VERSION }}
|
|
</footer>
|
|
{% endif %}
|
|
</body>
|
|
</html>
|