chore: template cleanup

!1
This commit is contained in:
2024-05-13 20:00:17 +09:30
parent 30e7c8de42
commit 0d1b31f9f0
11 changed files with 38 additions and 370 deletions

View File

@ -14,6 +14,7 @@
<input type="button" value="<< Back" onclick="window.location='{% url 'Access:Organizations' %}';">
<input type="button" value="New Team" onclick="window.location='{% url 'Access:_team_add' organization.id %}';">
<hr />
<table>
<thead>
<tr>

View File

@ -1,6 +1,6 @@
{% extends 'base.html.j2' %}
{% block title %}{{ team.team_name }} Team{% endblock %}
{% block title %}Team - {{ team.team_name }}{% endblock %}
{% block body%}
<section class="content-header">
@ -43,7 +43,7 @@
{% for field in teamusers %}
<tr>
<td>{{ field.user }}</td>
<td><input type="checkbox" {% if field.manager %}checked{% endif %}></td>
<td><input type="checkbox" {% if field.manager %}checked{% endif %} disabled></td>
<td>{{ field.created }}</td>
<td>{{ field.modified }}</td>
<td><a href="{% url 'Access:_team_user_delete' organization_id=organization.id team_id=field.team_id pk=field.id %}">Delete</a></a></td>

View File

@ -38,6 +38,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'core.apps.CoreConfig',
'access.apps.AccessConfig',
]
@ -148,3 +149,5 @@ STATICFILES_DIRS = [
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
SITE_TITLE = "Site Title"

0
app/core/__init__.py Normal file
View File

6
app/core/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'core'

View File

View File

@ -0,0 +1,9 @@
from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag
def settings_value(name):
return getattr(settings, name, "")

View File

@ -19,7 +19,7 @@ h1 {
h2 {
width: 100%;
background-color: aqua;
background-color: #fff;
height: 80px;
line-height: 80px;
text-align: center;
@ -58,7 +58,7 @@ article {
}
footer {
background-color: cadetblue;
background-color: #fff;
width: 100%;
height: 76px;
line-height: 76px;

View File

@ -96,3 +96,13 @@ input[type=checkbox]:checked:after,
input[type=checkbox]:checked::after {
content: "\2714";
}
input[type=submit] {
color: #fff;
background-color: blue;
height: 30px;
border: none;
border-radius: 5px;
cursor: pointer;
}

View File

@ -1,3 +1,4 @@
{% load settings_value %}
<html>
<head>
@ -15,16 +16,8 @@
<body>
<header>
<h1><a href="/" style="text-decoration: none; color: inherit;">Site Title</a></h1>
<div class="dropdown">
<button class="dropbtn">{% block org_name %}Organization{% endblock %}</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
<h1><a href="/" style="text-decoration: none; color: inherit;">{% settings_value "SITE_TITLE" %}</a></h1>
<div class="dropdown" style="right: 0px; position: fixed; padding-right: 50px;">
<button class="dropbtn">{% block user_name %}{%if user.username %}{{ user.username }}{% else %}My Account{% endif %}{% endblock %}</button>
@ -53,16 +46,12 @@
<nav style="padding: 0px;">
{% include 'navigation.html.j2' %}
</nav>
<section>
<h2>{% block title %}Page Title{% endblock %}</h2>
<article>
{% block body%}{% endblock %}
</article>
<footer>
Footer
</footer>
<footer>{% block footer%}{% endblock %}</footer>
</section>
</main>

View File

@ -2,354 +2,4 @@
{% block title %}Home{% endblock %}
{% block body%}
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
home
<br>
{% endblock %}
{% block body%}{% endblock %}