WIP: Cleanup
This commit is contained in:
parent
715224653d
commit
6ee942f8dc
37 changed files with 547 additions and 2591 deletions
89
gurps_character/templates/allauth/layouts/base.html
Normal file
89
gurps_character/templates/allauth/layouts/base.html
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{% load i18n %}
|
||||
{% load bootstrap_icons %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>
|
||||
{% block head_title %}
|
||||
{% endblock head_title %}
|
||||
</title>
|
||||
{% block extra_head %}
|
||||
{% endblock extra_head %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
...
|
||||
</head>
|
||||
<body class="bg-gray-50 font-serif leading-normal tracking-normal">
|
||||
{% block body %}
|
||||
{% include "navbar.html" %}
|
||||
{% if messages %}
|
||||
<div>
|
||||
<strong>{% trans "Messages:" %}</strong>
|
||||
<ul>
|
||||
{% for message in messages %}<li>{{ message }}</li>{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="container mx-auto">
|
||||
<section class="flex items-center justify-center h-screen">
|
||||
Modified template
|
||||
<strong>{% trans "Menu:" %}</strong>
|
||||
<ul>
|
||||
{% if user.is_authenticated %}
|
||||
{% url 'account_email' as email_url %}
|
||||
{% if email_url %}
|
||||
<li>
|
||||
<a href="{{ email_url }}">{% trans "Change Email" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% url 'account_change_password' as change_password_url %}
|
||||
{% if change_password_url %}
|
||||
<li>
|
||||
<a href="{{ change_password_url }}">{% trans "Change Password" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% url 'mfa_index' as mfa_url %}
|
||||
{% if mfa_url %}
|
||||
<li>
|
||||
<a href="{{ mfa_url }}">{% trans "Two-Factor Authentication" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% url 'usersessions_list' as usersessions_list_url %}
|
||||
{% if usersessions_list_url %}
|
||||
<li>
|
||||
<a href="{{ usersessions_list_url }}">{% trans "Sessions" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% url 'account_logout' as logout_url %}
|
||||
{% if logout_url %}
|
||||
<li>
|
||||
<a href="{{ logout_url }}">{% trans "Sign Out" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% url 'account_login' as login_url %}
|
||||
{% if login_url %}
|
||||
<li>
|
||||
<a href="{{ login_url }}">{% trans "Sign In" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% url 'account_signup' as signup_url %}
|
||||
{% if signup_url %}
|
||||
<li>
|
||||
<a href="{{ signup_url }}">{% trans "Sign Up" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</section>
|
||||
</div>
|
||||
{% endblock body %}
|
||||
{% block extra_body %}
|
||||
{% endblock extra_body %}
|
||||
</body>
|
||||
</html>
|
||||
27
gurps_character/templates/base.html
Normal file
27
gurps_character/templates/base.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Django GURPS</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<style>
|
||||
a { text-decoration: underline }
|
||||
</style>
|
||||
{% block extra_css %}{% endblock %}
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 font-serif leading-normal tracking-normal">
|
||||
<!--- Start Nav Bar -->
|
||||
{% include "navbar.html" %}
|
||||
<!--- End Nav Bar --->
|
||||
<div class="container mx-auto">
|
||||
<section class="flex items-center justify-center h-screen">
|
||||
{% block content %}{% endblock %}
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,8 +1,37 @@
|
|||
{% extends "base.html" %}
|
||||
{% load bootstrap_icons %}
|
||||
{% block content %}
|
||||
<h3>Welcome to the character store</h3>
|
||||
<h3>Welcome to the character store</h3>
|
||||
|
||||
<p<This is a webapp for storing characters.<p>
|
||||
<p>This is a webapp for storing characters.</p>
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<h1>Welcome {% if user.first_name %}{{ user.first_name }}{% else %}{{ user.username }}{% endif %}</h1>
|
||||
|
||||
{% if user.campaign_set.all %}
|
||||
<h2>Campaigns you run</h2>
|
||||
<ul>
|
||||
{% for campaign in user.campaign_set.all %}
|
||||
<li><a href="{% url 'campaign' campaign.id %}">{{ campaign.name }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<h2>Characters you play</h2>
|
||||
<ul>
|
||||
{% for character in user.gurpscharacter_set.all %}
|
||||
<li>
|
||||
{{ character.name }} in {{ character.campaign }}
|
||||
<a href="{% url 'details' character.uuid %}" title="view {{ character.name }}">{% bs_icon 'eye' %}</a>
|
||||
<a href="{% url 'download' character.uuid %}" title="download {{ character.name }}">{% bs_icon 'download' %}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>Please sign in to see your characters and campaigns</p>
|
||||
{% endif %}
|
||||
Add a character?
|
||||
|
||||
<p>Currently it works with GURPS, specifically characters created by GCS</p>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<a class="navbar-brand" href="/">Character Database</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item"><a class="nav-link active" aria-current="page" href="/">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link active" aria-current="page" href="/gurps">GURPS</a></li>
|
||||
<li class="nav-item"><a class="nav-link disabled" aria-current="page" href="/rq">RuneQuest</a></li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/admin">Admin</a>
|
||||
</li>
|
||||
{% if user.is_staff %}
|
||||
{# <li class="nav-item"><a class="nav-link active" aria-current="page" href="/gurps">GURPS</a></li>#}
|
||||
{# <li class="nav-item"><a class="nav-link disabled" aria-current="page" href="/rq">RuneQuest</a></li>#}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/admin">Admin</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<!--<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Dropdown
|
||||
|
|
@ -35,14 +36,21 @@
|
|||
|
||||
</div>
|
||||
<div class="navbar-text float-end">
|
||||
{% if user.is_authenticated %}
|
||||
<form method="post" action="{% url 'logout' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit">logout</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<a class="nav-link" href="{% url 'login' %}">Login</a>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
{% url 'account_email' as email_url %}
|
||||
{% url 'socialaccount_connections' as socialaccount_url %}
|
||||
{% if email_url or socialaccount_url %}
|
||||
<a href="{% if email_url %}{{ email_url }}{% else %}{{ socialaccount_url }}{% endif %}"
|
||||
class="btn btn-secondary">Manage Account</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'account_logout' %}" class="btn btn-danger">Sign Out </a>
|
||||
{% else %}
|
||||
<a href="{% url 'account_login' %}" class="btn btn-outline-light">Sign In</a>
|
||||
{% url 'account_signup' as signup_url %}
|
||||
{% if signup_url %}
|
||||
<a href="{{ signup_url }}" class="btn btn-success">Sign Up</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue