<commit_before><div class="application-content is-page" *ngIf="!isLoadingCollection && collection && collection._id">
  <div class="container">

    <div class="page-headings is-hidden" id="collectionDetailHeader">

      <span class="page-headings--page-pre-title" *ngIf="collection.isFeatured">Featured</span>
      <h2 class="page-headings--page-title">{{collection.title}}</h2>
      <p class="page-headings--page-description" *ngIf="collection.bio">{{collection.bio}}</p>

    </div>

    <!-- <div *ngIf="collection.depth > 0">
      <span *ngFor="let collection of collection._parents">
        <a [routerLink]="['/c', collection._id]" href="javascript:void(0)">{{collection.title}}</a>
      </span>
      <span>{{collection.title}}</span>
    </div> -->

    <div class="collection-container">
      <div class="collection-container--header">

        <div class="collection-container--publication">

          <a href="javascript:void(0)" title="{{collection._author?.name}}" [routerLink]="['/', collection._author.username]">
            <div class="collection-container--thumbnail avatar avatar--32">
              <img *ngIf="collection._author._avatar" [src]="collection._author._avatar.getPath('60x60')" onError="this.style.display='none';" alt="{{collection._author?.name}} avatar">
              <span class="avatar-char">{{collection._author.name.charAt(0)}}</span>
            </div>
          </a>

          <p class="collection-container--publication-infos">
            {{t._.collection?.by_title}} <a href="javascript:void(0)" title="{{collection._author?.name}}" [routerLink]="['/', collection._author.username]">{{collection._author?.name}}</a> <span class="muted">on {{collection.createdAt | date }} <span class="small" title="{{collection.modifiedAt | date }}" *ngIf="collection.modifiedAt">(edited)</span></span>
          </p>

        </div>

        <div class="collection-container--stats">
          <ul class="collection-container--stats-list">
            <li class="collection-container--stats-item muted" (click)="updateDisplayMode()">
              {{collection.displayMode}}
            </li>
            <li class="collection-container--stats-item muted" *ngIf="collection.itemsCount == 1">
              {{collection.itemsCount}} {{t._.collection?.item_sing}}
            </li>
            <li class="collection-container--stats-item muted" *ngIf="collection.itemsCount > 1 || collection.itemsCount == 0">
              {{collection.itemsCount}} {{t._.collection?.item_plur}}
            </li>
            <li class="collection-container--stats-item" *ngIf="collection.visibility.id != 'PRIVATE'" (click)="onStarCliked()">
              <span class="collection-container--stats-icon" [class.is-highlighted]="collection._star">star</span>
              <span>{{collection.starsCount}}</span>
            </li>
            <li class="collection-container--stats-item visibility" *ngIf="collection.visibility.id == 'UNINDEXED'">
              <span class="collection-container--stats-icon">visibility_off</span>
              <span class="muted">{{ t._.collection?.visibility[collection.visibility.id].title}}</span>
            </li>
            <li class="collection-container--stats-item visibility" *ngIf="collection.visibility.id == 'PRIVATE'">
              <span class="collection-container--stats-icon">lock</span>
              <span class="muted">{{ t._.collection?.visibility[collection.visibility.id].title}}</span>
            </li>

          </ul>

          <div class="collection-container--stats-actions" *ngIf="isAuthor">
            <button type="button" class="collection-container--stats-action btn btn-primary btn-sm" (click)="openModal(newItemModal, 'lg')">
              New item
            </button>

            <div class="collection-container--stats-action dropdown">
              <a class="btn btn-secondary btn-icon btn-icon-narrow btn-sm" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="icon">more_vert</span>
              </a>
              <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
                <a href="javascript:void(0)" class="dropdown-item" (click)="openModal(updateCollectionModal)">Edit</a>
                <a href="javascript:void(0)" class="dropdown-item" (click)="openDeleteCollectionModal(collectionDeleteModal)">Delete</a>
              </div>
            </div>

          </div>
        </div>

      </div>

      <div class="collection-container--list" *ngIf="itemLoaded && collection._items.length == 0">

        <div class="collection-item is-content is-empty" *ngIf="isAuthor">
          <div class="collection-item--content collection-item--empty-phase">
            <img class="collection-item--image empty-phase" src="assets/img/illustration-empty--send-new.png" />
            <h3 class="collection-item--empty-title">Create an item in your collection</h3>
            <p class="collection-item--empty-caption">
              Use the button bellow to add an item to your collection. It can be a link or a caption without link.
            </p>
            <ul class="collection-item--actions">
              <li class="collection-item--action">
                <button type="button" class="btn btn-primary" (click)="openModal(newItemModal)">
                  Add my first item
                </button>
              </li>
            </ul>
          </div>
        </div>

        <div class="collection-item is-content is-empty" *ngIf="!isAuthor">
          <div class="collection-item--content collection-item--empty-phase">
            <img class="collection-item--image empty-phase" src="assets/img/illustration-empty--send-new.png" />
            <h3 class="collection-item--empty-title">Whoops, this collection is empty</h3>
            <p class="collection-item--empty-caption">
              Unfortunately there is nothing in this collection yet, please make a try later.
            </p>
          </div>
        </div>

      </div>

      <div class="collection-container--list row" tc-sortable [list]=collection._items [ghostClass]="'collection-item-ghost'" (itemMoved)="onItemMoved($event)" *ngIf="itemLoaded && collection._items.length > 0">
        <tc-item class="ui-state-default collection-item--container col-12" [item]=item [isAuthor]=isAuthor (deletedItem)="onDeletedItem($event)" *ngFor="let item of collection._items"></tc-item>
      </div>

      <div class="collection-container--footer" *ngIf="itemLoaded && collection._items.length > 0">

        <a href="javascript:void(0)" class="btn btn-secondary btn-block" *ngIf="itemLoaded && haveMoreItems && !loadingItems" (click)="loadNextPage()">{{t._.action?.load_more}}...</a>
        <p class="loading-more" *ngIf="loadingItems">Loading...</p>
        <p class="no-more" *ngIf="!haveMoreItems && collection._items.length > 0">You reached the end of the collection...</p>

      </div>

    </div>

  </div>
</div>


<ng-template class="default-modal" #collectionDeleteModal let-c="close" let-d="dismiss">
  <div class="modal-header">
    <button type="button" class="close" aria-label="Close" (click)="c('cancel')">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <div class="modal-body">
    <b>Do you really want to delete this collection?</b>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-outline-dark" (click)="c('cancel')">Cancel</button>
    <button type="button" class="btn btn-danger" (click)="c('confirm')">Delete this collection</button>
  </div>
</ng-template>

<ng-template #newItemModal let-c="close" let-d="dismiss">
  <tc-item-create class="" *ngIf="isAuthor" [collection]="collection" (newItem)="onNewItem($event)"></tc-item-create>
</ng-template>

<ng-template #updateCollectionModal let-c="close" let-d="dismiss">
  <tc-collection-update
    [inputCollection]="collection"
    (newCollection)="onCollectionUpdated($event)"
    (updateCanceled)="onUpdateCollectionCanceled()">
  </tc-collection-update>
</ng-template>

<!--<tc-collection-create *ngIf="isAuthor" [parentCollection]="collection" (newCollection)="onSubCollectionCreated($event)"></tc-collection-create>-->

<div class="page" *ngIf="!isLoadingCollection && (!collection || !collection._id) && !cantFoundButwasStarred">
  <div class="container">

    <div class="page-headings">

      <h2 class="page-headings--page-title">Sorry cannot find collection with id: "{{searchParams}}"</h2>

    </div>

  </div>
</div>

<div class="page" *ngIf="!isLoadingCollection && cantFoundButwasStarred">
  <div class="container">

    <div class="page-headings">

      <h2 class="">Sorry this collection do not exist anymore or is now private. You can delete it from you starred collection if you want.</h2>
      <input href="javascript:void(0)" (click)="removeStarredCollection(true)" value="Remove from my starred collection" class="btn btn-sm btn-outline-primary" type="submit"/>

    </div>

  </div>
</div>
<commit_msg>client side: do not display displayMode<commit_after><div class="application-content is-page" *ngIf="!isLoadingCollection && collection && collection._id">
  <div class="container">

    <div class="page-headings is-hidden" id="collectionDetailHeader">

      <span class="page-headings--page-pre-title" *ngIf="collection.isFeatured">Featured</span>
      <h2 class="page-headings--page-title">{{collection.title}}</h2>
      <p class="page-headings--page-description" *ngIf="collection.bio">{{collection.bio}}</p>

    </div>

    <!-- <div *ngIf="collection.depth > 0">
      <span *ngFor="let collection of collection._parents">
        <a [routerLink]="['/c', collection._id]" href="javascript:void(0)">{{collection.title}}</a>
      </span>
      <span>{{collection.title}}</span>
    </div> -->

    <div class="collection-container">
      <div class="collection-container--header">

        <div class="collection-container--publication">

          <a href="javascript:void(0)" title="{{collection._author?.name}}" [routerLink]="['/', collection._author.username]">
            <div class="collection-container--thumbnail avatar avatar--32">
              <img *ngIf="collection._author._avatar" [src]="collection._author._avatar.getPath('60x60')" onError="this.style.display='none';" alt="{{collection._author?.name}} avatar">
              <span class="avatar-char">{{collection._author.name.charAt(0)}}</span>
            </div>
          </a>

          <p class="collection-container--publication-infos">
            {{t._.collection?.by_title}} <a href="javascript:void(0)" title="{{collection._author?.name}}" [routerLink]="['/', collection._author.username]">{{collection._author?.name}}</a> <span class="muted">on {{collection.createdAt | date }} <span class="small" title="{{collection.modifiedAt | date }}" *ngIf="collection.modifiedAt">(edited)</span></span>
          </p>

        </div>

        <div class="collection-container--stats">
          <ul class="collection-container--stats-list">
            <!-- <li class="collection-container--stats-item muted" (click)="updateDisplayMode()">
              {{collection.displayMode}}
            </li> -->
            <li class="collection-container--stats-item muted" *ngIf="collection.itemsCount == 1">
              {{collection.itemsCount}} {{t._.collection?.item_sing}}
            </li>
            <li class="collection-container--stats-item muted" *ngIf="collection.itemsCount > 1 || collection.itemsCount == 0">
              {{collection.itemsCount}} {{t._.collection?.item_plur}}
            </li>
            <li class="collection-container--stats-item" *ngIf="collection.visibility.id != 'PRIVATE'" (click)="onStarCliked()">
              <span class="collection-container--stats-icon" [class.is-highlighted]="collection._star">star</span>
              <span>{{collection.starsCount}}</span>
            </li>
            <li class="collection-container--stats-item visibility" *ngIf="collection.visibility.id == 'UNINDEXED'">
              <span class="collection-container--stats-icon">visibility_off</span>
              <span class="muted">{{ t._.collection?.visibility[collection.visibility.id].title}}</span>
            </li>
            <li class="collection-container--stats-item visibility" *ngIf="collection.visibility.id == 'PRIVATE'">
              <span class="collection-container--stats-icon">lock</span>
              <span class="muted">{{ t._.collection?.visibility[collection.visibility.id].title}}</span>
            </li>

          </ul>

          <div class="collection-container--stats-actions" *ngIf="isAuthor">
            <button type="button" class="collection-container--stats-action btn btn-primary btn-sm" (click)="openModal(newItemModal, 'lg')">
              New item
            </button>

            <div class="collection-container--stats-action dropdown">
              <a class="btn btn-secondary btn-icon btn-icon-narrow btn-sm" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="icon">more_vert</span>
              </a>
              <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
                <a href="javascript:void(0)" class="dropdown-item" (click)="openModal(updateCollectionModal)">Edit</a>
                <a href="javascript:void(0)" class="dropdown-item" (click)="openDeleteCollectionModal(collectionDeleteModal)">Delete</a>
              </div>
            </div>

          </div>
        </div>

      </div>

      <div class="collection-container--list" *ngIf="itemLoaded && collection._items.length == 0">

        <div class="collection-item is-content is-empty" *ngIf="isAuthor">
          <div class="collection-item--content collection-item--empty-phase">
            <img class="collection-item--image empty-phase" src="assets/img/illustration-empty--send-new.png" />
            <h3 class="collection-item--empty-title">Create an item in your collection</h3>
            <p class="collection-item--empty-caption">
              Use the button bellow to add an item to your collection. It can be a link or a caption without link.
            </p>
            <ul class="collection-item--actions">
              <li class="collection-item--action">
                <button type="button" class="btn btn-primary" (click)="openModal(newItemModal)">
                  Add my first item
                </button>
              </li>
            </ul>
          </div>
        </div>

        <div class="collection-item is-content is-empty" *ngIf="!isAuthor">
          <div class="collection-item--content collection-item--empty-phase">
            <img class="collection-item--image empty-phase" src="assets/img/illustration-empty--send-new.png" />
            <h3 class="collection-item--empty-title">Whoops, this collection is empty</h3>
            <p class="collection-item--empty-caption">
              Unfortunately there is nothing in this collection yet, please make a try later.
            </p>
          </div>
        </div>

      </div>

      <div class="collection-container--list row" tc-sortable [list]=collection._items [ghostClass]="'collection-item-ghost'" (itemMoved)="onItemMoved($event)" *ngIf="itemLoaded && collection._items.length > 0">
        <tc-item class="ui-state-default collection-item--container col-12" [item]=item [isAuthor]=isAuthor (deletedItem)="onDeletedItem($event)" *ngFor="let item of collection._items"></tc-item>
      </div>

      <div class="collection-container--footer" *ngIf="itemLoaded && collection._items.length > 0">

        <a href="javascript:void(0)" class="btn btn-secondary btn-block" *ngIf="itemLoaded && haveMoreItems && !loadingItems" (click)="loadNextPage()">{{t._.action?.load_more}}...</a>
        <p class="loading-more" *ngIf="loadingItems">Loading...</p>
        <p class="no-more" *ngIf="!haveMoreItems && collection._items.length > 0">You reached the end of the collection...</p>

      </div>

    </div>

  </div>
</div>


<ng-template class="default-modal" #collectionDeleteModal let-c="close" let-d="dismiss">
  <div class="modal-header">
    <button type="button" class="close" aria-label="Close" (click)="c('cancel')">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <div class="modal-body">
    <b>Do you really want to delete this collection?</b>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-outline-dark" (click)="c('cancel')">Cancel</button>
    <button type="button" class="btn btn-danger" (click)="c('confirm')">Delete this collection</button>
  </div>
</ng-template>

<ng-template #newItemModal let-c="close" let-d="dismiss">
  <tc-item-create class="" *ngIf="isAuthor" [collection]="collection" (newItem)="onNewItem($event)"></tc-item-create>
</ng-template>

<ng-template #updateCollectionModal let-c="close" let-d="dismiss">
  <tc-collection-update
    [inputCollection]="collection"
    (newCollection)="onCollectionUpdated($event)"
    (updateCanceled)="onUpdateCollectionCanceled()">
  </tc-collection-update>
</ng-template>

<!--<tc-collection-create *ngIf="isAuthor" [parentCollection]="collection" (newCollection)="onSubCollectionCreated($event)"></tc-collection-create>-->

<div class="page" *ngIf="!isLoadingCollection && (!collection || !collection._id) && !cantFoundButwasStarred">
  <div class="container">

    <div class="page-headings">

      <h2 class="page-headings--page-title">Sorry cannot find collection with id: "{{searchParams}}"</h2>

    </div>

  </div>
</div>

<div class="page" *ngIf="!isLoadingCollection && cantFoundButwasStarred">
  <div class="container">

    <div class="page-headings">

      <h2 class="">Sorry this collection do not exist anymore or is now private. You can delete it from you starred collection if you want.</h2>
      <input href="javascript:void(0)" (click)="removeStarredCollection(true)" value="Remove from my starred collection" class="btn btn-sm btn-outline-primary" type="submit"/>

    </div>

  </div>
</div>

{'fraction_non_alphanumeric': 0.17899432725670542, 'fraction_numerical': 0.0037451120779864516, 'mean_word_length': 3.220827522082752, 'pattern_counts': {'":': 0, '<': 344, '<?xml version=': 0, '>': 354, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2279879', 'n_tokens_mistral': 5366, 'n_tokens_neox': 5177, 'n_words': 969}