This commit is contained in:
gd
2021-03-23 23:11:57 +03:00
commit 73f23a591c
18 changed files with 912 additions and 0 deletions

15
templates/404.j2 Normal file
View File

@ -0,0 +1,15 @@
{% extends 'base.j2' %}
{% block title %}
Page not found
{% endblock %}
{% block content %}
<main class="page_not_found">
<h1 class="large-h">Page not found</h1>
<div class="blank-2"></div>
<a href="/"><button type="button" class="btn btn-primary btn-lg btn-dark">Go back</button></a>
</main>
{% endblock %}

47
templates/base.j2 Normal file
View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>
{% block title %}
owl
{% endblock %}
</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico')}}" type="image/x-icon">
<!-- Bottrstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<!-- Bottstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/font/bootstrap-icons.css">
<!-- Ubuntu Mono from Google Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500&display=swap" rel="stylesheet">
<!-- Custom CSS -->
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/style.css')}}">
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/codehilite.css')}}">
</head>
<body>
{% if session['logged_in'] %}
<div class="signout-btn">
<a href="/signout/" title="Sign out"><i class="bi bi-box-arrow-right"></i></a>
</div>
{% endif %}
{% block content %}
No content here
{% endblock %}
<div class="to-top-btn" id="to-top-btn">
<i class="bi bi-arrow-up-square"></i>
</div>
<!-- Bootstrap 5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
<!-- Minified JQuery 3.6.0 slim -->
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
<!-- Custom JS -->
<script src="{{ url_for('static', filename='js/script.js')}}"></script>
</body>
</html>

69
templates/index.j2 Normal file
View File

@ -0,0 +1,69 @@
{% extends 'base.j2' %}
{% block title %}
{{ title }}
{% endblock %}
{% block content %}
<!-- Header bar -->
<div class="headerbar">
<!-- Sidebar toggle button -->
<div class="sidebar-toggle-btn">
<i class="bi bi-layout-sidebar-inset"></i>
</div>
</div>
<nav class="sidebar">
<!-- Sidebar content -->
{{ contents | safe }}
</nav>
<main class="content">
<!-- Page main content -->
<div class="blank-1"></div>
<div class="blank-2"></div>
{# CURRENT PATH {{ current_path }} #}
<article>
{{ article | safe }}
<div class="blank-2"></div>
<!-- Pagination -->
{% for link in links %}
{% if link == current_path %}
<div class="container">
<div class="row">
<div class="col-sm-6" style="float: left; padding: 0 15px 0 0;">
{% if (links.index(link) - 1) > -1 %}
<div class="list-group">
<a href="{{ links[links.index(link) - 1] }}" class="list-group-item list-group-item-action">
<small class="mb-1">Previous</small>
{% if links[links.index(link) - 1] == '/' %}
{# Unique handler for root URL #}
<h5 class="mb-1">« {{ get_title('HOME/') }}</h5>
{% else %}
<h5 class="mb-1">« {{ get_title(links[links.index(link) - 1]) }}</h5>
{% endif %}
</a>
</div>
{% endif %}
</div>
<div class="col-sm-6" style="float: right; padding: 0 0 0 15px;">
{% if (links.index(link) + 1) <= (get_len(links) - 1) %}
<div class="list-group">
<a href="{{ links[links.index(link) + 1] }}" class="list-group-item list-group-item-action" style="text-align: right;">
<small class="mb-1">Next</small>
<h5 class="mb-1">{{ get_title(links[links.index(link) + 1]) }} »</h5>
</a>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endfor %}
</article>
<div class="blank-5"></div>
</main>
{% endblock %}

22
templates/signin.j2 Normal file
View File

@ -0,0 +1,22 @@
{% extends 'base.j2' %}
{% block title %}
Sign in
{% endblock %}
{% block content %}
<main class="form-signin">
<form action="/signin/" method="POST">
<center><h1 class="title-h">@v@</h1></center>
<div class="blank-1"></div>
{% if wrong_pw %}
<p><center style="color: #ff0000;">Wrong password.</center></p>
{% endif %}
<label for="inputPassword" class="visually-hidden">Password</label>
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password" required>
<button class="w-100 btn btn-lg btn-primary btn-dark" type="submit">Sign in</button>
</form>
</main>
{% endblock %}