Seperate report titles from headlines; leave title as a string, use headline for richer markup. Related to Bug#329369.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13102 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled 2006-02-04 20:49:00 +00:00
parent cb3d92579e
commit 17e78bdd29
11 changed files with 124 additions and 70 deletions

View File

@ -1,3 +1,21 @@
2006-02-04 Joshua Sled <jsled@asynchronous.org>
* src/report/report-system/html-document.scm
(gnc:html-document-headline): Add a headline property to the
html-document record.
* src/report/report-system/html-style-sheet.scm
(gnc:html-style-sheet-render): Add headline-copy, better comment.
* src/report/stylesheets/stylesheet-plain.scm (plain-renderer)
* src/report/stylesheets/stylesheet-fancy.scm (fancy-renderer)
* src/report/stylesheets/stylesheet-easy.scm (easy-renderer):
Use headline if available, fallback to title.
* src/business/business-reports/aging.scm (aging-renderer)
* src/business/business-reports/owner-report.scm (reg-renderer):
Use strings in titles, markup for the richer headline. Bug#329369.
2006-02-04 David Hampton <hampton@employees.org>
* src/gnome-utils/gnc-tree-view-commodity.c:

View File

@ -530,16 +530,22 @@ totals to report currency")
(document (gnc:make-html-document)))
; (gnc:debug "Account: " account)
;; set default title
(gnc:html-document-set-title! document report-title)
;; maybe redefine better...
(if account
(set! report-title (gnc:html-markup
(begin
(gnc:html-document-set-title!
document (string-append report-title ": " (gnc:account-get-name account)))
(gnc:html-document-set-headline! document
(gnc:html-markup
"!"
report-title
": "
(gnc:html-markup-anchor
(gnc:account-anchor-text account)
(gnc:account-get-name account)))))
(gnc:account-get-name account))))))
(gnc:html-document-set-title! document report-title)
(gnc:html-table-set-col-headers! table heading-list)
(if account

View File

@ -540,7 +540,7 @@
(end-date (gnc:timepair-end-day-time
(gnc:date-option-absolute-time
(opt-val gnc:pagename-general (N_ "To")))))
(title #f)
(title (string-append (_ type-str) (_ " Report"))))
(book (gnc:get-current-book)) ;XXX Grab this from elsewhere
(owner-type (opt-val "__reg" "owner-type"))
(type-str ""))
@ -553,11 +553,17 @@
((gnc-owner-employee)
(set! type-str (N_ "Employee"))))
(gnc:html-document-set-title! document title)
(if (gnc:owner-is-valid? owner)
(begin
(setup-query query owner account end-date)
(set! title (gnc:html-markup
(gnc:html-document-set-title!
(string-append (_ type-str ) (_ " Report: ") (gnc:owner-get-name owner)))
(gnc:html-document-set-headline!
document (gnc:html-markup
"!"
(_ type-str )
(_ " Report: ")
@ -565,8 +571,6 @@
(gnc:owner-anchor-text owner)
(gnc:owner-get-name owner))))
(gnc:html-document-set-title! document title)
(if account
(begin
(set! table (make-txn-table (gnc:report-options report-obj)

View File

@ -820,8 +820,7 @@
'tag "th"
'attribute (list "align" "left"))
(gnc:html-document-set-title!
doc report-name)
(gnc:html-document-set-title! doc report-name)
(gnc:html-document-add-object!
doc (gnc:make-html-text

View File

@ -780,8 +780,7 @@
'tag "th"
'attribute (list "align" "left"))
(gnc:html-document-set-title!
doc report-name)
(gnc:html-document-set-title! doc report-name)
(gnc:html-document-add-object!
doc (gnc:make-html-text

View File

@ -29,7 +29,7 @@
(define <html-document>
(make-record-type "<html-document>"
'(style-sheet style-stack style title objects)))
'(style-sheet style-stack style title headline objects)))
(define gnc:html-document?
(record-predicate <html-document>))
@ -43,6 +43,7 @@
'() ;; style stack
(gnc:make-html-style-table) ;; document style info
"" ;; document title
#f ;; headline
'() ;; subobjects
))
@ -52,6 +53,15 @@
(define gnc:html-document-title
(record-accessor <html-document> 'title))
(define gnc:html-document-set-headline!
(record-modifier <html-document> 'headline))
(define gnc:html-document-headline
(record-accessor <html-document> 'headline))
(define gnc:html-document-set-style-sheet!
(record-modifier <html-document> 'style-sheet))
(define gnc:html-document-set-style-sheet!
(record-modifier <html-document> 'style-sheet))

View File

@ -235,7 +235,12 @@
doc))
(headers? (if (null? rest) #f (if (car rest) #t #f))))
;; Copy values over to stylesheet-produced document. note that this is a
;; bug that should probably better be fixed by having the stylesheets
;; emit documents that are correct. this, however, is a slightly easier
;; place to enforce it. :p
(gnc:html-document-set-title! newdoc (gnc:html-document-title doc))
(gnc:html-document-set-headline! newdoc (gnc:html-document-headline doc))
;; push the style sheet's default styles
(gnc:html-document-push-style newdoc (gnc:html-style-sheet-style sheet))

View File

@ -213,6 +213,8 @@
(export gnc:make-html-document)
(export gnc:html-document-set-title!)
(export gnc:html-document-title)
(export gnc:html-document-set-headline!)
(export gnc:html-document-headline)
(export gnc:html-document-set-style-sheet!)
(export gnc:html-document-style-sheet)
(export gnc:html-document-set-style-stack!)

View File

@ -309,13 +309,16 @@
(if (and logopixmap (> (string-length logopixmap) 0))
(set! headcolumn 1))
(let* ((title (gnc:html-document-title doc))
(doc-headline (gnc:html-document-headline doc))
(headline (if (eq? doc-headline #f) title doc-headline)))
(gnc:html-table-set-cell!
t 1 headcolumn
(if show-preparer?
;; title plus preparer info
(gnc:make-html-text
(gnc:html-markup-b
(gnc:html-document-title doc))
(gnc:html-markup-b headline)
(gnc:html-markup-br)
(_ "Prepared by: ")
(gnc:html-markup-b preparer)
@ -329,8 +332,8 @@
;; title only
(gnc:make-html-text
(gnc:html-markup-b
(gnc:html-document-title doc)))))
(gnc:html-markup-b headline))))
)
; only setup an image if we specified one
(if (and logopixmap (> (string-length logopixmap) 0))

View File

@ -276,6 +276,10 @@
'attribute (list "border" 0)
'inheritable? #f)
(let* ((title (gnc:html-document-title doc))
(doc-headline (gnc:html-document-headline doc))
(headline (if (eq? doc-headline #f) title doc-headline)))
(gnc:html-table-set-cell!
t 1 1
(if show-preparer?
@ -298,6 +302,7 @@
(gnc:make-html-text
(gnc:html-markup-b
(gnc:html-document-title doc)))))
)
(if (and logopixmap
(not (string=? logopixmap "")))

View File

@ -160,13 +160,16 @@
ssdoc "a"
'tag ""))
(let ((title (gnc:html-document-title doc)))
(if title
(let* ((title (gnc:html-document-title doc))
(doc-headline (gnc:html-document-headline doc))
(headline (if (eq? doc-headline #f)
title doc-headline)))
(if headline
(gnc:html-document-add-object!
ssdoc
(gnc:make-html-text
(gnc:html-markup-p
(gnc:html-markup-h3 title))))))
(gnc:html-markup-h3 headline))))))
(gnc:html-document-append-objects! ssdoc
(gnc:html-document-objects doc))