This commit is contained in:
2025-06-29 23:13:26 +03:00
parent dfb662c646
commit fb2a96e94d
17 changed files with 256 additions and 3 deletions

28
app/templates/base.html Normal file
View File

@ -0,0 +1,28 @@
{% from 'common/infobox.html' import infobox with context %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
{% if title %}
<title>Porom - {% block title %}{% endblock %}</title>
{% else %}
<title>Porom</title>
{% endif %}
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
{% include 'common/topnav.html' %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{{ infobox(message, category) }}
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
<footer class="darkbg">
<span>Porom commit</span>
</footer>
<script src="/static/js/copy-code.js"></script>
<script src="/static/js/ui.js"></script>
</body>

View File

@ -0,0 +1,10 @@
{% macro infobox(message, kind=InfoboxKind.INFO) %}
<div class="{{ "infobox " + InfoboxHTMLClass[kind] }}">
<span>
<div class="infobox-icon-container">
<img src="{{ InfoboxIcons[kind] }}">
</div>
{{ message }}
</span>
</div>
{% endmacro %}

View File

@ -0,0 +1,22 @@
<nav id="topnav">
<span>
<a class="site-title" href="{{url_for('topics.all_topics')}}">Porom</a>
</span>
<span>
{% if not is_logged_in() %}
Welcome, guest. Please <a href="{{url_for('users.sign_up')}}">sign up</a> or <a href="{{url_for('users.log_in')}}">log in</a>
{% else %}
{% with user = get_active_user() %}
Welcome, <a href="{{ url_for("users.page", username = user.username) }}">{{user.username}}</a>
&bullet;
<a href="{{ url_for("users.settings", username = user.username) }}">Settings</a>
&bullet;
<a href="{{ url_for("users.inbox", username = user.username) }}">Inbox</a>
{% if user.is_mod() %}
&bullet;
<a href="{{ url_for("users.user_list") }}">User list</a>
{% endif %}
{% endwith %}
{% endif %}
</span>
</nav>

View File

@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block content %}
<nav class="darkbg">
<h1 class="thread-title">All topics</h1>
<span>{{admin.is_default_avatar()}}</span>
</nav>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html' %}
{% block title %}Log in{% endblock %}
{% block content %}
<div class="darkbg login-container">
<h1>Log In</h1>
<form method="post">
<label for="username">Username</label><br>
<input type="text" id="username" name="username" required autocomplete="username"><br>
<label for="password">Password</label><br>
<input type="password" id="password" name="password" required autocomplete="current-password"><br>
<input type="submit" value="Log in">
</form>
</div>
{% endblock %}

View File