<commit_before><div class="row">
  <div class="col-lg-12">
    <h1 class="page-header">
      Площадки
    </h1>
  </div>
</div>

<div ng-if="$user.isAdmin" class="row">
  <div class="col-lg-12">
    <form role="form" class="form form-filter">
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="row">
            <div class="col-lg-12">

              <div ng-if="$user.isAdmin()" class="form-group">
                <label for="owner">Наблюдател</label>

                <user-selector model-id="zonesController.filter.owner" name="owner"
                               placeholder="- всички -" on-select="zonesController.updateSearch()"></user-selector>
              </div>

              <div class="form-group">
                <label for="location">Локация</label>
                <location-selector name="location" model-id="zonesController.filter.location"
                                   placeholder="- всички -" on-select="zonesController.updateSearch()"></location-selector>
              </div>

              <div class="form-group">
                <label>Площадка</label>
                <ui-select ng-model="zonesController.filter.zone" name="zone"
                           on-remove="zonesController.updateSearch()"
                           on-select="zonesController.updateSearch()">
                  <ui-select-match allow-clear="true" placeholder="- всички -">
                    {{$select.ngModel.$modelValue}}
                  </ui-select-match>
                  <ui-select-choices
                    repeat="zone.id as zone in rows | filter:{
                  id: $select.search,
                  location: {id: zonesController.filter.location }
                } | limitTo:30">
                    <div ng-bind-html="zone.toString() | uibTypeaheadHighlight:$select.search"></div>
                  </ui-select-choices>
                </ui-select>
              </div>

              <div class="form-group">
                <label>Площадки</label>
                <ui-select multiple ng-model="zonesController.filter.status" name="status" on-remove="zonesController.updateSearch()" on-select="zonesController.updateSearch()">
                  <ui-select-match placeholder="- всички -">{{$item.value}}</ui-select-match>
                  <ui-select-choices repeat="name.id as (id, name) in zoneStatuses | filter:$select.search">
                    <div ng-bind-html="name.value | uibTypeaheadHighlight:$select.search"></div>
                  </ui-select-choices>
                </ui-select>
              </div>

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

<div class="row">

  <div
    ng-repeat="zone in visibleRows"
    class="col-md-6 col-lg-4">
    <div class="panel zone"
         ng-class="{
          'panel-primary': zone.status=='owned',
          'panel-warning': zone.status=='requested',
          'panel-default': zone.status=='free'
          }">
      <div class="panel-heading ellipsis"
           title="{{::zone.id}} - {{::zone.location.type.bg}} {{::zone.location.name.bg}}, {{::zone.location.area.bg}}">
        <i class="fa fa-map-marker fa-fw"></i>
        <span class="hidden">{{zone.id}}</span>
        <strong>{{::zone.id}}</strong>
        {{::zone.location.type.bg}} {{::zone.location.name.bg}}, {{::zone.location.area.bg}}
        <span class="hidden">({zone.status})</span>
        <span class="hidden">{{($user.isAdmin()?'admin':'user')+'_'+zone.status}}</span>
      </div>
      <!-- /.panel-heading -->
      <div>
        <a href ui-sref="::auth.zones.view({id: zone.id})" class="thumbnail">
          <img ng-src="{{::zonesController.getStaticMap(zone)}}" width="100%" class="userMap">
        </a>
      </div>

      <ul ng-if="$user.isAdmin()" class="list-group">
        <li class="list-group-item ellipsis owner" ng-init="$state={}">
          <div ng-if="!$state.chooseOwner" class="actions pull-right"
               ng-switch="($user.isAdmin()?'admin':'user')+'_'+zone.status">
            <div class="btn-group">
              <button ng-switch-when="admin_requested" type="button" class="btn btn-danger btn-xs"
                      ng-click="zonesController.rejectRequest(zone)">
                <i class="fa fa-close fa-fw"></i>
              </button>
              <button ng-switch-when="admin_requested" type="button" class="btn btn-success btn-xs"
                      ng-click="zonesController.approveRequest(zone)">
                <i class="fa fa-check fa-fw"></i>
              </button>
              <button ng-if="zone.status=='owned'" type="button"
                      class="btn btn-danger btn-xs" title="Премахване на наблюдател"
                      ng-click="zonesController.removeOwner(zone)">
                <i class="fa fa-remove"></i>
              </button>
              <button ng-if="zone.status=='free' && !$state.chooseOwner" type="button"
                      class="btn btn-primary btn-xs" title="Добавяне на наблюдател"
                      ng-click="$state.chooseOwner=true">
                <i class="fa fa-edit"></i>
              </button>
            </div>
          </div>

          <user-selector ng-if="$state.chooseOwner"
                         model-id="zone.ownerId"
                         model="zone.owner"
                         name="zone{{zone.id}}-owner"
                         placeholder="изберете потребител" input-class="input-sm"
                         btn-class="btn-sm"
                         confirm="true"
                         on-select="zonesController.setOwner(zone, zone.owner); $state.chooseOwner=false"
                         on-cancel="$state.chooseOwner=false"
          ></user-selector>

          <div ng-if="false && $state.chooseOwner"
               ng-class="{'input-group': zonesController.loadingUsers || zonesController.noUsers || zone.owner.id}">
            <input type="text"
                   ng-model="zone.owner" name="owner"
                   placeholder="- всички -" class="form-control input-sm"
                   uib-typeahead="user as user.getName() for user in zonesController.getUsers($viewValue)"
                   typeahead-loading="zonesController.loadingUsers"
                   typeahead-no-results="zonesController.noUsers"
                   typeahead-wait-ms="200"
                   typeahead-append-to-body="true"
            >

            <div ng-if="zonesController.loadingUsers || zonesController.noUsers" class="input-group-addon">
              <i ng-if="zonesController.loadingUsers" class="glyphicon glyphicon-refresh"></i>
              <i ng-if="zonesController.noUsers" title="Няма намерени потребители"
                 class="glyphicon glyphicon-remove"></i>
            </div>
            <div ng-if="zone.owner.id" class="input-group-btn">
              <button type="button" class="btn btn-danger btn-sm"
                      ng-click="zone.owner = null; $state.chooseOwner=false">
                <i class="fa fa-close fa-fw"></i>
              </button>
              <button type="button" class="btn btn-success btn-sm"
                      ng-click="zonesController.setOwner(zone, zone.owner); $state.chooseOwner=false">
                <i class="fa fa-check fa-fw"></i>
              </button>
            </div>
          </div>

          <p ng-if="!$state.chooseOwner">
            <a ng-if="zone.ownerId" href ui-sref="auth.users.view({id: zone.ownerId})">
              {{zone.owner.firstName}} {{zone.owner.lastName}}
            </a>
            <span ng-if="!zone.ownerId">свободна площадка</span>
          </p>

        </li>
      </ul>
      <!-- /.panel-body -->
    </div>
  </div>

  <div ng-if="!$user.isAdmin()" class="col-md-6 col-lg-4">
    <div class="panel panel-default">
      <div class="panel-heading">
        <i class="fa fa-map-o fa-fw"></i>
        Заяви нова площадка
      </div>
      <!-- /.panel-heading -->
      <div>
        <div class="aspect-map">
          <a class="text-center" href ui-sref="auth.zones.request" style="display:block;">
            <i class="fa fa-plus fa-fw"
               style="font-size: 150px; line-height: 170px; top: 50%; margin-top: -85px; position: absolute; left: 50%; margin-left: -96px;"></i>
          </a>
        </div>
      </div>
      <!-- /.panel-body -->
    </div>
  </div>
</div>
<commit_msg>fix zone detail link<commit_after><div class="row">
  <div class="col-lg-12">
    <h1 class="page-header">
      Площадки
    </h1>
  </div>
</div>

<div ng-if="$user.isAdmin" class="row">
  <div class="col-lg-12">
    <form role="form" class="form form-filter">
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="row">
            <div class="col-lg-12">

              <div ng-if="$user.isAdmin()" class="form-group">
                <label for="owner">Наблюдател</label>

                <user-selector model-id="zonesController.filter.owner" name="owner"
                               placeholder="- всички -" on-select="zonesController.updateSearch()"></user-selector>
              </div>

              <div class="form-group">
                <label for="location">Локация</label>
                <location-selector name="location" model-id="zonesController.filter.location"
                                   placeholder="- всички -" on-select="zonesController.updateSearch()"></location-selector>
              </div>

              <div class="form-group">
                <label>Площадка</label>
                <ui-select ng-model="zonesController.filter.zone" name="zone"
                           on-remove="zonesController.updateSearch()"
                           on-select="zonesController.updateSearch()">
                  <ui-select-match allow-clear="true" placeholder="- всички -">
                    {{$select.ngModel.$modelValue}}
                  </ui-select-match>
                  <ui-select-choices
                    repeat="zone.id as zone in rows | filter:{
                  id: $select.search,
                  location: {id: zonesController.filter.location }
                } | limitTo:30">
                    <div ng-bind-html="zone.toString() | uibTypeaheadHighlight:$select.search"></div>
                  </ui-select-choices>
                </ui-select>
              </div>

              <div class="form-group">
                <label>Площадки</label>
                <ui-select multiple ng-model="zonesController.filter.status" name="status" on-remove="zonesController.updateSearch()" on-select="zonesController.updateSearch()">
                  <ui-select-match placeholder="- всички -">{{$item.value}}</ui-select-match>
                  <ui-select-choices repeat="name.id as (id, name) in zoneStatuses | filter:$select.search">
                    <div ng-bind-html="name.value | uibTypeaheadHighlight:$select.search"></div>
                  </ui-select-choices>
                </ui-select>
              </div>

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

<div class="row">

  <div
    ng-repeat="zone in visibleRows"
    class="col-md-6 col-lg-4">
    <div class="panel zone"
         ng-class="{
          'panel-primary': zone.status=='owned',
          'panel-warning': zone.status=='requested',
          'panel-default': zone.status=='free'
          }">
      <div class="panel-heading ellipsis"
           title="{{::zone.id}} - {{::zone.location.type.bg}} {{::zone.location.name.bg}}, {{::zone.location.area.bg}}">
        <i class="fa fa-map-marker fa-fw"></i>
        <span class="hidden">{{zone.id}}</span>
        <strong>{{::zone.id}}</strong>
        {{::zone.location.type.bg}} {{::zone.location.name.bg}}, {{::zone.location.area.bg}}
        <span class="hidden">({zone.status})</span>
        <span class="hidden">{{($user.isAdmin()?'admin':'user')+'_'+zone.status}}</span>
      </div>
      <!-- /.panel-heading -->
      <div>
        <a href ui-sref="auth.zones.view({id: zone.id})" class="thumbnail">
          <img ng-src="{{::zonesController.getStaticMap(zone)}}" width="100%" class="userMap">
        </a>
      </div>

      <ul ng-if="$user.isAdmin()" class="list-group">
        <li class="list-group-item ellipsis owner" ng-init="$state={}">
          <div ng-if="!$state.chooseOwner" class="actions pull-right"
               ng-switch="($user.isAdmin()?'admin':'user')+'_'+zone.status">
            <div class="btn-group">
              <button ng-switch-when="admin_requested" type="button" class="btn btn-danger btn-xs"
                      ng-click="zonesController.rejectRequest(zone)">
                <i class="fa fa-close fa-fw"></i>
              </button>
              <button ng-switch-when="admin_requested" type="button" class="btn btn-success btn-xs"
                      ng-click="zonesController.approveRequest(zone)">
                <i class="fa fa-check fa-fw"></i>
              </button>
              <button ng-if="zone.status=='owned'" type="button"
                      class="btn btn-danger btn-xs" title="Премахване на наблюдател"
                      ng-click="zonesController.removeOwner(zone)">
                <i class="fa fa-remove"></i>
              </button>
              <button ng-if="zone.status=='free' && !$state.chooseOwner" type="button"
                      class="btn btn-primary btn-xs" title="Добавяне на наблюдател"
                      ng-click="$state.chooseOwner=true">
                <i class="fa fa-edit"></i>
              </button>
            </div>
          </div>

          <user-selector ng-if="$state.chooseOwner"
                         model-id="zone.ownerId"
                         model="zone.owner"
                         name="zone{{zone.id}}-owner"
                         placeholder="изберете потребител" input-class="input-sm"
                         btn-class="btn-sm"
                         confirm="true"
                         on-select="zonesController.setOwner(zone, zone.owner); $state.chooseOwner=false"
                         on-cancel="$state.chooseOwner=false"
          ></user-selector>

          <div ng-if="false && $state.chooseOwner"
               ng-class="{'input-group': zonesController.loadingUsers || zonesController.noUsers || zone.owner.id}">
            <input type="text"
                   ng-model="zone.owner" name="owner"
                   placeholder="- всички -" class="form-control input-sm"
                   uib-typeahead="user as user.getName() for user in zonesController.getUsers($viewValue)"
                   typeahead-loading="zonesController.loadingUsers"
                   typeahead-no-results="zonesController.noUsers"
                   typeahead-wait-ms="200"
                   typeahead-append-to-body="true"
            >

            <div ng-if="zonesController.loadingUsers || zonesController.noUsers" class="input-group-addon">
              <i ng-if="zonesController.loadingUsers" class="glyphicon glyphicon-refresh"></i>
              <i ng-if="zonesController.noUsers" title="Няма намерени потребители"
                 class="glyphicon glyphicon-remove"></i>
            </div>
            <div ng-if="zone.owner.id" class="input-group-btn">
              <button type="button" class="btn btn-danger btn-sm"
                      ng-click="zone.owner = null; $state.chooseOwner=false">
                <i class="fa fa-close fa-fw"></i>
              </button>
              <button type="button" class="btn btn-success btn-sm"
                      ng-click="zonesController.setOwner(zone, zone.owner); $state.chooseOwner=false">
                <i class="fa fa-check fa-fw"></i>
              </button>
            </div>
          </div>

          <p ng-if="!$state.chooseOwner">
            <a ng-if="zone.ownerId" href ui-sref="auth.users.view({id: zone.ownerId})">
              {{zone.owner.firstName}} {{zone.owner.lastName}}
            </a>
            <span ng-if="!zone.ownerId">свободна площадка</span>
          </p>

        </li>
      </ul>
      <!-- /.panel-body -->
    </div>
  </div>

  <div ng-if="!$user.isAdmin()" class="col-md-6 col-lg-4">
    <div class="panel panel-default">
      <div class="panel-heading">
        <i class="fa fa-map-o fa-fw"></i>
        Заяви нова площадка
      </div>
      <!-- /.panel-heading -->
      <div>
        <div class="aspect-map">
          <a class="text-center" href ui-sref="auth.zones.request" style="display:block;">
            <i class="fa fa-plus fa-fw"
               style="font-size: 150px; line-height: 170px; top: 50%; margin-top: -85px; position: absolute; left: 50%; margin-left: -96px;"></i>
          </a>
        </div>
      </div>
      <!-- /.panel-body -->
    </div>
  </div>
</div>

{'fraction_non_alphanumeric': 0.1695499673027763, 'fraction_numerical': 0.0040425658403186494, 'mean_word_length': 1.7906436629064366, 'pattern_counts': {'":': 1, '<': 303, '<?xml version=': 0, '>': 303, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6173097', 'n_tokens_mistral': 5139, 'n_tokens_neox': 4864, 'n_words': 801}