2022-08-14 21:40:57 +00:00
|
|
|
{{define "title"}}My Dashboard{{end}}
|
2022-08-10 05:10:47 +00:00
|
|
|
{{define "content"}}
|
|
|
|
<div class="container">
|
|
|
|
<section class="hero is-info is-bold">
|
|
|
|
<div class="hero-body">
|
|
|
|
<div class="container">
|
|
|
|
<h1 class="title">User Dashboard</h1>
|
|
|
|
<h2 class="subtitle">to your account</h2>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<div class="block p-4">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
2022-08-13 22:39:31 +00:00
|
|
|
<!-- Onboarding Checklist -->
|
|
|
|
{{if or (not .CurrentUser.Certified) (not .CurrentUser.ProfilePhoto.ID)}}
|
|
|
|
<div class="card block">
|
|
|
|
<header class="card-header has-background-danger">
|
|
|
|
<p class="card-header-title has-text-light">
|
|
|
|
<span class="icon"><i class="fa fa-check"></i></span>
|
|
|
|
<span>Onboarding Checklist</span>
|
|
|
|
</p>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="card-content">
|
|
|
|
<p class="block">
|
|
|
|
You're almost there! Please review the following checklist items to gain
|
|
|
|
full access to this website. Members are expected to have a face picture
|
|
|
|
as their default Profile Pic and upload a Verification Photo to become
|
|
|
|
certified as being a real person.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<ul class="menu-list block">
|
|
|
|
<li>
|
|
|
|
<a href="/photo/upload?intent=profile_pic">
|
|
|
|
{{if .CurrentUser.ProfilePhoto.ID}}
|
|
|
|
<span class="icon"><i class="fa fa-circle-check has-text-success"></i></span>
|
|
|
|
{{else}}
|
|
|
|
<span class="icon"><i class="fa fa-circle has-text-danger"></i></span>
|
|
|
|
{{end}}
|
|
|
|
<span>
|
|
|
|
Add a Profile Picture
|
|
|
|
{{if not .CurrentUser.ProfilePhoto.ID}}
|
|
|
|
<span class="icon"><i class="fa fa-external-link"></i></span>
|
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<a href="/photo/certification">
|
|
|
|
{{if .CurrentUser.Certified}}
|
|
|
|
<span class="icon"><i class="fa fa-circle-check has-text-success"></i></span>
|
|
|
|
{{else}}
|
|
|
|
<span class="icon"><i class="fa fa-circle has-text-danger"></i></span>
|
|
|
|
{{end}}
|
|
|
|
<span>
|
|
|
|
Get certified by uploading a verification selfie
|
|
|
|
{{if not .CurrentUser.Certified}}
|
|
|
|
<span class="icon"><i class="fa fa-external-link"></i></span>
|
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2023-02-14 06:19:18 +00:00
|
|
|
<!-- "Very Private" Restricted Account warning for certified users -->
|
|
|
|
{{if and .CurrentUser.Certified .IsShyUser}}
|
|
|
|
<div class="card block">
|
|
|
|
<header class="card-header has-background-danger">
|
|
|
|
<p class="card-header-title has-text-light">
|
|
|
|
<span class="icon"><i class="fa fa-exclamation-triangle"></i></span>
|
|
|
|
<span>Your profile page is too private</span>
|
|
|
|
</p>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="card-content">
|
|
|
|
<p class="block">
|
|
|
|
You are considered to be a <strong>Shy Account</strong> because your profile and
|
|
|
|
photos are all set to Private or Friends-only visibility, so that to other members
|
|
|
|
of {{PrettyTitle}} you appear like a blank, faceless profile.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="block">
|
|
|
|
While in this restricted state, you are grouped into a cohort with other members who
|
|
|
|
are as shy as you are and have limited contact options to connect with our other,
|
|
|
|
{{PrettyTitle}} members who are sharing their nudes on public.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="block">
|
|
|
|
<a href="/faq#shy-faqs">Click here to learn more</a> about your Shy Account. To
|
|
|
|
remedy this, please see the following steps:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<ul class="menu-list block">
|
|
|
|
<li>
|
|
|
|
<a href="/settings">
|
|
|
|
{{if eq .CurrentUser.Visibility "public"}}
|
|
|
|
<span class="icon"><i class="fa fa-circle-check has-text-success"></i></span>
|
|
|
|
{{else}}
|
|
|
|
<span class="icon"><i class="fa fa-circle has-text-danger"></i></span>
|
|
|
|
{{end}}
|
|
|
|
<span>
|
|
|
|
Have your profile visibility set to <strong>Public</strong>.
|
|
|
|
{{if not (eq .CurrentUser.Visibility "public")}}
|
|
|
|
<span class="icon"><i class="fa fa-external-link"></i></span>
|
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<a href="/photo/u/{{.CurrentUser.Username}}">
|
|
|
|
{{if .HasPublicPhoto}}
|
|
|
|
<span class="icon"><i class="fa fa-circle-check has-text-success"></i></span>
|
|
|
|
{{else}}
|
|
|
|
<span class="icon"><i class="fa fa-circle has-text-danger"></i></span>
|
|
|
|
{{end}}
|
|
|
|
<span>
|
|
|
|
Have at least one <strong>Public</strong> photo on your profile.
|
|
|
|
{{if not .HasPublicPhoto}}
|
|
|
|
<span class="icon"><i class="fa fa-external-link"></i></span>
|
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2023-08-20 04:09:23 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2023-09-19 00:22:50 +00:00
|
|
|
<!-- New Feature: Two Factor Auth -->
|
|
|
|
{{if not .TwoFactorEnabled}}
|
2023-08-20 04:09:23 +00:00
|
|
|
<div class="card block">
|
|
|
|
<header class="card-header has-background-success-dark">
|
|
|
|
<p class="card-header-title has-text-light">
|
|
|
|
<i class="fa fa-gift mr-2"></i>
|
2023-09-19 00:22:50 +00:00
|
|
|
New Feature: Two-Factor Authentication
|
2023-08-20 04:09:23 +00:00
|
|
|
</p>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="card-content">
|
|
|
|
<p class="block">
|
2023-09-19 00:22:50 +00:00
|
|
|
We've recently added a new security feature you can use to better protect your account:
|
|
|
|
<strong>Two-Factor Authentication (2FA)!</strong>
|
2023-08-20 04:09:23 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="block">
|
2023-09-19 00:22:50 +00:00
|
|
|
This feature can help protect your account in case somebody finds out your password. When
|
|
|
|
enabled, you can use an authenticator app (such as Google Authenticator or Authy) to generate
|
|
|
|
a one-time use passcode to log in to your account.
|
2023-08-20 04:09:23 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="block">
|
2023-09-19 00:22:50 +00:00
|
|
|
If interested, see your <a href="/account/two-factor/setup">Two Factor Auth</a> settings
|
|
|
|
page to get started! This message will disappear after you have enrolled in 2FA, or after
|
|
|
|
a few weeks when enough people have had a chance to learn about the new feature.
|
2023-08-20 04:09:23 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
2023-02-14 06:19:18 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2022-08-13 22:39:31 +00:00
|
|
|
<div class="card block">
|
2022-08-10 05:10:47 +00:00
|
|
|
<header class="card-header has-background-link">
|
|
|
|
<p class="card-header-title has-text-light">My Account</p>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="card-content">
|
|
|
|
<ul class="menu-list">
|
2022-08-13 06:11:36 +00:00
|
|
|
<li>
|
|
|
|
<a href="/u/{{.CurrentUser.Username}}">
|
|
|
|
<span class="icon"><i class="fa fa-user"></i></span>
|
|
|
|
My Profile
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="/photo/u/{{.CurrentUser.Username}}">
|
|
|
|
<span class="icon"><i class="fa fa-image"></i></span>
|
|
|
|
My Photos
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="/photo/upload">
|
|
|
|
<span class="icon"><i class="fa fa-upload"></i></span>
|
|
|
|
Upload Photos
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-09-08 04:18:54 +00:00
|
|
|
<li>
|
|
|
|
<a href="/photo/private">
|
|
|
|
<span class="icon"><i class="fa fa-eye"></i></span>
|
|
|
|
Manage Private Photos
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-08-13 06:11:36 +00:00
|
|
|
<li>
|
|
|
|
<a href="/settings">
|
|
|
|
<span class="icon"><i class="fa fa-edit"></i></span>
|
|
|
|
Edit Profile & Settings
|
|
|
|
</a>
|
|
|
|
</li>
|
2023-05-24 22:02:45 +00:00
|
|
|
{{if .CurrentUser.IsInnerCircle}}
|
2023-05-24 05:40:06 +00:00
|
|
|
<li>
|
|
|
|
<a href="/inner-circle">
|
|
|
|
<span class="icon"><img src="/static/img/circle-16.png"></span>
|
|
|
|
{{PrettyCircle}}
|
|
|
|
</a>
|
|
|
|
</li>
|
2023-05-24 22:02:45 +00:00
|
|
|
{{end}}
|
2022-08-14 00:42:42 +00:00
|
|
|
<li>
|
|
|
|
<a href="/photo/certification">
|
|
|
|
<span class="icon"><i class="fa fa-certificate"></i></span>
|
|
|
|
Certification Photo
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-08-15 00:45:55 +00:00
|
|
|
<li>
|
|
|
|
<a href="/users/blocked">
|
|
|
|
<span class="icon"><i class="fa fa-hand"></i></span>
|
|
|
|
Blocked Users
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-08-13 06:11:36 +00:00
|
|
|
<li>
|
|
|
|
<a href="/logout">
|
|
|
|
<span class="icon"><i class="fa fa-arrow-right-from-bracket"></i></span>
|
|
|
|
Log out
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-08-14 23:27:57 +00:00
|
|
|
{{if .SessionImpersonated}}
|
|
|
|
<li>
|
|
|
|
<a href="/admin/unimpersonate" class="has-text-danger">
|
|
|
|
<span class="icon"><i class="fa fa-ghost"></i></span>
|
|
|
|
<span>Unimpersonate</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{{end}}
|
2022-08-13 06:11:36 +00:00
|
|
|
<li>
|
2023-10-22 22:02:24 +00:00
|
|
|
<a href="/settings#deactivate">
|
2022-08-13 06:11:36 +00:00
|
|
|
<span class="icon"><i class="fa fa-trash"></i></span>
|
|
|
|
Delete account
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-08-10 05:10:47 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-25 04:17:34 +00:00
|
|
|
{{$Root := .}}
|
|
|
|
|
2022-08-10 05:10:47 +00:00
|
|
|
<div class="column">
|
2022-08-25 04:17:34 +00:00
|
|
|
<div class="card" id="notifications">
|
2022-08-10 05:10:47 +00:00
|
|
|
<header class="card-header has-background-warning">
|
2022-09-01 05:58:32 +00:00
|
|
|
<p class="card-header-title has-text-dark-dark">Notifications</p>
|
2022-08-10 05:10:47 +00:00
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="card-content">
|
2023-08-05 01:54:04 +00:00
|
|
|
<!-- Notifications header row: tablets on upwards -->
|
|
|
|
<div class="is-hidden-mobile">
|
|
|
|
<form method="POST" action="{{.Request.URL.Path}}">
|
|
|
|
{{InputCSRF}}
|
|
|
|
<div class="columns mb-2">
|
|
|
|
<div class="column">
|
|
|
|
{{if gt .NavUnreadNotifications 0}}
|
|
|
|
{{.NavUnreadNotifications}} unread notification{{Pluralize64 .NavUnreadNotifications}}.
|
|
|
|
{{else}}
|
|
|
|
No unread notifications.
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="column is-narrow has-text-right">
|
|
|
|
<button type="submit" name="intent" value="clear-all"
|
|
|
|
class="button is-danger is-light is-small"
|
2023-08-05 02:41:14 +00:00
|
|
|
onclick="return window.confirm('Are you sure you want to REMOVE all notifications?')"
|
|
|
|
title="Remove all notifications from your feed">
|
2023-08-05 01:54:04 +00:00
|
|
|
<i class="fa fa-xmark mr-1"></i>
|
|
|
|
Clear all
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<button type="submit" name="intent" value="read-notifications"
|
|
|
|
class="button is-link is-light is-small">
|
|
|
|
<i class="fa fa-check mr-1"></i>
|
|
|
|
Mark all as read
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Notifications header: for mobiles only version -->
|
|
|
|
<div class="is-hidden-tablet">
|
|
|
|
<p>
|
2022-08-25 04:17:34 +00:00
|
|
|
{{if gt .NavUnreadNotifications 0}}
|
|
|
|
{{.NavUnreadNotifications}} unread notification{{Pluralize64 .NavUnreadNotifications}}.
|
|
|
|
{{else}}
|
|
|
|
No unread notifications.
|
|
|
|
{{end}}
|
2023-08-05 01:54:04 +00:00
|
|
|
</p>
|
|
|
|
<form method="POST" action="{{.Request.URL.Path}}">
|
|
|
|
{{InputCSRF}}
|
|
|
|
<div class="my-2 has-text-right">
|
|
|
|
<button type="submit" name="intent" value="clear-all"
|
|
|
|
class="button is-danger is-light is-small"
|
|
|
|
onclick="return window.confirm('Are you sure you want to REMOVE all notifications?')">
|
|
|
|
<i class="fa fa-xmark mr-1"></i>
|
|
|
|
Clear all
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<button type="submit" name="intent" value="read-notifications"
|
|
|
|
class="button is-link is-light is-small">
|
|
|
|
<i class="fa fa-check mr-1"></i>
|
|
|
|
Mark all as read
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<hr>
|
2022-08-25 04:17:34 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<table class="table is-striped is-fullwidth is-hoverable">
|
|
|
|
<tbody>
|
|
|
|
{{range .Notifications}}
|
|
|
|
{{$Body := $Root.NotifMap.Get .ID}}
|
|
|
|
<tr>
|
|
|
|
<td class="nonshy-notification-row" data-notification-id="{{.ID}}">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column is-narrow has-text-centered">
|
|
|
|
{{if not .Read}}
|
|
|
|
<div class="mb-2 nonshy-notification-new">
|
|
|
|
<strong class="tag is-success">NEW!</strong>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2022-08-26 03:36:59 +00:00
|
|
|
<a href="/u/{{.AboutUser.Username}}">
|
2022-09-09 04:42:20 +00:00
|
|
|
{{template "avatar-48x48" .AboutUser}}
|
2022-08-25 04:17:34 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="column">
|
|
|
|
<div class="mb-1">
|
|
|
|
{{if eq .Type "like"}}
|
|
|
|
<span class="icon"><i class="fa fa-heart has-text-danger"></i></span>
|
|
|
|
<span>
|
2022-08-26 03:36:59 +00:00
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
2022-08-25 04:17:34 +00:00
|
|
|
liked your
|
|
|
|
{{if eq .TableName "photos"}}
|
2022-08-27 02:50:33 +00:00
|
|
|
{{if $Body.Photo}}
|
|
|
|
<a href="/photo/view?id={{$Body.Photo.ID}}">photo</a>.
|
|
|
|
{{else}}
|
|
|
|
photo.
|
|
|
|
{{end}}
|
2022-08-25 04:17:34 +00:00
|
|
|
{{else if eq .TableName "users"}}
|
|
|
|
profile page.
|
2022-08-30 03:00:15 +00:00
|
|
|
{{else if eq .TableName "comments"}}
|
|
|
|
{{if .Link}}
|
|
|
|
<a href="{{.Link}}">comment</a>:
|
|
|
|
{{else}}
|
|
|
|
comment.
|
|
|
|
{{end}}
|
2022-08-25 04:17:34 +00:00
|
|
|
{{else}}
|
|
|
|
{{.TableName}}.
|
|
|
|
{{end}}
|
|
|
|
</span>
|
2022-08-27 02:50:33 +00:00
|
|
|
{{else if eq .Type "comment"}}
|
|
|
|
<span class="icon"><i class="fa fa-comment has-text-success"></i></span>
|
|
|
|
<span>
|
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
|
|
|
commented on your
|
|
|
|
<a href="{{.Link}}">
|
|
|
|
{{if eq .TableName "photos"}}
|
|
|
|
photo:
|
|
|
|
{{else}}
|
|
|
|
{{.TableName}}:
|
|
|
|
{{end}}
|
|
|
|
</a>
|
|
|
|
</span>
|
2022-08-27 18:42:48 +00:00
|
|
|
{{else if eq .Type "also_comment"}}
|
|
|
|
<span class="icon"><i class="fa fa-comment has-text-success"></i></span>
|
|
|
|
<span>
|
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
|
|
|
also commented on a
|
|
|
|
<a href="{{.Link}}">
|
|
|
|
{{if eq .TableName "photos"}}
|
|
|
|
photo
|
|
|
|
{{else}}
|
|
|
|
{{.TableName}}
|
|
|
|
{{end}}
|
|
|
|
</a>
|
|
|
|
that you replied to:
|
|
|
|
</span>
|
|
|
|
{{else if eq .Type "also_posted"}}
|
|
|
|
<span class="icon"><i class="fa fa-comments has-text-success"></i></span>
|
|
|
|
<span>
|
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
|
|
|
replied to <a href="{{.Link}}">a forum thread</a> that you follow:
|
|
|
|
</span>
|
2022-08-26 03:36:59 +00:00
|
|
|
{{else if eq .Type "friendship_approved"}}
|
2022-08-27 02:50:33 +00:00
|
|
|
<span class="icon"><i class="fa fa-user-group has-text-success"></i></span>
|
2022-08-26 03:36:59 +00:00
|
|
|
<span>
|
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
|
|
|
accepted your friend request!
|
|
|
|
</span>
|
2022-09-08 04:18:54 +00:00
|
|
|
{{else if eq .Type "private_photo"}}
|
|
|
|
<span class="icon"><i class="fa fa-unlock has-text-private"></i></span>
|
|
|
|
<span>
|
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
|
|
|
has granted you access to see their
|
|
|
|
<a href="{{.Link}}" class="has-text-private">private photos</a>!
|
|
|
|
</span>
|
2023-03-17 03:04:43 +00:00
|
|
|
{{else if eq .Type "new_photo"}}
|
|
|
|
<span class="icon">
|
|
|
|
{{if and $Body.Photo (eq $Body.Photo.Visibility "private")}}
|
|
|
|
<i class="fa fa-eye has-text-private"></i>
|
2023-05-24 03:04:17 +00:00
|
|
|
{{else if and $Body.Photo (eq $Body.Photo.Visibility "circle")}}
|
|
|
|
<img src="/static/img/circle-16.png">
|
2023-03-17 03:04:43 +00:00
|
|
|
{{else}}
|
|
|
|
<i class="fa fa-image has-text-link"></i>
|
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<a href="/u/{{.AboutUser.Username}}"><strong>{{.AboutUser.Username}}</strong></a>
|
|
|
|
has uploaded a new
|
|
|
|
{{if and $Body.Photo (eq $Body.Photo.Visibility "private")}}
|
|
|
|
<span class="has-text-private">private photo!</span>
|
|
|
|
{{else}}
|
|
|
|
photo!
|
|
|
|
{{end}}
|
|
|
|
</span>
|
2022-08-26 03:36:59 +00:00
|
|
|
{{else if eq .Type "cert_approved"}}
|
|
|
|
<span class="icon"><i class="fa fa-certificate has-text-success"></i></span>
|
|
|
|
<span>
|
|
|
|
Your <strong>certification photo</strong> was approved!
|
|
|
|
</span>
|
|
|
|
{{else if eq .Type "cert_rejected"}}
|
|
|
|
<span class="icon"><i class="fa fa-certificate has-text-danger"></i></span>
|
|
|
|
<span>
|
|
|
|
Your <strong>certification photo</strong> was rejected!
|
|
|
|
</span>
|
2023-05-24 03:04:17 +00:00
|
|
|
{{else if eq .Type "inner_circle"}}
|
|
|
|
<span class="icon"><img src="/static/img/circle-16.png"></span>
|
|
|
|
<span>
|
|
|
|
You have been added to the {{PrettyCircle}} of nonshy.
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="block content mt-2">
|
|
|
|
<a href="/inner-circle">Click to learn more</a> about the inner circle.
|
|
|
|
</div>
|
2022-08-25 04:17:34 +00:00
|
|
|
{{else}}
|
2022-08-26 03:36:59 +00:00
|
|
|
{{.AboutUser.Username}} {{.Type}} {{.TableName}} {{.TableID}}
|
2022-08-25 04:17:34 +00:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
2022-08-26 03:36:59 +00:00
|
|
|
<!-- Attached message? -->
|
|
|
|
{{if .Message}}
|
2022-08-27 02:50:33 +00:00
|
|
|
<div class="block content mb-1">
|
2022-08-27 18:42:48 +00:00
|
|
|
<blockquote class="p-2 pl-4">{{ToMarkdown (TrimEllipses .Message 256)}}</blockquote>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<!-- Attached forum thread? -->
|
|
|
|
{{if $Body.Thread}}
|
|
|
|
<div>
|
|
|
|
On thread: <a href="{{.Link}}">{{$Body.Thread.Title}}</a>
|
2022-08-26 03:36:59 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2022-08-25 04:17:34 +00:00
|
|
|
<!-- Photo caption? -->
|
|
|
|
{{if $Body.Photo}}
|
|
|
|
<div class="block">
|
2022-08-27 02:50:33 +00:00
|
|
|
<!-- If it's a comment, have a link to view it -->
|
|
|
|
{{if eq .Type "comment"}}
|
|
|
|
<div class="is-size-7 pt-1">
|
|
|
|
<span class="icon"><i class="fa fa-arrow-right"></i></span>
|
|
|
|
<a href="{{.Link}}">See all comments</a>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<em>{{or $Body.Photo.Caption "No caption."}}</em>
|
|
|
|
{{end}}
|
2022-08-25 04:17:34 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<hr class="has-background-light mb-1">
|
|
|
|
<small title="{{.CreatedAt.Format "2006-01-02 15:04:05"}}">
|
2023-08-05 01:54:04 +00:00
|
|
|
{{SincePrettyCoarse .CreatedAt}} ago.
|
|
|
|
|
|
|
|
<!-- Delete button for just this notification -->
|
|
|
|
<button type="button"
|
|
|
|
class="button is-danger is-light is-small nonshy-notif-delete-button"
|
2023-08-05 02:41:14 +00:00
|
|
|
data-notification-id="{{.ID}}"
|
|
|
|
title="Remove this notification from your feed">
|
|
|
|
<i class="fa fa-xmark mr-1"></i> Clear
|
2023-08-05 01:54:04 +00:00
|
|
|
</button>
|
2022-08-25 04:17:34 +00:00
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Attached photo? -->
|
|
|
|
{{if $Body.PhotoID}}
|
2023-09-24 18:41:19 +00:00
|
|
|
<div class="column is-one-quarter is-clipped">
|
2023-06-26 06:09:43 +00:00
|
|
|
<!-- GIF video? -->
|
|
|
|
{{if HasSuffix $Body.Photo.Filename ".mp4"}}
|
2023-09-24 18:41:19 +00:00
|
|
|
<video loop controls
|
|
|
|
{{if BlurExplicit $Body.Photo}}class="blurred-explicit"
|
|
|
|
{{else if (not (eq ($Root.CurrentUser.GetProfileField "autoplay_gif") "false"))}}autoplay
|
|
|
|
{{end}}>
|
2023-06-26 06:09:43 +00:00
|
|
|
<source src="{{PhotoURL $Body.Photo.Filename}}" type="video/mp4">
|
|
|
|
</video>
|
2023-06-26 06:12:44 +00:00
|
|
|
<div>
|
|
|
|
<a href="/photo/view?id={{$Body.Photo.ID}}" class="is-size-7">
|
|
|
|
<i class="fa fa-arrow-right"></i> View GIF
|
|
|
|
</a>
|
|
|
|
</div>
|
2023-06-26 06:09:43 +00:00
|
|
|
{{else}}
|
2022-08-27 02:50:33 +00:00
|
|
|
<a href="/photo/view?id={{$Body.Photo.ID}}">
|
2023-09-24 18:41:19 +00:00
|
|
|
<img src="{{PhotoURL $Body.Photo.Filename}}"{{if BlurExplicit $Body.Photo}} class="blurred-explicit"{{end}}>
|
2022-08-27 02:50:33 +00:00
|
|
|
</a>
|
2023-06-26 06:09:43 +00:00
|
|
|
{{end}}
|
2022-08-25 04:17:34 +00:00
|
|
|
|
|
|
|
{{if $Body.Photo.Caption}}
|
|
|
|
<small>{{$Body.Photo.Caption}}</small>
|
|
|
|
{{else}}
|
|
|
|
<small><em>No caption.</em></small>
|
|
|
|
{{end}}
|
2023-06-16 02:06:16 +00:00
|
|
|
|
|
|
|
<!-- Like button for the photo right here -->
|
|
|
|
{{if ne $Body.Photo.UserID $Root.CurrentUser.ID}}
|
|
|
|
<div class="mt-1">
|
|
|
|
{{$Like := $Root.PhotoLikeMap.Get $Body.PhotoID}}
|
2023-06-22 01:36:42 +00:00
|
|
|
<button type="button" class="button is-small nonshy-like-button"
|
2023-06-16 02:06:16 +00:00
|
|
|
data-table-name="photos" data-table-id="{{$Body.PhotoID}}"
|
2023-06-22 01:36:42 +00:00
|
|
|
title="Like">
|
2023-06-16 02:06:16 +00:00
|
|
|
<span class="icon{{if $Like.UserLikes}} has-text-danger{{end}}"><i class="fa fa-heart"></i></span>
|
|
|
|
<span class="nonshy-likes">
|
|
|
|
Like
|
|
|
|
{{if gt $Like.Count 0}}
|
|
|
|
({{$Like.Count}})
|
|
|
|
{{end}}
|
|
|
|
</span>
|
2023-06-22 01:36:42 +00:00
|
|
|
</button>
|
2023-06-16 02:06:16 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2022-08-25 04:17:34 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
{{if .Pager.HasNext}}
|
|
|
|
<div class="has-text-centered">
|
2022-09-10 19:09:46 +00:00
|
|
|
<a href="{{.Request.URL.Path}}?{{QueryPlus "page" .Pager.Next}}" class="button">View older notifications</a>
|
2022-08-25 04:17:34 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2022-08-10 05:10:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-25 04:17:34 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// Notifications helper.
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
let busy = false;
|
|
|
|
|
2023-08-05 01:54:04 +00:00
|
|
|
// For delete buttons: if they click thru the first confirm, do not ask every single time
|
|
|
|
// for the rest of the current page load.
|
|
|
|
let dontAskAgain = false;
|
|
|
|
|
2022-08-25 04:17:34 +00:00
|
|
|
// Bind to the notification table rows.
|
|
|
|
(document.querySelectorAll(".nonshy-notification-row") || []).forEach(node => {
|
2022-09-09 04:42:20 +00:00
|
|
|
let $newBadge = node.querySelector(".nonshy-notification-new"),
|
2023-08-05 01:54:04 +00:00
|
|
|
$deleteButton = node.querySelector(".nonshy-notif-delete-button"),
|
2022-09-09 04:42:20 +00:00
|
|
|
ID = node.dataset.notificationId;
|
2022-08-25 04:17:34 +00:00
|
|
|
|
2023-08-05 01:54:04 +00:00
|
|
|
// Delete buttons for individual notifications.
|
|
|
|
$deleteButton.addEventListener("click", (e) => {
|
|
|
|
e.stopPropagation();
|
|
|
|
e.preventDefault();
|
|
|
|
if (!dontAskAgain) {
|
|
|
|
if (!window.confirm(
|
|
|
|
"Do you want to DELETE this notification?\n\nNote: If you click Ok, you will not be asked "+
|
|
|
|
"the next time you want to delete another notification until your next page reload."
|
|
|
|
)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
dontAskAgain = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
busy = true;
|
|
|
|
return fetch("/v1/notifications/delete", {
|
|
|
|
method: "POST",
|
|
|
|
mode: "same-origin",
|
|
|
|
cache: "no-cache",
|
|
|
|
credentials: "same-origin",
|
|
|
|
headers: {
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
},
|
|
|
|
body: JSON.stringify({
|
|
|
|
"id": parseInt(ID),
|
|
|
|
}),
|
|
|
|
})
|
|
|
|
.then((response) => response.json())
|
|
|
|
.then((data) => {
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
// Hide the notification row immediately.
|
|
|
|
node.style.display = 'none';
|
|
|
|
}).catch(resp => {
|
|
|
|
window.alert(resp);
|
|
|
|
}).finally(() => {
|
|
|
|
busy = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2022-09-09 04:42:20 +00:00
|
|
|
// If the notification doesn't have a "NEW!" badge, no action needed.
|
|
|
|
if ($newBadge === null) return;
|
2022-08-25 04:17:34 +00:00
|
|
|
|
2022-09-09 04:42:20 +00:00
|
|
|
// Collect any hyperlinks in this row.
|
|
|
|
let links = Array.from(node.querySelectorAll("a"));
|
|
|
|
links.push(node);
|
|
|
|
|
|
|
|
// Apply a "click" handler to the notification row as a whole, and to all of the hyperlinks in it.
|
|
|
|
// For the hyperlinks: prevent the browser following the link UNTIL the successful ajax request to
|
|
|
|
// mark the notification "read" has run.
|
|
|
|
links.forEach(link => {
|
|
|
|
link.addEventListener("click", (e) => {
|
|
|
|
if (busy) return;
|
|
|
|
|
|
|
|
// In case it's a hyperlink, grab the href.
|
|
|
|
let href = link.attributes.href;
|
|
|
|
if (href !== undefined) {
|
|
|
|
e.preventDefault();
|
|
|
|
href = href.textContent;
|
|
|
|
}
|
|
|
|
|
|
|
|
$newBadge.style.display = "none";
|
|
|
|
|
|
|
|
busy = true;
|
|
|
|
return fetch("/v1/notifications/read", {
|
|
|
|
method: "POST",
|
|
|
|
mode: "same-origin",
|
|
|
|
cache: "no-cache",
|
|
|
|
credentials: "same-origin",
|
|
|
|
headers: {
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
},
|
|
|
|
body: JSON.stringify({
|
|
|
|
"id": parseInt(ID),
|
|
|
|
}),
|
|
|
|
})
|
|
|
|
.then((response) => response.json())
|
|
|
|
.then((data) => {
|
|
|
|
console.log(data);
|
|
|
|
}).catch(resp => {
|
|
|
|
window.alert(resp);
|
|
|
|
}).finally(() => {
|
|
|
|
busy = false;
|
|
|
|
if (href !== undefined) {
|
|
|
|
window.location.href = href;
|
|
|
|
}
|
|
|
|
});
|
2022-08-25 04:17:34 +00:00
|
|
|
})
|
2023-08-05 01:54:04 +00:00
|
|
|
});
|
2022-08-25 04:17:34 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2023-06-17 00:42:28 +00:00
|
|
|
{{end}}
|