summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-31 18:33:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-31 18:33:19 -0400
commitc950e8fba0de95f3a102b2653f70457fc8f19ab3 (patch)
treec66d818c72d6c09e484b56df43ce720abac52848
parent4b5ffe8f9b84c20912871b0dfe627d041ce2d99f (diff)
move out to template
-rw-r--r--Assistant/WebApp/Configurators.hs20
-rw-r--r--Makefile4
-rw-r--r--templates/configurators/addrepository/form.hamlet8
3 files changed, 13 insertions, 19 deletions
diff --git a/Assistant/WebApp/Configurators.hs b/Assistant/WebApp/Configurators.hs
index 69bf92fdb..6a467692a 100644
--- a/Assistant/WebApp/Configurators.hs
+++ b/Assistant/WebApp/Configurators.hs
@@ -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
diff --git a/Makefile b/Makefile
index a6fdab7ca..8eef53f30 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/templates/configurators/addrepository/form.hamlet b/templates/configurators/addrepository/form.hamlet
new file mode 100644
index 000000000..fa5d07f2d
--- /dev/null
+++ b/templates/configurators/addrepository/form.hamlet
@@ -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