Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
enhancement: add [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
koen1711 committed Oct 28, 2023
1 parent 1ecd152 commit 3be8095
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 364 deletions.
203 changes: 104 additions & 99 deletions src/app/modules/core/components/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,122 +1,127 @@
<mat-toolbar class="shadow-sm header-container" id="header-container">
<img src="./assets/leaphy-logo.svg" class="header-logo" width="300" height="24"/>
<div class="flex-header">
<div class="flex-buttons">
<!-- Add ngIf to check for URL ending with "driverissues" -->
<ng-container *ngIf="isDriverIssuesUrl() && this.appState.selectedRobotType$ | async">
<button mat-stroked-button [matMenuTriggerFor]="projectMenu">
{{ "PROJECT" | translate }}
</button>
<button mat-stroked-button [matMenuTriggerFor]="helpMenu">
{{ "HELP" | translate }}
</button>
<button mat-stroked-button [matMenuTriggerFor]="moreMenu">
{{ "MORE" | translate }}
</button>
<button mat-stroked-button (click)="onChooseRobot()">
{{ "CHOOSE_ROBOT" | translate }}
</button>
</ng-container>
<ng-container *ngIf="!isDriverIssuesUrl()">
<button mat-stroked-button class="back-to-blocks" (click)="onBackToBlocks()">{{ "GO_BACK_TO_BLOCKS" | translate }}</button>
</ng-container>
</div>
<img src="./assets/leaphy-logo.svg" class="header-logo" width="300" height="24"/>
<div class="flex-header">
<div class="flex-buttons">
<!-- Add ngIf to check for URL ending with "driverissues" -->
<ng-container *ngIf="isDriverIssuesUrl() && this.appState.selectedRobotType$ | async">
<button mat-stroked-button [matMenuTriggerFor]="projectMenu">
{{ "PROJECT" | translate }}
</button>
<button mat-stroked-button [matMenuTriggerFor]="helpMenu">
{{ "HELP" | translate }}
</button>
<button mat-stroked-button [matMenuTriggerFor]="moreMenu">
{{ "MORE" | translate }}
</button>
<button mat-stroked-button (click)="onChooseRobot()">
{{ "CHOOSE_ROBOT" | translate }}
</button>
</ng-container>
<ng-container *ngIf="!isDriverIssuesUrl()">
<button mat-stroked-button class="back-to-blocks" (click)="onBackToBlocks()">{{ "GO_BACK_TO_BLOCKS" | translate }}</button>
</ng-container>
</div>

<div class="flex-buttons">
<!-- Add ngIf to check for URL ending with "driverissues" -->
<ng-container *ngIf="isDriverIssuesUrl() && this.appState.selectedRobotType$ | async">
<button mat-stroked-button class="icon-button" (click)="onUndoClicked()">
<mat-icon>undo</mat-icon>
</button>
<button mat-stroked-button class="icon-button" (click)="onRedoClicked()">
<mat-icon>redo</mat-icon>
</button>
</ng-container>
</div>
<div class="flex-buttons">
<!-- Add ngIf to check for URL ending with "driverissues" -->
<ng-container *ngIf="isDriverIssuesUrl() && this.appState.selectedRobotType$ | async">
<button mat-stroked-button class="icon-button" (click)="onUndoClicked()">
<mat-icon>undo</mat-icon>
</button>
<button mat-stroked-button class="icon-button" (click)="onRedoClicked()">
<mat-icon>redo</mat-icon>
</button>
</ng-container>
</div>

<div class="flex-buttons">
<!-- Add ngIf to check for URL ending with "driverissues" -->
<ng-container *ngIf="isDriverIssuesUrl() && this.appState.selectedRobotType$ | async">
<button mat-stroked-button [disabled]="(appState.canChangeCodeEditor$ | async) === false"
*ngIf="(appState.codeEditorType$ | async) === 1" (click)="onCodeEditorClicked()">
<mat-icon>editor</mat-icon><span>{{ "CODE" | translate }}</span>
</button>
<button mat-stroked-button [disabled]="(appState.canChangeCodeEditor$ | async) === false"
*ngIf="(appState.codeEditorType$ | async) === 2" (click)="onCodeEditorClicked()">
<mat-icon id="block-icon" svgIcon="block"></mat-icon><span>{{ "BLOCKS" | translate }}</span>
</button>
<button mat-stroked-button (click)="onSaveWorkspaceClicked()">
<mat-icon>save</mat-icon><span>{{ "SAVE" | translate }}</span>
</button>
<button mat-flat-button *ngIf="appState.selectedRobotType$ | async" (click)="onUploadClicked()">
{{ "UPLOAD" | translate }}
</button>
</ng-container>
<div class="flex-buttons">
<!-- Add ngIf to check for URL ending with "driverissues" -->
<ng-container *ngIf="isDriverIssuesUrl() && this.appState.selectedRobotType$ | async">
<button mat-stroked-button [disabled]="(appState.canChangeCodeEditor$ | async) === false"
*ngIf="(appState.codeEditorType$ | async) === 1" (click)="onCodeEditorClicked()">
<mat-icon>editor</mat-icon><span>{{ "CODE" | translate }}</span>
</button>
<button mat-stroked-button [disabled]="(appState.canChangeCodeEditor$ | async) === false"
*ngIf="(appState.codeEditorType$ | async) === 2" (click)="onCodeEditorClicked()">
<mat-icon id="block-icon" svgIcon="block"></mat-icon><span>{{ "BLOCKS" | translate }}</span>
</button>
<button mat-stroked-button (click)="onSaveWorkspaceClicked()">
<mat-icon>save</mat-icon><span>{{ "SAVE" | translate }}</span>
</button>
<button mat-flat-button *ngIf="appState.selectedRobotType$ | async" (click)="onUploadClicked()">
{{ "UPLOAD" | translate }}
</button>
</ng-container>
</div>
</div>
</div>
</mat-toolbar>

<mat-menu #projectMenu="matMenu" class="matmenus">
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onNewProjectClicked()">
<mat-icon>insert_drive_file</mat-icon>
<span>{{ "NEW" | translate }}</span>
</button>
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onLoadWorkspaceClicked()">
<mat-icon>folder</mat-icon>
<span>{{ "OPEN" | translate }}</span>
</button>
<span mat-menu-item disabled *ngIf="blocklyState.projectName$ | async as projectName">{{ projectName }}</span>
<button mat-menu-item [disabled]="
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onNewProjectClicked()">
<mat-icon>insert_drive_file</mat-icon>
<span>{{ "NEW" | translate }}</span>
</button>
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onLoadWorkspaceClicked()">
<mat-icon>folder</mat-icon>
<span>{{ "OPEN" | translate }}</span>
</button>
<span mat-menu-item disabled *ngIf="blocklyState.projectName$ | async as projectName">{{ projectName }}</span>
<button mat-menu-item [disabled]="
(appState.selectedRobotType$ | async) === null ||
(blocklyState.projectFilePath$ | async) === null
" (click)="onSaveWorkspaceClicked()">
<mat-icon>save</mat-icon>
<span>{{ "SAVE" | translate }}</span>
</button>
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onSaveWorkspaceAsClicked()">
<mat-icon>save</mat-icon>
<span>{{ "SAVEAS" | translate }}</span>
</button>
<mat-icon>save</mat-icon>
<span>{{ "SAVE" | translate }}</span>
</button>
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onSaveWorkspaceAsClicked()">
<mat-icon>save</mat-icon>
<span>{{ "SAVEAS" | translate }}</span>
</button>
</mat-menu>

<mat-menu #helpMenu="matMenu" class="matmenus">
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onHelpClicked()">
<mat-icon>help_center</mat-icon>
<span>{{ "HELP_FORUM" | translate }}</span>
</button>
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onHelpClicked()">
<mat-icon>help_center</mat-icon>
<span>{{ "HELP_FORUM" | translate }}</span>
# email
</button>
<button mat-menu-item [disabled]="(appState.selectedRobotType$ | async) === null" (click)="onEmailClicked()">
<mat-icon>email</mat-icon>
<span>{{ "EMAIL" | translate }}</span>
</button>
</mat-menu>

<mat-menu #moreMenu="matMenu" class="matmenus">
<button mat-menu-item (click)="onShowInfoClicked()">
<mat-icon>help_center</mat-icon>
<span>{{ "MORE_ABOUT" | translate }}</span>
</button>
<button mat-menu-item [matMenuTriggerFor]="languageMenu">
<mat-icon>language</mat-icon>
<span>{{ "LANGUAGE" | translate }}</span>
</button>
<button mat-menu-item (click)="onToggleSoundClicked()">
<mat-icon *ngIf="(blocklyState.isSoundOn$ | async)">volume_off</mat-icon>
<mat-icon *ngIf="(blocklyState.isSoundOn$ | async) === false">volume_up</mat-icon>
<span *ngIf="(blocklyState.isSoundOn$ | async)">{{ "SOUND_OFF" | translate }}</span>
<span *ngIf="(blocklyState.isSoundOn$ | async) === false">{{ "SOUND_ON" | translate }}</span>
</button>
<button mat-menu-item (click)="onViewLogClicked()">
<mat-icon>article</mat-icon>
<span>{{ "VIEW_LOG" | translate }}</span>
</button>
<button mat-menu-item (click)="onShowInfoClicked()">
<mat-icon>help_center</mat-icon>
<span>{{ "MORE_ABOUT" | translate }}</span>
</button>
<button mat-menu-item [matMenuTriggerFor]="languageMenu">
<mat-icon>language</mat-icon>
<span>{{ "LANGUAGE" | translate }}</span>
</button>
<button mat-menu-item (click)="onToggleSoundClicked()">
<mat-icon *ngIf="(blocklyState.isSoundOn$ | async)">volume_off</mat-icon>
<mat-icon *ngIf="(blocklyState.isSoundOn$ | async) === false">volume_up</mat-icon>
<span *ngIf="(blocklyState.isSoundOn$ | async)">{{ "SOUND_OFF" | translate }}</span>
<span *ngIf="(blocklyState.isSoundOn$ | async) === false">{{ "SOUND_ON" | translate }}</span>
</button>
<button mat-menu-item (click)="onViewLogClicked()">
<mat-icon>article</mat-icon>
<span>{{ "VIEW_LOG" | translate }}</span>
</button>

<a mat-menu-item id="download_drivers" href="https://github.com/leaphy-robotics/leaphy-webbased/archive/refs/heads/executables.zip">
<mat-icon>download</mat-icon>
<span>{{ "DOWNLOAD_DRIVERS" | translate }}</span>
</a>
<a mat-menu-item id="download_drivers" href="https://github.com/leaphy-robotics/leaphy-webbased/archive/refs/heads/executables.zip">
<mat-icon>download</mat-icon>
<span>{{ "DOWNLOAD_DRIVERS" | translate }}</span>
</a>
</mat-menu>

<mat-menu #languageMenu="matMenu" class="matmenus">
<button mat-menu-item *ngFor="let language of appState.availableLanguages$ | async" [value]="language"
(click)="onLanguageChanged(language)">
<span [class.selected]="language.code === (appState.currentLanguage$ | async)?.code">{{language.name}}</span>
</button>
<button mat-menu-item *ngFor="let language of appState.availableLanguages$ | async" [value]="language"
(click)="onLanguageChanged(language)">
<span [class.selected]="language.code === (appState.currentLanguage$ | async)?.code">{{language.name}}</span>
</button>
</mat-menu>


Expand Down
Loading

0 comments on commit 3be8095

Please sign in to comment.