[Trunk | Admin]:

1. dashboard.component.html: Show class help texts link only when community is 'openaire' or 'connect'.
2. div-help-contents.component & page-help-contents.component: As preview of content, strip html tags and show 200 first characters | show help texts by increasing order.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56767 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-07-25 14:09:29 +00:00
parent 7ea1d168b1
commit 7b74f83bf8
5 changed files with 18 additions and 5 deletions

View File

@ -65,7 +65,8 @@
</div>
<div>
<a routerLink="/pageContents" [queryParams]="{communityId: this.communityId}" class="uk-button uk-button-text">Help texts in pages</a><br>
<a routerLink="/classContents" [queryParams]="{communityId: this.communityId}" class="uk-button uk-button-text">Help texts in classes</a>
<a *ngIf="communityId === 'openaire' || communityId === 'connect'"
routerLink="/classContents" [queryParams]="{communityId: this.communityId}" class="uk-button uk-button-text">Help texts in classes</a>
</div>
</div>
<div *ngIf="communityType && communityType == 'ri' && communityId!='openaire' && this.communityId !== 'connect'" class="uk-card uk-card-default uk-card-body uk-card-hover">

View File

@ -118,7 +118,8 @@
<div class="divId" href="#">{{check.divHelpContent.divId.name}}</div>
</td>
<td>
<div class="content" [innerHTML]="check.divHelpContent.content | safeHtml"></div>
<!-- <div class="content" [innerHTML]="check.divHelpContent.content | safeHtml"></div>-->
<div class="content">{{check.divHelpContent.content}}</div>
</td>
<td>
<mat-slide-toggle [checked]="check.divHelpContent.isActive"

View File

@ -143,12 +143,17 @@ export class DivHelpContentsComponent implements OnInit {
this.counter.all = this.divHelpContents.length;
this.checkboxes = [];
for (let i = this.divHelpContents.length - 1; i >= 0; i -= 1) {
//for (let i = this.divHelpContents.length - 1; i >= 0; i -= 1) {
for (let i = 0; i < this.divHelpContents.length; i++) {
let divId: DivId = this.divHelpContents[i].divId as DivId;
let pages: Page[] = divId.pages as Page[];
const pageIds = pages.map(x => x._id);
if(!this.selectedPageId || pageIds.includes(this.selectedPageId)) {
this.divHelpContents[i].content = this.divHelpContents[i].content.replace(/<[^>]*>/g, '');
if(this.divHelpContents[i].content.length > 200) {
this.divHelpContents[i].content = this.divHelpContents[i].content.substr(0, 200) + "...";
}
this.checkboxes.push(<CheckDivHelpContent>{divHelpContent : this.divHelpContents[i], checked : false});
} else {
this.divHelpContents.splice(i, 1);

View File

@ -106,7 +106,8 @@
<div class="community" href="#">{{check.pageHelpContent.community.name}}</div>
</td>
<td>
<div class="content" [innerHtml]="check.pageHelpContent.content | safeHtml"></div>
<!-- <div class="content" [innerHtml]="check.pageHelpContent.content | safeHtml"></div>-->
<div class="content">{{check.pageHelpContent.content}}</div>
</td>
<td>
<div class="placement" href="#">{{check.pageHelpContent.placement}}</div>

View File

@ -156,9 +156,14 @@ export class PageHelpContentsComponent implements OnInit {
this.counter.all = this.pageHelpContents.length;
this.checkboxes = [];
for (let i = this.pageHelpContents.length - 1; i >= 0; i -= 1) {
//for (let i = this.pageHelpContents.length - 1; i >= 0; i -= 1) {
for (let i = 0; i < this.pageHelpContents.length; i++) {
let page: Page = this.pageHelpContents[i].page as Page;
if(!this.selectedPageId || (page._id == this.selectedPageId)) {
this.pageHelpContents[i].content = this.pageHelpContents[i].content.replace(/<[^>]*>/g, '');
if(this.pageHelpContents[i].content.length > 200) {
this.pageHelpContents[i].content = this.pageHelpContents[i].content.substr(0, 200) + "...";
}
this.checkboxes.push(<CheckPageHelpContent>{pageHelpContent : this.pageHelpContents[i], checked : false});
} else {
this.pageHelpContents.splice(i, 1);