More cleanup

This commit is contained in:
shamoon 2024-01-16 17:00:26 -08:00
parent beb20bd038
commit 6c7892559f
13 changed files with 74 additions and 74 deletions

View File

@ -136,6 +136,7 @@ import {
checkLg, checkLg,
chevronDoubleLeft, chevronDoubleLeft,
chevronDoubleRight, chevronDoubleRight,
clipboard,
clipboardCheckFill, clipboardCheckFill,
clipboardFill, clipboardFill,
dash, dash,
@ -149,6 +150,7 @@ import {
fileEarmark, fileEarmark,
fileEarmarkCheck, fileEarmarkCheck,
fileEarmarkFill, fileEarmarkFill,
fileEarmarkLock,
files, files,
fileText, fileText,
filter, filter,
@ -218,6 +220,7 @@ const icons = {
checkLg, checkLg,
chevronDoubleLeft, chevronDoubleLeft,
chevronDoubleRight, chevronDoubleRight,
clipboard,
clipboardCheckFill, clipboardCheckFill,
clipboardFill, clipboardFill,
dash, dash,
@ -231,6 +234,7 @@ const icons = {
fileEarmark, fileEarmark,
fileEarmarkCheck, fileEarmarkCheck,
fileEarmarkFill, fileEarmarkFill,
fileEarmarkLock,
files, files,
fileText, fileText,
filter, filter,

View File

@ -25,10 +25,6 @@
} }
} }
small > i-bs {
margin-top: -2px;
}
.list-group-item-note { .list-group-item-note {
line-height: 1; line-height: 1;

View File

@ -5,7 +5,7 @@
<label class="form-label" [class.mb-md-0]="horizontal" [for]="inputId">{{title}}</label> <label class="form-label" [class.mb-md-0]="horizontal" [for]="inputId">{{title}}</label>
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div> </div>

View File

@ -4,7 +4,7 @@
<label class="form-label" [class.mb-md-0]="horizontal" [for]="inputId">{{title}}</label> <label class="form-label" [class.mb-md-0]="horizontal" [for]="inputId">{{title}}</label>
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div> </div>

View File

@ -6,45 +6,45 @@
} }
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div>
<div [class.col-md-9]="horizontal">
<div>
<ng-select name="inputId" [(ngModel)]="selectedDocuments"
[disabled]="disabled"
[items]="foundDocuments$ | async"
placeholder="Search for documents"
[notFoundText]="notFoundText"
[multiple]="true"
bindValue="id"
[compareWith]="compareDocuments"
[trackByFn]="trackByFn"
[minTermLength]="2"
[loading]="loading"
[typeahead]="documentsInput$"
(change)="onChange(selectedDocuments)">
<ng-template ng-label-tmp let-document="item">
<div class="d-flex align-items-center">
<i-bs (click)="unselect(document)" name="x"></i-bs>
<a routerLink="/documents/{{document.id}}" class="badge bg-light text-primary" (mousedown)="$event.stopImmediatePropagation();">
<i-bs width="0.9em" height="0.9em" name="file-text"></i-bs><span>{{document.title}}</span>
</a>
</div>
</ng-template>
<ng-template ng-loadingspinner-tmp>
<div class="spinner-border spinner-border-sm fw-normal ms-2 me-auto" role="status"></div>
<div class="visually-hidden" i18n>Loading...</div>
</ng-template>
<ng-template ng-option-tmp let-document="item" let-index="index" let-search="searchTerm">
<div>{{document.title}} <small class="text-muted">({{document.created | customDate:'shortDate'}})</small></div>
</ng-template>
</ng-select>
</div>
@if (hint) {
<small class="form-text text-muted">{{hint}}</small>
}
</div>
</div>
</div> </div>
<div [class.col-md-9]="horizontal">
<div>
<ng-select name="inputId" [(ngModel)]="selectedDocuments"
[disabled]="disabled"
[items]="foundDocuments$ | async"
placeholder="Search for documents"
[notFoundText]="notFoundText"
[multiple]="true"
bindValue="id"
[compareWith]="compareDocuments"
[trackByFn]="trackByFn"
[minTermLength]="2"
[loading]="loading"
[typeahead]="documentsInput$"
(change)="onChange(selectedDocuments)">
<ng-template ng-label-tmp let-document="item">
<div class="d-flex align-items-center">
<i-bs (click)="unselect(document)" name="x"></i-bs>
<a routerLink="/documents/{{document.id}}" class="badge bg-light text-primary" (mousedown)="$event.stopImmediatePropagation();">
<i-bs width="0.9em" height="0.9em" name="file-text"></i-bs>&nbsp;<span>{{document.title}}</span>
</a>
</div>
</ng-template>
<ng-template ng-loadingspinner-tmp>
<div class="spinner-border spinner-border-sm fw-normal ms-2 me-auto" role="status"></div>
<div class="visually-hidden" i18n>Loading...</div>
</ng-template>
<ng-template ng-option-tmp let-document="item" let-index="index" let-search="searchTerm">
<div>{{document.title}} <small class="text-muted">({{document.created | customDate:'shortDate'}})</small></div>
</ng-template>
</ng-select>
</div>
@if (hint) {
<small class="form-text text-muted">{{hint}}</small>
}
</div>
</div>
</div>

View File

@ -6,7 +6,7 @@
} }
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div> </div>
@ -18,7 +18,7 @@
<div class="form-text d-flex align-items-center"> <div class="form-text d-flex align-items-center">
<span class="text-muted">{{filename}}</span> <span class="text-muted">{{filename}}</span>
<button type="button" class="btn btn-link btn-sm text-danger ms-2" (click)="clear()"> <button type="button" class="btn btn-link btn-sm text-danger ms-2" (click)="clear()">
<i-bs name="x"></i-bs><small class="ms-1" i18n>Remove</small> <i-bs name="x"></i-bs><small i18n>Remove</small>
</button> </button>
</div> </div>
} }

View File

@ -6,7 +6,7 @@
} }
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div> </div>

View File

@ -22,7 +22,7 @@
<label class="form-check-label" [class.text-muted]="showUnsetNote && isUnset" [for]="inputId" [ngbTooltip]="showUnsetNote && isUnset ? tipContent: null" placement="end"> <label class="form-check-label" [class.text-muted]="showUnsetNote && isUnset" [for]="inputId" [ngbTooltip]="showUnsetNote && isUnset ? tipContent: null" placement="end">
{{title}} {{title}}
@if (showUnsetNote && isUnset) { @if (showUnsetNote && isUnset) {
<i-bs width="0.9em" height="0.9em" name="exclamation-triangle"></i-bs> &nbsp;<i-bs width="0.9em" height="0.9em" name="exclamation-triangle"></i-bs>
} }
</label> </label>
} }

View File

@ -6,7 +6,7 @@
} }
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div> </div>

View File

@ -4,23 +4,23 @@
<label class="form-label" [class.mb-md-0]="horizontal" [for]="inputId">{{title}}</label> <label class="form-label" [class.mb-md-0]="horizontal" [for]="inputId">{{title}}</label>
@if (removable) { @if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)"> <button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container> <i-bs name="x"></i-bs>&nbsp;<ng-container i18n>Remove</ng-container>
</button> </button>
} }
</div> </div>
<div [class.col-md-9]="horizontal"> <div [class.col-md-9]="horizontal">
<div class="input-group" [class.is-invalid]="error"> <div class="input-group" [class.is-invalid]="error">
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" (change)="onChange(value)" [disabled]="disabled"> <input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" (change)="onChange(value)" [disabled]="disabled">
<a class="btn btn-outline-secondary rounded-end" title="Open link" i18n-title [href]="value" target="_blank"> <a class="btn btn-outline-secondary rounded-end" title="Open link" i18n-title [href]="value" target="_blank">
<i-bs width="1.2em" height="1.2em" name="box-arrow-up-right"></i-bs> <i-bs width="1.2em" height="1.2em" name="box-arrow-up-right"></i-bs>
</a> </a>
<div class="invalid-feedback position-absolute top-100"> <div class="invalid-feedback position-absolute top-100">
{{error}} {{error}}
</div>
</div> </div>
@if (hint) {
<small class="form-text text-muted" [innerHTML]="hint | safeHtml"></small>
}
</div> </div>
@if (hint) {
<small class="form-text text-muted" [innerHTML]="hint | safeHtml"></small>
}
</div> </div>
</div> </div>
</div>

View File

@ -9,7 +9,7 @@
} @else { } @else {
@if (requiresPassword) { @if (requiresPassword) {
<div class="w-100 h-100 position-relative"> <div class="w-100 h-100 position-relative">
<i-bs name="file-earmark-lock"></i-bs> <i-bs width="2em" height="2em" class="position-absolute top-50 start-50 translate-middle" name="file-earmark-lock"></i-bs>
</div> </div>
} }
@if (!requiresPassword) { @if (!requiresPassword) {

View File

@ -59,7 +59,7 @@
<div class="spinner-border spinner-border-sm me-2" role="status"></div> <div class="spinner-border spinner-border-sm me-2" role="status"></div>
} }
@if (!loading) { @if (!loading) {
<i-bs width="1.2em" height="1.2em" name="plus"></i-bs> <i-bs name="plus"></i-bs>
} }
<ng-container i18n>Create</ng-container> <ng-container i18n>Create</ng-container>
</button> </button>

View File

@ -15,7 +15,7 @@
<i-bs width="0.9em" height="0.9em" name="exclamation-triangle"></i-bs> <i-bs width="0.9em" height="0.9em" name="exclamation-triangle"></i-bs>
} }
<div> <div>
<p class="mb-0">{{toast.content}}</p> <p class="ms-2 mb-0">{{toast.content}}</p>
@if (toast.error) { @if (toast.error) {
<details> <details>
<div class="mt-2"> <div class="mt-2">
@ -33,12 +33,12 @@
<div class="col offset-sm-3"> <div class="col offset-sm-3">
<button class="btn btn-sm btn-outline-dark" (click)="copyError(toast.error)"> <button class="btn btn-sm btn-outline-dark" (click)="copyError(toast.error)">
@if (!copied) { @if (!copied) {
<i-bs name="clipboard"></i-bs> <i-bs name="clipboard"></i-bs>&nbsp;
} }
@if (copied) { @if (copied) {
<i-bs name="clipboard-check"></i-bs> <i-bs name="clipboard-check"></i-bs>&nbsp;
} }
>&nbsp;<ng-container i18n>Copy Raw Error</ng-container> <ng-container i18n>Copy Raw Error</ng-container>
</button> </button>
</div> </div>
</div> </div>