log in
This commit is contained in:
28
app/templates/base.html
Normal file
28
app/templates/base.html
Normal 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>
|
10
app/templates/common/infobox.html
Normal file
10
app/templates/common/infobox.html
Normal 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 %}
|
22
app/templates/common/topnav.html
Normal file
22
app/templates/common/topnav.html
Normal 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>
|
||||
•
|
||||
<a href="{{ url_for("users.settings", username = user.username) }}">Settings</a>
|
||||
•
|
||||
<a href="{{ url_for("users.inbox", username = user.username) }}">Inbox</a>
|
||||
{% if user.is_mod() %}
|
||||
•
|
||||
<a href="{{ url_for("users.user_list") }}">User list</a>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</nav>
|
7
app/templates/topics/topics.html
Normal file
7
app/templates/topics/topics.html
Normal 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 %}
|
14
app/templates/users/log_in.html
Normal file
14
app/templates/users/log_in.html
Normal 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 %}
|
0
app/templates/users/sign_up.html
Normal file
0
app/templates/users/sign_up.html
Normal file
Reference in New Issue
Block a user