[develop | DONE | ADDED ] parse featured filled from communities, add it for admins in community edit form
This commit is contained in:
parent
f9f2273ac0
commit
e290015c82
|
|
@ -100,6 +100,13 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
|
|||
placeholder="Who can join"
|
||||
[options]="membershipOptions" type="select"></div>
|
||||
</div>
|
||||
<div class="uk-width-1-3@m" *ngIf="isAdmin">
|
||||
<span class="uk-text-bold uk-margin-small-right">Is featured Community? (Yes / No)</span>
|
||||
<mat-slide-toggle [checked]="communityFb.get('featured').value"
|
||||
(change)="changeFeatured()"
|
||||
uk-tooltip="title:<div><div class='uk-text-bold'> Select community as a featured community for Joomla </div></div>"
|
||||
></mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
`,
|
||||
|
|
@ -169,7 +176,8 @@ export class EditCommunityComponent {
|
|||
membership: this.fb.control(this.community.membership),
|
||||
managers: this.fb.control(this.community.managers),
|
||||
isUpload: this.fb.control(this.community.isUpload),
|
||||
logoUrl: this.fb.control(this.community.logoUrl)
|
||||
logoUrl: this.fb.control(this.community.logoUrl),
|
||||
featured: this.fb.control(this.community.featured)
|
||||
});
|
||||
if (this.community.isUpload) {
|
||||
this.communityFb.get('logoUrl').clearValidators();
|
||||
|
|
@ -330,4 +338,8 @@ export class EditCommunityComponent {
|
|||
encodeURIComponent(this.community.communityId) + '/' + this.community.logoUrl).subscribe());
|
||||
}
|
||||
}
|
||||
changeFeatured() {
|
||||
this.communityFb.get('featured').setValue(!this.communityFb.get('featured').value);
|
||||
this.communityFb.get('featured').markAsDirty();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ import {ReactiveFormsModule} from "@angular/forms";
|
|||
import {CKEditorModule} from 'ng2-ckeditor';
|
||||
import {InputModule} from "../../../../openaireLibrary/sharedComponents/input/input.module";
|
||||
import {IconsModule} from "../../../../openaireLibrary/utils/icons/icons.module";
|
||||
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, ReactiveFormsModule, InputModule, IconsModule
|
||||
, CKEditorModule
|
||||
, CKEditorModule, MatSlideToggleModule,
|
||||
],
|
||||
declarations: [EditCommunityComponent],
|
||||
exports: [EditCommunityComponent]
|
||||
|
|
|
|||
Loading…
Reference in New Issue