Skip to content

Commit

Permalink
Merge branch 'main' into fix-missing-field
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital authored Feb 25, 2024
2 parents 67bd1f3 + c90f850 commit e088d6f
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 333 deletions.
2 changes: 1 addition & 1 deletion webui/dist/bitmagnet/index.html

Large diffs are not rendered by default.

229 changes: 0 additions & 229 deletions webui/dist/bitmagnet/main.e664518df7b1b9f1.js

This file was deleted.

2 changes: 2 additions & 0 deletions webui/src/app/search/search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { MatAutocompleteModule } from "@angular/material/autocomplete";
import { MatTabsModule } from "@angular/material/tabs";
import { MatDividerModule } from "@angular/material/divider";
import { MatCardModule } from "@angular/material/card";
import { MatTooltip } from "@angular/material/tooltip";
import { PaginatorModule } from "../paginator/paginator.module";
import { TorrentContentComponent } from "./torrent-content/torrent-content.component";

Expand Down Expand Up @@ -51,6 +52,7 @@ import { TorrentContentComponent } from "./torrent-content/torrent-content.compo
PaginatorModule,
ReactiveFormsModule,
NgOptimizedImage,
MatTooltip,
],
exports: [TorrentContentComponent],
})
Expand Down
210 changes: 108 additions & 102 deletions webui/src/app/search/torrent-content/torrent-content.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<div class="button-refresh">
<button
mat-mini-fab
title="Refresh results"
matTooltip="Refresh results"
color="primary"
(click)="loadResult(false)"
>
Expand Down Expand Up @@ -150,80 +150,82 @@
Edit tags
</ng-template>

<mat-card>
<mat-form-field class="form-edit-tags">
<mat-chip-grid #chipGrid aria-label="Enter tags">
@for (tagName of editedTags; let j = $index; track tagName) {
<mat-chip-row
[editable]="true"
(edited)="renameTag(tagName, $event.value)"
(removed)="deleteTag(tagName)"
[aria-description]="'press enter to edit'"
>
{{ tagName }}
<button
matChipRemove
[attr.aria-label]="'remove ' + tagName"
<ng-template matTabContent>
<mat-card>
<mat-form-field class="form-edit-tags">
<mat-chip-grid #chipGrid aria-label="Enter tags">
@for (tagName of editedTags; let j = $index; track tagName) {
<mat-chip-row
[editable]="true"
(edited)="renameTag(tagName, $event.value)"
(removed)="deleteTag(tagName)"
[aria-description]="'press enter to edit'"
>
<mat-icon>cancel</mat-icon>
</button>
</mat-chip-row>
}
</mat-chip-grid>
<input
placeholder="Tag..."
[formControl]="newTagCtrl"
[matAutocomplete]="auto"
[matChipInputFor]="chipGrid"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="$event.value && addTag($event.value)"
[value]="newTagCtrl.value"
/>
<mat-autocomplete
#auto="matAutocomplete"
(optionSelected)="addTag($event.option.viewValue)"
>
@for (tagName of suggestedTags; track tagName) {
<mat-option [value]="tagName">{{ tagName }}</mat-option>
}
</mat-autocomplete>
</mat-form-field>
<mat-card-actions class="button-row">
<button
mat-stroked-button
color="primary"
[disabled]="!selectedItems.hasValue()"
(click)="setTags()"
title="Replace tags of the selected torrents"
>
Set tags
</button>
<button
mat-stroked-button
color="primary"
[disabled]="
!selectedItems.hasValue() ||
(!editedTags.length && !newTagCtrl.value)
"
(click)="putTags()"
title="Add tags to the selected torrents"
>
Put tags
</button>
<button
mat-stroked-button
color="primary"
[disabled]="
!selectedItems.hasValue() ||
(!editedTags.length && !newTagCtrl.value)
"
(click)="deleteTags()"
title="Remove tags from the selected torrents"
>
Delete tags
</button>
</mat-card-actions>
</mat-card>
{{ tagName }}
<button
matChipRemove
[attr.aria-label]="'remove ' + tagName"
>
<mat-icon>cancel</mat-icon>
</button>
</mat-chip-row>
}
</mat-chip-grid>
<input
placeholder="Tag..."
[formControl]="newTagCtrl"
[matAutocomplete]="auto"
[matChipInputFor]="chipGrid"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="$event.value && addTag($event.value)"
[value]="newTagCtrl.value"
/>
<mat-autocomplete
#auto="matAutocomplete"
(optionSelected)="addTag($event.option.viewValue)"
>
@for (tagName of suggestedTags; track tagName) {
<mat-option [value]="tagName">{{ tagName }}</mat-option>
}
</mat-autocomplete>
</mat-form-field>
<mat-card-actions class="button-row">
<button
mat-stroked-button
color="primary"
[disabled]="!selectedItems.hasValue()"
(click)="setTags()"
matTooltip="Replace tags of the selected torrents"
>
Set tags
</button>
<button
mat-stroked-button
color="primary"
[disabled]="
!selectedItems.hasValue() ||
(!editedTags.length && !newTagCtrl.value)
"
(click)="putTags()"
matTooltip="Add tags to the selected torrents"
>
Put tags
</button>
<button
mat-stroked-button
color="primary"
[disabled]="
!selectedItems.hasValue() ||
(!editedTags.length && !newTagCtrl.value)
"
(click)="deleteTags()"
matTooltip="Remove tags from the selected torrents"
>
Delete tags
</button>
</mat-card-actions>
</mat-card>
</ng-template>
</mat-tab>

<mat-tab>
Expand All @@ -232,27 +234,29 @@
Delete
</ng-template>

<mat-card>
<mat-card-content>
<p>
<strong
>Are you sure you want to delete the selected
torrents?</strong
<ng-template matTabContent>
<mat-card>
<mat-card-content>
<p>
<strong
>Are you sure you want to delete the selected
torrents?</strong
>
<br />This action cannot be undone.
</p>
</mat-card-content>
<mat-card-actions class="button-row">
<button
mat-stroked-button
color="warn"
[disabled]="!selectedItems.hasValue()"
(click)="deleteTorrents(selectedInfoHashes())"
>
<br />This action cannot be undone.
</p>
</mat-card-content>
<mat-card-actions class="button-row">
<button
mat-stroked-button
color="warn"
[disabled]="!selectedItems.hasValue()"
(click)="deleteTorrents(selectedInfoHashes())"
>
<mat-icon>delete_forever</mat-icon>Delete
</button>
</mat-card-actions>
</mat-card>
<mat-icon>delete_forever</mat-icon>Delete
</button>
</mat-card-actions>
</mat-card>
</ng-template>
</mat-tab>
@if (selectedTabIndex > 0) {
<mat-tab>
Expand Down Expand Up @@ -357,7 +361,7 @@

<ng-container matColumnDef="peers">
<th mat-header-cell *matHeaderCellDef>
<abbr title="Seeders / Leechers">S / L</abbr>
<abbr matTooltip="Seeders / Leechers">S / L</abbr>
</th>
<td mat-cell *matCellDef="let i">
{{ item(i).torrent.seeders ?? "?" }} /
Expand Down Expand Up @@ -394,6 +398,7 @@
) {
<img
[ngSrc]="'https://image.tmdb.org/t/p/w300/' + posterPath"
alt="Poster"
class="poster"
width="300"
height="450"
Expand All @@ -404,7 +409,7 @@ <h2>{{ item(i).torrent.name }}</h2>
<strong>Info hash:</strong>
<span
class="info-hash"
title="Copy to clipboard"
matTooltip="Copy to clipboard"
[cdkCopyToClipboard]="item(i).infoHash"
>{{ item(i).infoHash }}</span
>
Expand Down Expand Up @@ -501,7 +506,8 @@ <h2>{{ item(i).torrent.name }}</h2>
<mat-icon>file_present</mat-icon>
Files
</ng-template>
@if (expandedItem.id === i.id) {

<ng-template matTabContent>
<mat-card class="torrent-files">
@if (item(i).torrent.filesStatus === "no_info") {
<p>No file information available.</p>
Expand Down Expand Up @@ -570,15 +576,15 @@ <h2>{{ item(i).torrent.name }}</h2>
</table>
}
</mat-card>
}
</ng-template>
</mat-tab>

<mat-tab>
<ng-template mat-tab-label>
<mat-icon>sell</mat-icon>
Edit tags
</ng-template>
@if (expandedItem.id === i.id) {
<ng-template matTabContent>
<mat-card>
<mat-form-field class="form-edit-tags">
<mat-chip-grid #chipGrid aria-label="Enter tags">
Expand Down Expand Up @@ -633,7 +639,7 @@ <h2>{{ item(i).torrent.name }}</h2>
</mat-autocomplete>
</mat-form-field>
</mat-card>
}
</ng-template>
</mat-tab>

<mat-tab>
Expand All @@ -642,7 +648,7 @@ <h2>{{ item(i).torrent.name }}</h2>
Delete
</ng-template>

@if (expandedItem.id === i.id) {
<ng-template matTabContent>
<mat-card>
<mat-card-content style="margin-top: 10px">
<p>
Expand All @@ -663,7 +669,7 @@ <h2>{{ item(i).torrent.name }}</h2>
</button>
</mat-card-actions>
</mat-card>
}
</ng-template>
</mat-tab>
@if (expandedItem.selectedTabIndex > 0) {
<mat-tab>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { AfterContentInit, AfterViewInit, Component } from "@angular/core";
import {
AfterContentInit,
AfterViewInit,
ChangeDetectionStrategy,
Component,
} from "@angular/core";
import { BehaviorSubject, catchError, EMPTY, tap } from "rxjs";
import { FormControl } from "@angular/forms";
import {
Expand Down Expand Up @@ -29,6 +34,7 @@ import { TorrentContentSearchEngine } from "./torrent-content-search.engine";
),
]),
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TorrentContentComponent
implements AfterContentInit, AfterViewInit
Expand Down

0 comments on commit e088d6f

Please sign in to comment.