Paste server written in Haskell. Fork of Hpaste, fully freedom and privacy respecting and generally improved. At the time of writing there's an instance at <http://paste.rel4tion.org>.

[[ 🗃 ^aoqmo toothpaste ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/aoqmo

SSH: git clone USERNAME@vervis.peers.community:aoqmo

Branches

Tags

hpaste :: src / Hpaste / Controller /

Reported.hs

{-# OPTIONS -Wall #-}
{-# LANGUAGE OverloadedStrings #-}

-- | Reported page controller.

module Hpaste.Controller.Reported
  (handle)
  where

import Hpaste.Model.Report   (getSomeReports,countReports)
import Hpaste.Controller.Admin   (withAuth)
import Hpaste.Types
import Hpaste.View.Reported  (page)

import Text.Blaze.Pagination
import Data.Pagination
import Snap.App

-- | List the reported pastes.
handle :: HPCtrl ()
handle =
  withAuth $ \key -> do
    pn <- getPagination "reported"
    total <- model countReports
    reports <- model $ getSomeReports (pnPn pn)
    output $ page pn reports key
[See repo JSON]