Browse Source

UI: dashboard form and image input redesign

pull/9553/head
Dmitriymush 3 years ago
parent
commit
8138a714b0
  1. 28
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.html
  2. 11
      ui-ngx/src/app/shared/components/image-input.component.html
  3. 12
      ui-ngx/src/app/shared/components/image-input.component.scss

28
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.html

@ -124,19 +124,21 @@
<textarea matInput formControlName="description" rows="2"></textarea>
</mat-form-field>
</div>
<div translate>dashboard.mobile-app-settings</div>
<tb-image-input fxFlex
label="{{'dashboard.image' | translate}}"
maxSizeByte="524288"
formControlName="image">
</tb-image-input>
<mat-checkbox fxFlex formControlName="mobileHide">
{{ 'dashboard.mobile-hide' | translate }}
</mat-checkbox>
<mat-form-field class="mat-block">
<mat-label translate>dashboard.mobile-order</mat-label>
<input matInput formControlName="mobileOrder" type="number" step="1">
</mat-form-field>
<div class="tb-form-panel stroked">
<div class="tb-form-panel-title" translate>dashboard.mobile-app-settings</div>
<mat-slide-toggle formControlName="mobileHide" class="mat-slide fixed-title-width">
{{ 'dashboard.mobile-hide' | translate }}
</mat-slide-toggle>
<mat-form-field class="mat-block">
<mat-label translate>dashboard.mobile-order</mat-label>
<input matInput formControlName="mobileOrder" type="number" step="1">
</mat-form-field>
<tb-image-input fxFlex
label="{{'dashboard.image' | translate}}"
maxSizeByte="524288"
formControlName="image">
</tb-image-input>
</div>
</fieldset>
</form>
</div>

11
ui-ngx/src/app/shared/components/image-input.component.html

@ -15,8 +15,14 @@
limitations under the License.
-->
<div class="tb-container">
<label class="tb-title" *ngIf="label" [ngClass]="{'tb-error': !disabled && (required && !safeImageUrl), 'tb-required': !disabled && required}">{{label}}</label>
<div class="tb-form-panel stroked">
<label class="tb-form-panel-title" *ngIf="label"
[ngClass]="{'tb-error': !disabled && (required && !safeImageUrl), 'tb-required': !disabled && required}">
{{label}}
</label>
<div class="tb-hint" *ngIf="maxSizeByte && !disabled" translate [translateParams]="{ size: maxSizeByte | fileSize}">
dashboard.maximum-upload-file-size
</div>
<ng-container #flow="flow"
[flowConfig]="{singleFile: true, allowDuplicateUploads: true}">
<div class="tb-image-select-container">
@ -63,5 +69,4 @@
</button>
</div>
</ng-container>
<div class="tb-hint" *ngIf="maxSizeByte && !disabled" translate [translateParams]="{ size: maxSizeByte | fileSize}">dashboard.maximum-upload-file-size</div>
</div>

12
ui-ngx/src/app/shared/components/image-input.component.scss

@ -20,12 +20,12 @@ $previewSize: 78px !default;
:host {
.tb-container {
margin-top: 0;
padding: 0 0 16px;
label.tb-title {
display: block;
padding-bottom: 8px;
.tb-form-panel.stroked {
gap: 8px;
.tb-hint {
padding: 0;
margin: 0;
}
}

Loading…
Cancel
Save