web: hacky changes towards simplifying the web ui

This commit is contained in:
Simon Michael 2011-06-03 22:56:24 +00:00
parent f2ac47b567
commit 5f9a3aba52
8 changed files with 13 additions and 28 deletions

View File

@ -4,7 +4,7 @@
/* 1. colours */
/* green */
body { background-color:#efe; }
body { background-color:; }
.registerreport .odd { background-color:#ded; }
.filtering { background-color:#ded; }
/* #main { border-color:#ded; } see below */

View File

@ -1,4 +1,4 @@
<a#addformlink href onclick="return addformToggle(event)">add transaction
<a#addformlink href onclick="return addformToggle(event)">add
<a#importformlink href onclick="return importformToggle(event)" style="display:none;">import transactions
\ | #
<a#editformlink href onclick="return editformToggle(event)">edit journal
<a#editformlink href onclick="return editformToggle(event)">edit

View File

@ -3,23 +3,10 @@
<table.form
<tr.#{filteringperiodclass}
<td
filter by period:
Search:
\ #
<td
<input name=p size=60 value=#{p}
^{phelp}
\ #
<td align=right
^{stopfilteringperiod}
<tr.#{filteringclass}
<td
filter by account/description:
\ #
<td
<input name=a size=60 value=#{a}
^{ahelp}
\ #
<input type=submit value=filter #
<input name=a size=100 value=#{a}
\#
<td align=right
^{stopfiltering}

View File

@ -1,11 +1,11 @@
^{topbar vd}
<div#content
^{filterform vd}
<div#sidebar
^{sidecontent}
<div#main.journal
^{navlinks vd}
<div#maincontent
^{filterform vd}
^{maincontent}
^{addform vd}
^{editform vd}

View File

@ -1,6 +1,4 @@
<div#navlinks
^{accountsjournallink}
\ | #
^{accountsregisterlink}
\ | #
^{editlinks}

View File

@ -1,11 +1,11 @@
^{topbar vd}
<div#content
^{filterform vd}
<div#sidebar
^{sidecontent}
<div#main.register
^{navlinks vd}
<div#maincontent
^{filterform vd}
^{maincontent}
^{addform vd}
^{editform vd}

View File

@ -46,7 +46,7 @@ getRobotsR :: Handler RepPlain
getRobotsR = return $ RepPlain $ toContent ("User-agent: *" :: ByteString)
getRootR :: Handler RepHtml
getRootR = redirect RedirectTemporary defaultroute where defaultroute = JournalR
getRootR = redirect RedirectTemporary defaultroute where defaultroute = RegisterR
----------------------------------------------------------------------
-- main views
@ -322,8 +322,8 @@ journalTitleDesc j p today = (title, desc)
navlinks :: ViewData -> Hamlet AppRoute
navlinks vd = $(Settings.hamletFile "navlinks")
where
accountsjournallink = navlink vd "journal" JournalR
accountsregisterlink = navlink vd "register" RegisterR
accountsjournallink = navlink vd "transactions" JournalR
accountsregisterlink = navlink vd "postings" RegisterR
navlink :: ViewData -> String -> AppRoute -> Hamlet AppRoute
navlink VD{here=here,a=a,p=p} s dest = $(Settings.hamletFile "navlink")
where u = (dest, concat [(if null a then [] else [("a", pack a)])
@ -401,7 +401,7 @@ journalselect journalfiles = $(Settings.hamletFile "journalselect")
-- utilities
nulltemplate :: Hamlet AppRoute
nulltemplate = [$hamlet||]
nulltemplate = [hamlet||]
-- | A bundle of data useful for handlers and their templates.
data ViewData = VD {

View File

@ -19,7 +19,7 @@ import Network.Wai.Middleware.Debug (debug)
#endif
import System.Console.GetOpt
import System.Exit (exitFailure)
import System.IO.Storage (withStore, putValue,)
import System.IO.Storage (withStore, putValue)
import Text.Printf
import Yesod.Helpers.Static