website/web/templates/photo/private.html
Noah de9ba94dd9 Private Photo Sharing
* Add ability to unlock your private photos for others.
    * Link to unlock is on another user's Photos page.
    * You can also access your "Manage Private Photos" page in the User Menu
      or Dashboard and add a user by username.
    * See who you have granted access, and see users who have granted you
      access to their private photos.
* Private photos of users who unlocked them for you may appear on the Site
  Gallery if the photo allows.
* Add new filters to the Site Gallery: you can choose to filter by Explicit,
  limit to a specific Visibility, and order by Newest or Oldest. Non-explicit
  users do not get a filter to see explicit content - they must opt-in in
  their settings.
* Bugfix: Site Gallery was not correctly filtering Explicit photos away from
  users who did not opt-in for explicit!
2022-09-07 21:18:54 -07:00

157 lines
6.8 KiB
HTML

{{define "title"}}Private Photos{{end}}
{{define "content"}}
<div class="container">
{{$Root := .}}
<section class="hero is-private is-bold">
<div class="hero-body">
<div class="container">
<h1 class="title has-text-light">
<i class="fa fa-eye mr-2"></i>
Private Photos
</h1>
</div>
</div>
</section>
<div class="p-4 is-text-centered">
<div class="level">
<div class="level-item">
<div class="tabs is-toggle">
<ul>
<li{{if not .IsGrantee}} class="is-active"{{end}}>
<a href="/photo/private">My Shares</a>
</li>
<li{{if .IsGrantee}} class="is-active"{{end}}>
<a href="/photo/private?view=grantee">
Shared With Me
{{if .CountGrantee}}
<span class="tag is-grey ml-2">{{.CountGrantee}}</span>
{{end}}
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="p-4">
<div class="block">
{{if .IsGrantee}}
{{.Pager.Total}} member{{Pluralize64 .Pager.Total}}
{{Pluralize64 .Pager.Total "has" "have"}}
granted you access to see their private photos
{{else}}
You have granted access to {{.Pager.Total}} member{{Pluralize64 .Pager.Total}}
to see your private photos
{{end}}
(page {{.Pager.Page}} of {{.Pager.Pages}}).
</div>
{{if not .IsGrantee}}
<div class="columns is-gapless is-centered">
<div class="column is-narrow mx-1 my-2">
<a href="/photo/private/share" class="button is-primary is-outlined is-fullwidth">
<span class="icon"><i class="fa fa-plus"></i></span>
<span>Add new share</span>
</a>
</div>
<div class="column is-narrow mx-1 my-2">
<a href="/photo/private/share?intent=revoke-all" class="button is-danger is-outlined is-fullwidth"
onclick="return confirm('Are you sure you want to lock your Private Photos from ALL users?')">
<span class="icon"><i class="fa fa-lock"></i></span>
<span>Revoke ALL Shares</span>
</a>
</div>
</div>
{{end}}
<div class="block">
<nav class="pagination" role="navigation" aria-label="pagination">
<a class="pagination-previous{{if not .Pager.HasPrevious}} is-disabled{{end}}" title="Previous"
href="{{.Request.URL.Path}}?{{if .IsGrantee}}view=grantee&{{end}}page={{.Pager.Previous}}">Previous</a>
<a class="pagination-next{{if not .Pager.HasNext}} is-disabled{{end}}" title="Next"
href="{{.Request.URL.Path}}?{{if .IsGrantee}}view=grantee&{{end}}page={{.Pager.Next}}">Next page</a>
<ul class="pagination-list">
{{$Root := .}}
{{range .Pager.Iter}}
<li>
<a class="pagination-link{{if .IsCurrent}} is-current{{end}}"
aria-label="Page {{.Page}}"
href="{{$Root.Request.URL.Path}}?{{if $Root.IsGrantee}}view=grantee&{{end}}page={{.Page}}">
{{.Page}}
</a>
</li>
{{end}}
</ul>
</nav>
</div>
<div class="columns is-multiline">
{{range .Users}}
<div class="column is-half-tablet is-one-third-desktop">
<form action="/photo/private/share" method="POST">
{{InputCSRF}}
<input type="hidden" name="to" value="{{.Username}}">
<div class="card">
<div class="card-content">
<div class="media block">
<div class="media-left">
<figure class="image is-64x64">
<a href="/u/{{.Username}}">
{{if .ProfilePhoto.ID}}
<img src="{{PhotoURL .ProfilePhoto.CroppedFilename}}">
{{else}}
<img src="/static/img/shy.png">
{{end}}
</a>
</figure>
</div>
<div class="media-content">
<p class="title is-4">
<a href="/u/{{.Username}}" class="has-text-dark">{{.NameOrUsername}}</a>
</p>
<p class="subtitle is-6">
<span class="icon"><i class="fa fa-user"></i></span>
<a href="/u/{{.Username}}">{{.Username}}</a>
{{if not .Certified}}
<span class="has-text-danger">
<span class="icon"><i class="fa fa-certificate"></i></span>
<span>Not Certified!</span>
</span>
{{end}}
{{if .IsAdmin}}
<span class="has-text-danger">
<span class="icon"><i class="fa fa-gavel"></i></span>
<span>Admin</span>
</span>
{{end}}
</p>
</div>
</div>
</div>
{{if not $Root.IsGrantee}}
<footer class="card-footer">
<button type="submit" name="intent" value="revoke" class="card-footer-item button is-danger is-outlined"
onclick="return confirm('Are you sure you want to revoke private photo access to this user?')">
<span class="icon"><i class="fa fa-xmark"></i></span>
<span>Revoke Access</span>
</button>
</footer>
{{end}}
</div>
</form>
</div>
{{end}}<!-- range .Friends -->
</div>
</div>
</div>
{{end}}