Skip to content

Commit

Permalink
feat: add header
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed May 6, 2024
1 parent 0215aa9 commit 64ddea7
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/angular/i18n/messages.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"link": " Link: {$START_LINK}{$INTERPOLATION}{$CLOSE_LINK}",
"docSearchOtherDocuments": "Other Documents:",
"functionSearchHeading": "Function Search",
"imagequeryHeading": "Image description",
"imageQueryHeading": "Image Query",
"imagequeryQuery": "Image query",
"tableSearchHeading": "Table Search",
"tableSearchDataImport": "A new DB instance needs a data import first.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
<mat-toolbar color="primary" class="custom-toolbar">
<div class="toolbar-content">
<div i18n="@@imageQueryHeading">Image Query</div>
<div class="example-fill-remaining-space"></div>
<div>
<button
mat-flat-button
color="primary"
(click)="showList()"
i18n="@@list"
>
List
</button>
</div>
<div>
<button
mat-flat-button
color="primary"
(click)="logout()"
i18n="@@logout"
>
Logout
</button>
</div>
</div>
</mat-toolbar>
<div>
<h1 i18n="@@imagequeryHeading">Image description</h1>
<form [formGroup]="imageForm">
@if(uploading) {
<div class="upload-spinner"><mat-spinner></mat-spinner></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
.toolbar-content {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
width: 100%;
}

.example-fill-remaining-space {
// This fills the remaining space, by using flexbox.
// Every toolbar row uses a flexbox row layout.
flex: 1 1 auto;
}

.example-full-width {
width: 100%;
}

.search-bar {
display: flex;
width: 100%;
align-items: center;
}


.example-full-width {
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import { ImageService } from '../service/image.service';
import { ImageFile } from '../model/image-file';
import { FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router } from '@angular/router';
import { MatToolbarModule } from '@angular/material/toolbar';

@Component({
selector: 'app-image-query',
standalone: true,
imports: [CommonModule, MatProgressSpinnerModule, MatInputModule,MatButtonModule,ReactiveFormsModule],
imports: [CommonModule, MatProgressSpinnerModule, MatInputModule,MatButtonModule,ReactiveFormsModule,MatToolbarModule],
templateUrl: './image-query.component.html',
styleUrl: './image-query.component.scss'
})
Expand Down Expand Up @@ -83,6 +84,14 @@ export class ImageQueryComponent {
}
}

protected showList(): void {
this.router.navigate(['/doclist']);
}

protected logout(): void {
console.log('logout');
}

protected cancel(): void {
this.router.navigate(['/']);
}
Expand Down

0 comments on commit 64ddea7

Please sign in to comment.