{-# LANGUAGE RecordWildCards, OverloadedStrings, QuasiQuotes #-} module Clckwrks.ProfileData.EditProfileDataFor where import Clckwrks import Clckwrks.Admin.Template (template) import Clckwrks.ProfileData.Acid (GetProfileData(..), SetProfileData(..)) import Clckwrks.Authenticate.Monad (AuthenticatePluginState(..)) import Clckwrks.Authenticate.URL (AuthURL(ResetPassword)) import Control.Monad.State (get) import Data.Maybe (fromMaybe) import Data.Monoid ((<>)) import Data.Set as Set import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as LT import qualified Data.Text as Text import Data.UserId (UserId) import Language.Haskell.HSX.QQ (hsx) import Happstack.Authenticate.Core (Email(..), GetUserByUserId(..), User(..), UserId(..), Username(..)) import Happstack.Authenticate.Password.Core (SetPassword(..), mkHashedPass, resetTokenForUserId) import HSP.XMLGenerator import HSP.XML import System.FilePath ((>)) import Text.Reform ((++>), mapView, transformEitherM) import Text.Reform.Happstack (reform) import Text.Reform.HSP.Text (inputCheckboxes, inputPassword, inputText, labelText, inputSubmit, fieldset, ol, li, form, setAttrs) import Web.Plugins.Core (getConfig, getPluginState, getPluginRouteFn) editProfileDataForPage :: ProfileDataURL -> UserId -> Clck ProfileDataURL Response editProfileDataForPage here uid = do pd <- query (GetProfileData uid) mu <- query (GetUserByUserId uid) case mu of Nothing -> template "Edit Profile Data" () $ [hsx|
Share this link with the user
<% lnk %>