The very basics of a project view

This commit is contained in:
Klaas van Schelven
2023-11-08 22:49:36 +01:00
parent 2dd3a23f5a
commit 51bfb2879d
3 changed files with 58 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
import json
import uuid
from django.db import models
@@ -12,3 +14,13 @@ class Issue(models.Model):
def get_absolute_url(self):
return f"/issues/issue/{ self.id }/events/"
def parsed_data(self):
# TEMP solution; won't scale
return json.loads(self.events.first().data)
def title(self):
# TODO: refactor to a (filled-on-create) field
parsed_data = json.loads(self.events.first().data)
foo = parsed_data["exception"]["values"][0]
return foo["type"] + ": " + foo["value"]

View File

@@ -6,13 +6,22 @@
<body>
<h1>Issues for project {{ project_id }}</h1>
<div class="m-4">
<h1 class="text-3xl mt-4">Issues for project {{ project_id }}</h1>
{% for issue in issue_list %}
<div>
{% for issue in issue_list %}
<a href="/issues/issue/{{ issue.id }}/events/">{{ issue.id }} </a><br>
<div class="m-2">
<div><a href="/issues/issue/{{ issue.id }}/events/" class="text-blue-800 font-bold">{{ issue.title }}</a> <span class="ml-2 italic">{{ issue.parsed_data.transaction }}</span> </div>
<div class="text-sm">from <b>8 Nov 12:33</b> | last <b>8 Nov 12:39</b> | with <b>3</b> events</div>
</div>
{% endfor %}
{% endfor %}
<div>
</div>
</body>

View File

@@ -791,6 +791,10 @@ select {
margin: 4rem;
}
.m-2 {
margin: 0.5rem;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
@@ -840,6 +844,10 @@ select {
margin-top: 1.5rem;
}
.ml-2 {
margin-left: 0.5rem;
}
.block {
display: block;
}
@@ -1087,6 +1095,11 @@ select {
line-height: 2rem;
}
.text-sm {
font-size: 0.875rem;
line-height: 1.25rem;
}
.font-bold {
font-weight: 700;
}
@@ -1111,6 +1124,26 @@ select {
letter-spacing: 0em;
}
.text-blue-800 {
--tw-text-opacity: 1;
color: rgb(30 64 175 / var(--tw-text-opacity));
}
.text-slate-700 {
--tw-text-opacity: 1;
color: rgb(51 65 85 / var(--tw-text-opacity));
}
.text-slate-500 {
--tw-text-opacity: 1;
color: rgb(100 116 139 / var(--tw-text-opacity));
}
.text-slate-600 {
--tw-text-opacity: 1;
color: rgb(71 85 105 / var(--tw-text-opacity));
}
.filter {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}