init commit
This commit is contained in:
35
app/templates/_flash_sticky.html
Normal file
35
app/templates/_flash_sticky.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% set bs_class = {
|
||||
'success': 'bg-success text-white',
|
||||
'error': 'bg-danger text-white',
|
||||
'warning': 'bg-warning text-dark',
|
||||
'info': 'bg-info text-dark'
|
||||
} %}
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=True) %}
|
||||
{% if messages %}
|
||||
<div class="toast-container position-fixed top-0 end-0 p-3" style="z-index: 1100;">
|
||||
{% for category, message in messages %}
|
||||
<div class="toast align-items-center {{ bs_class.get(category, 'bg-secondary text-white') }}" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="d-flex">
|
||||
<div class="toast-body">
|
||||
<strong class="me-2">{{ category|capitalize }}:</strong> {{ message }}
|
||||
</div>
|
||||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Show all toasts on page load
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var toastElList = [].slice.call(document.querySelectorAll('.toast'));
|
||||
toastElList.forEach(function (toastEl) {
|
||||
// Autohide after 5s; tweak as needed
|
||||
var t = new bootstrap.Toast(toastEl, { autohide: true, delay: 5000 });
|
||||
t.show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
28
app/templates/auth/login.html
Normal file
28
app/templates/auth/login.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "bases/login_base.html" %}
|
||||
{% block content %}
|
||||
<div class="card shadow-lg p-4" style="max-width: 400px; width: 100%;">
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title mb-4">
|
||||
<i class="fa-solid fa-right-to-bracket me-2"></i> Login to Code of Conquest
|
||||
</h5>
|
||||
|
||||
<form method="post" class="text-start">
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input id="email" name="email" type="email" class="form-control" required placeholder="you@example.com" />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input id="password" name="password" type="password" class="form-control" required />
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary w-100">Sign in</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<small>No account?</small>
|
||||
<a href="{{ url_for('auth.register') }}" class="btn btn-link p-0 ms-1">Create one</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
36
app/templates/auth/register.html
Normal file
36
app/templates/auth/register.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{% extends "bases/login_base.html" %}
|
||||
{% block content %}
|
||||
<div class="card shadow-lg p-4" style="max-width: 400px; width: 100%;">
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title mb-4">
|
||||
<i class="fa-solid fa-user-plus me-2"></i> Create Your Account
|
||||
</h5>
|
||||
|
||||
<form method="post" class="text-start">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name <span class="text-muted">(optional)</span></label>
|
||||
<input id="name" name="name" type="text" class="form-control" placeholder="Jane Doe">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input id="email" name="email" type="email" class="form-control" required placeholder="you@example.com">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input id="password" name="password" type="password" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-success w-100">Sign up</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card-footer text-center">
|
||||
<small>Already have an account?</small>
|
||||
<a href="{{ url_for('auth.login') }}" class="btn btn-link p-0 ms-1">Sign in</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
40
app/templates/bases/login_base.html
Normal file
40
app/templates/bases/login_base.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ title or "Code of Conquest" }}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<!-- Halfmoon CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/halfmoon@2.0.2/css/halfmoon.min.css" rel="stylesheet" integrity="sha256-RjeFzczeuZHCyS+Gvz+kleETzBF/o84ZRHukze/yv6o=" crossorigin="anonymous">
|
||||
|
||||
<!-- Google Font -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Martian+Mono:wght@300;400;500;700&display=swap">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body class="d-flex flex-column justify-content-center align-items-center vh-100">
|
||||
|
||||
<!-- Centered content block -->
|
||||
<main class="w-100 d-flex justify-content-center align-items-center flex-grow-1">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="text-center mt-auto mb-3 small text-muted">
|
||||
<p class="mb-0">© 2025 <a href="/" class="text-reset text-decoration-none">Code of Conquest</a></p>
|
||||
<p class="mb-0"><span class="version">v 0.1.0</span></p>
|
||||
</footer>
|
||||
|
||||
<!-- App Write JS Client -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/appwrite@17.0.0"></script>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha256-CDOy6cOibCWEdsRiZuaHf8dSGGJRYuBGC+mjoJimHGw=" crossorigin="anonymous"></script>
|
||||
{% include "_flash_sticky.html" %}
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
65
app/templates/bases/main_base.html
Normal file
65
app/templates/bases/main_base.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="dark" data-bs-core="elegant">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>{% block title %}Admin Panel{% endblock %} - {{app_version}}</title>
|
||||
|
||||
<link rel="icon" href="{{ url_for('static', filename='images/favicons/favicon-32x32.png') }}" type="image/png">
|
||||
|
||||
<!-- Halfmoon CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/halfmoon@2.0.2/css/halfmoon.min.css" rel="stylesheet" integrity="sha256-RjeFzczeuZHCyS+Gvz+kleETzBF/o84ZRHukze/yv6o=" crossorigin="anonymous">
|
||||
|
||||
<!-- Google Font -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Martian+Mono:wght@300;400;500;700&display=swap">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
|
||||
</head>
|
||||
|
||||
<body class="ps-xxl-sbwidth">
|
||||
|
||||
<!-- Top navbar (mobile) -->
|
||||
<nav class="navbar navbar-expand-xxl bg-body-tertiary border-bottom border-opacity-25 d-flex d-xxl-none">
|
||||
<div class="container-fluid">
|
||||
<a href="{{ url_for('main.dashboard') }}" class="navbar-brand">
|
||||
<img src="{{ url_for('static', filename='images/COC_Icon.png') }}" alt="icon" width="24" height="24"> Admin Panel
|
||||
</a>
|
||||
<button class="btn btn-secondary" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar">
|
||||
<i class="fa-solid fa-bars"></i>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% include "bases/side_nav.html" %}
|
||||
|
||||
{% if current_user.is_authenticated and not current_user.email_verification %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
Please verify your email to unlock all features.
|
||||
<form method="post" action="{{ url_for('auth.send') }}" style="display:inline">
|
||||
<button class="btn btn-sm btn-primary">Resend verification email</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% block body %}
|
||||
<!-- Page content goes here -->
|
||||
{% endblock %}
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="text-center mt-auto mb-3 small text-muted">
|
||||
<p class="mb-0">© 2025 <a href="/" class="text-reset text-decoration-none">Code of Conquest</a></p>
|
||||
<p class="mb-0"><span class="version">{{app_version}}</span></p>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha256-CDOy6cOibCWEdsRiZuaHf8dSGGJRYuBGC+mjoJimHGw=" crossorigin="anonymous"></script>
|
||||
<!-- <script src="/static/halfmoon/halfmoon-1.1.1.min.js"></script> -->
|
||||
{% include "_flash_sticky.html" %}
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
40
app/templates/bases/side_nav.html
Normal file
40
app/templates/bases/side_nav.html
Normal file
@@ -0,0 +1,40 @@
|
||||
{# Helper to mark active links by endpoint name #}
|
||||
{% macro nav_link(endpoint, text) -%}
|
||||
{%- set href = url_for(endpoint) -%}
|
||||
{%- set active = 'active' if request.endpoint == endpoint else '' -%}
|
||||
<a href="{{ href }}" class="nav-link {{ active }}" {% if active %}aria-current="page"{% endif %}>{{ text }}</a>
|
||||
{%- endmacro %}
|
||||
|
||||
<nav class="sidebar offcanvas-start offcanvas-xxl" id="sidebar" tabindex="-1">
|
||||
<div class="offcanvas-header bg-body-tertiary border-bottom border-opacity-25">
|
||||
<a class="sidebar-brand" href="{{ url_for('main.dashboard') }}">
|
||||
<img src="{{ url_for('static', filename='images/COC_Icon.png') }}" alt="icon" width="32" height="32"> Admin Panel
|
||||
</a>
|
||||
<small>
|
||||
<span class="version">{{ version or '' }}</span>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas-body">
|
||||
<ul class="sidebar-nav">
|
||||
|
||||
<li><h6 class="sidebar-header text-uppercase">Dashboard</h6></li>
|
||||
<li><hr class="sidebar-divider"></li>
|
||||
|
||||
<li class="nav-item">
|
||||
{{ nav_link('main.dashboard', 'Home') }}
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
{# nav_link('profile', 'Profile') #}
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
{# nav_link('login', 'Login') #}
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
{{ nav_link('auth.logout', 'Logout') }}
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
19
app/templates/main/dashboard.html
Normal file
19
app/templates/main/dashboard.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "bases/main_base.html" %}
|
||||
|
||||
{% block title %}Admin Panel — Dashboard{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container-fluid vh-100">
|
||||
<div class="row justify-content-center align-items-center vh-100">
|
||||
<div class="col-12">
|
||||
<div class="text-center">
|
||||
<h1 class="mb-0">
|
||||
Code of Conquest Dashboard
|
||||
</h1>
|
||||
<p class="mb-0"></p>
|
||||
<img src="{{ url_for('static', filename='images/COC_Logo.png') }}" alt="logo" width="300" height="300">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user