<div ng:controller="gImagesMainController" class="row-fluid" id="body-main" qn:Fillheight="scrollOptions">
    <div class="col10">
        <div class="toolbar cfix">
            <div class="toolbar-group">
                <h3>
                    <span ng:show="isLibrary == false">{{$resource('images.allgalerys')}}</span>
                </h3>
            </div>
            <div class="toolbar-group" >
                <button class="button" ng:show="isSearch()" ng:click="all()"><i class="icon-angle-left"></i></button>
                <button title="{{$resource('utility.refresh')}}" class="button tooltip" ng:click="refresh()"><i class="icon-refresh"></i></button>
            </div>
            <div class="toolbar-group right">
                  <span class="info">{{pager.from}}-{{pager.to}} of {{pager.total}}</span>
                  <button class="button prev" ng:disabled="!pager.canPrev()" ng:click="pager.prev()"><i class="icon-chevron-left"></i></button>
                  <button class="button next" ng:disabled="!pager.canNext()" ng:click="pager.next()"><i class="icon-chevron-right"></i></button>
              </div>
        </div>
        <div class="fillh scroller">
           <div class="table table-hover fillh">
            <table class="">
                <thead>
                    <tr>
                        <th class="icon">&nbsp;</th>
                        <th>{{$resource('images.title')}}</th>
                        <th>{{$resource('blogs.status')}}</th>
                    </tr>
                </thead>
                <tbody ng:Model="documents">
                    <tr ng:repeat="library in libraries">
                        <td class="icon">
                            <span class="circle circle-small blue"><span class="icon li_note"></span></span>
                        </td>
                         <td>{{library.Title}}</td>
                         <td>{{library.Status.DisplayName}}</td>
                        <td class="command icon">
                            <span title="{{$resource('utility.options')}}" class="trigger tooltip"><i class="icon-reorder"></i></span>
                            <div qn:popover="{position: {my: 'right top', at: 'left top'}}">
                                <ul>
                                    <li><a ng:click="removeLibrary(librarz.ID, $index)" value="Are you sure?"><i class="icon-trash"></i>{{$resource('documents.delete')}}</a></li>
                                    <li><a ng:click="setLockStatusLista(library)" value="Da li ste sigurni?"><span ng:show="library.Status.DisplayName == 'NeAktivan'"><i class=" icon-ban-circle"></i>{{$resource('images.ugaleriji')}}</span><span ng:show="library.Status.DisplayName == 'Aktivan'"><i class="icon-ok-circle"></i>{{$resource('images.negaleriji')}}</span><span ng:show="library.Status.DisplayName == 'Draft'"><i class="icon-ok-circle"></i>{{$resource('images.ugaleriji')}}</span></a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        </div>
    </div>
    <div class="col2 sidebar">
        <div class="toolbar toolbar-strip lightblue cfix">
            <div class="toolbar-group row-fluid">
                <button title="{{$resource('utility.basic')}}" class="button lightblue col4 tooltip" ng:class="{active:sidebarView == 'basic'}" ng:click="switchSidebar('basic')"><i class="icon-star"></i></button>
                <button title="{{$resource('utility.tags')}}" class="button lightblue col4 tooltip" ng:class="{active:sidebarView == 'tags'}" ng:click="switchSidebar('tags')"><i class="icon-tag"></i></button>
                <button title="{{$resource('utility.other')}}" class="button lightblue col4 tooltip"><i class="icon-tasks"></i></button>
            </div>
        </div>
        <div class="inner fillh" >
            <ul class="nav" ng:show="sidebarView == 'basic'">
                <li class="search-box"><input ng:Model="searchLibraries" type="text" placeholder="Search libraries"/><i ng:show="searchLibraries.length > 0" ng:click="searchLibraries = ''" class="icon-remove clickabile"></i></li>
                <li ng:repeat="library in libraries | filter : searchLibraries" ng:class="{active: isCurrentLibrary(library)}"><a ng:click="lib(library)"><i class="icon-angle-right"></i>{{library.Title}}</a></li>
            </ul>
            <ul class="nav" ng:show="sidebarView == 'tags'">
                <li class="search-box"><input ng:Model="searchTags" type="text" placeholder="Search tags"/><i ng:show="searchTags.length > 0" ng:click="searchTags = ''" class="icon-remove clickabile"></i></li>
                <li ng:class="{active:!isSearch()}"><a ng:click="reset()"><i class="icon-asterisk"></i>{{$resource('images.all')}}</a></li>
                <li ng:class="{active:query.tag==tag.Alias}" ng:repeat="tag in classification.Labels | filter : searchTags"><a ng:click="search({tag: tag.Alias}, true)"><i class="icon-angle-right"></i>{{tag.Name}}</a></li>
            </ul>
        </div>
    </div>
    <div qn:dialog="ui.dialogEdit">
        <form name="fomra">
            <p>{{$resource('images.title')}}<input type="text" name="Title" ng:Model="image.Title" /></p>
             <div class="control-group">
                <label class="control-label">{{classification.Name}}</label>
                <div class="controls" >
                    <select qn:chosen multiple="multiple" ng:model="Labels[classification.Alias]" ng:options="label.ID as label.Name for label in classification.Labels"></select>
                </div>
            </div>
            <input  type="hidden" name="ID" value="{{image.ID}}" />
            <input qn:upload="uploadOption" ng:Model="upload" id="editfile" type="file" name="file" data-url="/qusion/image/edit" />
           
            <p>{{$resource('images.warning')}}</p>
        </form>
        <div>
            <button class="btn lightblue" ng:click="startUpload()">{{$resource('images.save')}}</button> ili <button ng:Click="cancelEdit()" class="btn btn-link">{{$resource('images.cancel')}}</button>
        </div>
    </div>
</div>