mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
HTML: export dive events to detailed view
Add table of dive events to the dive detailed view. This should view each event, its type and the time this event took place. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b438158693
commit
10345d62fc
2 changed files with 37 additions and 0 deletions
13
save-html.c
13
save-html.c
|
@ -11,6 +11,18 @@ void write_attribute(struct membuffer *b, const char *att_name, const char *valu
|
|||
put_string(b, "\",");
|
||||
}
|
||||
|
||||
void put_HTML_bookmarks(struct membuffer *b, struct dive *dive)
|
||||
{
|
||||
struct event *ev = dive->dc.events;
|
||||
put_string(b, "\"events\":[");
|
||||
while (ev) {
|
||||
put_format(b, "{\"name\":\"%s\",", ev->name);
|
||||
put_format(b, "\"time\":\"%d:%02d min\",},", FRACTION(ev->time.seconds, 60));
|
||||
ev = ev->next;
|
||||
}
|
||||
put_string(b, "],");
|
||||
}
|
||||
|
||||
static void put_cylinder_HTML(struct membuffer *b, struct dive *dive)
|
||||
{
|
||||
int i, nr;
|
||||
|
@ -155,6 +167,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, int *dive_no, const
|
|||
if (!list_only) {
|
||||
put_cylinder_HTML(b, dive);
|
||||
put_HTML_samples(b, dive);
|
||||
put_HTML_bookmarks(b, dive);
|
||||
}
|
||||
put_string(b, "},\n");
|
||||
(*dive_no)++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue