move out to template

This commit is contained in:
Joey Hess 2012-07-31 18:33:19 -04:00
parent 4b5ffe8f9b
commit c950e8fba0
3 changed files with 13 additions and 19 deletions

View file

@ -48,24 +48,10 @@ addRepositoryForm :: Form RepositoryPath
addRepositoryForm msg = do
cwd <- liftIO $ getCurrentDirectory
(pathRes, pathView) <- mreq textField "" (Just $ pack cwd)
let widget = do
let form = do
webAppFormAuthToken
toWidget [julius|
$(function() {
$('##{fvId pathView}').focus();
})
|]
[whamlet|
#{msg}
<p>
<div .input-prepend .input-append>
<span .add-on>
<i .icon-folder-open></i>
^{fvInput pathView}
<button type=submit .btn>
Make Repository
|]
return (RepositoryPath <$> pathRes, widget)
$(widgetFile "configurators/addrepository/form")
return (RepositoryPath <$> pathRes, form)
addRepository :: Bool -> Widget
addRepository firstrun = do