@using PantheonRA.WebApi.Contracts.Enums;

@model PantheonRA.WebApi.Contracts.PaWoExRegOper

@{ 

    var icon = String.Empty;
    var color = String.Empty;

    switch (Model.EventType)
    {
        case WorkRegEventType.OperationStart:
            icon = "fad fa-lg fa-play";
            color = "#7EAF3F";
            break;
        case WorkRegEventType.OperationPause:
            icon = "fad fa-lg fa-pause-circle";
            color = "goldenrod";
            break;
        case WorkRegEventType.OperationContinue:
            icon = "fad fa-lg fa-play-circle";
            color = "#7EAF3F";
            break;
        case WorkRegEventType.OperationEnd:
            icon = "fad fa-lg fa-stop-circle";
            color = "#BB5534";
            break;

        default:
            icon = "fa fa-clock-o";
            break;
    }


}

<div class="row document-head top-row-margin-bottom">
    <div class="col-md-2 col-sm-2 col-xs-5 text-center top-row-large-font theme-button-color" id="stopwatch_div">
        <i class="@icon " style="color: @color; padding-right:5px" title="@Model.EventTypeCaption"></i>
        <span style="color: @color" id="stopwatch">00:00:00</span>
        
    </div>
    <div id="timerecord-col" class="col-lg-8 col-md-10 col-sm-10 col-xs-7" style="padding:15px 0px;overflow-x:inherit">
        <div id="timerecord-buttons" class="col-xs-12" style="display: inline-flex; padding: 0px">

            <button id="record-button-0" type="button"
                    data-event-type="@WorkRegEventType.OperationStart"
                    data-milliseconds="@Model.Milliseconds"
                    class="btn btn-sm text-center entry-type-button col-xs-6 @(Model.EventType == WorkRegEventType.OperationStart ? "set-in-progress" : string.Empty)
                        @(Model.EventType == WorkRegEventType.OperationStart || Model.EventType == WorkRegEventType.OperationPause || Model.EventType == WorkRegEventType.OperationContinue ? "hidden" : string.Empty)"
                    onclick="startWorkRecording(this.id)"
                    data-icon="fad fa-play"
                    data-color="#7EAF3F">

                <i class="fad fa-play fa-lg" style="color: #7EAF3F"></i>
                <span style="display:block">@Loc.TaBegin</span>
            </button>
            <button id="record-button-1" type="button"
                    data-event-type="@WorkRegEventType.OperationPause"
                    data-milliseconds="@Model.Milliseconds"
                    class="btn btn-sm text-center entry-type-button col-xs-6 @(Model.EventType == WorkRegEventType.OperationPause ? "set-in-progress" : string.Empty)
                        @(String.IsNullOrEmpty(Model.EventType) || Model.EventType == WorkRegEventType.OperationPause || Model.EventType == WorkRegEventType.OperationEnd ? "hidden" : string.Empty)"
                    onclick="startWorkRecording(this.id)"
                    data-icon="far fa-pause-circle"
                    data-color="goldenrod">

                <i class="far fa-pause-circle  fa-lg" style="color: goldenrod"></i>
                <span style="display:block">@Loc.Pause</span>
            </button>
            <button id="record-button-2" type="button"
                    data-event-type="@WorkRegEventType.OperationContinue"
                    data-milliseconds="@Model.Milliseconds"
                    class="btn btn-sm text-center entry-type-button col-xs-6 @(Model.EventType == WorkRegEventType.OperationContinue ? "set-in-progress" : string.Empty)
                        @(String.IsNullOrEmpty(Model.EventType) || Model.EventType == WorkRegEventType.OperationStart || Model.EventType == WorkRegEventType.OperationContinue ||
                            Model.EventType == WorkRegEventType.OperationEnd ? "hidden" : string.Empty)"
                    onclick="startWorkRecording(this.id)"
                    data-icon="far fa-play-circle"
                    data-color="#7EAF3F">

                <i class="far fa-play-circle fa-lg" style="color: #7EAF3F"></i>
                <span style="display:block">@Loc.Continue</span>
            </button>
            <button id="record-button-3" type="button"
                    data-event-type="@WorkRegEventType.OperationEnd"
                    data-milliseconds="@Model.Milliseconds"
                    class="btn btn-sm text-center entry-type-button col-xs-6 @(Model.EventType == WorkRegEventType.OperationEnd ? "set-in-progress" : string.Empty) "
                    onclick="stopWorkRecordings(this.id)"
                    data-icon="far fa-stop-circle"
                    data-color="#BB5534">

                <i class="far fa-stop-circle  fa-lg" style="color: #BB5534"></i>
                <span style="display:block">@Loc.TaEnd</span>
            </button>

        </div>
    </div>
</div>
