HTML: display dive status in detailed view

Add dive status in the detailed dive view.

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-11 03:26:21 +02:00 committed by Dirk Hohndel
parent 6a5dcb4859
commit 346f71f262
2 changed files with 20 additions and 1 deletions

View file

@ -734,7 +734,6 @@ function get_bookmarks_HTML(dive)
return result;
}
/**
*Return HTML main data of a dive
*/
@ -756,6 +755,17 @@ function get_dive_HTML(dive)
'</td></tr></table><div style="margin:10px;"><p class="words">Notes: </p>' + dive.notes + '</div>';
};
/**
*Return HTML dive status data
*/
function get_status_HTML(dive)
{
return '<h2 class="det_hed">Dive Status</h2><table><tr><td class="words">Sac: </td><td>' + dive.sac +
'</td><td class="words">&nbsp&nbsp&nbsp&nbsp&nbspOtu: </td><td>' + dive.otu +
'</td><td class="words">&nbsp&nbsp&nbsp&nbsp&nbspCns: </td><td>' + dive.cns +
'</td></tr></table>';
};
function mkelvin_to_C(mkelvin)
{
return (mkelvin - ZERO_C_IN_MKELVIN) / 1000.0;
@ -937,6 +947,7 @@ function showDiveDetails(dive)
document.getElementById("diveinfo").innerHTML = get_dive_HTML(items[dive_id]);
document.getElementById("dive_equipments").innerHTML = get_cylinders_HTML(items[dive_id]);
document.getElementById("bookmarks").innerHTML = get_bookmarks_HTML(items[dive_id]);
document.getElementById("divestats").innerHTML = get_status_HTML(items[dive_id]);
setDiveTitle(items[dive_id]);
//hide the list of dives and show the canvas.