New inner circle invite workflow
This commit is contained in:
parent
cca449090a
commit
9a854e5679
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -38,10 +38,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="/inner-circle/invite" method="POST">
|
|
||||||
{{InputCSRF}}
|
|
||||||
<input type="hidden" name="to" value="{{.User.Username}}">
|
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p>
|
<p>
|
||||||
Do you want to invite <strong>{{.User.Username}}</strong> to join the
|
Do you want to invite <strong>{{.User.Username}}</strong> to join the
|
||||||
|
@ -74,17 +70,22 @@
|
||||||
immediately and receive a notification that they had been added. They won't know that
|
immediately and receive a notification that they had been added. They won't know that
|
||||||
it was <em>you</em> who invited them to join the circle.
|
it was <em>you</em> who invited them to join the circle.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
To proceed, please <strong>double check that they have 5 Public photos</strong>
|
||||||
|
that include their face and nude body.
|
||||||
|
</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>
|
||||||
|
<a href="/u/{{.User.Username}}" class="button is-warning ml-1">
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user