aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html
blob: 727633399655002369123d1d3aa8e7043d0e4397 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<div class="toggle-plugin-type">
  <p-selectButton [options]="pluginTypeOptions" [(ngModel)]="pluginType" (ngModelChange)="reloadPlugins()"></p-selectButton>
</div>

<div class="search-bar">
  <input type="text" (input)="onSearchChange($event)" i18n-placeholder placeholder="Search..." autofocus />
</div>

<div class="alert alert-info" i18n *ngIf="pluginInstalled">
  To load your new installed plugins or themes, refresh the page.
</div>

<div class="result-title" *ngIf="!isSearching">
  <ng-container *ngIf="!search">
    <my-global-icon iconName="trending" aria-hidden="true"></my-global-icon>
    <ng-container i18n>Popular</ng-container>
  </ng-container>

  <ng-container *ngIf="!!search">
    <my-global-icon iconName="search"></my-global-icon>

    <ng-container i18n>
      {{ pagination.totalItems }} {pagination.totalItems, plural, =1 {result} other {results}} for {{ search }}"
    </ng-container>
  </ng-container>
</div>

<div class="no-results" i18n *ngIf="pagination.totalItems === 0">
  No results.
</div>

<div class="plugins" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [autoInit]="true" [dataObservable]="onDataSubject.asObservable()">
  <div class="card plugin" *ngFor="let plugin of plugins">
    <div class="card-body">
      <div class="first-row">
        <span class="plugin-name">{{ plugin.name }}</span>

        <span class="plugin-version">{{ plugin.latestVersion }}</span>

        <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="plugin.homepage" i18n-title title="Plugin homepage (new window)">
          <my-global-icon iconName="home"></my-global-icon>
        </a>

        <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin npm package (new window)">
          <my-global-icon iconName="npm"></my-global-icon>
        </a>

        <span *ngIf="plugin.installed" class="badge badge-success">Installed</span>

        <div class="buttons">
          <my-edit-button *ngIf="plugin.installed === true && !isThemeSearch()" [routerLink]="getShowRouterLink(plugin)" label="Settings" i18n-label></my-edit-button>

          <my-button class="update-button" *ngIf="plugin.installed === false" (click)="install(plugin)" [loading]="isInstalling(plugin)"
                     label="Install" icon="cloud-download" [attr.disabled]="isInstalling(plugin)"
          ></my-button>
        </div>
      </div>

      <div class="second-row">
        <div class="description">{{ plugin.description }}</div>
      </div>
    </div>
  </div>
</div>