Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

news: more admin permissions (fixes #7486) #7487

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/app/news/news-list-item.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<mat-chip-list>
<mat-chip color="primary" selected class="planet-chip-label chip-no-style" *ngFor="let label of item.doc.labels">
<planet-label i18n-label [label]="label"></planet-label>
<mat-icon *ngIf="item.doc.user.name === currentUser.name && editable && !item.doc.chat" matChipRemove (click)="labelClick(label, 'remove')">clear</mat-icon>
<mat-icon *ngIf="(item.doc.user.name === currentUser.name || currentUser.isUserAdmin ) && editable && !item.doc.chat" matChipRemove (click)="labelClick(label, 'remove')">clear</mat-icon>
</mat-chip>
<mat-chip class="planet-chip-label chip-no-style chat-chip" *ngIf="item.doc.chat">
<planet-label i18n-label [label]="'shared chat'"></planet-label>
Expand Down Expand Up @@ -46,16 +46,16 @@
<ng-container i18n>Show Replies</ng-container> ({{replyObject[item.doc._id]?.length}})
</button>
<span class="toolbar-fill"></span>
<ng-container *ngIf="item.doc.user.name === currentUser.name">
<ng-container *ngIf="item.doc.user.name === currentUser.name || currentUser.isUserAdmin">
<button mat-icon-button type="button" (click)="editNews(item.doc)"><mat-icon>edit</mat-icon></button>
<button mat-icon-button type="button" (click)="openDeleteDialog(item.doc)"><mat-icon>delete</mat-icon></button>
<button mat-button i18n *ngIf="editable && !item.doc.chat" [matMenuTriggerFor]="labelMenu" [disabled]="labels.listed.length === 0">Add Label</button>
<mat-menu #labelMenu="matMenu">
<button mat-menu-item *ngFor="let label of labels.listed" (click)="labelClick(label, 'add')"><planet-label [label]="label"></planet-label></button>
</mat-menu>
<button mat-button *ngIf="showShare" (click)="shareStory(item.doc)" i18n>Share with {
shareTarget, select, community {Community} nation {Nation} center {Earth}
}</button>
</ng-container>
<button mat-button i18n *ngIf="editable && !item.doc.chat" [matMenuTriggerFor]="labelMenu" [disabled]="labels.listed.length === 0">Add Label</button>
<mat-menu #labelMenu="matMenu">
<button mat-menu-item *ngFor="let label of labels.listed" (click)="labelClick(label, 'add')"><planet-label [label]="label"></planet-label></button>
</mat-menu>
<button mat-button *ngIf="showShare" (click)="shareStory(item.doc)" i18n>Share with {
shareTarget, select, community {Community} nation {Nation} center {Earth}
}</button>
</mat-card-actions>
</mat-card>
Loading