<commit_before><!-- The search bar template -->
<ng-template #OmnisearchTemplate let-collapsable="collapsable">
  <div class="omnisearch" [ngClass]="{ expanded: showSearchOptions }">
    <div fxLayout="row">
      <button mat-icon-button aria-label="Seach Icon" disabled>
        <mat-icon>search</mat-icon>
      </button>

      <mat-form-field appearance="none" style="width: 100%; margin-top: -0.4em; margin-bottom: -30px"
        floatLabel="never">
        <input matInput autocomplete="off" spellcheck="false" type="text" placeholder="Search Inbox"
          [(ngModel)]="filters.studentName" (ngModelChange)="applyFilters()" />
      </mat-form-field>
      <button *ngIf="collapsable" matTooltip="Filter options" matTooltipPosition="above" mat-icon-button
        aria-label="Inbox search dropdown" (click)="showSearchOptions = !showSearchOptions">
        <mat-icon>{{ showSearchOptions ? 'arrow_drop_up' : 'arrow_drop_down' }}</mat-icon>
      </button>

      <button matTooltip="Refresh the task inbox" matTooltipPosition="above" mat-icon-button aria-label="Refresh Inbox"
        (click)="refreshTasks()">
        <mat-icon>refresh</mat-icon>
      </button>
    </div>

    <mat-accordion>
      <mat-expansion-panel class="search-settings-panel mat-elevation-z0" disabled hideToggle
        [expanded]="!collapsable || showSearchOptions">
        <form class="search-options">
          <div class="task-definition">
            <div class="dropdown" dropdown>
              <i *ngIf="isTaskDefMode" class="fa fa-download pull-right dropdown-toggle"
                style="cursor: pointer; padding-top: 8px; padding-right: 8px" dropdown-toggle></i>
              <ul class="dropdown-menu pull-right">
                <li>
                  <a [href]="submissionsPdfsUrl">Bulk Export Submission PDFs</a>
                </li>
                <li>
                  <a [href]="submissionsUrl">Bulk Export Submission Files</a>
                </li>
              </ul>
            </div>
            <div fxLayout="row" fxLayoutAlign="space-between center">
              <mat-form-field fxFlex>
                <mat-label>Task Definition</mat-label>
                <mat-select [(ngModel)]="filters.taskDefinitionIdSelected" name="taskDefID"
                  (selectionChange)="taskDefinitionIdChanged()">
                  <mat-option value="" [hidden]="isTaskDefMode">All Task Definitions</mat-option>
                  <mat-option *ngFor="let td of unit.task_definitions" [value]="td.id">
                    {{ td.abbreviation + ' - ' + td.name }}
                  </mat-option>
                </mat-select>
                <mat-hint> Display specific task definitions. </mat-hint>
              </mat-form-field>
              <button mat-icon-button aria-label="Sort by task definition icon" (click)="toggleTaskDefSort()">
                <mat-icon>{{states[taskDefSort].icon}}</mat-icon>
              </button>
            </div>
          </div>
          <!--/task-definition-->
          <div fxLayout="row" fxLayoutAlign="space-between center">
            <mat-form-field fxFlex>
              <mat-label>Tutorials</mat-label>
              <mat-select [(ngModel)]="filters.tutorialIdSelected" name="tutorial"
                (selectionChange)="tutorialIdChanged()">
                <mat-option *ngFor="let t of tutorials" [value]="t.id">
                  {{ t.inbox_description }}
                </mat-option>
              </mat-select>
              <mat-hint> Filter tutorials. </mat-hint>
            </mat-form-field>
            <button disabled mat-icon-button aria-label="Sort by tutorial icon" (click)="toggleTutorialSort()">
              <mat-icon>{{states[tutorialSort].icon}}</mat-icon>
            </button>
          </div>
          <!--/tutorial-->
        </form>
      </mat-expansion-panel>
    </mat-accordion>
  </div>
</ng-template>

<!-- Narrow width search dialog template-->
<ng-template #searchDialog>
  <ng-container *ngTemplateOutlet="OmnisearchTemplate; context: { collapsable: false }"></ng-container>
  <div mat-dialog-actions align="end">
    <button mat-button [mat-dialog-close]>OK</button><commit_msg>style: disable sorting when filtering by task definition<commit_after><!-- The search bar template -->
<ng-template #OmnisearchTemplate let-collapsable="collapsable">
  <div class="omnisearch" [ngClass]="{ expanded: showSearchOptions }">
    <div fxLayout="row">
      <button mat-icon-button aria-label="Seach Icon" disabled>
        <mat-icon>search</mat-icon>
      </button>

      <mat-form-field appearance="none" style="width: 100%; margin-top: -0.4em; margin-bottom: -30px"
        floatLabel="never">
        <input matInput autocomplete="off" spellcheck="false" type="text" placeholder="Search Inbox"
          [(ngModel)]="filters.studentName" (ngModelChange)="applyFilters()" />
      </mat-form-field>
      <button *ngIf="collapsable" matTooltip="Filter options" matTooltipPosition="above" mat-icon-button
        aria-label="Inbox search dropdown" (click)="showSearchOptions = !showSearchOptions">
        <mat-icon>{{ showSearchOptions ? 'arrow_drop_up' : 'arrow_drop_down' }}</mat-icon>
      </button>

      <button matTooltip="Refresh the task inbox" matTooltipPosition="above" mat-icon-button aria-label="Refresh Inbox"
        (click)="refreshTasks()">
        <mat-icon>refresh</mat-icon>
      </button>
    </div>

    <mat-accordion>
      <mat-expansion-panel class="search-settings-panel mat-elevation-z0" disabled hideToggle
        [expanded]="!collapsable || showSearchOptions">
        <form class="search-options">
          <div class="task-definition">
            <div class="dropdown" dropdown>
              <i *ngIf="isTaskDefMode" class="fa fa-download pull-right dropdown-toggle"
                style="cursor: pointer; padding-top: 8px; padding-right: 8px" dropdown-toggle></i>
              <ul class="dropdown-menu pull-right">
                <li>
                  <a [href]="submissionsPdfsUrl">Bulk Export Submission PDFs</a>
                </li>
                <li>
                  <a [href]="submissionsUrl">Bulk Export Submission Files</a>
                </li>
              </ul>
            </div>
            <div fxLayout="row" fxLayoutAlign="space-between center">
              <mat-form-field fxFlex>
                <mat-label>Task Definition</mat-label>
                <mat-select [(ngModel)]="filters.taskDefinitionIdSelected" name="taskDefID"
                  (selectionChange)="taskDefinitionIdChanged()">
                  <mat-option value="" [hidden]="isTaskDefMode">All Task Definitions</mat-option>
                  <mat-option *ngFor="let td of unit.task_definitions" [value]="td.id">
                    {{ td.abbreviation + ' - ' + td.name }}
                  </mat-option>
                </mat-select>
                <mat-hint> Display specific task definitions. </mat-hint>
              </mat-form-field>
              <button [disabled]="(filters.taskDefinitionIdSelected || !filters.taskDefinitionIdSelected === '')"
                mat-icon-button aria-label="Sort by task definition icon"(click)="toggleTaskDefSort()">
                <mat-icon>{{states[taskDefSort].icon}}</mat-icon>
              </button>
              {{filters.taskDefinitionIdSelected}}
            </div>
          </div>
          <!--/task-definition-->
          <div fxLayout="row" fxLayoutAlign="space-between center">
            <mat-form-field fxFlex>
              <mat-label>Tutorials</mat-label>
              <mat-select [(ngModel)]="filters.tutorialIdSelected" name="tutorial"
                (selectionChange)="tutorialIdChanged()">
                <mat-option *ngFor="let t of tutorials" [value]="t.id">
                  {{ t.inbox_description }}
                </mat-option>
              </mat-select>
              <mat-hint> Filter tutorials. </mat-hint>
            </mat-form-field>
            <button disabled mat-icon-button aria-label="Sort by tutorial icon" (click)="toggleTutorialSort()">
              <mat-icon>{{states[tutorialSort].icon}}</mat-icon>
            </button>
          </div>
          <!--/tutorial-->
        </form>
      </mat-expansion-panel>
    </mat-accordion>
  </div>
</ng-template>

<!-- Narrow width search dialog template-->
<ng-template #searchDialog>
  <ng-container *ngTemplateOutlet="OmnisearchTemplate; context: { collapsable: false }"></ng-container>
  <div mat-dialog-actions align="end">
    <button mat-button [mat-dialog-close]>OK</button>
{'fraction_non_alphanumeric': 0.1513874253600281, 'fraction_numerical': 0.002341646177262616, 'mean_word_length': 2.303170920340294, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 0, '>': 177, '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': '3877549', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2404, 'n_words': 460}