HTML: Add notes variable to the JSON file even if notes don't exist

if dive notes don't exist, notes variable must be added to the
javascript containing empty value "--", this is more friendly than just
showing 'undefined'

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:
Gehad elrobey 2014-07-19 01:49:30 +02:00 committed by Dirk Hohndel
parent 7fabeda184
commit f46b6f6ee2

View file

@ -114,11 +114,13 @@ void put_HTML_quoted(struct membuffer *b, const char *text)
void put_HTML_notes(struct membuffer *b, struct dive *dive, const char *pre, const char *post)
{
put_string(b, pre);
if (dive->notes) {
put_string(b, pre);
put_HTML_quoted(b, dive->notes);
put_string(b, post);
} else {
put_string(b, "--");
}
put_string(b, post);
}
void put_HTML_time(struct membuffer *b, struct dive *dive, const char *pre, const char *post)