Fix Gallery checkbox always checking itself + small fixes

face-detect
Noah Petherbridge 2023-05-24 18:40:27 -07:00
parent e6388de589
commit 50d05f92f1
8 changed files with 156 additions and 113 deletions

View File

@ -22,9 +22,9 @@ type CertificationPhotoStatus string
const ( const (
CertificationPhotoNeeded CertificationPhotoStatus = "needed" CertificationPhotoNeeded CertificationPhotoStatus = "needed"
CertificationPhotoPending = "pending" CertificationPhotoPending CertificationPhotoStatus = "pending"
CertificationPhotoApproved = "approved" CertificationPhotoApproved CertificationPhotoStatus = "approved"
CertificationPhotoRejected = "rejected" CertificationPhotoRejected CertificationPhotoStatus = "rejected"
) )
// GetCertificationPhoto retrieves the user's record from the DB or upserts their initial record. // GetCertificationPhoto retrieves the user's record from the DB or upserts their initial record.

View File

@ -86,7 +86,7 @@ func PaginateForums(user *User, categories []string, pager *Pagination) ([]*Foru
placeholders = []interface{}{} placeholders = []interface{}{}
) )
if categories != nil && len(categories) > 0 { if len(categories) > 0 {
wheres = append(wheres, "category IN ?") wheres = append(wheres, "category IN ?")
placeholders = append(placeholders, categories) placeholders = append(placeholders, categories)
} }

View File

@ -28,7 +28,7 @@ func PaginateRecentPosts(user *User, categories []string, pager *Pagination) ([]
placeholders = []interface{}{} placeholders = []interface{}{}
) )
if categories != nil && len(categories) > 0 { if len(categories) > 0 {
wheres = append(wheres, "forums.category IN ?") wheres = append(wheres, "forums.category IN ?")
placeholders = append(placeholders, categories) placeholders = append(placeholders, categories)
} }

View File

@ -32,16 +32,16 @@ type NotificationType string
const ( const (
NotificationLike NotificationType = "like" NotificationLike NotificationType = "like"
NotificationFriendApproved = "friendship_approved" NotificationFriendApproved NotificationType = "friendship_approved"
NotificationComment = "comment" NotificationComment NotificationType = "comment"
NotificationAlsoCommented = "also_comment" NotificationAlsoCommented NotificationType = "also_comment"
NotificationAlsoPosted = "also_posted" // forum replies NotificationAlsoPosted NotificationType = "also_posted" // forum replies
NotificationCertRejected = "cert_rejected" NotificationCertRejected NotificationType = "cert_rejected"
NotificationCertApproved = "cert_approved" NotificationCertApproved NotificationType = "cert_approved"
NotificationPrivatePhoto = "private_photo" NotificationPrivatePhoto NotificationType = "private_photo"
NotificationNewPhoto = "new_photo" NotificationNewPhoto NotificationType = "new_photo"
NotificationInnerCircle = "inner_circle" NotificationInnerCircle NotificationType = "inner_circle"
NotificationCustom = "custom" // custom message pushed NotificationCustom NotificationType = "custom" // custom message pushed
) )
// CreateNotification // CreateNotification

View File

@ -30,9 +30,9 @@ type PhotoVisibility string
const ( const (
PhotoPublic PhotoVisibility = "public" // on profile page and/or public gallery PhotoPublic PhotoVisibility = "public" // on profile page and/or public gallery
PhotoFriends = "friends" // only friends can see it PhotoFriends PhotoVisibility = "friends" // only friends can see it
PhotoPrivate = "private" // private PhotoPrivate PhotoVisibility = "private" // private
PhotoInnerCircle = "circle" // inner circle PhotoInnerCircle PhotoVisibility = "circle" // inner circle
) )
// PhotoVisibility preset settings. // PhotoVisibility preset settings.

View File

@ -47,8 +47,8 @@ type UserVisibility string
const ( const (
UserVisibilityPublic UserVisibility = "public" UserVisibilityPublic UserVisibility = "public"
UserVisibilityExternal = "external" UserVisibilityExternal UserVisibility = "external"
UserVisibilityPrivate = "private" UserVisibilityPrivate UserVisibility = "private"
) )
// All visibility options. // All visibility options.

View File

@ -15,7 +15,50 @@
<div class="block p-4"> <div class="block p-4">
<div class="content"> <div class="columns">
<div class="column is-one-quarter">
<!-- Quick Links -->
<div class="card block">
<header class="card-header has-background-link">
<p class="card-header-title has-text-light">
<span class="icon mr-1"><img src="/static/img/circle-16.png"></span>
<span>Quick Links</span>
</p>
</header>
<div class="card-content">
<p class="block">
Some quick links to {{PrettyCircle}}-only views mentioned
in the description on this page:
</p>
<ul class="menu-list block">
<li>
<a href="/photo/gallery?visibility=circle">
<i class="fa fa-image mr-1"></i>
Gallery (circle-only photos)
</a>
</li>
<li>
<a href="/members?certified=circle">
<i class="fa fa-people-group mr-1"></i>
Inner circle members
</a>
</li>
<li>
<a href="/f/circle">
<i class="fa fa-comments mr-1"></i>
Forum (Circle Chat)
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="column content">
<p> <p>
Congratulations! You have been added to the <strong>{{PrettyCircle}}</strong> because you Congratulations! You have been added to the <strong>{{PrettyCircle}}</strong> because you
exemplify what it truly means to be a {{PrettyTitle}} nudist. exemplify what it truly means to be a {{PrettyTitle}} nudist.
@ -120,6 +163,7 @@
</li> </li>
</ul> </ul>
</div> </div>
</div>
</div> </div>
{{end}} {{end}}

View File

@ -292,8 +292,7 @@
<input type="checkbox" <input type="checkbox"
name="gallery" name="gallery"
value="true" value="true"
checked {{if or .EditPhoto.Gallery (not .EditPhoto)}}checked{{end}}>
{{if .EditPhoto.Gallery}}checked{{end}}>
Show this photo in the site-wide Photo Gallery Show this photo in the site-wide Photo Gallery
</label> </label>
<p class="help"> <p class="help">