modified: app.py modified: init_db.py modified: static/styles.css modified: templates/index.html new file: templates/login.html new file: templates/register.html
121 lines
4.7 KiB
HTML
121 lines
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Финансовый учет</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1><i class="fas fa-coins"></i> Финансовый учет</h1>
|
|
<div class="summary">
|
|
<div class="summary-item income">
|
|
<span>Доходы</span>
|
|
<strong>{{ total_income|int }} ₽</strong>
|
|
</div>
|
|
<div class="summary-item expense">
|
|
<span>Расходы</span>
|
|
<strong>{{ total_expense|int }} ₽</strong>
|
|
</div>
|
|
<div class="summary-item balance">
|
|
<span>Баланс</span>
|
|
<strong>{{ balance|int }} ₽</strong>
|
|
</div>
|
|
</div>
|
|
<div class="user-menu">
|
|
<span>Привет, {{ username }}!</span>
|
|
<div class="dropdown">
|
|
<button class="dropbtn">
|
|
<i class="fas fa-user-circle"></i>
|
|
<i class="fas fa-caret-down"></i>
|
|
</button>
|
|
<div class="dropdown-content">
|
|
<a href="#"><i class="fas fa-user"></i> Профиль</a>
|
|
<a href="{{ url_for('logout') }}"><i class="fas fa-sign-out-alt"></i> Выход</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="controls">
|
|
<a href="{{ url_for('add_transaction') }}" class="btn add-btn">
|
|
<i class="fas fa-plus"></i> Добавить операцию
|
|
</a>
|
|
</div>
|
|
|
|
<section class="categories">
|
|
<h2>Расходы по категориям</h2>
|
|
<div class="category-list">
|
|
{% for category, amounts in categories.items() %}
|
|
{% if amounts['expense'] > 0 %}
|
|
<div class="category-item">
|
|
<span>{{ category }}</span>
|
|
<span class="amount expense">{{ amounts['expense']|int }} ₽</span>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
|
|
<section class="transactions">
|
|
<h2>История операций</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Дата</th>
|
|
<th>Категория</th>
|
|
<th>Описание</th>
|
|
<th>Сумма</th>
|
|
<th>Действия</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for t in transactions %}
|
|
<tr>
|
|
<td>{{ t.date.strftime('%d.%m.%Y') }}</td>
|
|
<td>{{ t.category }}</td>
|
|
<td>{{ t.description }}</td>
|
|
<td class="{{ 'income' if t.type == 'income' else 'expense' }}">
|
|
{{ t.amount|int }} ₽
|
|
</td>
|
|
<td class="actions">
|
|
<a href="{{ url_for('edit_transaction', id=t.id) }}" class="btn edit-btn">
|
|
<i class="fas fa-edit"></i>
|
|
</a>
|
|
<a href="{{ url_for('delete_transaction', id=t.id) }}" class="btn delete-btn">
|
|
<i class="fas fa-trash"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="5" class="empty">Нет операций</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<footer>
|
|
<p>Сегодня: {{ current_date.strftime('%d.%m.%Y') }}</p>
|
|
<p class="tip">"Учет финансов - первый шаг к финансовой свободе!"</p>
|
|
</footer>
|
|
</div>
|
|
|
|
<!-- Обработка сообщений flash -->
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
setTimeout(function() {
|
|
const messages = document.querySelectorAll('.flash-message');
|
|
messages.forEach(msg => {
|
|
msg.style.opacity = '0';
|
|
setTimeout(() => msg.remove(), 500);
|
|
});
|
|
}, 3000);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |