Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 33 additions & 23 deletions br/templates/backend/_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,39 @@ <h4>Rapid<strong>SMS</strong></h4>
</a>
<ul class="dropdown-menu text-small shadow" aria-labelledby="dropdownMenu">
{% if user.is_authenticated %}
{% if perms.br.change_birthregistration %}<li><a class="dropdown-item" href="{% url 'br:reports_list' %}">BR reports</a></li>{% endif %}
{% if perms.br.change_birthregistration %}<li><a class="dropdown-item" href="{% url 'locations:center_list' %}">BR centers</a></li>{% endif %}
<li><a class="dropdown-item" href="{% url 'br:help' %}">BR help</a></li>
<div class="dropdown-divider"></div>
{% if perms.dr.change_deathreport %}<li><a class="dropdown-item" href="{% url 'dr:dr_report_list' %}">DR reports</a></li>{% endif %}
{% if perms.dr.change_deathreport %}<li><a class="dropdown-item" href="{% static 'documents/DRFORM.pdf' %}">DR manual</a></li>{% endif %}
<div class="dropdown-divider"></div>
{% if perms.ipd.change_report %}<li><a class="dropdown-item" href="{% url 'mnchw:campaign_list' %}">MNCHW campaigns</a></li>{% endif %}
<div class="dropdown-divider"></div>
{% if perms.reporters.change_reporter %}
<li><a href="{% url 'reporters:reporter_list' %}" class="dropdown-item">Reporters</a></li>
<div class="dropdown-divider"></div>
{% endif %}
<li><a class="dropdown-item" href="{% url 'messaging:message_list' %}">Messages</a></li>
<div class="dropdown-divider"></div>
<li>
<a class="dropdown-item" href="{% url 'user-logout' %}">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" width="20" height="20">
<path fill-rule="evenodd" d="M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z" clip-rule="evenodd" />
</svg>
&nbsp; Log Out
</a>
</li>
<li><a class="dropdown-item" href="{% url 'br:help' %}">BR help</a></li>
{% if perms.br.change_birthregistration %}
<li><a class="dropdown-item" href="{% url 'br:reports_list' %}">BR reports</a></li>
<li><a class="dropdown-item" href="{% url 'locations:center_list' %}">BR centers</a></li>
<div class="dropdown-divider"></div>
{% endif %}
{% if perms.dr.change_deathreport %}
<li><a class="dropdown-item" href="{% url 'dr:dr_report_list' %}">DR reports</a></li>
<li><a class="dropdown-item" href="{% static 'documents/DRFORM.pdf' %}">DR manual</a></li>
<div class="dropdown-divider"></div>
{% endif %}
{% if perms.ipd.change_report %}
<li><a class="dropdown-item" href="{% url 'mnchw:campaign_list' %}">MNCHW campaigns</a></li>
<div class="dropdown-divider"></div>
{% endif %}
{% if perms.reporters.change_reporter %}
<li><a href="{% url 'reporters:reporter_list' %}" class="dropdown-item">Reporters</a></li>
<div class="dropdown-divider"></div>
{% endif %}
{% if perms.auth.change_user %}
<li><a href="{% url 'users:users_list' %}" class="dropdown-item">Users</a></li>
<div class="dropdown-divider"></div>
{% endif %}
<li><a class="dropdown-item" href="{% url 'messaging:message_list' %}">Messages</a></li>
<div class="dropdown-divider"></div>
<li>
<a class="dropdown-item" href="{% url 'user-logout' %}">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" width="20" height="20">
<path fill-rule="evenodd" d="M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z" clip-rule="evenodd" />
</svg>
&nbsp; Log Out
</a>
</li>
{% endif %}
</ul>
</div>
Expand Down
68 changes: 68 additions & 0 deletions br/templates/backend/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'vendor/bootstrap5/css/bootstrap.min.css' %}">
<title>Login</title>
<style>
html,body {
height: 100%;
}

body {
display: flex;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;
}

.form-signin {
width: 100%;
max-width: 330px;
padding: 15px;
margin: auto;
}

.form-signin .form-floating:focus-within {
z-index: 2;
}

.form-signin input[type="text"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}

.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
</style>
</head>
<body class="text-center">
<main class="form-signin">
<form method="post">
{% csrf_token %}
<h1 class="h3 mb-3 fw-normal">Please sign in</h1>
<div class="form-floating">
<input id="username" type="text" name="username" class="form-control" placeholder="Username">
<label for="username">Username</label>
</div>
<div class="form-floating">
<input id="password" type="password" name="password" class="form-control" placeholder="Password">
<label for="password">Password</label>
</div>
<button class="w-100 btn btn-lg btn-primary" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" width="20" height="20">
<path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
</svg>
Sign in
</button>
</form>
</main>
</body>
</html>
2 changes: 1 addition & 1 deletion br/templates/backend/message_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h3>{{ page_title }}</h3>
</tr>
{% empty %}
<tr>
<td class="table-warning" colspan="4">No records fo</td>
<td class="table-warning" colspan="4">No records found</td>
</tr>
{% endfor %}
</tbody>
Expand Down
8 changes: 5 additions & 3 deletions br/templates/backend/reports_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3>{{ page_title }}</h3>
{% for message in messages %}
<div class="row">
<div class="col-sm-12">
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %} alert-dismissable">
<div class="alert {% if message.tags %}{{ message.tags|lower }}{% endif %} alert-dismissable fade show" role="alert">
{{ message|safe }}
<button class="btn-close" type="button" data-bs-dismss="alert" aria-label="Close"></button>
</div>
Expand Down Expand Up @@ -84,13 +84,15 @@ <h3>{{ page_title }}</h3>
</tr>
</thead>
<form action="{% url 'br:rep_delete' %}" id="delete_form" method="post">
{% csrf_token %}
<tbody>
{% for report in reports %}
<tr>
<td>
<div class="form-check">
<input type="checkbox" name="reports" value="{{ report.pk }}" class="reports form-check-input" data-delete-checkbox="true"></td>
<input type="checkbox" name="{{ delete_form.reports.name }}" value="{{ report.pk }}" class="reports form-check-input" data-delete-checkbox="true">
</div>
</td>
<td>
{% if report.source == 'internal' %}
<a href="{% url 'br:report_edit' report.pk %}">
Expand Down Expand Up @@ -133,8 +135,8 @@ <h3>{{ page_title }}</h3>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="deleteModalLabel">Delete records?</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Are you sure you want to delete these records?</p>
Expand Down
124 changes: 124 additions & 0 deletions br/templates/backend/user_create.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{% extends 'backend/_layout.html' %}
{% block content %}
<div class="row">
<div class="col">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-1 pb-1 mb-1 border-bottom">
<h3>{{ page_title }}</h3>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-10 offset-sm-1 col-md-8 offset-md-2 py-3">
<form method="post">
{% csrf_token %}
<div class="card">
<div class="card-body">
<div class="row mb-3">
<label for="{{ form.username.id_for_label }}" class="col-sm-4 col-form-label">Username</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="{{ form.username.name }}" id="{{ form.username.id_for_label }}">
</div>
</div>
<div class="row mb-3">
<label for="{{ form.email.id_for_label }}" class="col-sm-4 col-form-label">Email</label>
<div class="col-sm-8">
<input type="email" class="form-control" name="{{ form.email.name }}" id="{{ form.email.id_for_label }}">
</div>
</div>
<div class="row mb-3">
<label for="{{ form.first_name.id_for_label }}" class="col-sm-4 col-form-label">First name</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="{{ form.first_name.name }}" id="{{ form.first_name.id_for_label }}">
</div>
</div>
<div class="row mb-3">
<label for="{{ form.password_confirm.id_for_label }}" class="col-sm-4 col-form-label">Surname</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="{{ form.last_name.name }}" id="{{ form.last_name.id_for_label }}">
</div>
</div>
<div class="row mb-3">
<label for="{{ form.password.id_for_label }}" class="col-sm-4 col-form-label">Password</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="{{ form.password.name }}" id="{{ form.password.id_for_label }}">
<p class="form-text">Enter a new password to change the current password</p>
</div>
</div>
<div class="row mb-3">
<label for="{{ form.password_confirm.id_for_label }}" class="col-sm-4 col-form-label">Confirm password</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="{{ form.password_confirm.name }}" id="{{ form.password_confirm.id_for_label }}">
<p class="form-text">Repeat the password entered above</p>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.is_active.name }}" id="{{ form.is_active.id_for_label }}" class="form-check-input">
<label for="{{ form.is_active.id_for_label }}" class="form-check-label">Active?</label>
<p class="form-text">An inactive user will not be able to use the system.</p>
</div>
</div>
</div>
<fieldset>
<legend>Permissions</legend>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.can_add_locations.name }}" id="{{ form.can_add_locations.id_for_label }}" class="form-check-input">
<label for="{{ form.can_add_locations.id_for_label }}" class="form-check-label">Can manage BR centres</label>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.can_change_br_reports.name }}" id="{{ form.can_change_br_reports.id_for_label }}" class="form-check-input">
<label for="{{ form.can_change_br_reports.id_for_label }}" class="form-check-label">Can manage BR reports</label>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.can_change_dr_reports.name }}" id="{{ form.can_change_dr_reports.id_for_label }}" class="form-check-input">
<label for="{{ form.can_change_dr_reports.id_for_label }}" class="form-check-label">Can manage DR reports</label>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.can_change_mnchw_reports.name }}" id="{{ form.can_change_mnchw_reports.id_for_label }}" class="form-check-input">
<label for="{{ form.can_change_mnchw_reports.id_for_label }}" class="form-check-label">Can manage MNCHW reports</label>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.can_change_reporters.name }}" id="{{ form.can_change_reporters.id_for_label }}" class="form-check-input">
<label for="{{ form.can_change_reporters.id_for_label }}" class="form-check-label">Can manage users</label>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-sm-4">
<div class="form-check">
<input type="checkbox" name="{{ form.is_superuser.name }}" id="{{ form.is_superuser.id_for_label }}" class="form-check-input">
<label for="{{ form.is_superuser.id_for_label }}" class="form-check-label">Superuser?</label>
<p class="form-text">A superuser has access to everything without needing specific access to anything. <span class="text-danger">Use with caution.</span></p>
</div>
</div>
</div>
</fieldset>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary">Save Changes</button>
<a href="{% url 'users:users_list' %}" class="btn btn-secondary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
{% endblock content %}
Loading