<!-- Template for rig logbook -->

<div style="padding:50px;">


<h1>Logbook for rig [% rig_info.name %]</h1>

<div class="fit-content" style="display:flex;gap:40px; margin:auto; align-items:flex-start; margin-top:20px;">
<div class="logarea content-container">
[% IF data.content %][% data.content.replace('\n',"<br>\n") %][% ELSE %]No logbook data entered![% END%]
</div>
<br>
<div class="content-container">
<form method=post action="/cgi-bin/celltest/logbook.cgi" name=logbook_form>
[% INCLUDE print_hidden.tt %]
<label><input type="checkbox" name="log_all" value="on">Add to logbook for all rigs on this server</label>
<br>
<textarea name="text" rows="6" class="textfield" placeholder="Add a new entry to Rig [% rig_info.name %] logbook here" autocomplete=off></textarea>
<input type=hidden name=action value=Save>
<br><input type="button" value="Save new entry" onclick="store_comment(this)" class=rfcbutton>
</form>
</div>
</div>



</div>


<style>
.textfield {
   width:100%;
}

.logarea {
   overflow-y:auto;
   min-width:600px;
   max-height:1000px;
   min-height:100px;
}

</style>


<script>

function store_comment(e)
{
    var f = e.form;
    e.disabled = true;
    var str = f.text.value;
[% IF config.main.equipmentid && global_config.global.remote_equipment_database -%]        
    remote_log('[% global_config.global.remote_equipment_database %]',[% config.main.equipmentid %],str,do_nothing);
[% END -%]
    setTimeout(submit_comment,1000);
    return true;
}

function do_nothing(res)
{

}

function submit_comment()
{
    document.logbook_form.submit();
}

</script>
