[Connect | Trunk]: Change communityCard to portalSearchCard
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@58838 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
738234e4e4
commit
9ab748a890
|
@ -34,7 +34,7 @@
|
|||
uk-grid>
|
||||
|
||||
<div *ngFor="let affiliation of affiliations;">
|
||||
<div class="uk-card communityCard">
|
||||
<div class="uk-card portalSearchCard">
|
||||
<a *ngIf="affiliation.website_url" target="_blank" [href]="urlPrefix(affiliation.website_url) + affiliation.website_url" class="affiliation-content">
|
||||
<ng-container *ngTemplateOutlet="card; context: { organization: affiliation, fullView: true}"></ng-container>
|
||||
</a>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
class="uk-grid-match uk-grid-medium uk-child-width-1-5@m uk-child-width-1-2 uk-text-center"
|
||||
uk-grid uk-height-match=".community">
|
||||
<div *ngFor="let community of researchCommunities.slice(0, 5); let i = index">
|
||||
<div class="uk-padding-small communityCard">
|
||||
<div class="uk-padding-small portalSearchCard">
|
||||
<browse-community [community]=community></browse-community>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
class="uk-grid-match uk-grid-small uk-child-width-1-3@s uk-child-width-1-2 uk-text-center"
|
||||
uk-grid >
|
||||
<div *ngFor="let community of managerOfCommunities.slice(0,3); let i = index">
|
||||
<div class="uk-padding-small uk-card uk-card-default uk-card-small communityCard"
|
||||
<div class="uk-padding-small uk-card uk-card-default uk-card-small portalSearchCard"
|
||||
title="{{community.description}}">
|
||||
<browse-community [community]=community [smallTitle]="true" [showDescription]=false></browse-community>
|
||||
</div>
|
||||
|
@ -57,7 +57,7 @@
|
|||
class="uk-grid-match uk-grid-small uk-child-width-1-3@s uk-child-width-1-2 uk-text-center"
|
||||
uk-grid>
|
||||
<div *ngFor="let community of subscriberOfCommunities.slice(0,3); let i = index">
|
||||
<div class="uk-padding-small uk-card uk-card-small uk-card-default communityCard"
|
||||
<div class="uk-padding-small uk-card uk-card-small uk-card-default portalSearchCard"
|
||||
[attr.uk-tooltip]="((community.description) ? ('title: '+ community.description + '; pos: bottom-right') : 'cls: uk-invisible')">
|
||||
<browse-community [community]=community [smallTitle]="true" [showDescription]=false></browse-community>
|
||||
</div>
|
||||
|
@ -101,7 +101,7 @@
|
|||
class="uk-grid-match uk-grid-medium uk-child-width-1-5@m uk-child-width-1-2 uk-text-center"
|
||||
uk-grid uk-height-match=".community;">
|
||||
<div *ngFor="let community of researchCommunities.slice(0, 5); let i = index">
|
||||
<div class="uk-padding-small uk-card uk-card-default communityCard">
|
||||
<div class="uk-padding-small uk-card uk-card-default portalSearchCard">
|
||||
<browse-community [community]=community></browse-community>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,6 @@ import {SearchUtilsClass} from "../../openaireLibrary/searchPages/searchUtils/se
|
|||
import {ErrorMessagesComponent} from "../../openaireLibrary/utils/errorMessages.component";
|
||||
import {ErrorCodes} from "../../openaireLibrary/utils/properties/errorCodes";
|
||||
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
|
||||
import {SearchPageComponent} from "../../openaireLibrary/searchPages/searchUtils/searchPage.component";
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {AdvancedField, Filter, Value} from "../../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
|
||||
import {SearchFields} from "../../openaireLibrary/utils/properties/searchFields";
|
||||
|
@ -31,12 +30,8 @@ import {NewSearchPageComponent} from "../../openaireLibrary/searchPages/searchUt
|
|||
[lastIndex]=false
|
||||
[simpleView]="true"
|
||||
[fieldIds]="fieldIds" [fieldIdsMap]="fieldIdsMap" [selectedFields]="selectedFields"
|
||||
[simpleSearchLink]="searchLink" [entitiesSelection]="false" [showBreadcrumb]="true"
|
||||
>
|
||||
[simpleSearchLink]="searchLink" [entitiesSelection]="false" [showBreadcrumb]="true">
|
||||
</new-search-page>
|
||||
<!-- [baseUrl]="baseUrl"-->
|
||||
<!-- [breadcrumbs]="breadcrumbs"
|
||||
[showType]="showType"-->
|
||||
`
|
||||
})
|
||||
export class SearchCommunitiesComponent {
|
||||
|
@ -45,16 +40,26 @@ export class SearchCommunitiesComponent {
|
|||
private errorMessages: ErrorMessagesComponent;
|
||||
public results: CommunityInfo[] = [];
|
||||
public totalResults: CommunityInfo[] = [];
|
||||
public sub: any; public subResults: any;
|
||||
public sub: any;
|
||||
public subResults: any;
|
||||
public filters = [];
|
||||
public searchFields: SearchFields = new SearchFields();
|
||||
public searchUtils: SearchUtilsClass = new SearchUtilsClass();
|
||||
public selectedFields: AdvancedField[] = [];
|
||||
public disableForms: boolean = false;
|
||||
public baseUrl: string = null;
|
||||
public fieldIds: string[] = ["q"];
|
||||
public refineFields: string[] = this.searchFields.COMMUNITIES_SEARCH_FIELDS;
|
||||
public fieldIdsMap = {["q"]:{name:"All fields", type:"keyword", param:"q", operator: "op", equalityOperator: "=", filterType: null}};
|
||||
public selectedFields: AdvancedField[] = [];//[new AdvancedField(this.fieldIds[0], "", this.fieldIdsMap[this.fieldIds[0]].name, this.fieldIdsMap[this.fieldIds[0]].type,"", "and")];
|
||||
public fieldIdsMap = {
|
||||
["q"]: {
|
||||
name: "All fields",
|
||||
type: "keyword",
|
||||
param: "q",
|
||||
operator: "op",
|
||||
equalityOperator: "=",
|
||||
filterType: null
|
||||
}
|
||||
};
|
||||
public keyword = "";
|
||||
public searchLink;
|
||||
public showType = false;
|
||||
|
@ -83,8 +88,6 @@ export class SearchCommunitiesComponent {
|
|||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.searchPage.resultsPerPage = 10;
|
||||
// this.searchUtils.keyword = (params['fv0']?params['fv0']:'');
|
||||
// this.searchUtils.keyword = StringUtils.URIDecode(this.searchUtils.keyword);
|
||||
this.keyword = (params['fv0'] ? params['fv0'] : '');
|
||||
this.keyword = StringUtils.URIDecode(this.keyword);
|
||||
this.searchUtils.page = (params['page'] === undefined) ? 1 : +params['page'];
|
||||
|
@ -152,8 +155,7 @@ export class SearchCommunitiesComponent {
|
|||
this._getResults(params);
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this._getResults(params);
|
||||
}
|
||||
},
|
||||
|
@ -224,10 +226,6 @@ export class SearchCommunitiesComponent {
|
|||
this.checkFilters(params);
|
||||
this.sort();
|
||||
this.searchUtils.totalResults = this.results.length;
|
||||
// this.searchPage.checkSelectedFilters(this.filters);
|
||||
// this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||
// this.searchPage.buildPageURLParameters(this.filters, [], false);
|
||||
//this.filters =
|
||||
this.searchPage.prepareFiltersToShow(this.filters, this.searchUtils.totalResults);
|
||||
|
||||
this.results = this.results.slice((this.searchUtils.page - 1) * this.searchUtils.size, (this.searchUtils.page * this.searchUtils.size));
|
||||
|
@ -330,8 +328,7 @@ export class SearchCommunitiesComponent {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(filterId == 'status') {
|
||||
} else if (filterId == 'status') {
|
||||
for (let i = 0; i < this.results.length; i++) {
|
||||
if (values.length == 0) {
|
||||
results.push(this.results[i]);
|
||||
|
@ -351,8 +348,7 @@ export class SearchCommunitiesComponent {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(filterId == 'role') {
|
||||
} else if (filterId == 'role') {
|
||||
for (let i = 0; i < this.results.length; i++) {
|
||||
if (values.length == 0) {
|
||||
results.push(this.results[i]);
|
||||
|
@ -404,15 +400,13 @@ export class SearchCommunitiesComponent {
|
|||
this.filters[i].values[j].number++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.filters[i].filterId == 'status') {
|
||||
} else if (this.filters[i].filterId == 'status') {
|
||||
if (results[k].isSubscribed) {
|
||||
this.filters[i].values[0].number++;
|
||||
} else {
|
||||
this.filters[i].values[1].number++;
|
||||
}
|
||||
}
|
||||
else if (this.filters[i].filterId == 'role') {
|
||||
} else if (this.filters[i].filterId == 'role') {
|
||||
if (results[k].isManager) {
|
||||
this.filters[i].values[0].number++;
|
||||
}
|
||||
|
@ -503,7 +497,16 @@ export class SearchCommunitiesComponent {
|
|||
let value: Value = {name: value_names[i][j], id: value_original_ids[i][j], number: 0, selected: false};
|
||||
values.push(value);
|
||||
}
|
||||
let filter: Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: true , filterType: "checkbox"};
|
||||
let filter: Filter = {
|
||||
title: filter_names[i],
|
||||
filterId: filter_ids[i],
|
||||
originalFilterId: filter_original_ids[i],
|
||||
values: values,
|
||||
countSelectedValues: 0,
|
||||
"filterOperator": 'or',
|
||||
valueIsExact: true,
|
||||
filterType: "checkbox"
|
||||
};
|
||||
filters.push(filter);
|
||||
}
|
||||
return filters;
|
||||
|
|
|
@ -40,24 +40,6 @@
|
|||
color: white;
|
||||
}
|
||||
|
||||
.communityCard {
|
||||
box-shadow: 0 1px 3px #00000029;
|
||||
border-radius: 2px;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.rc-label {
|
||||
color: black !important;
|
||||
background-color: #FFC700 !important;
|
||||
}
|
||||
|
||||
.private-view-label {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
|
||||
.searchForm, .communitiesSearchForm {
|
||||
background: transparent linear-gradient(0deg, #FAFAFA 0%, #E2EEFA 100%);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue