summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-04-14 11:18:18 +0200
committerLibravatar GitHub <noreply@github.com>2025-04-14 10:18:18 +0100
commit6ff0d3355c487dbdc13403ec32f5e587c7f93073 (patch)
treee4a85a079ec0ca6843489ef86043e381297b137b
parent[chore]: Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0 (#4003) (diff)
downloadgotosocial-6ff0d3355c487dbdc13403ec32f5e587c7f93073.tar.xz
[feature/frontend] Add visibility icon for posts (#4005)
-rw-r--r--web/source/css/status.css4
-rw-r--r--web/template/status_info.tmpl29
2 files changed, 32 insertions, 1 deletions
diff --git a/web/source/css/status.css b/web/source/css/status.css
index 6f2c458f4..91665cd45 100644
--- a/web/source/css/status.css
+++ b/web/source/css/status.css
@@ -275,6 +275,10 @@
gap: 0.4rem;
}
+ .stats-item.published-at {
+ text-decoration: underline;
+ }
+
.stats-item:not(.published-at):not(.edited-at) {
z-index: 1;
user-select: none;
diff --git a/web/template/status_info.tmpl b/web/template/status_info.tmpl
index 194a799f5..5d26811d7 100644
--- a/web/template/status_info.tmpl
+++ b/web/template/status_info.tmpl
@@ -17,9 +17,36 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ -}}
+{{- define "visibility_icon" -}}
+ {{- if eq .Visibility "public" -}}
+ globe
+ {{- else if eq .Visibility "unlisted" -}}
+ unlock
+ {{- else -}}
+ question
+ {{- end -}}
+{{- end -}}
+
+{{- define "visibility_title" -}}
+ {{- if eq .Visibility "public" -}}
+ Public
+ {{- else if eq .Visibility "unlisted" -}}
+ Unlisted
+ {{- else -}}
+ Unknown
+ {{- end -}}
+{{- end -}}
+
{{- with . }}
<dl class="status-stats">
<div class="stats-grouping">
+ <div class="stats-item visibility-level" title="{{- template "visibility_title" . -}}">
+ <dt class="sr-only">Visibility</dt>
+ <dd>
+ <i class="fa fa-{{- template "visibility_icon" . -}}" aria-hidden="true"></i>
+ <span class="sr-only">{{- template "visibility_title" . -}}</span>
+ </dd>
+ </div>
<div class="stats-item published-at text-cutoff">
<dt class="sr-only">Published</dt>
<dd>
@@ -30,7 +57,7 @@
<div class="stats-item edited-at text-cutoff">
<dt class="sr-only">Edited</dt>
<dd>
- (edited <time class="dt-updated" datetime="{{- .EditedAt -}}">{{- .EditedAt | timestampPrecise -}}</time>)
+ edited <time class="dt-updated" datetime="{{- .EditedAt -}}">{{- .EditedAt | timestampPrecise -}}</time>
</dd>
</div>
{{ end }}