New inner circle invite workflow

This commit is contained in:
Noah Petherbridge 2024-01-06 20:07:36 -08:00
parent cca449090a
commit 9a854e5679
4 changed files with 108 additions and 44 deletions

View File

@ -77,11 +77,12 @@ func InviteCircle() http.HandlerFunc {
// Add them! // Add them!
if err := models.AddToInnerCircle(user); err != nil { if err := models.AddToInnerCircle(user); err != nil {
session.FlashError(w, r, "Couldn't add to the inner circle: %s", err) session.FlashError(w, r, "Couldn't add to the inner circle: %s", err)
} else {
session.Flash(w, r, "%s has been added to the inner circle!", user.Username)
} }
log.Info("InnerCircle: %s adds %s to the inner circle", currentUser.Username, user.Username) log.Info("InnerCircle: %s adds %s to the inner circle", currentUser.Username, user.Username)
session.Flash(w, r, "%s has been added to the inner circle!", user.Username)
templates.Redirect(w, "/photo/u/"+user.Username) templates.Redirect(w, "/photo/u/"+user.Username)
return return
} }

View File

@ -33,6 +33,9 @@ func UserPhotos() http.HandlerFunc {
filterVisibility = r.FormValue("visibility") filterVisibility = r.FormValue("visibility")
sort = r.FormValue("sort") sort = r.FormValue("sort")
sortOK bool sortOK bool
// Inner circle invite view?
innerCircleInvite = r.FormValue("intent") == "inner_circle"
) )
// Sort options. // Sort options.
@ -78,6 +81,11 @@ func UserPhotos() http.HandlerFunc {
isShyFrom = !isOwnPhotos && (currentUser.IsShyFrom(user) || (isShy && !areFriends)) isShyFrom = !isOwnPhotos && (currentUser.IsShyFrom(user) || (isShy && !areFriends))
) )
// Inner circle invite: not if we are not in the circle ourselves.
if innerCircleInvite && !currentUser.IsInnerCircle() {
innerCircleInvite = false
}
// Bail early if we are shy from this user. // Bail early if we are shy from this user.
if isShy && isShyFrom { if isShy && isShyFrom {
var vars = map[string]interface{}{ var vars = map[string]interface{}{
@ -207,6 +215,7 @@ func UserPhotos() http.HandlerFunc {
"CommentMap": commentMap, "CommentMap": commentMap,
"ViewStyle": viewStyle, "ViewStyle": viewStyle,
"ExplicitCount": explicitCount, "ExplicitCount": explicitCount,
"InnerCircleInviteView": innerCircleInvite,
// Search filters // Search filters
"Sort": sort, "Sort": sort,

View File

@ -38,53 +38,54 @@
</div> </div>
</div> </div>
<form action="/inner-circle/invite" method="POST"> <div class="content">
{{InputCSRF}} <p>
<input type="hidden" name="to" value="{{.User.Username}}"> Do you want to invite <strong>{{.User.Username}}</strong> to join the
{{PrettyCircle}}? Please review the following notes:
</p>
<div class="content"> <ul>
<p> <li>
Do you want to invite <strong>{{.User.Username}}</strong> to join the The inner circle is designed for {{PrettyTitle}} members who <em>actually</em> post
{{PrettyCircle}}? Please review the following notes: several nude photos <strong>with face</strong> on their profile page.
</p> If {{.User.Username}} only has clothed selfies on their page, or keeps
their face hidden or cropped out of their nudes, please <strong>do not</strong>
invite them to join the inner circle.
</li>
<li>
We especially want people who post such pics <strong>on public</strong> visibility.
If {{.User.Username}} has <strong>several</strong> public nude pics with face (e.g.
at least 5 or so pictures), invite them into the circle!
</li>
<li>
All members of the inner circle are allowed to invite others to join the
circle. We trust your judgment -- help ensure that the inner circle is only
made up of truly non-shy nudists who show their whole body on their profile
page.
</li>
</ul>
<ul> <p>
<li> Note: while we use the word "invite" they will actually be added to the inner circle
The inner circle is designed for {{PrettyTitle}} members who <em>actually</em> post immediately and receive a notification that they had been added. They won't know that
several nude photos <strong>with face</strong> on their profile page. it was <em>you</em> who invited them to join the circle.
If {{.User.Username}} only has clothed selfies on their page, or keeps </p>
their face hidden or cropped out of their nudes, please <strong>do not</strong>
invite them to join the inner circle.
</li>
<li>
We especially want people who post such pics <strong>on public</strong> visibility.
If {{.User.Username}} has <strong>several</strong> public nude pics with face (e.g.
at least 5 or so pictures), invite them into the circle!
</li>
<li>
All members of the inner circle are allowed to invite others to join the
circle. We trust your judgment -- help ensure that the inner circle is only
made up of truly non-shy nudists who show their whole body on their profile
page.
</li>
</ul>
<p> <p>
Note: while we use the word "invite" they will actually be added to the inner circle To proceed, please <strong>double check that they have 5 Public photos</strong>
immediately and receive a notification that they had been added. They won't know that that include their face and nude body.
it was <em>you</em> who invited them to join the circle. </p>
</p> </div>
</div>
<div class="field has-text-centered"> <div class="field has-text-centered">
<button type="submit" name="intent" value="confirm" class="button is-success"> <a href="/photo/u/{{.User.Username}}?visibility=public&intent=inner_circle"
Add to the inner circle class="button is-success">
</button> Continue to their Public gallery...
<button type="submit" name="intent" value="cancel" class="button is-warning ml-1"> </a>
Cancel <a href="/u/{{.User.Username}}" class="button is-warning ml-1">
</button> Cancel
</div> </a>
</form> </div>
</div> </div>
</div> </div>

View File

@ -192,6 +192,31 @@
</div> </div>
{{end}} {{end}}
<!-- Inner circle invite notice -->
{{if .InnerCircleInviteView}}
<div class="notification is-info is-light content">
<p>
<img src="/static/img/circle-24.png" width="16" height="16">
<strong class="ml-2">{{PrettyCircle}} invitation</strong>
</p>
<p>
You are now viewing @{{.User.Username}}'s <strong>Public gallery photos</strong> to verify
they should be invited to the {{PrettyCircle}}.
</p>
<p>
Please take a look and see if they have at least <strong>five (5) photos</strong> that clearly show
their <strong>face</strong> as well as their full nude body together.
</p>
<p>
If they qualify to join the {{PrettyCircle}}, the button to invite them will be at
<strong>the bottom of this page</strong>.
</p>
</div>
{{end}}
<div class="block"> <div class="block">
<div class="level"> <div class="level">
<div class="level-left"> <div class="level-left">
@ -663,6 +688,34 @@
{{SimplePager .Pager}} {{SimplePager .Pager}}
<!-- Inner circle invite notice -->
{{if .InnerCircleInviteView}}
<div class="notification is-info is-light content">
<p>
<img src="/static/img/circle-24.png" width="16" height="16">
<strong class="ml-2">{{PrettyCircle}} invitation</strong>
</p>
<p>
If <strong>@{{.User.Username}}</strong> shows at least 5 nude photos <strong>with face</strong>
on their public gallery, click on the button below to add them to the {{PrettyCircle}}.
</p>
<form action="/inner-circle/invite" method="POST">
{{InputCSRF}}
<input type="hidden" name="to" value="{{.User.Username}}">
<button type="submit" name="intent" value="confirm" class="button is-link">
Add to the inner circle
</button>
<button type="submit" name="intent" value="cancel" class="button is-warning ml-1">
Cancel
</button>
</form>
</div>
{{end}}
</div> </div>
</div> </div>