<%@ Page Language="C#" AutoEventWireup="true" UICulture="auto" Culture="auto" meta:resourcekey="PageResource1" %>

<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Globalization" %>

<script runat="server">
    //@Override this is suggested by Microsoft, overriding the initialize culture function (that is
    //automatically called by the aspx.
    //Checks if the cookie exists and sets the language correctly, otherwise will fall-back to the default language
    //(English).
    protected override void InitializeCulture()
    {
        HttpCookie lang = Request.Cookies["siteLanguage"];

        String selectedLanguage = (lang != null) ? lang.Value : "en";
        UICulture = selectedLanguage;
        Culture = selectedLanguage;

        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(selectedLanguage);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedLanguage);
        base.InitializeCulture();
    }
</script>

<%  
    //this prevents the browser from caching templates. (on IE the templates where cached with the old language
    //too, so the change language was not working, this is a workaround for that).

    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now.AddMinutes(-30)); %>

<%--view template starts here (will be appended inside a row-fluid)--%>

<link href="<%= ResolveUrl("~/assets/libs/js/backgrid-0.3.5/lib/backgrid.css") %>" rel="stylesheet" />
<link href="<%= ResolveUrl("~/app/custom-screens/" + Path.GetFileNameWithoutExtension(this.Request.PhysicalPath) + "/" + Path.GetFileNameWithoutExtension(this.Request.PhysicalPath) + ".css")%>" rel="stylesheet" />
<link href="<%= ResolveUrl("~/assets/libs/js/multiselect/virtual-select.min.css") %>" rel="stylesheet" />

<div class="no-data-poster row-fluid text-center animated fadeIn" data-bind="classes: { hide: not(all(not(hasData), not(isLoading))), }," style="height:500px;">
    <div class="row-fluid" style="position:relative;top:100px;">
        <i class="fw-icon-circle-blank fw-icon-4x" style="font-size:115px;"></i>
    </div>
    <div class="row-fluid" style="position:relative;top:115px;">
        <h3 style="font-size:50px;">
            <asp:localize runat=server meta:resourcekey="no_data_available" />
        </h3>
    </div>
</div>
<div class="no-data-poster row-fluid text-center animated fadeIn" data-bind="classes: { hide: not(all(isLoading)), }," style="height:500px;">
    <div class="row-fluid" style="position:relative;top:100px;">
        <i class="fa fa-cog fw-icon-4x fa-spin" style="font-size:115px;"></i>
    </div>
    <div class="row-fluid" style="position:relative;top:115px;">
        <h3 style="font-size:50px;">
            <asp:localize runat=server meta:resourcekey="loading_data" />
        </h3>
    </div>
</div>
<div class="row-fluid items-grid-container infinite-container" data-bind="classes: { hide: not(all(hasData, not(isLoading))), },"></div>
          
<script id="datetime_picker_hydrogen_samples" type="text/x-handlebars-template">
    <div class="text-center">
        <div class="row-fluid">
            <div class="span12">
                <label class="datetime-current-value"></label>
            </div>
            <%--<div class="span4">
                <button data-toggle="tooltip" data-placement="bottom" data-cell-action="EDIT_DETAILS" title="<asp:Localize runat=server meta:resourcekey=edit_datetime_title />" class="btn btn-cell-action btn-small btn-edit-details edit-datetime">Edit</button>
 
            </div>--%>
        </div>
   </div>
</script>


<script id="subnavbar_controls_hydrogen_samples" type="text/x-handlebars-template">
    <div class="span12">
        <div class="subnavbar-toolbar form-inline">
            <div class="span12 row-fluid">
                <div class="span4" >
                    <div style="text-align: left;">
                        <label class="label-name">
                            Heat
                        </label>
                        <label class="control-label" style="width:200px;">
                            <div id="heat-picker-multi-select"></div>
                        </label>
                        
                        <button class="btn add-item add-sample">
                <asp:Localize runat=server meta:resourcekey=add_item_btn_label />
            </button>
                    </div>
                </div> 
        </div>
       <%--     
            <select id="heat-picker-multi-select" data-bind="value: heatId, options: heatNames "></select>--%>




          <%--  <button id="refreshBtn" class="btn btn-primary" style="margin-bottom:5px;margin-left:10px;" title="<asp:localize runat=server meta:resourcekey=refresh_btn_title />">
            <i class="fa fa-refresh"></i>
            </button>--%>
        </div>
    </div>
</script>

<script id="actions_cell_template_hydrogen_samples" type="text/x-handlebars-template">
    <div class="text-center">
        <button data-toggle="tooltip" data-placement="bottom" data-cell-action="SAVE" title="<asp:Localize runat=server meta:resourcekey=save_title />" class="btn btn-cell-action btn-small btn-save hide"><i class="fa fa-floppy-o"></i></button>
        <button data-toggle="tooltip" data-placement="bottom" data-cell-action="DISCARD" title="<asp:Localize runat=server meta:resourcekey=discard_title />" class="btn btn-cell-action btn-small btn-discard hide"><i class="fa fa-times"></i></button>
        <button data-toggle="tooltip" data-placement="bottom" data-cell-action="DELETE" title="<asp:Localize runat=server meta:resourcekey=remove_batch_title />" class="btn btn-cell-action btn-small btn-remove"><i class="fa fa-trash-o"></i></button>

    </div>
</script>




<script id="datetime_picker_modal" type="text/x-handlebars-template">
    <div class="modal-header" >    
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>
            <span style="font-weight:600;display:inline-block;color: #505050;" data-bind="text: title"></span>
        </h3>
    </div>
    <div class="modal-body" style="height:250px;">

        <div style="padding-bottom:0;height:230px;" class="modal-body">
             
            <div class="row-fluid">
                 <div class="row-fluid" style="margin-bottom: 10px !important;">   
                    <div class="span3">

                    <label class="formbold-form-label"> Timestamp </label>
                    </div>
                    <div class="span4" style="margin-left:-3px;">
                        <div class="form-group">
                            <div class="input-group form-inline">
                                <label>
                                    <asp:localize runat="server" meta:resourcekey="delays_declare_delay_start_label" />
                                </label>
                                <label for="dateModal" class="input-prepend"><span class="add-on"><i class="icon-calendar"></i></span></label>
                                <input type="text" id="dateModal" class="form-control" data-bind="value: dateModal" style="width: 100px;margin-left: -3.5px;">
                            </div>
                        </div>
                    </div>
                    <div class="span4" style="margin-left:-5px;">
                        <div class="form-group">
                            <div class="input-group form-inline bootstrap-timepicker timepicker">
                                <label for="timeModal" class="input-prepend"><span class="add-on"><i class="icon-time"></i></span></label>
                                <input type="text" id="timeModal" class="form-control" data-bind="value: timeModal"  style="width: 100px;margin-left: -3.5px;">
                            </div>
                        </div>
                    </div>
                </div>             
            </div>
            <hr />
             <div class="row-fluid" style="margin-bottom: 10px !important;"> 
                 <div class="span2">
                    <label class="formbold-form-label">Location</label>

                 </div>
                 <div class="span4" style="margin-top: 2px;">
                    <span data-bind="text:sampleLocationName"></span>
                 </div>

            </div>     
            <hr />
            <div class="row-fluid" style="margin-bottom: 10px !important;">
               <div class="span2">
                 <label class="formbold-form-label">Hydrogen</label>

              </div>
              <div class="span4" style="margin-top: 2px;">
                 <span data-bind="text:hydrogen"></span>
              </div>
 

            </div>   
               
             
            <hr />

        </div>
    </div>
    <div class="modal-footer">
        <div class="modal-status-msg-container pull-left">
            <div class="modal-status-msg hide" data-bind="toggle: notEquals(errorMsg, ''),">
                <span data-bind="text: errorMsg, attr: { title: errorMsg, }," style="color:#ff0000;font-size:16px;"></span>
            </div>
            <div class="modal-status-msg hide" data-bind="toggle: processing,">
                <asp:Localize runat='server' meta:resourcekey='processing_msg' />
                <i class="fa fa-cog fa-spin"></i>
            </div>
        </div>
        <button id="acceptBtn" class="btn btn-primary" data-bind="enabled: not(processing),">
            <asp:Localize runat='server' meta:resourcekey='accept_btn_label' />
        </button>
        <button id="cancelBtn" class="btn" data-dismiss="modal" data-bind="enabled: not(processing),">
            <asp:Localize runat='server' meta:resourcekey='cancel_btn_label' />
        </button>
    </div>
</script>