98 lines
5.7 KiB
HTML
98 lines
5.7 KiB
HTML
{% load i18n %}
|
|
<!DOCTYPE html>
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
<html lang="{{ LANGUAGE_CODE }}">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}{% trans "Claims" %}{% endblock %}</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<script>
|
|
tailwind.config = {
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
brand: {
|
|
50: '#eef2ff',
|
|
600: '#4f46e5',
|
|
700: '#4338ca',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="min-h-screen bg-slate-50 text-gray-900">
|
|
<header class="bg-white shadow-sm">
|
|
<div class="mx-auto flex max-w-6xl items-center justify-between px-4 py-4">
|
|
<a href="{% url 'claims:submit' %}" class="text-lg font-semibold text-gray-900 hover:text-brand-700">{% trans "claims-system" %}</a>
|
|
<nav class="flex flex-wrap items-center gap-4 text-sm font-medium text-gray-600">
|
|
<a class="rounded-full border border-gray-200 px-3 py-1 hover:text-gray-900" href="{% url 'claims:submit' %}">
|
|
{% trans "Skicka utlägg" %}
|
|
</a>
|
|
{% if user.is_authenticated %}
|
|
<details class="group relative">
|
|
<summary class="flex cursor-pointer items-center gap-2 rounded-full border border-gray-200 px-3 py-1 text-sm text-gray-600 transition hover:text-gray-900">
|
|
{% trans "Interna vyer" %}
|
|
<svg class="h-3 w-3 transition group-open:rotate-180" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M1 1.5L5 4.5L9 1.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
</svg>
|
|
</summary>
|
|
<div class="absolute right-0 z-20 mt-2 w-52 rounded-2xl border border-gray-200 bg-white p-3 shadow-lg">
|
|
<a class="block rounded-xl px-3 py-2 text-sm text-gray-700 hover:bg-gray-50" href="{% url 'claims:admin-list' %}">{% trans "Dashboard" %}</a>
|
|
<a class="block rounded-xl px-3 py-2 text-sm text-gray-700 hover:bg-gray-50" href="{% url 'claims:my-claims' %}">{% trans "Mina utlägg" %}</a>
|
|
{% if perms.auth.view_user %}
|
|
<a class="block rounded-xl px-3 py-2 text-sm text-gray-700 hover:bg-gray-50" href="{% url 'claims:user-manage' %}">{% trans "Användare" %}</a>
|
|
{% endif %}
|
|
<a class="block rounded-xl px-3 py-2 text-sm text-gray-700 hover:bg-gray-50" href="{% url 'claims:export' %}">{% trans "Export" %}</a>
|
|
{% if user.is_staff %}
|
|
<a class="block rounded-xl px-3 py-2 text-sm text-gray-700 hover:bg-gray-50" href="{% url 'admin:index' %}">{% trans "Django admin" %}</a>
|
|
{% endif %}
|
|
</div>
|
|
</details>
|
|
{% endif %}
|
|
<form action="{% url 'set_language' %}" method="post" class="inline-flex items-center gap-1 text-xs text-gray-500">
|
|
{% csrf_token %}
|
|
<input name="next" type="hidden" value="{{ request.path }}">
|
|
<label for="lang-select" class="sr-only">{% trans "Språk" %}</label>
|
|
<select id="lang-select" name="language" onchange="this.form.submit()" class="rounded-full border border-gray-200 bg-white px-3 py-1 text-xs text-gray-700 focus:outline-none">
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
{% get_available_languages as LANGUAGES %}
|
|
{% for code, name in LANGUAGES %}
|
|
<option value="{{ code }}"{% if code == LANGUAGE_CODE %} selected{% endif %}>{{ name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</form>
|
|
{% if user.is_authenticated %}
|
|
<span class="hidden text-xs text-gray-400 sm:inline">|</span>
|
|
<span class="text-xs text-gray-500">{% trans "Inloggad som" %} {{ user.get_username }}</span>
|
|
<form action="{% url 'logout' %}" method="post" class="inline">
|
|
{% csrf_token %}
|
|
<button class="rounded-full bg-gray-100 px-3 py-1 text-xs font-semibold text-gray-700 transition hover:bg-gray-200" type="submit">
|
|
{% trans "Logga ut" %}
|
|
</button>
|
|
</form>
|
|
{% else %}
|
|
<a class="rounded-full bg-brand-600 px-3 py-1 text-white transition hover:bg-brand-700" href="{% url 'login' %}">{% trans "Logga in" %}</a>
|
|
{% endif %}
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
<main class="mx-auto max-w-6xl px-4 py-6">
|
|
{% if messages %}
|
|
<div class="space-y-3">
|
|
{% for message in messages %}
|
|
<div class="rounded-lg border-l-4 {% if message.tags == 'success' %}border-green-500 bg-green-50 text-green-800{% elif message.tags == 'warning' %}border-amber-500 bg-amber-50 text-amber-800{% elif message.tags == 'error' %}border-rose-500 bg-rose-50 text-rose-800{% else %}border-slate-300 bg-white text-slate-800{% endif %} px-4 py-3 text-sm">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
{% block modals %}{% endblock %}
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html>
|