{{$scopes := get_scopes}}
{{$resource := .Resource}}
{{if $scopes}}
  <div class="qor-actions qor-bottomsheet__filter" data-toggle="qor.filter">
    {{range $scope := $scopes}}
      {{if $scope.Group}}
        <select class="qor-action--select" data-toggle="qor.selector" data-clearable="true" name="scopes" placeholder="{{t (printf "%v.scopes.%v" $resource.ToParam $scope.Group) $scope.Group}}">
          {{range $s := $scope.Scopes}}
            <option value="{{$s.Name}}" {{if $s.Active}}selected{{end}}>{{t (printf "%v.scopes.%v.%v" $resource.ToParam $scope.Group $s.Label) $s.Label}}</option>
          {{end}}
        </select>
      {{else}}
        {{range $s := $scope.Scopes}}
          <a class="qor-action--label {{if $s.Active}}is-active{{end}}" href="{{patch_current_url "scopes" $s.Name}}">{{t (printf "%v.scopes.%v" $resource.ToParam $s.Label) $s.Label}} {{if $s.Active}}<i class="material-icons">clear</i>{{end}}</a>
        {{end}}
      {{end}}
    {{end}}
  </div>
{{end}}
