Add minor improvements to error report template

This commit is contained in:
Andrey Antukh 2023-08-10 15:44:11 +02:00
parent da62a6809c
commit 28836d82cd
3 changed files with 14 additions and 6 deletions

View file

@ -7,7 +7,7 @@ Report: {{hint|abbreviate:150}} - {{id}} - Penpot Error Report (v3)
{% block content %} {% block content %}
<nav> <nav>
<div>[<a href="/dbg/error">⮜</a>]</div> <div>[<a href="/dbg/error">⮜</a>]</div>
<div>[<a href="#message">message</a>]</div> <div>[<a href="#head">head</a>]</div>
<div>[<a href="#props">props</a>]</div> <div>[<a href="#props">props</a>]</div>
<div>[<a href="#context">context</a>]</div> <div>[<a href="#context">context</a>]</div>
{% if params %} {% if params %}
@ -29,10 +29,11 @@ Report: {{hint|abbreviate:150}} - {{id}} - Penpot Error Report (v3)
<main> <main>
<div class="table"> <div class="table">
<div class="table-row multiline"> <div class="table-row multiline">
<div id="message" class="table-key">MESSAGE: </div> <div id="head" class="table-key">HEAD</div>
<div class="table-val"> <div class="table-val">
<h1>{{hint}}</h1> <h1><span class="not-important">Hint:</span> <br/> {{hint}}</h1>
<h2><span class="not-important">Reported at:</span> <br/> {{created-at}}</h2>
<h2><span class="not-important">Report ID:</span> <br/> {{id}}</h2>
</div> </div>
</div> </div>

View file

@ -36,6 +36,11 @@ small {
color: #888; color: #888;
} }
.not-important {
color: #888;
font-weight: 200;
}
small > strong { small > strong {
font-size: 9px; font-size: 9px;
} }

View file

@ -238,9 +238,11 @@
(-> (io/resource "app/templates/error-report.v2.tmpl") (-> (io/resource "app/templates/error-report.v2.tmpl")
(tmpl/render report))) (tmpl/render report)))
(render-template-v3 [{report :content id :id}] (render-template-v3 [{:keys [content id created-at]}]
(-> (io/resource "app/templates/error-report.v3.tmpl") (-> (io/resource "app/templates/error-report.v3.tmpl")
(tmpl/render (assoc report :id id)))) (tmpl/render (-> content
(assoc :id id)
(assoc :created-at (dt/format-instant created-at :rfc1123))))))
] ]
(when-not (authorized? pool request) (when-not (authorized? pool request)