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 */ /* 1. colours */
/* green */ /* green */
body { background-color:#efe; } body { background-color:; }
.registerreport .odd { background-color:#ded; } .registerreport .odd { background-color:#ded; }
.filtering { background-color:#ded; } .filtering { background-color:#ded; }
/* #main { border-color:#ded; } see below */ /* #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#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 <table.form
<tr.#{filteringperiodclass} <tr.#{filteringperiodclass}
<td <td
filter by period: Search:
\ # \ #
<td <td
<input name=p size=60 value=#{p} <input name=a size=100 value=#{a}
^{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 #
\ #
<td align=right <td align=right
^{stopfiltering} ^{stopfiltering}

View File

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

View File

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

View File

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

View File

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

View File

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