web: add form uses currently focussed account as default from account
This commit is contained in:
		
							parent
							
								
									35b3c0d37e
								
							
						
					
					
						commit
						938adb8a4e
					
				@ -4,7 +4,7 @@
 | 
			
		||||
  <select id=#{acctvar} name=#{acctvar}
 | 
			
		||||
   <option
 | 
			
		||||
   $forall a <- acctnames
 | 
			
		||||
    <option value=#{a}>#{a}
 | 
			
		||||
    <option value=#{a} :shouldselect a:selected>#{a}
 | 
			
		||||
 ^{amtfield}
 | 
			
		||||
<tr.helprow
 | 
			
		||||
 <td
 | 
			
		||||
 | 
			
		||||
@ -372,7 +372,7 @@ searchform VD{here=here,q=q} = $(Settings.hamletFile "searchform")
 | 
			
		||||
 | 
			
		||||
-- | Add transaction form.
 | 
			
		||||
addform :: ViewData -> Hamlet AppRoute
 | 
			
		||||
addform vd = $(Settings.hamletFile "addform")
 | 
			
		||||
addform vd@VD{qopts=qopts} = $(Settings.hamletFile "addform")
 | 
			
		||||
 where
 | 
			
		||||
  datehelp = "eg: 2010/7/20" :: String
 | 
			
		||||
  deschelp = "eg: supermarket (optional)" :: String
 | 
			
		||||
@ -381,6 +381,7 @@ addform vd = $(Settings.hamletFile "addform")
 | 
			
		||||
  manyfiles = (length $ files $ j vd) > 1
 | 
			
		||||
  postingfields VD{j=j} n = $(Settings.hamletFile "addformpostingfields")
 | 
			
		||||
   where
 | 
			
		||||
    shouldselect a = n == 2 && Just a == inAccount qopts
 | 
			
		||||
    numbered = (++ show n)
 | 
			
		||||
    acctvar = numbered "account"
 | 
			
		||||
    amtvar = numbered "amount"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user