Adding some titles
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Víðir Valberg Guðmundsson 2023-10-02 20:50:39 +02:00
parent 88e15974dc
commit f42101c476
8 changed files with 26 additions and 2 deletions

2
.gitignore vendored
View file

@ -5,3 +5,5 @@ db.sqlite3
.pytest_cache .pytest_cache
.idea/ .idea/
*.mo *.mo
.env
venv/

View file

@ -1,6 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block head_title %}
{% trans "Member detail" %}
{% endblock %}
{% block content %} {% block content %}
<h1> <h1>

View file

@ -1,6 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block head_title %}
{% trans "Membership" %}
{% endblock %}
{% block content %} {% block content %}
{% if not current_membership %} {% if not current_membership %}

View file

@ -39,6 +39,8 @@ def members_admin(request):
users = get_members() users = get_members()
return render_list( return render_list(
entity_name="member",
entity_name_plural="members",
request=request, request=request,
paginate_by=20, paginate_by=20,
objects=users, objects=users,

View file

@ -1 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block head_title %}
{% trans "Home" %}
{% endblock %}

View file

@ -1,4 +1,4 @@
from django.shortcuts import render from utils.view_utils import render
def index(request): def index(request):

View file

@ -1,10 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block head_title %}
{{ entity_name_plural|capfirst }}
{% endblock %}
{% block content %} {% block content %}
<h1> <h1>
Users <small class="text-muted">{{ total_count }}</small> {{ entity_name_plural|capfirst }} <small class="text-muted">{{ total_count }}</small>
</h1> </h1>
<table class="table table-striped"> <table class="table table-striped">

View file

@ -46,6 +46,8 @@ class RowAction:
def render_list( def render_list(
request: HttpRequest, request: HttpRequest,
entity_name: str,
entity_name_plural: str,
objects: list["Model"], objects: list["Model"],
columns: list[tuple[str, str]], columns: list[tuple[str, str]],
row_actions: list[RowAction] = None, row_actions: list[RowAction] = None,
@ -87,6 +89,8 @@ def render_list(
"list_actions": list_actions, "list_actions": list_actions,
"total_count": total_count, "total_count": total_count,
"order_by": order_by, "order_by": order_by,
"entity_name": entity_name,
"entity_name_plural": entity_name_plural,
} }
if paginate_by: if paginate_by: