<link href="css/lib/angular-xeditable/xeditable.min.css?v=10.5.1" rel="stylesheet">

<link href="css/lib/yasqe.min.css?v=10.5.1" rel="stylesheet"/>

<link href="css/new-sparql.css?v=10.5.1" rel="stylesheet"/>
<div id="wb-sparql">

    <div ng-show="getActiveRepositoryNoError()" class="pull-right mt-1">
        <div id="hideEditor" class="btn-group btn-group-sm" ng-click="showHideEditor()">
            <button class="btn btn-secondary btn-sm editor-only-btn" ng-model="viewMode" uib-btn-radio="'yasr'" uncheckable>
                {{'sparql.editor.only' | translate}}
            </button>
            <button class="btn btn-secondary btn-sm editor-and-results-btn" ng-model="viewMode" uib-btn-radio="'none'" uncheckable>
                {{'sparql.editor.and.results' | translate}}
            </button>
            <button class="btn btn-secondary btn-sm results-only-btn" ng-model="viewMode" uib-btn-radio="'editor'" uncheckable>
                {{'sparql.results.only' | translate}}
            </button>

            <button class="btn btn-link btn-sm p-0 ml-1 toggle-horizontal-view-btn"
                    ng-click="changeViewMode(currentQuery.id)"
                    gdb-tooltip="{{'switch.to' | translate}} {{orientationViewMode ? 'vertical' : 'horizontal' | translate}} {{'view' | translate}}"
                    tooltip-placement="left">
                <span class="icon-columns icon-lg m-0"
                      ng-class="orientationViewMode ? 'icon-rotate-90' : 'icon-rotate-270'"></span>
            </button>
        </div>
    </div>

     <h1 id="sparql-query-update-title-label">
        {{title}}
        <span class="btn btn-link"
              uib-popover-template="'js/angular/templates/titlePopoverTemplate.html'"
              popover-trigger="mouseenter"
              popover-placement="bottom-right"
              popover-append-to-body="true"><span class="icon-info text-tertiary"></span></span>
    </h1>

    <div core-errors></div>
    <div class="alert alert-danger" ng-show="repositoryError && getActiveRepository()">
        <p>{{'not.usable.active.repo.error' | translate}}</p>
        <p>{{repositoryError}}</p>
    </div>
    <query-editor
            ng-show="getActiveRepositoryNoError()"
            ng-keyup="saveQueryToLocal(currentQuery)"
            nocount="{{skipCountQuery}}" enable-column-resizing-on-window-width>
    </query-editor>
    <form id="wb-download" method="POST" action="" target="_self">
        <input id="wb-download-query" name="query" type="hidden"/>
        <input id="wb-download-infer" name="infer" type="hidden"/>
        <input id="wb-download-sameAs" name="sameAs" type="hidden"/>
        <input id="wb-download-accept" name="Accept" type="hidden"/>
        <input id="wb-auth-token" name="authToken" type="hidden"/>
    </form>
</div>
