diff options
author | 2015-02-13 23:52:41 -0800 | |
---|---|---|
committer | 2015-02-13 23:52:41 -0800 | |
commit | 56de6b73f67d5ddeec74153303a27866e39279c7 (patch) | |
tree | 45040e1fb23c26e12b3002e9381f13717a9eb78d /save-html.c | |
parent | 2843dc38c9e64e87ac1ee84e2cb0147f630ab117 (diff) | |
parent | f81e2c111d9c563a78e62c3bae64bec07c052ec0 (diff) | |
download | subsurface-56de6b73f67d5ddeec74153303a27866e39279c7.tar.gz |
Merge branch 'divesites'
This brings in the dive site infrastructure and initial UI work
Diffstat (limited to 'save-html.c')
-rw-r--r-- | save-html.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/save-html.c b/save-html.c index d67931d8f..13d2fd559 100644 --- a/save-html.c +++ b/save-html.c @@ -172,8 +172,11 @@ void put_HTML_samples(struct membuffer *b, struct dive *dive) void put_HTML_coordinates(struct membuffer *b, struct dive *dive) { - degrees_t latitude = dive->latitude; - degrees_t longitude = dive->longitude; + struct dive_site *ds = get_dive_site_for_dive(dive); + if (!ds) + return; + degrees_t latitude = ds->latitude; + degrees_t longitude = ds->longitude; //don't put coordinates if in (0,0) if (!latitude.udeg && !longitude.udeg) @@ -304,7 +307,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d put_format(b, "\"subsurface_number\":%d,", dive->number); put_HTML_date(b, dive, "\"date\":\"", "\","); put_HTML_time(b, dive, "\"time\":\"", "\","); - write_attribute(b, "location", dive->location, ", "); + write_attribute(b, "location", get_dive_location(dive), ", "); put_HTML_coordinates(b, dive); put_format(b, "\"rating\":%d,", dive->rating); put_format(b, "\"visibility\":%d,", dive->visibility); |