diff --git a/errors.go b/errors.go index fa7304f..c0d435c 100644 --- a/errors.go +++ b/errors.go @@ -1,57 +1,57 @@ /* * Copyright © 2018 A Bunch Tell LLC. * * This file is part of WriteFreely. * * WriteFreely is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, included * in the LICENSE file in this source code package. */ package writefreely import ( "net/http" "github.com/writeas/impart" ) // Commonly returned HTTP errors var ( ErrBadFormData = impart.HTTPError{http.StatusBadRequest, "Expected valid form data."} ErrBadJSON = impart.HTTPError{http.StatusBadRequest, "Expected valid JSON object."} ErrBadJSONArray = impart.HTTPError{http.StatusBadRequest, "Expected valid JSON array."} ErrBadAccessToken = impart.HTTPError{http.StatusUnauthorized, "Invalid access token."} ErrNoAccessToken = impart.HTTPError{http.StatusBadRequest, "Authorization token required."} ErrNotLoggedIn = impart.HTTPError{http.StatusUnauthorized, "Not logged in."} ErrForbiddenCollection = impart.HTTPError{http.StatusForbidden, "You don't have permission to add to this collection."} ErrForbiddenEditPost = impart.HTTPError{http.StatusForbidden, "You don't have permission to update this post."} ErrUnauthorizedEditPost = impart.HTTPError{http.StatusUnauthorized, "Invalid editing credentials."} ErrUnauthorizedGeneral = impart.HTTPError{http.StatusUnauthorized, "You don't have permission to do that."} ErrBadRequestedType = impart.HTTPError{http.StatusNotAcceptable, "Bad requested Content-Type."} ErrCollectionUnauthorizedRead = impart.HTTPError{http.StatusUnauthorized, "You don't have permission to access this collection."} ErrNoPublishableContent = impart.HTTPError{http.StatusBadRequest, "Supply something to publish."} ErrInternalGeneral = impart.HTTPError{http.StatusInternalServerError, "The humans messed something up. They've been notified."} ErrInternalCookieSession = impart.HTTPError{http.StatusInternalServerError, "Could not get cookie session."} ErrCollectionNotFound = impart.HTTPError{http.StatusNotFound, "Collection doesn't exist."} ErrCollectionGone = impart.HTTPError{http.StatusGone, "This blog was unpublished."} ErrCollectionPageNotFound = impart.HTTPError{http.StatusNotFound, "Collection page doesn't exist."} ErrPostNotFound = impart.HTTPError{Status: http.StatusNotFound, Message: "Post not found."} ErrPostBanned = impart.HTTPError{Status: http.StatusGone, Message: "Post removed."} ErrPostUnpublished = impart.HTTPError{Status: http.StatusGone, Message: "Post unpublished by author."} ErrPostFetchError = impart.HTTPError{Status: http.StatusInternalServerError, Message: "We encountered an error getting the post. The humans have been alerted."} ErrUserNotFound = impart.HTTPError{http.StatusNotFound, "User doesn't exist."} ErrUserNotFoundEmail = impart.HTTPError{http.StatusNotFound, "Please enter your username instead of your email address."} - ErrUserSuspended = impart.HTTPError{http.StatusForbidden, "Account is suspended, contact the administrator."} + ErrUserSuspended = impart.HTTPError{http.StatusForbidden, "Account is silenced."} ) // Post operation errors var ( ErrPostNoUpdatableVals = impart.HTTPError{http.StatusBadRequest, "Supply some properties to update."} ) diff --git a/templates/pad.tmpl b/templates/pad.tmpl index 4be311e..0b73b94 100644 --- a/templates/pad.tmpl +++ b/templates/pad.tmpl @@ -1,367 +1,367 @@ {{define "pad"}} {{if .Editing}}Editing {{if .Post.Title}}{{.Post.Title}}{{else}}{{.Post.Id}}{{end}}{{else}}New Post{{end}} — {{.SiteName}}
{{if not .SingleUser}}

{{if .Editing}}{{end}}
{{end}} diff --git a/templates/user/admin/users.tmpl b/templates/user/admin/users.tmpl index df840b2..fb69d3a 100644 --- a/templates/user/admin/users.tmpl +++ b/templates/user/admin/users.tmpl @@ -1,33 +1,33 @@ {{define "users"}} {{template "header" .}}
{{template "admin-header" .}}

Users {{.TotalUsers}} total

{{range .Users}} - + {{end}}
User Joined Type Status
{{.Username}} {{.CreatedFriendly}} {{if .IsAdmin}}Admin{{else}}User{{end}}{{if .IsSuspended}}Suspended{{else}}Active{{end}}{{if .IsSilenced}}Silenced{{else}}Active{{end}}
{{template "footer" .}} {{end}} diff --git a/templates/user/admin/view-user.tmpl b/templates/user/admin/view-user.tmpl index 3b13c33..dc7b2ef 100644 --- a/templates/user/admin/view-user.tmpl +++ b/templates/user/admin/view-user.tmpl @@ -1,126 +1,126 @@ {{define "view-user"}} {{template "header" .}}
{{template "admin-header" .}}


- +
No. {{.User.ID}}
Type {{if .User.IsAdmin}}Admin{{else}}User{{end}}
Username {{.User.Username}}
Joined {{.User.CreatedFriendly}}
Total Posts {{.TotalPosts}}
Last Post {{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}
Status {{if .User.IsSuspended}} -


- +


+ {{else}}


- + {{end}}


{{range .Colls}}


{{if $.Config.Federation}} {{end}}
Alias {{.Alias}}
Title {{.Title}}
Description {{.Description}}
Visibility {{.FriendlyVisibility}}
Views {{.Views}}
Posts {{.TotalPosts}}
Last Post {{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}
Fediverse Followers {{.Followers}}
{{template "footer" .}} {{end}} diff --git a/templates/user/include/suspended.tmpl b/templates/user/include/suspended.tmpl index e5d9be8..76906de 100644 --- a/templates/user/include/suspended.tmpl +++ b/templates/user/include/suspended.tmpl @@ -1,5 +1,5 @@ {{define "user-suspended"}}

Your account is suspended. You can still access all of your posts and blogs, but no one else can currently see them.


Your account has been silenced. You can still access all of your posts and blogs, but no one else can currently see them.