summaryrefslogtreecommitdiff
path: root/jimbrella
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-02-06 16:44:45 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-02-06 16:44:45 +0800
commitccef2ce14d14da2ccfcfa74778b8ec1e2a3839f3 (patch)
tree180215d19000c20300c34cfeec02d895b8905985 /jimbrella
parent425edff4ff3d312a879258ca7387d53498ba94ef (diff)
Adapt frontend to new AdminLog
Diffstat (limited to 'jimbrella')
-rw-r--r--jimbrella/static/jimbrella.css2
-rw-r--r--jimbrella/templates/admin/admin_logs.html52
-rw-r--r--jimbrella/templates/admin/logs.html34
3 files changed, 53 insertions, 35 deletions
diff --git a/jimbrella/static/jimbrella.css b/jimbrella/static/jimbrella.css
index 056e0b4..2c6987b 100644
--- a/jimbrella/static/jimbrella.css
+++ b/jimbrella/static/jimbrella.css
@@ -76,7 +76,7 @@ input.db-edit {
background-color: #d3e99f;
}
-.admin_modify_db, .yellow {
+.yellow {
background-color: #e8e89d;
}
diff --git a/jimbrella/templates/admin/admin_logs.html b/jimbrella/templates/admin/admin_logs.html
new file mode 100644
index 0000000..8d31e88
--- /dev/null
+++ b/jimbrella/templates/admin/admin_logs.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>JI Umbrella</title>
+ <link rel="stylesheet" href="/static/jimbrella.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ </head>
+ <body>
+ <h1>JI Umbrella Logs</h1>
+ <div id="container">
+ {% include "admin/tabs.html" %}
+ <div class="data-table-container">
+ <table class="data">
+ <thead>
+ <tr>
+ <td>Date</td>
+ <td>Admin</td>
+ <td>Umbrella #</td>
+ <td>Status</td>
+ <td>Tenant</td>
+ <td>ID</td>
+ <td>Phone</td>
+ <td>Lent at</td>
+ <td>Note</td>
+ </tr>
+ <tbody>
+ {% for log in logs %}
+ <tr>
+ <td rowspan=2>{{ log.date }}</td>
+ <td rowspan=2>{{ log.actor }}</td>
+ <td rowspan=2>{{ log.id }}</td>
+ <td class="red">{{ log.status_a }}</td>
+ <td class="red">{{ log.tenant_name_a }}</td>
+ <td class="red">{{ log.tenant_id_a }}</td>
+ <td class="red">{{ log.tenant_phone_a }}</td>
+ <td class="red">{{ log.lent_at_a }}</td>
+ <td rowspan=2>{{ log.note }}</td>
+ </tr>
+ <tr>
+ <td class="green">{{ log.status_b }}</td>
+ <td class="green">{{ log.tenant_name_b }}</td>
+ <td class="green">{{ log.tenant_id_b }}</td>
+ <td class="green">{{ log.tenant_phone_b }}</td>
+ <td class="green">{{ log.lent_at_b }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/jimbrella/templates/admin/logs.html b/jimbrella/templates/admin/logs.html
deleted file mode 100644
index f4f57c0..0000000
--- a/jimbrella/templates/admin/logs.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>JI Umbrella</title>
- <link rel="stylesheet" href="/static/jimbrella.css" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- </head>
- <body>
- <h1>JI Umbrella Logs</h1>
- <div id="container">
- {% include "admin/tabs.html" %}
- <div class="data-table-container">
- <table class="data">
- <thead>
- <tr>
- <th>Date</th>
- <th>Event</th>
- <th>Note</th>
- </tr>
- </thead>
- <tbody>
- {% for log in logs|reverse %}
- <tr class="{{ log.event|lower }}">
- <td>{{ log.date_str }}</td>
- <td>{{ log.description }}</td>
- <td>{{ log.note }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </body>
-</html>