mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-18 06:44:22 +01:00
Fix rendering of naddr and other events
This commit is contained in:
@@ -111,6 +111,9 @@ func render(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kindDescription := kindNames[event.Kind]
|
kindDescription := kindNames[event.Kind]
|
||||||
|
if kindDescription == "" {
|
||||||
|
kindDescription = fmt.Sprintf("Kind %d", event.Kind)
|
||||||
|
}
|
||||||
kindNIP := kindNIPS[event.Kind]
|
kindNIP := kindNIPS[event.Kind]
|
||||||
|
|
||||||
imageMatch := regexp.MustCompile(`https:\/\/[^ ]*\.(gif|jpe?g|png|webp)`).FindStringSubmatch(event.Content)
|
imageMatch := regexp.MustCompile(`https:\/\/[^ ]*\.(gif|jpe?g|png|webp)`).FindStringSubmatch(event.Content)
|
||||||
|
|||||||
@@ -686,23 +686,23 @@ body.profile .column_content {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body.note .column_content, body.raw .column_content {
|
body.note .column_content, body.other .column_content {
|
||||||
flex-basis: 75%;
|
flex-basis: 75%;
|
||||||
max-width: 75%;
|
max-width: 75%;
|
||||||
}
|
}
|
||||||
@media (max-width: 580px) {
|
@media (max-width: 580px) {
|
||||||
body.note .column_content, body.raw .column_content {
|
body.note .column_content, body.other .column_content {
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.note .column_content .profile_intro, body.raw .column_content .profile_intro {
|
body.note .column_content .profile_intro, body.other .column_content .profile_intro {
|
||||||
display: flex;
|
display: flex;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
body.note .column_content .profile_intro a, body.raw .column_content .profile_intro a {
|
body.note .column_content .profile_intro a, body.other .column_content .profile_intro a {
|
||||||
display: inherit;
|
display: inherit;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
align-items: inherit;
|
align-items: inherit;
|
||||||
@@ -711,56 +711,56 @@ body.note .column_content .profile_intro a, body.raw .column_content .profile_in
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
@media (max-width: 580px) {
|
@media (max-width: 580px) {
|
||||||
body.note .column_content .profile_intro a, body.raw .column_content .profile_intro a {
|
body.note .column_content .profile_intro a, body.other .column_content .profile_intro a {
|
||||||
margin-top: 0rem;
|
margin-top: 0rem;
|
||||||
margin-bottom: -0.5rem;
|
margin-bottom: -0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.note .column_content .profile_intro .info-wrapper, body.raw .column_content .profile_intro .info-wrapper {
|
body.note .column_content .profile_intro .info-wrapper, body.other .column_content .profile_intro .info-wrapper {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
@media (max-width: 580px) {
|
@media (max-width: 580px) {
|
||||||
body.note .column_content .profile_intro .info-wrapper, body.raw .column_content .profile_intro .info-wrapper {
|
body.note .column_content .profile_intro .info-wrapper, body.other .column_content .profile_intro .info-wrapper {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 580px) {
|
@media (max-width: 580px) {
|
||||||
body.note .column_content .profile_intro .info-wrapper .name,
|
body.note .column_content .profile_intro .info-wrapper .name,
|
||||||
body.note .column_content .profile_intro .info-wrapper .npub, body.raw .column_content .profile_intro .info-wrapper .name,
|
body.note .column_content .profile_intro .info-wrapper .npub, body.other .column_content .profile_intro .info-wrapper .name,
|
||||||
body.raw .column_content .profile_intro .info-wrapper .npub {
|
body.other .column_content .profile_intro .info-wrapper .npub {
|
||||||
display: block-inline;
|
display: block-inline;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.note .column_content .profile_intro .pic-wrapper, body.raw .column_content .profile_intro .pic-wrapper {
|
body.note .column_content .profile_intro .pic-wrapper, body.other .column_content .profile_intro .pic-wrapper {
|
||||||
flex-basis: 16%;
|
flex-basis: 16%;
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
@media (max-width: 580px) {
|
@media (max-width: 580px) {
|
||||||
body.note .column_content .profile_intro .pic-wrapper, body.raw .column_content .profile_intro .pic-wrapper {
|
body.note .column_content .profile_intro .pic-wrapper, body.other .column_content .profile_intro .pic-wrapper {
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.note .column_content .published_at, body.note .column_content .reply_of, body.raw .column_content .published_at, body.raw .column_content .reply_of {
|
body.note .column_content .published_at, body.note .column_content .reply_of, body.other .column_content .published_at, body.other .column_content .reply_of {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
align-self: end;
|
align-self: end;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
.theme--default body.note .column_content .published_at, .theme--default body.note .column_content .reply_of, .theme--default body.raw .column_content .published_at, .theme--default body.raw .column_content .reply_of {
|
.theme--default body.note .column_content .published_at, .theme--default body.note .column_content .reply_of, .theme--default body.other .column_content .published_at, .theme--default body.other .column_content .reply_of {
|
||||||
color: #9a9a9a;
|
color: #9a9a9a;
|
||||||
}
|
}
|
||||||
.theme--dark body.note .column_content .published_at, .theme--dark body.note .column_content .reply_of, .theme--dark body.raw .column_content .published_at, .theme--dark body.raw .column_content .reply_of {
|
.theme--dark body.note .column_content .published_at, .theme--dark body.note .column_content .reply_of, .theme--dark body.other .column_content .published_at, .theme--dark body.other .column_content .reply_of {
|
||||||
color: #f3f3f3;
|
color: #f3f3f3;
|
||||||
}
|
}
|
||||||
.theme--default body.note .column_content .published_at a, .theme--default body.note .column_content .reply_of a, .theme--default body.raw .column_content .published_at a, .theme--default body.raw .column_content .reply_of a {
|
.theme--default body.note .column_content .published_at a, .theme--default body.note .column_content .reply_of a, .theme--default body.other .column_content .published_at a, .theme--default body.other .column_content .reply_of a {
|
||||||
color: #e32a6d;
|
color: #e32a6d;
|
||||||
}
|
}
|
||||||
.theme--dark body.note .column_content .published_at a, .theme--dark body.note .column_content .reply_of a, .theme--dark body.raw .column_content .published_at a, .theme--dark body.raw .column_content .reply_of a {
|
.theme--dark body.note .column_content .published_at a, .theme--dark body.note .column_content .reply_of a, .theme--dark body.other .column_content .published_at a, .theme--dark body.other .column_content .reply_of a {
|
||||||
color: #e32a6d;
|
color: #e32a6d;
|
||||||
}
|
}
|
||||||
body.note .column_content .reply_of, body.raw .column_content .reply_of {
|
body.note .column_content .reply_of, body.other .column_content .reply_of {
|
||||||
margin-top: 0.2rem;
|
margin-top: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ body.profile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body.note, body.raw {
|
body.note, body.other {
|
||||||
.column_content {
|
.column_content {
|
||||||
flex-basis: 75%;
|
flex-basis: 75%;
|
||||||
max-width: 75%;
|
max-width: 75%;
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
<div class="field {{if not (eq .type "other")}}advanced{{end}}">
|
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}">
|
||||||
<div class="label">Published at</div>
|
<div class="label">Published at</div>
|
||||||
{{.createdAt | sanitizeString}}
|
{{.createdAt | sanitizeString}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field {{if not (eq .type "other")}}advanced{{end}}">
|
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}">
|
||||||
<div class="label">Kind type</div>
|
<div class="label">Kind type</div>
|
||||||
{{.kindID}} - <a href="https://github.com/nostr-protocol/nips/blob/master/{{.kindNIP | sanitizeString}}.md">{{.kindDescription | sanitizeString}}</a>
|
{{.kindID}}
|
||||||
|
{{ if not (eq .kindNIP "")}}
|
||||||
|
- <a href="https://github.com/nostr-protocol/nips/blob/master/{{.kindNIP | sanitizeString}}.md">{{.kindDescription | sanitizeString}}</a>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field {{if not (eq .type "other")}}advanced{{end}}">
|
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}">
|
||||||
<div class="label">Nevent</div>
|
<div class="label">Nevent</div>
|
||||||
<div>{{.nevent | sanitizeString}}</div>
|
<div>{{.nevent | sanitizeString}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field {{if not (eq .type "other")}}advanced{{end}} boxed">
|
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}} boxed">
|
||||||
<div class="label">Event JSON</div>
|
<div class="label">Event JSON</div>
|
||||||
<div class="json">{{.eventJSON}}</div>
|
<div class="json">{{.eventJSON}}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,5 +63,5 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="stylesheet" href="/njump/static/styles.css?v=20230601" />
|
<link rel="stylesheet" href="/njump/static/styles.css?v=20230601b" />
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
{{template "head.html" .}}
|
{{template "head.html" .}}
|
||||||
|
|
||||||
<body class="raw">
|
<body class="other">
|
||||||
{{template "top.html" .}}
|
{{template "top.html" .}}
|
||||||
|
|
||||||
<div class="container_wrapper">
|
<div class="container_wrapper">
|
||||||
|
|||||||
Reference in New Issue
Block a user