diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index ac752c573..501c3c048 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -5163,8 +5163,7 @@ explained on the section xref:S_ImportingCSVDives[Importing CSV dives]. == APPENDIX E: Writing a custom print template _Subsurface_ has a way to create or modify templates for printing dive logs to -produce customized printouts of them. Templates written in HTML, as well as a simple -Grantlee instruction set, are rendered to the print device by _Subsurface_. +produce customized printouts of them. Templates written in HTML are rendered to the print device by _Subsurface_. Templates are accessed using the print dialog (see image *B* below). @@ -5187,14 +5186,11 @@ image::images/Template1_f22.jpg["FIGURE: template edit dialog",align="center"] customizable: the _Edit_ buttons in the _Colors_ tab allows choosing arbitrary colors for different components of the dive log printout. -3) The _Template_ tab of the Edit Panel (see image below) allows creating a template using HTML as well as a few - Grantlee programming primitives. Grantlee can create and format HTML code in - a highly simple but efficient way (see below). The HTML of the template can be edited and saved. The saved - template is stored in the same directory as the dive being processed. By default, a _Custom_ - template is a skeleton with no specific print instructions. The information printed - needs to be specified and formatted in the template by replacing the section marked with: - "". Writing HTML code with Grantlee instructions allows unlimited - freedom in determining what is printed and in which way it should be rendered. +3) The _Template_ tab of the Edit Panel (see image below) allows creating a template using HTML. The HTML of the + template can be edited and saved. The saved template is stored in the same directory as the dive being processed. + By default, a _Custom_ template is a skeleton with no specific print instructions. The information printed needs to + be specified and formatted in the template by replacing the section marked with: + "". image::images/Template2_f22.jpg["FIGURE:Template tab",align="center"] @@ -5205,7 +5201,8 @@ dialog to save the new template using a new template name. To write a custom template, the following elements must exist so the template will be correctly handled and rendered. === Main dive loop -_Subsurface_ exports a dive list called (*dives*) to the _Grantlee_ back end. It is possible to iterate over the list as follows: +_Subsurface_ exports a dive list called (*dives*) as well as a list of cylinders called (*cylinderObjects*) to the back end. It is +possible to iterate over the list as follows: .template.html .... {% for dive in dives %} @@ -5220,34 +5217,40 @@ _Subsurface_ exports a dive list called (*dives*) to the _Grantlee_ back end. It
{{ dive.notes|safe }}
diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp index 2578b6bdf..46e7db912 100644 --- a/desktop-widgets/templatelayout.cpp +++ b/desktop-widgets/templatelayout.cpp @@ -502,6 +502,12 @@ QVariant TemplateLayout::getValue(QString list, QString property, const State &s return get_pressure_string(cylinder->end, true); } else if (property == "gasMix") { return get_gas_string(cylinder->gasmix); + } else if (property == "gasO2") { + return (get_o2(cylinder->gasmix) + 5) / 10; + } else if (property == "gasN2") { + return (get_n2(cylinder->gasmix) + 5) / 10; + } else if (property == "gasHe") { + return (get_he(cylinder->gasmix) + 5) / 10; } } else if (list == "dives") { if (!state.currentDive)