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

View file

@ -6,7 +6,7 @@ FEATURES=-DWITH_ASSISTANT -DWITH_S3 -DWITH_WEBAPP
bins=git-annex
mans=git-annex.1 git-annex-shell.1
sources=Build/SysConfig.hs Utility/Touch.hs Utility/Mounts.hs
thfiles=Assistant/Threads/WebApp.hs
thfiles=Assistant/Threads/WebApp.hs $(shell find Assistant/WebApp*)
all=$(bins) $(mans) docs
OS:=$(shell uname | sed 's/[-_].*//')
@ -58,7 +58,7 @@ Build/SysConfig.hs: configure.hs Build/TestConfig.hs Build/Configure.hs
# Force GHC to rebuild template haskell files whenever includes
# change
$(thfiles): $(shell echo templates/* static/*)
$(thfiles): $(shell find templates static)
$(thfiles):
touch $(thfiles)

View file

@ -0,0 +1,8 @@
#{msg}
<p>
<div .input-prepend .input-append>
<span .add-on>
<i .icon-folder-open></i>
^{fvInput pathView}
<button type=submit .btn>
Make Repository