[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9fe1d07 125/156: Implement page-specific foot
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9fe1d07 125/156: Implement page-specific footer for "Tabular Details" pages |
Date: |
Tue, 30 Jan 2018 17:22:28 -0500 (EST) |
branch: master
commit 9fe1d0741c448eebe654d1ba244bab91786776ba
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Implement page-specific footer for "Tabular Details" pages
These pages need to show specific footnotes in their footer, so allow
overriding get_upper_footer_template_name() at the page level and use
the correct footer template for these pages.
---
footer_disclaimer.mustache | 11 +++++++++++
ledger_pdf_generator_wx.cpp | 26 ++++++++++++++++++++++----
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/footer_disclaimer.mustache b/footer_disclaimer.mustache
new file mode 100644
index 0000000..fc5f2b0
--- /dev/null
+++ b/footer_disclaimer.mustache
@@ -0,0 +1,11 @@
+<font size="-2">
+
+{{^IsInforce}}
+ {{NonGuaranteedFootnote}}
+{{/IsInforce}}
+{{#IsInforce}}
+ {{InforceNonGuaranteedFootnote0}}<br>
+ <b>{{InforceNonGuaranteedFootnote3}}</b>
+{{/IsInforce}}
+
+</font>
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 3adce7a..a24960c 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -756,6 +756,9 @@ class pdf_illustration : protected html_interpolator
// templates should be used for the upper (above the separating line) and
// the lower parts of the footer. The upper template name may be empty if
// it is not used at all.
+ //
+ // Notice that the upper footer template name can be overridden at the page
+ // level, the methods here define the default for all illustration pages.
virtual std::string get_upper_footer_template_name() const = 0;
virtual std::string get_lower_footer_template_name() const = 0;
@@ -976,8 +979,7 @@ class page_with_footer : public page
,e_output_measure_only
);
- auto const&
- upper_template = illustration_->get_upper_footer_template_name();
+ auto const& upper_template = get_upper_footer_template_name();
if(!upper_template.empty())
{
footer_height += writer.output_html
@@ -1003,8 +1005,7 @@ class page_with_footer : public page
auto y = footer_top_;
- auto const&
- upper_template = illustration_->get_upper_footer_template_name();
+ auto const& upper_template = get_upper_footer_template_name();
if(!upper_template.empty())
{
y += writer.output_html
@@ -1049,6 +1050,13 @@ class page_with_footer : public page
// the page number or equivalent string (e.g. "Appendix").
virtual std::string get_page_number() const = 0;
+ // This method forwards to the illustration by default, but can be
+ // overridden to define a page-specific footer if necessary.
+ virtual std::string get_upper_footer_template_name() const
+ {
+ return illustration_->get_upper_footer_template_name();
+ }
+
// This method uses get_page_number() and returns the HTML wrapping it
// and other fixed information appearing in the lower part of the footer.
text get_footer_lower_html(html_interpolator const& interpolate_html) const
@@ -1708,6 +1716,11 @@ class tabular_detail_page : public
page_with_tabular_report
return "{{>tabular_details}}";
}
+ std::string get_upper_footer_template_name() const override
+ {
+ return "footer_disclaimer";
+ }
+
void render_or_measure_extra_headers
(illustration_table_generator& table
,html_interpolator const& interpolate_html
@@ -1791,6 +1804,11 @@ class tabular_detail2_page : public
page_with_tabular_report
return "{{>tabular_details2}}";
}
+ std::string get_upper_footer_template_name() const override
+ {
+ return "footer_disclaimer";
+ }
+
illustration_table_columns const& get_table_columns() const override
{
static illustration_table_columns const columns =
- [lmi-commits] [lmi] master 048ae05 093/156: Start NASD PDF illustration class implementation, (continued)
- [lmi-commits] [lmi] master 048ae05 093/156: Start NASD PDF illustration class implementation, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5ea5c86 101/156: Simplify and correct current PDF DC font handling, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ec490eb 153/156: Revise and extend some comments in PDF generation code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 38cab5e 096/156: Make footer template depend on illustration kind, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d1204c2 111/156: Factor out common parts of render_or_measure_fixed_page_part(), Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e388f6e 037/156: Add beginning of numeric summary page using an external template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 531699b 115/156: Factor out common page_with_basic_tabular_report class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master a85943b 124/156: Add the rest of individual private placement illustration pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master f0b9cea 113/156: Add "Assumption Detail" page to NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 031070b 132/156: Implement supplemental report page for the regular illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 9fe1d07 125/156: Implement page-specific footer for "Tabular Details" pages,
Greg Chicares <=
- [lmi-commits] [lmi] master 4f3a02e 078/156: Add company logo to the cover page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2d93248 118/156: Add the rest of group private placement illustration pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1272ce2 127/156: Don't include "Assumptions" page in composite NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e00ab7d 080/156: Hide "attained age" column for composite illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 29e63d6 117/156: Add basic illustration page of group placement illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1a9bfb3 137/156: Factor out standard_supplemental_report class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7c0ff88 145/156: Add copyright notices to all .mst template files, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2fd6a11 147/156: Use shorter and more consistent names for external templates, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b09a25f 026/156: Implement numbering pages in the PDF output, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb75971 033/156: Implement the second part of the narrative summary page, Greg Chicares, 2018/01/30