Skip to content

Commit

Permalink
community: smoother services (fixes #5615) (#7708)
Browse files Browse the repository at this point in the history
Co-authored-by: mutugiii <[email protected]>
Co-authored-by: dogi <[email protected]>
  • Loading branch information
3 people authored Nov 5, 2024
1 parent 27c7d00 commit 88299f0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.15.33",
"version": "0.15.34",
"myplanet": {
"latest": "v0.20.78",
"min": "v0.19.78"
"latest": "v0.20.79",
"min": "v0.19.79"
},
"scripts": {
"ng": "ng",
Expand Down
25 changes: 15 additions & 10 deletions src/app/community/community.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,34 @@ <h3 style="text-align: right; margin-right: 0.5rem;">
</div>
</mat-tab>
<mat-tab i18n-label label="Services">
<planet-markdown *ngIf="team.description" [content]="team.description || ''"></planet-markdown>
<span *ngIf="!team.description" i18n><p>No description available.</p></span>
<ng-container *ngIf="!planetCode">
<button *planetAuthorizedRoles="''" (click)="openDescriptionDialog()" mat-stroked-button i18n>
{ servicesDescriptionLabel, select, Edit {Edit} Add {Add}} { configuration.planetType, select, community {Community} nation {Nation} center {Earth}} Description
</button>
</ng-container>
<span *ngIf="links?.length === 0" i18n><p>No links available.</p></span>
<mat-nav-list>
<mat-list-item *ngFor="let link of links" [routerLink]="(link.teamType === 'sync' || !planetCode) ? link.route : []" i18n-matTooltip [matTooltip]="(link.teamType === 'sync' || !planetCode) ? '' : link.title + ' is only available on ' + configuration.name" [disableRipple]="link.teamType === 'local' && planetCode">
<span matLine>{{link.title}}</span>
<button *ngIf="deleteMode" mat-icon-button color="warn" (click)="openDeleteLinkDialog(link); $event.stopPropagation()"><mat-icon>delete</mat-icon></button>
</mat-list-item>
</mat-nav-list>
<planet-markdown *ngIf="team.description; else noTeamDesc" [content]="team.description || ''"></planet-markdown>
<ng-template #noTeamDesc><p i18n>No description available.</p></ng-template>
<ng-container *ngIf="!planetCode">
<div *planetAuthorizedRoles="''" class="action-buttons">
<div *planetAuthorizedRoles="''" class="action-buttons sticky-button">
<button (click)="openAddLinkDialog()" mat-stroked-button i18n>Add Link</button>
<button (click)="toggleDeleteMode()" [disabled]="links.length===0" mat-stroked-button>
<span *ngIf="!deleteMode" i18n>Remove Links</span>
<span *ngIf="deleteMode" i18n>Done Removing Links</span>
</button>
</div>
</ng-container>
<ng-container>
<span *ngIf="links?.length === 0" i18n><p>No links available.</p></span>
<mat-nav-list>
<mat-list-item *ngFor="let link of links" [routerLink]="(link.teamType === 'sync' || !planetCode) ? link.route : []" i18n-matTooltip [matTooltip]="(link.teamType === 'sync' || !planetCode) ? '' : link.title + ' is only available on ' + configuration.name" [disableRipple]="link.teamType === 'local' && planetCode">
<span matLine>{{link.title}}</span>
<button *ngIf="deleteMode" mat-icon-button color="warn" (click)="openDeleteLinkDialog(link); $event.stopPropagation()"><mat-icon>delete</mat-icon></button>
</mat-list-item>
</mat-nav-list>
</ng-container>
<ng-template #noLinks>
<p i18n>No links available.</p>
</ng-template>
</mat-tab>
<mat-tab *ngIf="configuration.planetType==='nation'" i18n-label label="Communities">
<planet-community-list></planet-community-list>
Expand Down
8 changes: 8 additions & 0 deletions src/app/community/community.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ planet-calendar {
mat-tab-group, mat-tab {
height: 100%;
}

.sticky-button {
position: sticky;
top: 0;
z-index: 10;
background-color: white;
padding-bottom: 0.5rem;
}

0 comments on commit 88299f0

Please sign in to comment.