[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master d77620f 100/156: Factor out dollar_units temp
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master d77620f 100/156: Factor out dollar_units template from the existing ones |
Date: |
Tue, 30 Jan 2018 17:22:21 -0500 (EST) |
branch: master
commit d77620fa6109281f43420ff43928d8bdcedc9583
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Factor out dollar_units template from the existing ones
The fragment defined in this template is used in more than a few places,
so put it in a reusable file instead of duplicating it.
Also move "HasScaleUnit" variable definition to the base illustration
class to allow reusing this template (which references this variable) in
illustrations of other types.
---
dollar_units.mustache | 10 ++++++++++
ledger_pdf_generator_wx.cpp | 10 +++++-----
numeric_summary.mustache | 12 ++----------
tabular_details.mustache | 8 +-------
4 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/dollar_units.mustache b/dollar_units.mustache
new file mode 100644
index 0000000..9158691
--- /dev/null
+++ b/dollar_units.mustache
@@ -0,0 +1,10 @@
+{{! Define a fragment common to several pages. }}
+<p align="center">
+<font size="-1">
+Values shown are in
+{{#HasScaleUnit}}
+{{ScaleUnit}}s of
+{{/HasScaleUnit}}
+dollars
+</font>
+</p>
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 539738d..0bd03e1 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -792,6 +792,11 @@ class pdf_illustration : protected html_interpolator
add_abbreviated_variable("ContractNumber", full_abbrev_length / 2);
add_variable
+ ("HasScaleUnit"
+ ,!invar.ScaleUnit().empty()
+ );
+
+ add_variable
("UWTypeIsMedical"
,invar.UWType == "Medical"
);
@@ -1810,11 +1815,6 @@ class pdf_illustration_regular : public pdf_illustration
);
add_variable
- ("HasScaleUnit"
- ,!invar.ScaleUnit().empty()
- );
-
- add_variable
("DefnLifeInsIsGPT"
,invar.DefnLifeIns == "GPT"
);
diff --git a/numeric_summary.mustache b/numeric_summary.mustache
index 01a7779..b783e6a 100644
--- a/numeric_summary.mustache
+++ b/numeric_summary.mustache
@@ -2,17 +2,9 @@
<p align="center">Numeric Summary</p>
-<font size="-1">
+{{>dollar_units}}
-<p align="center">
-Values shown are in
-{{^HasScaleUnit}}
-dollars
-{{/HasScaleUnit}}
-{{#HasScaleUnit}}
-{{HasScaleUnit}}s of dollars
-{{/HasScaleUnit}}
-</p>
+<font size="-1">
<br></br>
<br></br>
diff --git a/tabular_details.mustache b/tabular_details.mustache
index fef605c..b611b36 100644
--- a/tabular_details.mustache
+++ b/tabular_details.mustache
@@ -2,13 +2,7 @@
<p align="center">Tabular Detail</p>
-<p align="center"><font size="-1">
-Values shown are in
-{{#HasScaleUnit}}
-{{ScaleUnit}}s of
-{{/HasScaleUnit}}
-dollars
-</font></p>
+{{>dollar_units}}
<br></br>
<br></br>
- [lmi-commits] [lmi] master 29e63d6 117/156: Add basic illustration page of group placement illustration, (continued)
- [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
- [lmi-commits] [lmi] master 964db82 067/156: Rename columns_headings_page to column_headings_page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2a94469 074/156: Use Mustache template files from the data directory, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 01be23a 103/156: Automatically squeeze table columns to make them fit if necessary, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 46a7442 068/156: Factor out helper render_template() method, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d77620f 100/156: Factor out dollar_units template from the existing ones,
Greg Chicares <=
- [lmi-commits] [lmi] master 833eef5 086/156: Use std::make_unique<> instead of raw "new", Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 34c088c 073/156: Move footer contents into an external template too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0ba1c32 146/156: Consistently use "curr" as abbreviation of "current", Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 29865fc 133/156: Add supplemental report to NASD illustrations too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 919d796 001/156: Remove old XSL-FO-based PDF generation code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master cc7fc05 143/156: Change template file extension from .mustache to .mst, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 08984bb 148/156: Recognize Mustache files in the coding rules test, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master de5a5c7 151/156: Fix interpolate_string_test build, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb5693e 136/156: Harmonize spacing in header in reg_d_group illustrations too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0c85a7a 154/156: Avoid using directive for the "html" namespace, Greg Chicares, 2018/01/30