Commit graph

42 commits

Author SHA1 Message Date
Lubomir I. Ivanov
6895c0eca5 printing: delete One Dive Simple.html and cleanup
The previous commit by Willem introduced
a new HTML template file which is not needed, as it was
decided to override the default `One Dive.html`.

This patch also include small cleanup in the new version
of `One Dive.html`.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24 19:44:45 +02:00
Willem Ferguson
4de47fbd87 PATCH: Update the single-dive per page print template
1) Place the dive profile below the synoptic info for the dive.
2) Re-arrange the synoptic info items.
3) In the synoptic info, replace air temperature info with
    gas and cylinder info.
4) If any items among the the synoptic data take more than one line,
    the the alignment of cells in the synoptic info table is
    maintained. In the previous version this caused a ragged bottom
    edge of the synoptic info table.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
2017-11-24 19:43:54 +02:00
Martin Měřinský
dcf2542215 Use abbreviations with dots. 2017-03-11 08:09:07 -08:00
Martin Měřinský
de73cf8ac4 Time is not an abbreviation. 2017-03-11 08:09:07 -08:00
Martin Měřinský
869a7fcfcc dive master > divemaster 2017-03-04 12:08:17 -08:00
Lubomir I. Ivanov
1d4075f368 printing_templates: mark 'dive.notes' as 'safe'
Grantlee has a way to display a variable as HTML by
marking it as 'safe' e.g.:
{{ dive.notes|safe }}

This allows any HTML to be preserved when printing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15 21:07:12 -08:00
Gehad elrobey
27bec9bc7b Printing: support in-place editing for templates
Edit the templates into the same file, which is more intuitive as
Custom.html is a bit confusing.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16 21:17:22 -07:00
Gehad elrobey
4553155cf3 Printing: add a statistics template
Add a statistics template to the templates directory.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:36:10 +03:00
Gehad elrobey
b19d07c61c Printing: fix the six dives per page layout
Add container with height 100% which contains the six dives, so dives
don't overflow the page.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:32:17 +03:00
Gehad elrobey
f7fcc96bff Printing: enhance 2 dives template
- Add more text padding on the left
- Reduce the width of the profile so that the padding on the right of it
is equal to the padding bottom from it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:16 +03:00
Gehad elrobey
2d360e8a6d Printing: add table backgrounds and borders to six dives template
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:12 +03:00
Gehad elrobey
4f9349f548 Printing: use the same background for all the data cells flow layout
Dive notes should have the same background as the remaining data cells.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:07 +03:00
Gehad elrobey
c862636cf0 Printing: add 'dontbreak' css class to dives
Prevent breaking the dives in flowlayout, and the rows
in the table template. They should have the 'dontbreak'
css selector.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:58 +03:00
Gehad elrobey
72b35d8e79 Printing: use border width from Grantlee backend
Find the border-width dynamically from the Grantlee backend.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:26 +03:00
Gehad elrobey
efe8dc9b57 Printing: remove the outer border from table template
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:03:49 +03:00
Gehad elrobey
d7f1a6b96e Printing: remove extra white spaces from 6 dives template
The are some rounding errors in the 6 dives template.
Solve them them by adding the color to the main body div.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:03:07 +03:00
Gehad elrobey
cfa34cc022 Printing: add more padding on the top of the profile
add more padding on the top of the profile so that the
left-right-top padding around the profile is the same.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:03:05 +03:00
Gehad elrobey
d72ba4f15a Printing: remove templates additional margins
Remove extra margins and paddings in templates.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:57 +03:00
Gehad elrobey
dc56d1fa54 Printing: remove the outer most border for all templates
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:51 +03:00
Gehad elrobey
ebd83b15da Printing: make the actual data font width regular (not bold)
The actual data needs to be regular font not a bold font, so use <p>
instead of <h1> tag for the actual data fields.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:48 +03:00
Gehad elrobey
04fc07405a Printing: add color3 to templates and make it effective
Use the added color for 'Table cells 2'

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:35 +03:00
Gehad elrobey
e0ecccfa7b Printing: fix color numbers in printing templates
After adding the additional 'Table Cells 2' color to the color palette
fix the colors assigned to each field.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:33 +03:00
Gehad elrobey
11841563d2 Printing: add six dives per page template
Six dives per page templates makes good use of the page area, it can be
mainly used to produce a lightweight print outs.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:15 +03:00
Gehad elrobey
9c13e7a071 Printing: enhance templates layout
Make better use of extra spaces, and decrease the margin sizes.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:12 +03:00
Gehad elrobey
8d0101bf3d Printing: templates should use colors defined in the color palette
Use the colors defined in the color palettes for all font, borders,
table sections and backgrounds of all templates.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:02:07 +03:00
Dirk Hohndel
a27623dad0 Printing: make better use of the space in Two Dives template
There was way too much wasted space and the profile ended up being
unnecessarily tiny.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29 12:37:01 -07:00
Dirk Hohndel
a4608f7c91 Printing: fix dive lookup for profile generation
The existing code (and templates) looked up dives by number and then used
that as index into the dive table. This worked exactly in one case: if all
dives were numbered consecutively starting with 1. While that is not an
entirely unreasonable case, it's of course not an acceptable assumption to
make.

This commit adds the necessary changes to instead look up dives by their
unique id. That's what it's there fore, after all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28 13:37:14 -07:00
Gehad elrobey
ccddcc3952 Printing: rename templates to have spaces and capitalization
This is easier to have user friendly names for the bundled
templates.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:44 +03:00
Gehad elrobey
6319f0efba Printing: add a "Flow" layout
Print dives successively and fit as many as we can in the smallest
number of pages. Some dives may be broken between pages.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:12 +03:00
Gehad elrobey
c6116b0269 Printing: add a "Table" template
The "Table" template shows a simple table of user dives. The fields
shown are:
Dive number, Date, Time, Depth, Duration, Master and Location.
Other fields can be added by the user.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:05 +03:00
Gehad elrobey
d2bc70a570 Printing: add css filter to templates
Filter HTML body with grayscale value, add background-color to div
inside body so filter can be applied to it.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:59 +03:00
Gehad elrobey
c18e5ec795 Printing: make templates support custom colors
Use template_options colors instead of static colors.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:37 +03:00
Gehad elrobey
85bce0fa0d Printing: enhance the one_dive per page template
- fix the layout
- prevent the notes from expanding
- don't overflow the text

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:31 +03:00
Gehad elrobey
c35092f5c9 Printing: add custom options to the PrintDialog
Add:
-custom.html template
-custom template to print_options struct
-options to the options dialog

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:02:09 +03:00
Gehad elrobey
815072d2ae Printing: retrieve number of dives per page from the template file
Add special data attribute 'data-numberofdives' in the template <body> with
the number of dives per page.
This is standard HTML5 specification so it won't corrupt the template file.
Any template that will be used for printing must contain this attribute to
assure correct output.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:01:53 +03:00
Gehad elrobey
6446b75b9e Printing: edit templates to show template options dynamically
Template styles must refere to Grantlee fields to be replaced with
user selected settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:01:31 +03:00
Gehad elrobey
3d5caabe4a Printing: fix two dives per page borders and text font
As we use a responsive layout, every UI element must be relative
to its parent and its size must be a ratio of the view port to
prevent them from displaying outside their containing parents.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 20:58:47 +03:00
Gehad elrobey
75263e3d2c Printing: rename the "base" template for consistency
Change the name of the template "base" to "two_dives" as this name
describes it better.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:58 +03:00
Gehad elrobey
42b9d0d047 Printing: add a "one dive per page" template
This is a Grantlee template to show 1 dive per page.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:57 +03:00
Gehad elrobey
cd30e11672 Printing: render the dive profile on top of QWebView
We render the dive profile over the QWebView to the QPainter. This helps
us not to save the SVG images to disk and then render them again to the
webview.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:56 +03:00
Gehad elrobey
1040f0d4e5 Printing: fix rendering bug for odd number of dives
Odd number of dives needs extra space from the buttom, so that when we
scroll to the last page extra whitespace is shown under the last dive
frame, this is fixed by adding a default footer to the base template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:56 +03:00
Gehad elrobey
672039c44f Printing: Create two dives per page grantlee template
This is just a HTML/CSS template file which will be used
as the basis for initial Grantlee development.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-04 10:05:11 -07:00