mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 18:42:26 -05:00
more dicking abuot
This commit is contained in:
parent
60ee05d2a7
commit
6ef4cc36b2
9 changed files with 176 additions and 71 deletions
|
|
@ -166,6 +166,12 @@ type WebStatus struct {
|
||||||
// after the "main" thread, so it and everything
|
// after the "main" thread, so it and everything
|
||||||
// below it can be considered "replies".
|
// below it can be considered "replies".
|
||||||
ThreadFirstReply bool
|
ThreadFirstReply bool
|
||||||
|
|
||||||
|
// Sorted slice of StatusEdit times for
|
||||||
|
// this status, from latest to oldest.
|
||||||
|
// Only set if status has been edited.
|
||||||
|
// Last entry is always creation time.
|
||||||
|
EditTimeline []string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -1217,6 +1217,31 @@ func (c *Converter) StatusToWebStatus(
|
||||||
// Mark local.
|
// Mark local.
|
||||||
webStatus.Local = *s.Local
|
webStatus.Local = *s.Local
|
||||||
|
|
||||||
|
// Get edit history for this status.
|
||||||
|
if webStatus.EditedAt != nil {
|
||||||
|
if len(s.Edits) != len(s.EditIDs) {
|
||||||
|
s.Edits, err = c.state.DB.GetStatusEditsByIDs(ctx, s.EditIDs)
|
||||||
|
if err != nil && !errors.Is(err, db.ErrNoEntries) {
|
||||||
|
err := gtserror.Newf("db error getting status edits: %w", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, edit := range s.Edits {
|
||||||
|
webStatus.EditTimeline = append(
|
||||||
|
webStatus.EditTimeline,
|
||||||
|
util.FormatISO8601(edit.CreatedAt),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
webStatus.EditTimeline = append(
|
||||||
|
webStatus.EditTimeline,
|
||||||
|
*webStatus.EditedAt,
|
||||||
|
)
|
||||||
|
|
||||||
|
slices.Reverse(webStatus.EditTimeline)
|
||||||
|
}
|
||||||
|
|
||||||
// Set additional templating
|
// Set additional templating
|
||||||
// variables on media attachments.
|
// variables on media attachments.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,31 @@ blockquote {
|
||||||
border-right: 1px solid #001ea0;
|
border-right: 1px solid #001ea0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Status info dropdown button */
|
||||||
|
.status .status-info .status-stats details.stats-more-info > summary {
|
||||||
|
color: var(--button-fg);
|
||||||
|
background: var(--ecks-pee-start-button);
|
||||||
|
border-left: 1px solid var(--ecks-pee-darkest-green);
|
||||||
|
border-right: 1px solid var(--ecks-pee-darkest-green);
|
||||||
|
}
|
||||||
|
.status .status-info .status-stats details.stats-more-info > summary:hover {
|
||||||
|
outline: 0;
|
||||||
|
background: var(--ecks-pee-light-green);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Status info dropdown content */
|
||||||
|
.status .status-info .status-stats .stats-more-info-content,
|
||||||
|
.status.expanded .status-info .status-stats .stats-more-info-content {
|
||||||
|
color: black;
|
||||||
|
text-shadow: none;
|
||||||
|
background: var(--ecks-pee-beige);
|
||||||
|
border: 0.2rem outset var(--ecks-pee-darker-beige);
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
.status .status-info .status-stats .stats-item.edit-timeline {
|
||||||
|
border-top: var(--ecks-pee-dotted-trim);
|
||||||
|
}
|
||||||
|
|
||||||
/* Button stuff */
|
/* Button stuff */
|
||||||
button, .button {
|
button, .button {
|
||||||
border-left: 1px solid var(--ecks-pee-darkest-green);
|
border-left: 1px solid var(--ecks-pee-darkest-green);
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,26 @@ html, body {
|
||||||
background: black;
|
background: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Status info dropdown button */
|
||||||
|
.status .status-info .status-stats details.stats-more-info > summary {
|
||||||
|
color: var(--button-fg);
|
||||||
|
background: var(--button-bg);
|
||||||
|
}
|
||||||
|
.status .status-info .status-stats details.stats-more-info > summary:hover {
|
||||||
|
outline: 0;
|
||||||
|
background: var(--button-hover-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Status info dropdown content */
|
||||||
|
.status.expanded .status-info .status-stats .stats-more-info-content,
|
||||||
|
.status .status-info .status-stats .stats-more-info-content {
|
||||||
|
background-color: black;
|
||||||
|
border: 0.25rem solid var(--magenta);
|
||||||
|
}
|
||||||
|
.status .status-info .status-stats .stats-item.edit-timeline {
|
||||||
|
border-top: 0.15rem dotted var(--acid-green);
|
||||||
|
}
|
||||||
|
|
||||||
/* Back + next links */
|
/* Back + next links */
|
||||||
.backnextlinks {
|
.backnextlinks {
|
||||||
background: var(--gray1);
|
background: var(--gray1);
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,12 @@ blockquote {
|
||||||
background: var(--outer-space);
|
background: var(--outer-space);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Status info dropdown content */
|
||||||
|
.status.expanded .status-info .status-stats .stats-more-info-content,
|
||||||
|
.status .status-info .status-stats .stats-more-info-content {
|
||||||
|
background: var(--outer-space);
|
||||||
|
}
|
||||||
|
|
||||||
/* Make show more/less buttons more legible */
|
/* Make show more/less buttons more legible */
|
||||||
.status .button {
|
.status .button {
|
||||||
border: 1px solid var(--feral-orange);
|
border: 1px solid var(--feral-orange);
|
||||||
|
|
|
||||||
|
|
@ -142,3 +142,9 @@ code, code[class*="language-"] {
|
||||||
blockquote {
|
blockquote {
|
||||||
background-color: var(--soft-lilac-translucent);
|
background-color: var(--soft-lilac-translucent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Status info dropdown content */
|
||||||
|
.status.expanded .status-info .status-stats .stats-more-info-content,
|
||||||
|
.status .status-info .status-stats .stats-more-info-content {
|
||||||
|
background: var(--soft-pink);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
|
|
||||||
.text-spoiler > summary, .text {
|
.text-spoiler > summary, .text {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-spoiler > summary {
|
.text-spoiler > summary {
|
||||||
|
|
@ -264,8 +264,10 @@
|
||||||
.stats-more-info-content {
|
.stats-more-info-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats-grouping {
|
||||||
column-gap: 1rem;
|
column-gap: 1rem;
|
||||||
row-gap: 0.25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-item {
|
.stats-item {
|
||||||
|
|
@ -279,6 +281,15 @@
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
|
||||||
& > summary {
|
& > summary {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Make it easy to touch.
|
||||||
|
*/
|
||||||
|
width: 3rem;
|
||||||
|
height: 2rem;
|
||||||
|
margin: -0.25rem -0.5rem;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Remove details/summary
|
Remove details/summary
|
||||||
arrow and use our own.
|
arrow and use our own.
|
||||||
|
|
@ -297,16 +308,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Normalize width and
|
Normalize fa
|
||||||
alignment of fa icons.
|
icon alignment.
|
||||||
*/
|
*/
|
||||||
|
align-items: center;
|
||||||
i.fa {
|
i.fa {
|
||||||
width: 2rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: $br-inner;
|
border-radius: $br-inner;
|
||||||
|
|
@ -342,8 +350,11 @@
|
||||||
.stats-more-info-content {
|
.stats-more-info-content {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
z-index: 3;
|
||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
row-gap: 0.5rem;
|
||||||
|
|
||||||
background: $status-info-bg;
|
background: $status-info-bg;
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
|
|
@ -351,42 +362,39 @@
|
||||||
box-shadow: $boxshadow;
|
box-shadow: $boxshadow;
|
||||||
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
|
.stats-grouping {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-item.published-at dd time.dt-published {
|
.stats-item.published-at dd time.dt-published {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-item:not(.published-at):not(.edited-at) {
|
.stats-item:not(.published-at):not(.edit-timeline) {
|
||||||
z-index: 1;
|
z-index: 2;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stats-item.edit-timeline {
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
border-top: $boxshadow-border;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
|
||||||
|
dd {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grid-column: span 3;
|
grid-column: span 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-link {
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
text-indent: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
z-index: 0;
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
/*
|
|
||||||
Inset focus to compensate for themes where
|
|
||||||
statuses have a really thick border.
|
|
||||||
*/
|
|
||||||
outline-offset: -0.25rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
/* top left, top right */
|
/* top left, top right */
|
||||||
border-top-left-radius: $br;
|
border-top-left-radius: $br;
|
||||||
|
|
|
||||||
|
|
@ -90,27 +90,7 @@ media photoswipe-gallery {{ (len .) | oddOrEven }} {{ if eq (len .) 1 }}single{{
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
<aside class="status-info" aria-hidden="true">
|
<aside class="status-info">
|
||||||
{{- include "status_info.tmpl" . | indent 1 }}
|
{{- include "status_info.tmpl" . | indent 1 }}
|
||||||
</aside>
|
</aside>
|
||||||
{{- if .Local }}
|
|
||||||
<a
|
|
||||||
href="{{- .URL -}}"
|
|
||||||
class="status-link u-url"
|
|
||||||
data-nosnippet
|
|
||||||
title="Open thread at this post"
|
|
||||||
>
|
|
||||||
Open thread at this post
|
|
||||||
</a>
|
|
||||||
{{- else }}
|
|
||||||
<a
|
|
||||||
href="{{- .URL -}}"
|
|
||||||
class="status-link u-url"
|
|
||||||
data-nosnippet
|
|
||||||
rel="nofollow noreferrer noopener" target="_blank"
|
|
||||||
title="Open remote post (opens in a new window)"
|
|
||||||
>
|
|
||||||
Open remote post (opens in a new window)
|
|
||||||
</a>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
@ -38,8 +38,8 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- with . }}
|
{{- with . }}
|
||||||
<dl class="status-stats">
|
<div class="status-stats">
|
||||||
<div class="stats-grouping">
|
<dl class="stats-grouping">
|
||||||
<div class="stats-item visibility-level" title="{{- template "visibility_title" . -}}">
|
<div class="stats-item visibility-level" title="{{- template "visibility_title" . -}}">
|
||||||
<dt class="sr-only">Visibility</dt>
|
<dt class="sr-only">Visibility</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
@ -50,7 +50,26 @@
|
||||||
<div class="stats-item published-at text-cutoff">
|
<div class="stats-item published-at text-cutoff">
|
||||||
<dt class="sr-only">Published</dt>
|
<dt class="sr-only">Published</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<time class="dt-published" datetime="{{- .CreatedAt -}}">{{- .CreatedAt | timestampPrecise -}}</time>{{- if .EditedAt }}*{{- end }}
|
{{- if .Local }}
|
||||||
|
<a
|
||||||
|
href="{{- .URL -}}"
|
||||||
|
class="u-url"
|
||||||
|
data-nosnippet
|
||||||
|
title="Open thread at this post"
|
||||||
|
>
|
||||||
|
<time class="dt-published" datetime="{{- .CreatedAt -}}">{{- .CreatedAt | timestampPrecise -}}</time>{{- if .EditedAt }}*{{- end }}
|
||||||
|
</a>
|
||||||
|
{{- else }}
|
||||||
|
<a
|
||||||
|
href="{{- .URL -}}"
|
||||||
|
class="u-url"
|
||||||
|
data-nosnippet
|
||||||
|
rel="nofollow noreferrer noopener" target="_blank"
|
||||||
|
title="Open remote post (opens in a new window)"
|
||||||
|
>
|
||||||
|
<time class="dt-published" datetime="{{- .CreatedAt -}}">{{- .CreatedAt | timestampPrecise -}}</time>{{- if .EditedAt }}*{{- end }}
|
||||||
|
</a>
|
||||||
|
{{- end }}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{{- if .Pinned }}
|
{{- if .Pinned }}
|
||||||
|
|
@ -63,24 +82,25 @@
|
||||||
</div>
|
</div>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</dl>
|
||||||
<details class="stats-more-info">
|
<details class="stats-more-info">
|
||||||
<summary title="More info">
|
<summary title="More info">
|
||||||
|
<i class="fa fa-fw fa-info" aria-hidden="true"></i>
|
||||||
<span class="sr-only">More info</span>
|
<span class="sr-only">More info</span>
|
||||||
<i class="fa fa-chevron-right show" aria-hidden="true"></i>
|
<i class="fa fa-fw fa-chevron-right show" aria-hidden="true"></i>
|
||||||
<i class="fa fa-chevron-down hide" aria-hidden="true"></i>
|
<i class="fa fa-fw fa-chevron-down hide" aria-hidden="true"></i>
|
||||||
</summary>
|
</summary>
|
||||||
<div class="stats-more-info-content">
|
<dl class="stats-more-info-content">
|
||||||
<div class="stats-grouping">
|
<div class="stats-grouping">
|
||||||
{{- if .LanguageTag.DisplayStr }}
|
{{- if .LanguageTag.DisplayStr }}
|
||||||
<div class="stats-item" title="{{ .LanguageTag.DisplayStr }}">
|
<div class="stats-item" title="Language">
|
||||||
<dt>
|
<dt>
|
||||||
<span class="sr-only">Language</span>
|
<span class="sr-only">Language</span>
|
||||||
<i class="fa fa-language" aria-hidden="true"></i>
|
<i class="fa fa-language" aria-hidden="true"></i>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<span class="sr-only">{{ .LanguageTag.DisplayStr }}</span>
|
<span class="sr-only">{{ .LanguageTag.DisplayStr -}}</span>
|
||||||
<span aria-hidden="true">{{- .LanguageTag.TagStr -}}</span>
|
<span aria-hidden="true" title="{{- .LanguageTag.DisplayStr -}}">{{- .LanguageTag.TagStr -}}</span>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
|
|
@ -107,18 +127,27 @@
|
||||||
<dd>{{- .ReblogsCount -}}</dd>
|
<dd>{{- .ReblogsCount -}}</dd>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{- if .EditedAt -}}
|
{{- if and .EditedAt (gt (len .EditTimeline) 1) -}}
|
||||||
<div class="stats-item edited-at text-cutoff" title="Edited {{ .EditedAt -}}">
|
<div class="stats-item edit-timeline text-cutoff">
|
||||||
<dt>
|
<dt>Edit timeline:</dt>
|
||||||
|
{{- range $index, $edited := .EditTimeline }}
|
||||||
|
{{- if not (eq $index (add (len $.EditTimeline) -1)) }}
|
||||||
|
<dd class="text-cutoff" title="Edited {{ $edited -}}">
|
||||||
<span class="sr-only">Edited</span>
|
<span class="sr-only">Edited</span>
|
||||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
<i class="fa fa-asterisk" aria-hidden="true"></i>
|
||||||
</dt>
|
<time datetime="{{- $edited -}}">{{- $edited | timestampPrecise -}}</time>
|
||||||
<dd class="text-cutoff">
|
|
||||||
<time class="dt-updated" datetime="{{- .EditedAt -}}">{{- .EditedAt | timestampPrecise -}}</time>
|
|
||||||
</dd>
|
</dd>
|
||||||
|
{{- else }}
|
||||||
|
<dd class="text-cutoff" title="Published {{ $.CreatedAt -}}">
|
||||||
|
<span class="sr-only">Published</span>
|
||||||
|
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||||
|
<time datetime="{{- $.CreatedAt -}}">{{- $.CreatedAt | timestampPrecise -}}</time>
|
||||||
|
</dd>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</dl>
|
||||||
</details>
|
</details>
|
||||||
</dl>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue