web: use transaction indexes instead of the date for html tag ids #308
This commit is contained in:
		
							parent
							
								
									ac3db83e02
								
							
						
					
					
						commit
						5fbdae005b
					
				| @ -60,7 +60,7 @@ journalTransactionsReportAsHtml _ vd (_,items) = [hamlet| | |||||||
| -- .#{datetransition} | -- .#{datetransition} | ||||||
|    itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute |    itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute | ||||||
|    itemAsHtml VD{..} (n, _, _, _, (t, _, split, _, amt, _)) = [hamlet| |    itemAsHtml VD{..} (n, _, _, _, (t, _, split, _, amt, _)) = [hamlet| | ||||||
| <tr ##{date} .item.#{evenodd}.#{firstposting} style="vertical-align:top;" title="#{show t}"> | <tr ##{tindex t} .item.#{evenodd}.#{firstposting} style="vertical-align:top;" title="#{show t}"> | ||||||
|  <td.date>#{date} |  <td.date>#{date} | ||||||
|  <td.description colspan=2>#{elideRight 60 desc} |  <td.description colspan=2>#{elideRight 60 desc} | ||||||
|  <td.amount style="text-align:right;"> |  <td.amount style="text-align:right;"> | ||||||
| @ -72,7 +72,7 @@ $forall p' <- tpostings t | |||||||
|   <td.description> |   <td.description> | ||||||
|   <td.account> |   <td.account> | ||||||
|      |      | ||||||
|    <a href="@?{acctlink (paccount p')}##{date}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'} |    <a href="@?{acctlink (paccount p')}##{tindex t}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'} | ||||||
|   <td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'} |   <td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'} | ||||||
| <tr.#{evenodd}> | <tr.#{evenodd}> | ||||||
|  <td>  |  <td>  | ||||||
|  | |||||||
| @ -73,8 +73,9 @@ registerItemsHtml _ vd (balancelabel,items) = [hamlet| | |||||||
|    itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute |    itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute | ||||||
|    itemAsHtml VD{..} (n, newd, newm, _, (torig, tacct, split, acct, amt, bal)) = [hamlet| |    itemAsHtml VD{..} (n, newd, newm, _, (torig, tacct, split, acct, amt, bal)) = [hamlet| | ||||||
| 
 | 
 | ||||||
| <tr ##{date} .item.#{evenodd}.#{firstposting}.#{datetransition} title="#{show torig}" style="vertical-align:top;"> | <tr ##{tindex torig} .item.#{evenodd}.#{firstposting}.#{datetransition} title="#{show torig}" style="vertical-align:top;"> | ||||||
|  <td.date><a href="@{JournalR}##{date}">#{date} |  <td.date> | ||||||
|  |   <a href="@{JournalR}##{tindex torig}">#{date} | ||||||
|  <td.description title="#{show torig}">#{elideRight 30 desc} |  <td.description title="#{show torig}">#{elideRight 30 desc} | ||||||
|  <td.account>#{elideRight 40 acct} |  <td.account>#{elideRight 40 acct} | ||||||
|  <td.amount style="text-align:right; white-space:nowrap;"> |  <td.amount style="text-align:right; white-space:nowrap;"> | ||||||
| @ -119,7 +120,7 @@ registerChartHtml percommoditytxnreports = | |||||||
|           $forall i <- reverse items |           $forall i <- reverse items | ||||||
|            [ |            [ | ||||||
|             #{dayToJsTimestamp $ triDate i}, |             #{dayToJsTimestamp $ triDate i}, | ||||||
|             #{simpleMixedAmountQuantity $ triCommodityBalance c i}, |             #{simpleMixedAmountQuantity $ triCommodityBalance c i} | ||||||
|            ], |            ], | ||||||
|           /* [] */ |           /* [] */ | ||||||
|         ], |         ], | ||||||
| @ -145,6 +146,7 @@ registerChartHtml percommoditytxnreports = | |||||||
|             '#{showMixedAmountWithZeroCommodity $ triCommodityAmount c i}', |             '#{showMixedAmountWithZeroCommodity $ triCommodityAmount c i}', | ||||||
|             '#{showMixedAmountWithZeroCommodity $ triCommodityBalance c i}', |             '#{showMixedAmountWithZeroCommodity $ triCommodityBalance c i}', | ||||||
|             '#{concat $ intersperse "\\n" $ lines  $ show $ triOrigTransaction i}', |             '#{concat $ intersperse "\\n" $ lines  $ show $ triOrigTransaction i}', | ||||||
|  |             #{tindex $ triOrigTransaction i} | ||||||
|            ], |            ], | ||||||
|           /* [] */ |           /* [] */ | ||||||
|         ], |         ], | ||||||
|  | |||||||
| @ -113,13 +113,12 @@ function registerChart($container, series) { | |||||||
| 
 | 
 | ||||||
| function registerChartClick(ev, pos, item) { | function registerChartClick(ev, pos, item) { | ||||||
|   if (item) { |   if (item) { | ||||||
|     var date = $.plot.dateGenerator(item.datapoint[0], {}); |     $target = $('#'+item.series.data[item.dataIndex][5]); | ||||||
|     var dateid = $.plot.formatDate(date, '%Y-%m-%d'); |     if ($target.length) { | ||||||
|     $target = $('#'+dateid); |  | ||||||
|     if ($target.length) |  | ||||||
|       $('html, body').animate({ |       $('html, body').animate({ | ||||||
|         scrollTop: $target.offset().top |         scrollTop: $target.offset().top | ||||||
|       }, 1000); |       }, 1000); | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user