summaryrefslogtreecommitdiffstats
path: root/save-html.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 19:01:27 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 21:30:56 -0800
commitb7e53aaee6703c27061037dfadd657f5fc301559 (patch)
treea589b40966ff019398c725917a8de8f173515fc2 /save-html.c
parent4c87ccf952de33a0e62a4fbaf56457ce7359ed84 (diff)
downloadsubsurface-b7e53aaee6703c27061037dfadd657f5fc301559.tar.gz
Change from locations to dive sites in save-html and worldmap
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-html.c')
-rw-r--r--save-html.c9
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);