Removed all Material Cards
Removed Tailwind Moved to scss Moved to material theme 3
This commit is contained in:
@@ -1,29 +1,22 @@
|
||||
<div class="flex flex-auto flex-row justify-around content-center items-center lg:max-w-[50%]">
|
||||
<mat-card class="flex-auto">
|
||||
<mat-card-header>
|
||||
<mat-card-title>Role</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" class="flex flex-col">
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Name</mat-label>
|
||||
<input matInput #nameElement formControlName="name" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-divider></mat-divider>
|
||||
<div formArrayName="permissions">
|
||||
@for (p of item.permissions; track p; let i = $index) {
|
||||
<div class="flex flex-row justify-around content-start items-start" [formGroupName]="i">
|
||||
<mat-checkbox formControlName="permission" class="flex-auto">{{ p.name }}</mat-checkbox>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="primary" (click)="save()">Save</button>
|
||||
<button mat-raised-button color="warn" (click)="confirmDelete()">Delete</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<h2>Role</h2>
|
||||
|
||||
<form [formGroup]="form" class="flex flex-col wrapped">
|
||||
<div class="row-container">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Name</mat-label>
|
||||
<input matInput #nameElement formControlName="name" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div formArrayName="permissions">
|
||||
@for (p of item.permissions; track p; let i = $index) {
|
||||
<div class="flex flex-row justify-around content-start items-start" [formGroupName]="i">
|
||||
<mat-checkbox formControlName="permission" class="flex-auto">{{ p.name }}</mat-checkbox>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="row-container">
|
||||
<button mat-raised-button color="primary" (click)="save()">Save</button>
|
||||
<button mat-raised-button color="warn" (click)="confirmDelete()">Delete</button>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { AfterViewInit, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
@@ -19,7 +18,6 @@ import { RoleService } from '../role.service';
|
||||
templateUrl: './role-detail.component.html',
|
||||
styleUrls: ['./role-detail.component.css'],
|
||||
imports: [
|
||||
MatCardModule,
|
||||
ReactiveFormsModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
|
||||
@@ -1,46 +1,41 @@
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title-group>
|
||||
<mat-card-title>Roles</mat-card-title>
|
||||
<a mat-button [routerLink]="['/roles', 'new']">
|
||||
<mat-icon>add_box</mat-icon>
|
||||
Add
|
||||
</a>
|
||||
</mat-card-title-group>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"
|
||||
><a [routerLink]="['/roles', row.id]">{{ row.name }}</a></mat-cell
|
||||
>
|
||||
</ng-container>
|
||||
<h2 class="row-container space-between">
|
||||
<span>Roles</span>
|
||||
<a mat-button [routerLink]="['/roles', 'new']">
|
||||
<mat-icon>add_box</mat-icon>
|
||||
Add
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<!-- Permissions Column -->
|
||||
<ng-container matColumnDef="permissions">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Permissions</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<ul>
|
||||
@for (permission of row.permissions; track permission) {
|
||||
<li>{{ permission }}</li>
|
||||
}
|
||||
</ul>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator
|
||||
#paginator
|
||||
[length]="dataSource.data.length"
|
||||
[pageIndex]="0"
|
||||
[pageSize]="50"
|
||||
[pageSizeOptions]="[25, 50, 100, 250]"
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"
|
||||
><a [routerLink]="['/roles', row.id]">{{ row.name }}</a></mat-cell
|
||||
>
|
||||
</mat-paginator>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</ng-container>
|
||||
|
||||
<!-- Permissions Column -->
|
||||
<ng-container matColumnDef="permissions">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Permissions</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<ul>
|
||||
@for (permission of row.permissions; track permission) {
|
||||
<li>{{ permission }}</li>
|
||||
}
|
||||
</ul>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator
|
||||
#paginator
|
||||
[length]="dataSource.data.length"
|
||||
[pageIndex]="0"
|
||||
[pageSize]="50"
|
||||
[pageSizeOptions]="[25, 50, 100, 250]"
|
||||
>
|
||||
</mat-paginator>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Component, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatSort, MatSortModule } from '@angular/material/sort';
|
||||
@@ -13,7 +12,7 @@ import { RoleListDatasource } from './role-list-datasource';
|
||||
selector: 'app-role-list',
|
||||
templateUrl: './role-list.component.html',
|
||||
styleUrls: ['./role-list.component.css'],
|
||||
imports: [MatCardModule, RouterModule, MatIconModule, MatTableModule, MatSortModule, MatPaginatorModule],
|
||||
imports: [RouterModule, MatIconModule, MatTableModule, MatSortModule, MatPaginatorModule],
|
||||
})
|
||||
export class RoleListComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
|
||||
Reference in New Issue
Block a user