Made levels & Achievements public
This commit is contained in:
parent
ca5db6d397
commit
07fc512633
@ -3,7 +3,8 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p-table #dt [value]="achievements" [responsive]="true" responsiveLayout="stack" [breakpoint]="'720px'" dataKey="id" editMode="row" [rowHover]="true" [rows]="10"
|
<p-table #dt [value]="achievements" [responsive]="true" responsiveLayout="stack" [breakpoint]="'720px'" dataKey="id"
|
||||||
|
editMode="row" [rowHover]="true" [rows]="10"
|
||||||
[rowsPerPageOptions]="[10,25,50]" [paginator]="true" [loading]="loading" [totalRecords]="totalRecords"
|
[rowsPerPageOptions]="[10,25,50]" [paginator]="true" [loading]="loading" [totalRecords]="totalRecords"
|
||||||
[lazy]="true" (onLazyLoad)="nextPage($event)">
|
[lazy]="true" (onLazyLoad)="nextPage($event)">
|
||||||
|
|
||||||
@ -17,17 +18,20 @@
|
|||||||
{{'view.server.achievements.achievements' | translate}}
|
{{'view.server.achievements.achievements' | translate}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
|
<app-multi-select-columns [table]="name" [columns]="columns"
|
||||||
|
[(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-caption-btn-wrapper btn-wrapper">
|
<div class="table-caption-btn-wrapper btn-wrapper">
|
||||||
<button pButton label="{{'common.add' | translate}}" class="icon-btn btn"
|
<button pButton label="{{'common.add' | translate}}" class="icon-btn btn"
|
||||||
icon="pi pi-plus" (click)="addAchievement(dt)" [disabled]="isEditingNew || !user?.isModerator && !user?.isAdmin">
|
icon="pi pi-plus" (click)="addAchievement(dt)"
|
||||||
|
[disabled]="isEditingNew || !user?.isModerator && !user?.isAdmin">
|
||||||
</button>
|
</button>
|
||||||
<button pButton label="{{'common.reset_filters' | translate}}" icon="pi pi-undo"
|
<button pButton label="{{'common.reset_filters' | translate}}" icon="pi pi-undo"
|
||||||
class="icon-btn btn" (click)="resetFilters()">
|
class="icon-btn btn" (click)="resetFilters()">
|
||||||
</button>
|
</button>
|
||||||
<app-data-import-and-export name="achievements" [(data)]="achievements"
|
<app-data-import-and-export *ngIf="user?.isModerator || user?.isAdmin" name="achievements"
|
||||||
|
[(data)]="achievements"
|
||||||
[callback]="callback" [validator]="validator"></app-data-import-and-export>
|
[callback]="callback" [validator]="validator"></app-data-import-and-export>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -179,7 +183,8 @@
|
|||||||
<span class="p-column-title">{{'common.operator' | translate}}:</span>
|
<span class="p-column-title">{{'common.operator' | translate}}:</span>
|
||||||
<p-cellEditor>
|
<p-cellEditor>
|
||||||
<ng-template pTemplate="input">
|
<ng-template pTemplate="input">
|
||||||
<p-dropdown [options]="operators" [(ngModel)]="achievement.operator" placeholder="{{'common.operator' | translate}}"></p-dropdown>
|
<p-dropdown [options]="operators" [(ngModel)]="achievement.operator"
|
||||||
|
placeholder="{{'common.operator' | translate}}"></p-dropdown>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template pTemplate="output">
|
<ng-template pTemplate="output">
|
||||||
{{achievement.operator}}
|
{{achievement.operator}}
|
||||||
@ -200,7 +205,8 @@
|
|||||||
|
|
||||||
<p-cellEditor *ngIf="getAchievementAttributeByName(achievement.attribute)?.type === 'Level'">
|
<p-cellEditor *ngIf="getAchievementAttributeByName(achievement.attribute)?.type === 'Level'">
|
||||||
<ng-template pTemplate="input">
|
<ng-template pTemplate="input">
|
||||||
<p-dropdown [options]="levels" [(ngModel)]="achievement.value" placeholder="{{'view.server.members.headers.level' | translate}}"></p-dropdown>
|
<p-dropdown [options]="levels" [(ngModel)]="achievement.value"
|
||||||
|
placeholder="{{'view.server.members.headers.level' | translate}}"></p-dropdown>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template pTemplate="output">
|
<ng-template pTemplate="output">
|
||||||
{{achievement.value}}
|
{{achievement.value}}
|
||||||
@ -209,7 +215,8 @@
|
|||||||
|
|
||||||
<p-cellEditor *ngIf="getAchievementAttributeByName(achievement.attribute)?.type === 'GameServer'">
|
<p-cellEditor *ngIf="getAchievementAttributeByName(achievement.attribute)?.type === 'GameServer'">
|
||||||
<ng-template pTemplate="input">
|
<ng-template pTemplate="input">
|
||||||
<p-dropdown [options]="gameServers" [(ngModel)]="achievement.value" placeholder="{{'view.server.profile.joined_game_server.name' | translate}}"></p-dropdown>
|
<p-dropdown [options]="gameServers" [(ngModel)]="achievement.value"
|
||||||
|
placeholder="{{'view.server.profile.joined_game_server.name' | translate}}"></p-dropdown>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template pTemplate="output">
|
<ng-template pTemplate="output">
|
||||||
{{achievement.value}}
|
{{achievement.value}}
|
||||||
@ -241,16 +248,21 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<app-history-btn *ngIf="!isEditingNew" [id]="achievement.id" [query]="query" translationKey="view.server.achievements.header"></app-history-btn>
|
<app-history-btn *ngIf="!isEditingNew" [id]="achievement.id" [query]="query"
|
||||||
|
translationKey="view.server.achievements.header"></app-history-btn>
|
||||||
<button *ngIf="!editing" pButton pInitEditableRow class="btn icon-btn" icon="pi pi-pencil"
|
<button *ngIf="!editing" pButton pInitEditableRow class="btn icon-btn" icon="pi pi-pencil"
|
||||||
(click)="onRowEditInit(dt, achievement, ri)" [disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
(click)="onRowEditInit(dt, achievement, ri)"
|
||||||
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
<button *ngIf="!editing" pButton class="btn icon-btn danger-icon-btn" icon="pi pi-trash"
|
<button *ngIf="!editing" pButton class="btn icon-btn danger-icon-btn" icon="pi pi-trash"
|
||||||
(click)="deleteAchievement(achievement)" [disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
(click)="deleteAchievement(achievement)"
|
||||||
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
|
|
||||||
<button *ngIf="editing" pButton pSaveEditableRow class="btn icon-btn"
|
<button *ngIf="editing" pButton pSaveEditableRow class="btn icon-btn"
|
||||||
icon="pi pi-check-circle" (click)="onRowEditSave(achievement, ri)" [disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
icon="pi pi-check-circle" (click)="onRowEditSave(achievement, ri)"
|
||||||
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
<button *ngIf="editing" pButton pCancelEditableRow class="btn icon-btn danger-icon-btn"
|
<button *ngIf="editing" pButton pCancelEditableRow class="btn icon-btn danger-icon-btn"
|
||||||
icon="pi pi-times-circle" (click)="onRowEditCancel(ri)" [disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
icon="pi pi-times-circle" (click)="onRowEditCancel(ri)"
|
||||||
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
<div class="table-caption-btn-wrapper btn-wrapper">
|
<div class="table-caption-btn-wrapper btn-wrapper">
|
||||||
<button pButton label="{{'common.add' | translate}}" class="icon-btn btn"
|
<button pButton label="{{'common.add' | translate}}" class="icon-btn btn"
|
||||||
icon="pi pi-plus" (click)="addLevel(dt)"
|
icon="pi pi-plus" (click)="addLevel(dt)"
|
||||||
[disabled]="isEditingNew || user?.isModerator && !user?.isAdmin">
|
[disabled]="isEditingNew || !user?.isModerator && !user?.isAdmin">
|
||||||
</button>
|
</button>
|
||||||
<button pButton label="{{'common.reset_filters' | translate}}" icon="pi pi-undo"
|
<button pButton label="{{'common.reset_filters' | translate}}" icon="pi pi-undo"
|
||||||
class="icon-btn btn" (click)="resetFilters()">
|
class="icon-btn btn" (click)="resetFilters()">
|
||||||
</button>
|
</button>
|
||||||
<app-data-import-and-export name="levels" [(data)]="levels"
|
<app-data-import-and-export *ngIf="user?.isModerator || user?.isAdmin" name="levels" [(data)]="levels"
|
||||||
[callback]="callback" [validator]="validator"></app-data-import-and-export>
|
[callback]="callback" [validator]="validator"></app-data-import-and-export>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -219,17 +219,17 @@
|
|||||||
translationKey="view.server.levels.header"></app-history-btn>
|
translationKey="view.server.levels.header"></app-history-btn>
|
||||||
<button *ngIf="!editing" pButton pInitEditableRow class="btn icon-btn" icon="pi pi-pencil"
|
<button *ngIf="!editing" pButton pInitEditableRow class="btn icon-btn" icon="pi pi-pencil"
|
||||||
(click)="onRowEditInit(dt, level, ri)"
|
(click)="onRowEditInit(dt, level, ri)"
|
||||||
[disabled]="!user || user.isModerator && !user.isAdmin"></button>
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
<button *ngIf="!editing" pButton class="btn icon-btn danger-icon-btn" icon="pi pi-trash"
|
<button *ngIf="!editing" pButton class="btn icon-btn danger-icon-btn" icon="pi pi-trash"
|
||||||
(click)="deleteLevel(level)"
|
(click)="deleteLevel(level)"
|
||||||
[disabled]="!user || user.isModerator && !user.isAdmin"></button>
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
|
|
||||||
<button *ngIf="editing" pButton pSaveEditableRow class="btn icon-btn"
|
<button *ngIf="editing" pButton pSaveEditableRow class="btn icon-btn"
|
||||||
icon="pi pi-check-circle" (click)="onRowEditSave(level, ri)"
|
icon="pi pi-check-circle" (click)="onRowEditSave(level, ri)"
|
||||||
[disabled]="!user || user.isModerator && !user.isAdmin"></button>
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
<button *ngIf="editing" pButton pCancelEditableRow class="btn icon-btn danger-icon-btn"
|
<button *ngIf="editing" pButton pCancelEditableRow class="btn icon-btn danger-icon-btn"
|
||||||
icon="pi pi-times-circle" (click)="onRowEditCancel(ri)"
|
icon="pi pi-times-circle" (click)="onRowEditCancel(ri)"
|
||||||
[disabled]="!user || user.isModerator && !user.isAdmin"></button>
|
[disabled]="!user || !user.isModerator && !user.isAdmin"></button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -28,16 +28,11 @@ const routes: Routes = [
|
|||||||
data: { memberRole: MemberRoles.Moderator }
|
data: { memberRole: MemberRoles.Moderator }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "levels",
|
path: "levels", loadChildren: () => import("./levels/levels.module").then(m => m.LevelsModule)
|
||||||
loadChildren: () => import("./levels/levels.module").then(m => m.LevelsModule),
|
|
||||||
canActivate: [AuthGuard],
|
|
||||||
data: { memberRole: MemberRoles.Moderator }
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "achievements",
|
path: "achievements",
|
||||||
loadChildren: () => import("./achievements/achievements.module").then(m => m.AchievementsModule),
|
loadChildren: () => import("./achievements/achievements.module").then(m => m.AchievementsModule)
|
||||||
canActivate: [AuthGuard],
|
|
||||||
data: { memberRole: MemberRoles.Moderator }
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "short-role-names",
|
path: "short-role-names",
|
||||||
|
@ -203,8 +203,8 @@ export class SidebarService {
|
|||||||
this.serverMembers.visible = isTechnicianAndFullAccessActive || user?.isModerator;
|
this.serverMembers.visible = isTechnicianAndFullAccessActive || user?.isModerator;
|
||||||
this.serverUserWarnings.visible = isTechnicianAndFullAccessActive || user?.isModerator;
|
this.serverUserWarnings.visible = isTechnicianAndFullAccessActive || user?.isModerator;
|
||||||
this.serverAutoRoles.visible = isTechnicianAndFullAccessActive || this.hasFeature("AutoRoleModule") && user?.isModerator;
|
this.serverAutoRoles.visible = isTechnicianAndFullAccessActive || this.hasFeature("AutoRoleModule") && user?.isModerator;
|
||||||
this.serverLevels.visible = isTechnicianAndFullAccessActive || this.hasFeature("LevelModule") && user?.isModerator;
|
this.serverLevels.visible = true;
|
||||||
this.serverAchievements.visible = isTechnicianAndFullAccessActive || this.hasFeature("AchievementsModule") && user?.isModerator;
|
this.serverAchievements.visible = true;
|
||||||
this.serverScheduledEvents.visible = isTechnicianAndFullAccessActive || this.hasFeature("ScheduledEvents") && user?.isModerator;
|
this.serverScheduledEvents.visible = isTechnicianAndFullAccessActive || this.hasFeature("ScheduledEvents") && user?.isModerator;
|
||||||
this.serverShortRoleNames.visible = isTechnicianAndFullAccessActive || this.hasFeature("ShortRoleName") && user?.isAdmin;
|
this.serverShortRoleNames.visible = isTechnicianAndFullAccessActive || this.hasFeature("ShortRoleName") && user?.isAdmin;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user