first commit
This commit is contained in:
239
core/apps/management/templates/base.html
Normal file
239
core/apps/management/templates/base.html
Normal file
@@ -0,0 +1,239 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="uz">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Xvatayka{% endblock %}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
|
||||
background: #f4f5f7;
|
||||
color: #1f2937;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
header {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
padding: 16px 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
header .logo { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
|
||||
|
||||
#menu-btn {
|
||||
position: absolute;
|
||||
left: 24px; top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: #fff; border: none; padding: 6px 10px;
|
||||
border-radius: 8px; cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
#menu-btn svg { stroke: #4f46e5; }
|
||||
|
||||
/* Sidebar */
|
||||
#sidebar {
|
||||
background: #fff;
|
||||
border-right: 1px solid #e5e7eb;
|
||||
padding: 20px;
|
||||
width: 240px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: -260px;
|
||||
height: 100vh; /* full viewport height */
|
||||
overflow: hidden; /* non-scrollable */
|
||||
transition: left 0.3s ease, box-shadow 0.3s ease;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; /* keeps logout at bottom */
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.05);
|
||||
}
|
||||
#sidebar.active { left: 0; }
|
||||
|
||||
#sidebar ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
#sidebar ul li { margin-bottom: 16px; }
|
||||
#sidebar ul li a {
|
||||
text-decoration: none;
|
||||
color: #1f2937;
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
transition: all 0.25s ease;
|
||||
background: #f9fafb;
|
||||
white-space: nowrap; /* prevent wrapping */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#sidebar ul li a:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(79,70,229,0.3);
|
||||
}
|
||||
|
||||
/* Logout button fixed at bottom */
|
||||
.logout-container {
|
||||
margin-top: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.logout-btn {
|
||||
width: 100%;
|
||||
background: #ef4444;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 10px 14px;
|
||||
border-radius: 10px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s ease;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
|
||||
}
|
||||
.logout-btn:hover {
|
||||
background: #dc2626;
|
||||
box-shadow: 0 3px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
transition: margin-left 0.3s ease;
|
||||
background: #f4f5f7;
|
||||
min-height: calc(100vh - 64px);
|
||||
}
|
||||
main.shifted { margin-left: 240px; }
|
||||
|
||||
/* Cards */
|
||||
.cards-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 16px 20px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
|
||||
.card-row { margin-bottom: 8px; font-size: 14px; color: #374151; }
|
||||
.card-row strong { color: #111827; }
|
||||
.card-actions { margin-top: 12px; }
|
||||
.card-actions .btn {
|
||||
display: inline-block;
|
||||
padding: 6px 10px;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
margin-right: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.card-actions .btn.edit { background: #4f46e5; }
|
||||
.card-actions .btn.confirm { background: #10b981; }
|
||||
.card-actions .btn.decline { background: #ef4444; }
|
||||
.card-actions .btn:hover { opacity: 0.85; transform: translateY(-1px); }
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 1024px) {
|
||||
#sidebar { width: 220px; }
|
||||
main.shifted { margin-left: 220px; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
#sidebar { width: 200px; left: -220px; }
|
||||
#sidebar.active { left: 0; box-shadow: 2px 0 12px rgba(0,0,0,0.2); }
|
||||
main.shifted { margin-left: 0; } /* overlay on small screens */
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.cards-container { grid-template-columns: 1fr; }
|
||||
.card { padding: 14px 16px; }
|
||||
.card-row { font-size: 13px; }
|
||||
.card-actions .btn { font-size: 12px; padding: 5px 8px; margin-bottom: 4px; }
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
header { padding: 12px 16px; }
|
||||
#menu-btn { left: 16px; padding: 4px 8px; }
|
||||
.logo { font-size: 18px; }
|
||||
#sidebar { padding: 16px; }
|
||||
.logout-btn { font-size: 13px; padding: 8px 10px; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<button id="menu-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 5h16"/>
|
||||
<path d="M4 12h16"/>
|
||||
<path d="M4 19h16"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="logo">Xvatayka</div>
|
||||
</header>
|
||||
|
||||
<nav id="sidebar">
|
||||
<ul>
|
||||
<li><a href="{% url 'dashboard' %}">Dashboard</a></li>
|
||||
<li><a href="{% url 'expense_list' %}">Xarajatlar</a></li>
|
||||
<li><a href="{% url 'income_list' %}">Kirimlar</a></li>
|
||||
<li><a href="{% url 'toy_movement_list' %}">Oʻyinchoq harakatlari</a></li>
|
||||
{% if user.role == "manager" or user.role == "businessman" %}
|
||||
<li><a href="{% url 'device_list' %}">Aparatlar</a></li>
|
||||
<li><a href="{% url 'warehouse_list' %}">Omborlar</a></li>
|
||||
<li><a href="{% url 'user_list' %}">Foydalanuvchilar</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="logout-container">
|
||||
{% if user.is_authenticated %}
|
||||
<form method="post" action="{% url 'logout' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="logout-btn">Chiqish</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main id="main-content">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const menuBtn = document.getElementById('menu-btn');
|
||||
const sidebar = document.getElementById('sidebar');
|
||||
const mainContent = document.getElementById('main-content');
|
||||
|
||||
menuBtn.addEventListener('click', () => {
|
||||
sidebar.classList.toggle('active');
|
||||
mainContent.classList.toggle('shifted');
|
||||
});
|
||||
|
||||
// Optional: click outside to close
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!sidebar.contains(e.target) && !menuBtn.contains(e.target)) {
|
||||
sidebar.classList.remove('active');
|
||||
mainContent.classList.remove('shifted');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<br>
|
||||
<h2 style="text-align:center; margin-bottom:24px; color:#111827;">Businessman Paneli</h2>
|
||||
|
||||
<div class="dashboard-grid">
|
||||
<a href="{% url 'create_user' %}" class="dashboard-card">
|
||||
<div class="icon">👤</div>
|
||||
<div class="label">Foydalanuvchi yaratish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_device' %}" class="dashboard-card">
|
||||
<div class="icon">💻</div>
|
||||
<div class="label">Aparat yaratish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_expense' %}" class="dashboard-card">
|
||||
<div class="icon">💸</div>
|
||||
<div class="label">Xarajat qo'shish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_income' %}" class="dashboard-card">
|
||||
<div class="icon">📥</div>
|
||||
<div class="label">Kirim qo'shish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_warehouse' %}" class="dashboard-card">
|
||||
<div class="icon">🏬</div>
|
||||
<div class="label">Ombor yaratish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_toy_movement' %}" class="dashboard-card">
|
||||
<div class="icon">🚚</div>
|
||||
<div class="label">Oʻyinchoq harakati yaratish</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.dashboard-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 16px;
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.dashboard-card {
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 20px 12px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #111827;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
||||
transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.dashboard-card .icon {
|
||||
font-size: 32px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.dashboard-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dashboard-card:hover .icon {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Mobile adjustments: keep grid layout, adjust size */
|
||||
@media (max-width: 768px) {
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.dashboard-card {
|
||||
padding: 16px 10px;
|
||||
}
|
||||
.dashboard-card .icon {
|
||||
font-size: 28px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.label {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
.dashboard-card {
|
||||
padding: 14px 8px;
|
||||
}
|
||||
.dashboard-card .icon {
|
||||
font-size: 24px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.label {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
147
core/apps/management/templates/common/create/device_create.html
Normal file
147
core/apps/management/templates/common/create/device_create.html
Normal file
@@ -0,0 +1,147 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Yaratish" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Yaratish" }}</h2>
|
||||
|
||||
<a href="{% url 'dashboard' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">Saqlash</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Mobile adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.form-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
165
core/apps/management/templates/common/create/expense_create.html
Normal file
165
core/apps/management/templates/common/create/expense_create.html
Normal file
@@ -0,0 +1,165 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Yaratish" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Yaratish" }}</h2>
|
||||
|
||||
<a href="{% url 'dashboard' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-group" id="group-{{ field.name }}">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">
|
||||
{% if title %}{{ title }}{% else %}Saqlash{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const typeSelect = document.getElementById("id_expense_type");
|
||||
const employeeGroup = document.getElementById("group-employee");
|
||||
const deviceGroup = document.getElementById("group-device");
|
||||
|
||||
function toggleFields() {
|
||||
if (!typeSelect) return;
|
||||
|
||||
const value = typeSelect.value;
|
||||
|
||||
// Hide both initially
|
||||
if (employeeGroup) employeeGroup.style.display = "none";
|
||||
if (deviceGroup) deviceGroup.style.display = "none";
|
||||
|
||||
if (value === "salary") {
|
||||
if (employeeGroup) employeeGroup.style.display = "flex";
|
||||
} else if (value === "rent" || value === "maintenance") {
|
||||
if (deviceGroup) deviceGroup.style.display = "flex";
|
||||
}
|
||||
}
|
||||
|
||||
toggleFields();
|
||||
if (typeSelect) typeSelect.addEventListener("change", toggleFields);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 40px auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
.back-btn .icon { width: 16px; height: 16px; }
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Mobile adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.form-container { padding: 20px 16px; }
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
150
core/apps/management/templates/common/create/income_create.html
Normal file
150
core/apps/management/templates/common/create/income_create.html
Normal file
@@ -0,0 +1,150 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Yaratish" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Yaratish" }}</h2>
|
||||
|
||||
<a href="{% url 'dashboard' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">
|
||||
{% if title %}{{ title }}{% else %}Saqlash{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Mobile adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.form-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,196 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Yaratish" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Yaratish" }}</h2>
|
||||
|
||||
<a href="{% url 'dashboard' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">Saqlash</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 40px auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 12px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.form-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const movementType = document.getElementById("id_movement_type");
|
||||
const toWarehouse = document.getElementById("id_to_warehouse");
|
||||
const device = document.getElementById("id_device");
|
||||
|
||||
function toggleFields() {
|
||||
const value = movementType.value;
|
||||
|
||||
if (value === "from_warehouse") { // Ombordan -> Aparatga
|
||||
toWarehouse.parentElement.style.display = "none";
|
||||
device.parentElement.style.display = "";
|
||||
} else if (value === "between_warehouses") { // Ombordan -> Omborga
|
||||
device.parentElement.style.display = "none";
|
||||
toWarehouse.parentElement.style.display = "";
|
||||
} else {
|
||||
toWarehouse.parentElement.style.display = "";
|
||||
device.parentElement.style.display = "";
|
||||
}
|
||||
}
|
||||
|
||||
// Update movement_type when to_warehouse is selected
|
||||
if (toWarehouse) {
|
||||
toWarehouse.addEventListener("change", function() {
|
||||
if (toWarehouse.value) {
|
||||
movementType.value = "between_warehouses";
|
||||
toggleFields();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update movement_type when device is selected
|
||||
if (device) {
|
||||
device.addEventListener("change", function() {
|
||||
if (device.value) {
|
||||
movementType.value = "from_warehouse";
|
||||
toggleFields();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Run on page load
|
||||
if (movementType) {
|
||||
toggleFields();
|
||||
movementType.addEventListener("change", toggleFields);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
184
core/apps/management/templates/common/create/user_create.html
Normal file
184
core/apps/management/templates/common/create/user_create.html
Normal file
@@ -0,0 +1,184 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Yaratish" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Yaratish" }}</h2>
|
||||
|
||||
<a href="{% url 'dashboard' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">Saqlash</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px; /* pill shape */
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition:all 0.2s ease;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.form-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const roleField = document.getElementById("id_role");
|
||||
const regionGroup = document.getElementById("id_region")?.closest(".form-group");
|
||||
const warehouseGroup = document.getElementById("id_warehouse")?.closest(".form-group");
|
||||
|
||||
function toggleFields() {
|
||||
if (!roleField) return;
|
||||
|
||||
const role = roleField.value;
|
||||
|
||||
// Manager
|
||||
if (role === "manager") {
|
||||
if (regionGroup) regionGroup.style.display = "block";
|
||||
if (warehouseGroup) warehouseGroup.style.display = "none";
|
||||
}
|
||||
|
||||
// Employee
|
||||
if (role === "employee") {
|
||||
if (regionGroup) regionGroup.style.display = "none";
|
||||
if (warehouseGroup) warehouseGroup.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
toggleFields();
|
||||
|
||||
if (roleField) {
|
||||
roleField.addEventListener("change", toggleFields);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
147
core/apps/management/templates/common/edit/device_edit.html
Normal file
147
core/apps/management/templates/common/edit/device_edit.html
Normal file
@@ -0,0 +1,147 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Tahrirlash" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Tahrirlash" }}</h2>
|
||||
|
||||
<a href="{% url 'device_list' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">Saqlash</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition:all 0.2s ease;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Mobile adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.form-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
139
core/apps/management/templates/common/edit/expense_edit.html
Normal file
139
core/apps/management/templates/common/edit/expense_edit.html
Normal file
@@ -0,0 +1,139 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Create Expense{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
.card {
|
||||
max-width: 520px;
|
||||
margin: 40px auto;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 12px 40px rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 20px;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin-bottom: 6px;
|
||||
color: #6b7280;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
select, input {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
font-size: 16px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #d1d5db;
|
||||
background: #f9fafb;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
margin-top: 12px;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 14px;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: #4338ca;
|
||||
}
|
||||
|
||||
.error {
|
||||
background: #fee2e2;
|
||||
color: #991b1b;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<h1>Create Expense</h1>
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="error">{{ form.non_field_errors.0 }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="field" id="field-expense_type">
|
||||
{{ form.expense_type.label_tag }}
|
||||
{{ form.expense_type }}
|
||||
{{ form.expense_type.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field" id="field-amount">
|
||||
{{ form.amount.label_tag }}
|
||||
{{ form.amount }}
|
||||
{{ form.amount.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field" id="field-employee" style="display:none;">
|
||||
{{ form.employee.label_tag }}
|
||||
{{ form.employee }}
|
||||
{{ form.employee.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field" id="field-device" style="display:none;">
|
||||
{{ form.device.label_tag }}
|
||||
{{ form.device }}
|
||||
{{ form.device.errors }}
|
||||
</div>
|
||||
|
||||
<button type="submit">
|
||||
{% if title %}{{ title }}{% else %}Create{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const typeSelect = document.getElementById("id_expense_type");
|
||||
const employeeField = document.getElementById("field-employee");
|
||||
const deviceField = document.getElementById("field-device");
|
||||
|
||||
function toggleFields() {
|
||||
if (!typeSelect) return;
|
||||
|
||||
const value = typeSelect.value;
|
||||
|
||||
// Reset both
|
||||
employeeField.style.display = "none";
|
||||
deviceField.style.display = "none";
|
||||
|
||||
if (value === "salary") {
|
||||
employeeField.style.display = "block";
|
||||
} else if (value === "rent" || value === "maintenance") {
|
||||
deviceField.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
if (typeSelect) {
|
||||
toggleFields();
|
||||
typeSelect.addEventListener("change", toggleFields);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
98
core/apps/management/templates/common/edit/income_edit.html
Normal file
98
core/apps/management/templates/common/edit/income_edit.html
Normal file
@@ -0,0 +1,98 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Create Income{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
.card {
|
||||
max-width: 520px;
|
||||
margin: 40px auto;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 12px 40px rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 20px;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin-bottom: 6px;
|
||||
color: #6b7280;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
select, input {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
font-size: 16px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #d1d5db;
|
||||
background: #f9fafb;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
margin-top: 12px;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 14px;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: #4338ca;
|
||||
}
|
||||
|
||||
.error {
|
||||
background: #fee2e2;
|
||||
color: #991b1b;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<h1>Create Income</h1>
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="error">{{ form.non_field_errors.0 }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="field" id="field-device">
|
||||
{{ form.device.label_tag }}
|
||||
{{ form.device }}
|
||||
{{ form.device.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field" id="field-amount">
|
||||
{{ form.amount.label_tag }}
|
||||
{{ form.amount }}
|
||||
{{ form.amount.errors }}
|
||||
</div>
|
||||
|
||||
<button type="submit">
|
||||
{% if title %}{{ title }}{% else %}Create{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,142 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Create Toy Movement{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
.card {
|
||||
max-width: 520px;
|
||||
margin: 40px auto;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 12px 40px rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 20px;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin-bottom: 6px;
|
||||
color: #6b7280;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
select, input {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
font-size: 16px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #d1d5db;
|
||||
background: #f9fafb;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
margin-top: 12px;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 14px;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: #4338ca;
|
||||
}
|
||||
|
||||
.error {
|
||||
background: #fee2e2;
|
||||
color: #991b1b;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<h1>Create Toy Movement</h1>
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="error">{{ form.non_field_errors.0 }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if user_role != "employee" %}
|
||||
<div class="field" id="field-movement_type">
|
||||
{{ form.movement_type.label_tag }}
|
||||
{{ form.movement_type }}
|
||||
{{ form.movement_type.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="field" id="field-from_warehouse">
|
||||
{{ form.from_warehouse.label_tag }}
|
||||
{{ form.from_warehouse }}
|
||||
{{ form.from_warehouse.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field" id="field-to_warehouse">
|
||||
{{ form.to_warehouse.label_tag }}
|
||||
{{ form.to_warehouse }}
|
||||
{{ form.to_warehouse.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field" id="field-device">
|
||||
{{ form.device.label_tag }}
|
||||
{{ form.device }}
|
||||
{{ form.device.errors }}
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
{{ form.quantity.label_tag }}
|
||||
{{ form.quantity }}
|
||||
{{ form.quantity.errors }}
|
||||
</div>
|
||||
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const typeSelect = document.getElementById("id_movement_type");
|
||||
const toWarehouse = document.getElementById("field-to_warehouse");
|
||||
const device = document.getElementById("field-device");
|
||||
|
||||
function toggleFields() {
|
||||
if (!typeSelect) return;
|
||||
|
||||
const value = typeSelect.value;
|
||||
if (value === "from_warehouse") {
|
||||
toWarehouse.style.display = "none";
|
||||
device.style.display = "block";
|
||||
} else if (value === "between_warehouses") {
|
||||
toWarehouse.style.display = "block";
|
||||
device.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
if (typeSelect) {
|
||||
toggleFields();
|
||||
typeSelect.addEventListener("change", toggleFields);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
183
core/apps/management/templates/common/edit/user_edit.html
Normal file
183
core/apps/management/templates/common/edit/user_edit.html
Normal file
@@ -0,0 +1,183 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title|default:"Yaratish" }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="form-container">
|
||||
<h2>{{ title|default:"Yaratish" }}</h2>
|
||||
|
||||
<a href="{% url 'user_list' %}" class="back-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6"/>
|
||||
</svg>
|
||||
Orqaga
|
||||
</a>
|
||||
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<small class="help-text">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
{% for error in field.errors %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="submit" class="submit-btn">Saqlash</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
padding: 24px 28px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
.form-container h2 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
color: #111827;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 16px;
|
||||
background: #f3f4f6;
|
||||
color: #4f46e5;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 9999px; /* pill shape */
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.back-btn .icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition:all 0.2s ease;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 12px;
|
||||
color: #ef4444;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #4338ca;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.form-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const roleField = document.getElementById("id_role");
|
||||
const regionGroup = document.getElementById("id_region")?.closest(".form-group");
|
||||
const warehouseGroup = document.getElementById("id_warehouse")?.closest(".form-group");
|
||||
|
||||
function toggleFields() {
|
||||
if (!roleField) return;
|
||||
|
||||
const role = roleField.value;
|
||||
|
||||
// Manager
|
||||
if (role === "manager") {
|
||||
if (regionGroup) regionGroup.style.display = "block";
|
||||
if (warehouseGroup) warehouseGroup.style.display = "none";
|
||||
}
|
||||
|
||||
// Employee
|
||||
if (role === "employee") {
|
||||
if (regionGroup) regionGroup.style.display = "none";
|
||||
if (warehouseGroup) warehouseGroup.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
toggleFields();
|
||||
|
||||
if (roleField) {
|
||||
roleField.addEventListener("change", toggleFields);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
33
core/apps/management/templates/common/list.html
Normal file
33
core/apps/management/templates/common/list.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% load custom_filters %}
|
||||
<h2>{{ title }}</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for field in fields %}
|
||||
<th>{{ field_translations|get_item:field|default:field|capfirst }}</th>
|
||||
{% endfor %}
|
||||
|
||||
{% if model_name != "toy_movement" %}
|
||||
<th>Amallar</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for obj in objects %}
|
||||
<tr>
|
||||
{% for field in fields %}
|
||||
<td>{{ obj|attr:field }}</td>
|
||||
{% endfor %}
|
||||
{% if model_name != "toy_movement" %}
|
||||
<td>
|
||||
<a href="{% url 'edit_'|add:model_name obj.pk %}" class="edit-btn">Tahrirlash</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="{{ fields|length|add:'1' }}">Hech narsa topilmadi</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
24
core/apps/management/templates/common/lists/device_list.html
Normal file
24
core/apps/management/templates/common/lists/device_list.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Aparatlar{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-bottom:20px;">{{ title|default:"Aparatlar" }}</h2>
|
||||
|
||||
<div class="cards-container">
|
||||
{% for device in devices %}
|
||||
<div class="card">
|
||||
<div class="card-row"><strong>Address:</strong> {{ device.address }}</div>
|
||||
<div class="card-row"><strong>Hudud:</strong> {{ device.district.name }}</div>
|
||||
|
||||
{% if role == "manager" or role == "businessman" %}
|
||||
<div class="card-actions">
|
||||
<a href="{% url 'edit_device' device.pk %}" class="btn edit">Tahrirlash</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p style="text-align:center; font-style:italic;">Hech narsa topilmadi</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,36 @@
|
||||
{% extends "base.html" %}
|
||||
{% load custom_filters %}
|
||||
|
||||
{% block title %}Xarajatlar{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-bottom:20px;">{{ title|default:"Xarajatlar" }}</h2>
|
||||
|
||||
<div class="cards-container">
|
||||
{% for obj in expenses %}
|
||||
<div class="card">
|
||||
<div class="card-row"><strong>Miqdor:</strong> {{ obj.amount }}</div>
|
||||
<div class="card-row"><strong>Tur:</strong> {{ obj|attr:"expense_type" }}</div>
|
||||
{% if obj.device %}<div class="card-row"><strong>Aparat:</strong> {{ obj.device.name }}</div>{% else %}{% endif %}
|
||||
{% if obj.employee %}<div class="card-row"><strong>Hodim:</strong> {{ obj.employee.get_full_name }}</div>{% else %}{% endif %}
|
||||
<div class="card-row"><strong>Yaratgan:</strong> {{ obj.created_by.get_full_name }}</div>
|
||||
<div class="card-row"><strong>Tasdiqlanganmi:</strong> {% if obj.confirmed_by %}{{ obj.confirmed_by.get_full_name }}{% else %}Yo'q{% endif %}</div>
|
||||
<div class="card-row"><strong>Yaratilgan sana:</strong> {{ obj.created_at|date:"d.m.Y H:i" }}</div>
|
||||
|
||||
{% if role == "manager" or role == "businessman" %}
|
||||
<div class="card-actions">
|
||||
{% if not obj.is_confirmed %}
|
||||
<a href="{% url 'confirm_expense' obj.pk %}" class="btn confirm">✔</a>
|
||||
<a href="{% url 'decline_expense' obj.pk %}" class="btn decline">✖</a>
|
||||
{% endif %}
|
||||
{% if role == "businessman" %}
|
||||
<a href="{% url 'edit_expense' obj.pk %}" class="btn edit">Tahrirlash</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p style="text-align:center; font-style:italic;">Hech narsa topilmadi</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
92
core/apps/management/templates/common/lists/income_list.html
Normal file
92
core/apps/management/templates/common/lists/income_list.html
Normal file
@@ -0,0 +1,92 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Kirimlar{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-bottom:20px;">{{ title|default:"Kirimlar" }}</h2>
|
||||
|
||||
<div class="cards-container">
|
||||
{% for income in incomes %}
|
||||
<div class="card">
|
||||
<div class="card-row"><strong>Miqdor:</strong> {{ income.amount|default:"-" }}</div>
|
||||
<div class="card-row"><strong>Aparat:</strong> {% if income.device %}{{ income.device.address }}{% else %}-{% endif %}</div>
|
||||
<div class="card-row"><strong>Yaratgan:</strong> {{ income.created_by.get_full_name }}</div>
|
||||
<div class="card-row"><strong>Yaratilgan sana:</strong> {{ income.created_at|date:"d.m.Y H:i" }}</div>
|
||||
|
||||
{% if role == "manager" or role == "businessman" %}
|
||||
<div class="card-actions">
|
||||
<a href="{% url 'edit_income' income.pk %}" class="btn edit">Tahrirlash</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p style="text-align:center; font-style:italic;">Hech narsa topilmadi</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.cards-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 16px 20px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.card-row {
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.card-row strong {
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.card-actions .btn {
|
||||
display: inline-block;
|
||||
padding: 6px 10px;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
margin-right: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.card-actions .btn.edit { background: #4f46e5; }
|
||||
.card-actions .btn.confirm { background: #10b981; }
|
||||
.card-actions .btn.decline { background: #ef4444; }
|
||||
|
||||
.card-actions .btn:hover {
|
||||
opacity: 0.85;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.card-row { font-size: 13px; }
|
||||
.card-actions .btn { font-size: 12px; padding: 5px 8px; }
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.cards-container { grid-template-columns: 1fr; }
|
||||
.card { padding: 14px 16px; }
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
10
core/apps/management/templates/common/lists/rent_list.html
Normal file
10
core/apps/management/templates/common/lists/rent_list.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,34 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}O'yinchoq harakatlari{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-bottom:20px;">{{ title|default:"O'yinchoq harakatlari" }}</h2>
|
||||
|
||||
{% if role == "manager" or role == "businessman" %}
|
||||
<div class="card-actions">
|
||||
<a href="{% url 'create_toy_movement_auto' %}" class="btn edit">Yaratish</a>
|
||||
</div>
|
||||
<br>
|
||||
{% endif %}
|
||||
|
||||
<div class="cards-container">
|
||||
{% for tm in toy_movements %}
|
||||
<div class="card">
|
||||
<div class="card-row"><strong>Tur:</strong> {{ tm.get_movement_type_display }}</div>
|
||||
<div class="card-row"><strong>From:</strong> {{ tm.from_warehouse.name }}</div>
|
||||
{% if tm.to_warehouse %}
|
||||
<div class="card-row"><strong>To:</strong> {{ tm.to_warehouse.name }}</div>
|
||||
{% endif %}
|
||||
{% if tm.device %}
|
||||
<div class="card-row"><strong>Aparat:</strong> {{ tm.device.name }}</div>
|
||||
{% endif %}
|
||||
<div class="card-row"><strong>Miqdor:</strong> {{ tm.quantity }}</div>
|
||||
<div class="card-row"><strong>Yaratgan:</strong> {{ tm.created_by.get_full_name }}</div>
|
||||
<div class="card-row"><strong>Sana:</strong> {{ tm.created_at|date:"d.m.Y H:i" }}</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p style="text-align:center; font-style:italic;">Hech narsa topilmadi</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
28
core/apps/management/templates/common/lists/user_list.html
Normal file
28
core/apps/management/templates/common/lists/user_list.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Foydalanuvchilar{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-bottom:20px;">{{ title|default:"Foydalanuvchilar" }}</h2>
|
||||
|
||||
<div class="cards-container">
|
||||
{% for user in users %}
|
||||
<div class="card">
|
||||
<div class="card-row"><strong>Ism:</strong> {{ user.get_full_name }}</div>
|
||||
<div class="card-row"><strong>Telefon:</strong> {{ user.phone }}</div>
|
||||
<div class="card-row"><strong>Rol:</strong> {{ user.role }}</div>
|
||||
{% if user.region %}
|
||||
<div class="card-row"><strong>Hudud:</strong> {{ user.region.name }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if role != "manager" or user.role != "manager" %}
|
||||
<div class="card-actions">
|
||||
<a href="{% url 'edit_user' user.pk %}" class="btn edit">Tahrirlash</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p style="text-align:center; font-style:italic;">Hech narsa topilmadi</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Omborlar{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-bottom:20px;">{{ title|default:"Omborlar" }}</h2>
|
||||
|
||||
<div class="cards-container">
|
||||
{% for wh in warehouses %}
|
||||
<div class="card">
|
||||
<div class="card-row"><strong>Nomi:</strong> {{ wh.name }}</div>
|
||||
<div class="card-row"><strong>Hudud:</strong> {{ wh.region.name }}</div>
|
||||
<div class="card-row"><strong>O'yinchoqlar:</strong> {{ wh.toys_count }}</div>
|
||||
|
||||
{% if role == "businessman" %}
|
||||
<div class="card-actions">
|
||||
<a href="{% url 'edit_warehouse' wh.pk %}" class="btn edit">Tahrirlash</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p style="text-align:center; font-style:italic;">Hech narsa topilmadi</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
105
core/apps/management/templates/employee/employee_dashboard.html
Normal file
105
core/apps/management/templates/employee/employee_dashboard.html
Normal file
@@ -0,0 +1,105 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="text-align:center; margin-bottom:24px; color:#111827;">Hodim Paneli</h2>
|
||||
|
||||
<div class="dashboard-grid">
|
||||
<a href="{% url 'create_income' %}" class="dashboard-card">
|
||||
<div class="icon">📥</div>
|
||||
<div class="label">Kirim qo'shish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_expense' %}" class="dashboard-card">
|
||||
<div class="icon">💸</div>
|
||||
<div class="label">Xarajat qo'shish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_toy_movement' %}" class="dashboard-card">
|
||||
<div class="icon">🚚</div>
|
||||
<div class="label">Oʻyinchoq harakati yaratish</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.dashboard-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 16px;
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.dashboard-card {
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 20px 12px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #111827;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
||||
transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.dashboard-card .icon {
|
||||
font-size: 32px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.dashboard-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dashboard-card:hover .icon {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Mobile adjustments: keep grid layout, adjust size */
|
||||
@media (max-width: 768px) {
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.dashboard-card {
|
||||
padding: 16px 10px;
|
||||
}
|
||||
.dashboard-card .icon {
|
||||
font-size: 28px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.label {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
.dashboard-card {
|
||||
padding: 14px 8px;
|
||||
}
|
||||
.dashboard-card .icon {
|
||||
font-size: 24px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.label {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
112
core/apps/management/templates/manager/manager_dashboard.html
Normal file
112
core/apps/management/templates/manager/manager_dashboard.html
Normal file
@@ -0,0 +1,112 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="text-align:center; margin-bottom:24px; color:#111827;">Manager Paneli</h2>
|
||||
|
||||
<div class="dashboard-grid">
|
||||
<a href="{% url 'create_user' %}" class="dashboard-card">
|
||||
<div class="icon">👤</div>
|
||||
<div class="label">Foydalanuvchi yaratish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_device' %}" class="dashboard-card">
|
||||
<div class="icon">💻</div>
|
||||
<div class="label">Aparat yaratish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_expense' %}" class="dashboard-card">
|
||||
<div class="icon">💸</div>
|
||||
<div class="label">Xarajat qo'shish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_income' %}" class="dashboard-card">
|
||||
<div class="icon">📥</div>
|
||||
<div class="label">Kirim qo'shish</div>
|
||||
</a>
|
||||
<a href="{% url 'create_toy_movement' %}" class="dashboard-card">
|
||||
<div class="icon">🚚</div>
|
||||
<div class="label">Oʻyinchoq harakati yaratish</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.dashboard-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 16px;
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.dashboard-card {
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 20px 12px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #111827;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
||||
transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.dashboard-card .icon {
|
||||
font-size: 32px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.dashboard-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dashboard-card:hover .icon {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Mobile adjustments: keep grid layout, adjust size */
|
||||
@media (max-width: 768px) {
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.dashboard-card {
|
||||
padding: 16px 10px;
|
||||
}
|
||||
.dashboard-card .icon {
|
||||
font-size: 28px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.label {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
.dashboard-card {
|
||||
padding: 14px 8px;
|
||||
}
|
||||
.dashboard-card .icon {
|
||||
font-size: 24px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.label {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user