Documentation
¶
Index ¶
- Constants
- Variables
- func AdminAddPage(w http.ResponseWriter, r *http.Request)
- func AdminCategoriesPage(w http.ResponseWriter, r *http.Request)
- func AdminCategoryEditPage(w http.ResponseWriter, r *http.Request)
- func AdminCategoryGrantsPage(w http.ResponseWriter, r *http.Request)
- func AdminCategoryPage(w http.ResponseWriter, r *http.Request)
- func AdminDashboardPage(w http.ResponseWriter, r *http.Request)
- func AdminLinkGrantsPage(w http.ResponseWriter, r *http.Request)
- func AdminLinksPage(w http.ResponseWriter, r *http.Request)
- func AdminQueuePage(w http.ResponseWriter, r *http.Request)
- func AdminQueueUpdateActionPage(w http.ResponseWriter, r *http.Request)
- func AtomPage(w http.ResponseWriter, r *http.Request)
- func CategoriesPage(w http.ResponseWriter, r *http.Request)
- func CommentEditActionCancelPage(w http.ResponseWriter, r *http.Request)
- func CommentsPage(w http.ResponseWriter, r *http.Request)
- func CustomLinkerIndex(data *common.CoreData, r *http.Request)
- func EnforceLinkViewAccess(next http.Handler) http.Handler
- func EnforceLinkerCommentsAccess(next http.Handler) http.Handler
- func FetchPageTitle(ctx context.Context, targetURL string) string
- func LinkerCategoryPage(w http.ResponseWriter, r *http.Request)
- func LinkerPage(w http.ResponseWriter, r *http.Request)
- func NewLinkerCategoryTask() tasks.Task
- func NewLinkerTask() tasks.Task
- func RedirectReplyError(w http.ResponseWriter, r *http.Request, msg, text string, languageID int)
- func Register(reg *router.Registry)
- func RegisterAdminRoutes(ar *mux.Router)
- func RegisterRoutes(r *mux.Router, _ *config.RuntimeConfig) []navpkg.RouterOptions
- func RegisterTasks() []tasks.NamedTask
- func RssPage(w http.ResponseWriter, r *http.Request)
- func ShowPage(w http.ResponseWriter, r *http.Request)
- func ShowReplyPage(w http.ResponseWriter, r *http.Request)
- func SuggestPage(w http.ResponseWriter, r *http.Request)
- func UserCanCreateLink(ctx context.Context, q db.Querier, categoryID sql.NullInt32, uid int32) (bool, error)
- func UserPage(w http.ResponseWriter, r *http.Request)
- type CategoryGrantCreateTask
- type EditReplyTask
- type LinkGrantCreateTask
- type SuggestTask
Constants ¶
const ( EmailTemplateLinkerApproved notif.EmailTemplateName = "linkerApprovedEmail" NotificationTemplateLinkerApproved notif.NotificationTemplateName = "linker_approved" EmailTemplateAdminNotificationLinkerApproved notif.EmailTemplateName = "adminNotificationLinkerApprovedEmail" EmailTemplateLinkerAdd notif.EmailTemplateName = "linkerAddEmail" NotificationTemplateLinkerAdd notif.NotificationTemplateName = "linker_add" EmailTemplateAdminNotificationLinkerAdd notif.EmailTemplateName = "adminNotificationLinkerAddEmail" EmailTemplateLinkerDeleted notif.EmailTemplateName = "linkerDeletedEmail" NotificationTemplateLinkerDeleted notif.NotificationTemplateName = "linker_deleted" EmailTemplateLinkerRejected notif.EmailTemplateName = "linkerRejectedEmail" NotificationTemplateLinkerRejected notif.NotificationTemplateName = "linker_rejected" EmailTemplateAdminNotificationLinkerRejected notif.EmailTemplateName = "adminNotificationLinkerRejectedEmail" )
const ( // TaskReply posts a reply to a thread or comment. TaskReply tasks.TaskString = "Reply" // TaskEditReply edits a comment or reply. TaskEditReply tasks.TaskString = "Edit Reply" // TaskCancel cancels the current operation and returns to the previous // page. TaskCancel tasks.TaskString = "Cancel" // TaskSuggest creates a suggestion in the linker. TaskSuggest tasks.TaskString = "Suggest" // TaskUpdate updates an existing item. TaskUpdate tasks.TaskString = "Update" // TaskRenameCategory renames a category. TaskRenameCategory tasks.TaskString = "Rename Category" // TaskDeleteCategory removes a category. TaskDeleteCategory tasks.TaskString = "Delete Category" // TaskCreateCategory creates a new category entry. TaskCreateCategory tasks.TaskString = "Create Category" // TaskAdd represents the "Add" action, commonly used when creating a new // record. TaskAdd tasks.TaskString = "Add" // TaskDelete removes an existing item. TaskDelete tasks.TaskString = "Delete" // TaskApprove approves an item in moderation queues. TaskApprove tasks.TaskString = "Approve" // TaskBulkApprove approves multiple queued items at once. TaskBulkApprove tasks.TaskString = "Bulk Approve" // TaskBulkDelete removes multiple queued items at once. TaskBulkDelete tasks.TaskString = "Bulk Delete" // TaskCategoryGrantCreate adds a new grant to a linker category. TaskCategoryGrantCreate tasks.TaskString = "Create grant" // TaskCategoryGrantDelete removes an existing linker category grant. TaskCategoryGrantDelete tasks.TaskString = "Delete grant" )
The following constants define the allowed values of the "task" form field. Each HTML form includes a hidden or submit input named "task" whose value identifies the intended action. When routes are registered the constants are passed to gorillamuxlogic's HasTask so that only requests specifying the expected task reach a handler. Centralising these string values avoids typos between templates and route declarations.
const LinkerAdminAddPageTmpl tasks.Template = "domains/linker/adminAddPage.gohtml"
const LinkerAdminCategoriesPageTmpl tasks.Template = "domains/linker/linkerAdminCategoriesPage.gohtml"
const LinkerAdminCategoryEditPageTmpl tasks.Template = "domains/linker/linkerAdminCategoryEditPage.gohtml"
const LinkerAdminCategoryGrantsPageTmpl tasks.Template = "domains/linker/adminCategoryGrantsPage.gohtml"
const LinkerAdminCategoryPageTmpl tasks.Template = "domains/linker/linkerAdminCategoryPage.gohtml"
const LinkerAdminDashboardPageTmpl tasks.Template = "domains/linker/linkerAdminDashboardPage.gohtml"
const LinkerAdminLinkGrantsPageTmpl tasks.Template = "domains/linker/adminLinkGrantsPage.gohtml"
const LinkerAdminLinkPageTmpl tasks.Template = "domains/linker/adminLinkPage.gohtml"
const LinkerAdminLinkViewPageTmpl tasks.Template = "domains/linker/adminLinkViewPage.gohtml"
const LinkerAdminLinksPageTmpl tasks.Template = "domains/linker/linkerAdminLinksPage.gohtml"
const LinkerAdminQueuePageTmpl tasks.Template = "domains/linker/adminQueuePage.gohtml"
const LinkerCategoriesPageTmpl tasks.Template = "domains/linker/linkerCategoriesPage.gohtml"
const (
LinkerCategoryPageTmpl tasks.Template = "domains/linker/categoryPage.gohtml"
)
const LinkerCommentsPageTmpl tasks.Template = "domains/linker/commentsPage.gohtml"
const (
LinkerPageTmpl tasks.Template = "domains/linker/page.gohtml"
)
const LinkerShowPageTmpl tasks.Template = "domains/linker/showPage.gohtml"
const LinkerSuggestPageTmpl tasks.Template = "domains/linker/suggestPage.gohtml"
const LinkerTopicDescription = "THIS IS A HIDDEN FORUM FOR A LINKER TOPIC"
LinkerTopicDescription describes the hidden linker forum.
const LinkerTopicName = "A LINKER TOPIC"
LinkerTopicName is the default name for the hidden linker forum.
const LinkerUserPageTmpl tasks.Template = "domains/linker/linkerPage.gohtml"
const (
// SectionWeight controls the order of the Linker section in navigation.
SectionWeight = 50
)
Variables ¶
var AdminAddTask = &addTask{TaskString: TaskAdd}
var AdminApproveTask = &approveTask{TaskString: TaskApprove}
var AdminBulkApproveTask = &bulkApproveTask{TaskString: TaskBulkApprove}
var AdminBulkDeleteTask = &bulkDeleteTask{TaskString: TaskBulkDelete}
var AdminCategoryGrantDeleteTask = &adminCategoryGrantDeleteTask{TaskString: TaskCategoryGrantDelete}
var AdminDeleteCategoryTask = &deleteCategoryTask{TaskString: TaskDeleteCategory}
var AdminDeleteTask = &deleteTask{TaskString: TaskDelete}
var AdminEditLinkTask = &editLinkTask{TaskString: TaskUpdate}
var AdminLinkGrantDeleteTask = &linkGrantDeleteTask{TaskString: TaskCategoryGrantDelete}
var CreateCategoryTask = &createCategoryTask{TaskString: TaskCreateCategory}
var RenameCategoryTask = &renameCategoryTask{TaskString: TaskRenameCategory}
var UpdateCategoryTask = &updateCategoryTask{TaskString: TaskUpdate}
Functions ¶
func AdminAddPage ¶
func AdminAddPage(w http.ResponseWriter, r *http.Request)
func AdminCategoriesPage ¶
func AdminCategoriesPage(w http.ResponseWriter, r *http.Request)
func AdminCategoryEditPage ¶
func AdminCategoryEditPage(w http.ResponseWriter, r *http.Request)
AdminCategoryEditPage renders the edit form for a linker category.
func AdminCategoryGrantsPage ¶
func AdminCategoryGrantsPage(w http.ResponseWriter, r *http.Request)
AdminCategoryGrantsPage displays grants for a linker category.
func AdminCategoryPage ¶
func AdminCategoryPage(w http.ResponseWriter, r *http.Request)
AdminCategoryPage shows a linker category with its links.
func AdminDashboardPage ¶
func AdminDashboardPage(w http.ResponseWriter, r *http.Request)
AdminDashboardPage shows summary links for linker admin.
func AdminLinkGrantsPage ¶
func AdminLinkGrantsPage(w http.ResponseWriter, r *http.Request)
AdminLinkGrantsPage displays grants for a linker item.
func AdminLinksPage ¶
func AdminLinksPage(w http.ResponseWriter, r *http.Request)
AdminLinksPage lists all links grouped by category.
func AdminQueuePage ¶
func AdminQueuePage(w http.ResponseWriter, r *http.Request)
func AdminQueueUpdateActionPage ¶
func AdminQueueUpdateActionPage(w http.ResponseWriter, r *http.Request)
func CategoriesPage ¶
func CategoriesPage(w http.ResponseWriter, r *http.Request)
func CommentEditActionCancelPage ¶
func CommentEditActionCancelPage(w http.ResponseWriter, r *http.Request)
CommentEditActionCancelPage aborts editing a comment.
func CommentsPage ¶
func CommentsPage(w http.ResponseWriter, r *http.Request)
func FetchPageTitle ¶
FetchPageTitle returns the <title> contents of the page at the given URL. An empty string is returned if the title cannot be retrieved within the timeout.
func LinkerCategoryPage ¶
func LinkerCategoryPage(w http.ResponseWriter, r *http.Request)
func LinkerPage ¶
func LinkerPage(w http.ResponseWriter, r *http.Request)
func NewLinkerCategoryTask ¶
func NewLinkerTask ¶
func RedirectReplyError ¶ added in v0.0.214
func RegisterAdminRoutes ¶
RegisterAdminRoutes attaches linker admin endpoints to ar.
func RegisterRoutes ¶
func RegisterRoutes(r *mux.Router, _ *config.RuntimeConfig) []navpkg.RouterOptions
RegisterRoutes attaches the public linker endpoints to r.
func RegisterTasks ¶
RegisterTasks returns linker related tasks.
func ShowReplyPage ¶
func ShowReplyPage(w http.ResponseWriter, r *http.Request)
func SuggestPage ¶
func SuggestPage(w http.ResponseWriter, r *http.Request)
Types ¶
type CategoryGrantCreateTask ¶
type CategoryGrantCreateTask struct{ tasks.TaskString }
CategoryGrantCreateTask creates a new grant for a linker category.
func (CategoryGrantCreateTask) Action ¶
func (CategoryGrantCreateTask) Action(w http.ResponseWriter, r *http.Request) any
type EditReplyTask ¶
type EditReplyTask struct{ tasks.TaskString }
EditReplyTask posts an edited reply and refreshes thread metadata.
func (EditReplyTask) Action ¶
func (EditReplyTask) Action(w http.ResponseWriter, r *http.Request) any
type LinkGrantCreateTask ¶
type LinkGrantCreateTask struct{ tasks.TaskString }
LinkGrantCreateTask creates a new grant for a link item.
func (LinkGrantCreateTask) Action ¶
func (LinkGrantCreateTask) Action(w http.ResponseWriter, r *http.Request) any
type SuggestTask ¶
type SuggestTask struct{ tasks.TaskString }
func (SuggestTask) Action ¶
func (SuggestTask) Action(w http.ResponseWriter, r *http.Request) any
Source Files
¶
- approve_task.go
- bulk_approve_task.go
- bulk_delete_task.go
- cancel_edit_reply_task.go
- category_grant_create_task.go
- category_grant_delete_task.go
- constants.go
- create_category_task.go
- delete_category_task.go
- delete_task.go
- edit_reply_task.go
- link_grant_create_task.go
- link_grant_delete_task.go
- linkerAdminAddPage.go
- linkerAdminCategoriesPage.go
- linkerAdminCategoryEditPage.go
- linkerAdminCategoryGrantsPage.go
- linkerAdminCategoryPage.go
- linkerAdminDashboardPage.go
- linkerAdminLinkGrantsPage.go
- linkerAdminLinkPage.go
- linkerAdminLinkViewPage.go
- linkerAdminLinksPage.go
- linkerAdminQueuePage.go
- linkerCategoriesPage.go
- linkerCategoryPage.go
- linkerCategoryTask.go
- linkerCommentsEditPage.go
- linkerCommentsPage.go
- linkerFeed.go
- linkerPage.go
- linkerShowPage.go
- linkerSuggestPage.go
- linkerTask.go
- linkerUserPage.go
- middleware.go
- notification_templates.go
- permissions.go
- rename_category_task.go
- routes.go
- routes_admin.go
- section.go
- tasks.go
- tasks_register.go
- update_category_task.go
- urlpreview.go