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 /

Activity.hs

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

-- | Activity page controller.

module Hpaste.Controller.Activity
  (handle)
  where

import Hpaste.Types
import Hpaste.Controller.Cache (cache)
import Hpaste.Model.Activity   (getCommits)
import Hpaste.Types.Cache      as Key
import Hpaste.View.Activity    (page)

import Control.Monad.Env       (env)
import Snap.App

-- | Display commit history.
handle :: HPCtrl ()
handle = do
  html <- cache Key.Activity $ do
    uri <- env $ configCommits . controllerStateConfig
    repourl <- env $ configRepoURL . controllerStateConfig
    commits <- model $ getCommits uri
    return $ Just $ page repourl commits
  maybe (return ()) outputText html
[See repo JSON]