Project

General

Profile

« Previous | Next » 

Revision 55234

[Trunk|Library]: 1. Move manage in library. 2. change community search result View. 3. search filter cannot be disabled when they are selected.

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/communitySearchResults.component.html
2 2
    <errorMessages [status]="[status]" [type]="'results'"></errorMessages>
3 3

  
4 4
    <li *ngFor="let result of results" class="uk-animation-fade uk-margin-auto" uk-grid>
5
        <a class="uk-width-1-5 uk-height-small uk-card uk-card-default uk-card-body uk-margin-auto-top" (click)="confirmModalOpen(result.community)">
5
        <a class="uk-width-1-5 uk-height-small uk-card uk-card-default uk-card-body" (click)="confirmModalOpen(result.community)">
6 6
            <div *ngIf="result.isSubscribed" class="uk-card-badge portal-card-badge uk-width-1-2 uk-position-top-left uk-text-small uk-text-center">Subscribed</div>
7 7
            <img *ngIf= "result.community.logoUrl != null && result.community.logoUrl != '' " class="uk-padding uk-position-center" src="{{result.community.logoUrl}}" alt="{{(result.community.title)?result.community.title:result.community.shortTitle}} logo" >
8 8
            <span  *ngIf= "result.community.logoUrl == null || result.community.logoUrl == '' "  class="uk-icon uk-padding uk-position-center">
......
10 10
            </span>
11 11
        </a>
12 12
        <div class="uk-width-expand">
13
            <div  [title] =  result.community.shortTitle class="uk-text-large">
14
                <a (click)="confirmModalOpen(result.community)">
13
            <div  [title] =  result.community.shortTitle class="uk-text-large uk-grid">
14
                <a (click)="confirmModalOpen(result.community)" class="uk-width-3-4">
15 15
                    {{(result.community.title)?result.community.title:result.community.shortTitle}}
16 16
                </a>
17
                <manage *ngIf="result.isManager" [communityId]="result.community.communityId" class="uk-width-expand"></manage>
17 18
            </div>
18
            <div *ngIf="result.community.description">
19
                <div class="text-justify descriptionText">
20
                    {{result.community.description}}
19
            <div *ngIf="result.community.description" class="uk-margin-auto">
20
                <div class="text-justify descriptionText" [title]="result.community.description">
21
                    {{_formatDescription(result.community.description)}}
21 22
                </div>
22 23
            </div>
23 24
            <div class="uk-padding-small uk-padding-remove-left uk-grid">
24
                <div class="uk-width-1-2">
25
                <div class="uk-width-3-5">
25 26
                    <span *ngIf="result.community.date"><b> Creation Date: </b></span>
26 27
                    <span *ngIf="result.community.date">{{result.community.date | date:'dd-MM-yyyy'}}</span>
27 28
                </div>
28
                <div class="uk-width-1-2 uk-text-right">
29
                <div class="uk-width-expand">
29 30
                    <span *ngIf="result.community.type && result.community.type != ''" ><b> Type: </b></span>
30 31
                    <span *ngIf="result.community.type && result.community.type != ''" >{{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}</span>
31 32
                </div>
32 33
            </div>
33
            <manage *ngIf="result.isManager" [communityId]="result.community.communityId"></manage>
34 34
        </div>
35 35
    </li>
36 36
</ul>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/communitySearchResults.module.ts
5 5
import {ErrorMessagesModule}    from '../../utils/errorMessages.module';
6 6
import {CommunitySearchResultsComponent} from "./communitySearchResults.component";
7 7
import {AlertModalModule} from "../../utils/modal/alertModal.module";
8
import {ManageModule} from "../../../utils/manage/manage.module";
8
import {ManageModule} from "../../utils/manage/manage.module";
9 9

  
10 10
@NgModule({
11 11
  imports: [
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchFilter.component.html
7 7
      <div class="searchFilterBoxValues ">
8 8
        <div *ngFor = "let value of getSelectedValues(filter,'num')"  class = "uk-animation-fade filterItem">
9 9
           <span class="filterName"><div title = "{{value.name}}">
10
           <input [disabled]="isDisabled || (showResultCount && value.number === 0)" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
10
           <input  [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
11 11
           {{_formatName(value)}} </div></span>
12 12
           <span class="filterNumber" *ngIf = "showResultCount === true" >  ({{value.number|number}})</span>
13 13
        </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/communitySearchResults.component.ts
17 17
  @Input() showLoading: boolean = false;
18 18
  @Input() custom_class: string = "search-results";
19 19
  @Input() properties: EnvProperties;
20
  @Input() maxCharacters: number = 150;
20 21
  @ViewChild('AlertModal') modal;
21 22

  
22 23

  
......
37 38

  
38 39

  
39 40
  getProductionPrefix():string{
40
    return (this.properties.environment =="beta")?"beta.":""
41
    return (this.properties.environment == "beta")?"beta.":""
41 42
  }
42 43

  
43 44
  isProduction():boolean{
......
45 46

  
46 47
  }
47 48

  
49
  public _formatDescription(description){
50
    return (((description).length >this.maxCharacters)?(description.substring(0,(this.maxCharacters - ('...').length))+"..."):description);
51
  }
52

  
48 53
  public confirmModalOpen(community: CommunityInfo) {
49 54
      this.selectedCommunityId = community.communityId;
50 55
      this.modal.cancelButton = true;
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/manage/manage.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { RouterModule } from '@angular/router';
4

  
5
import {ManageComponent} from './manage.component';
6
import {AlertModalModule} from '../modal/alertModal.module';
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule,   RouterModule, AlertModalModule
11
  ],
12
  declarations: [
13
    ManageComponent
14
  ],
15
  exports: [
16
    ManageComponent
17
  ]
18
})
19
export class ManageModule { }
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/manage/manage.component.ts
1
import { Component, Input} from '@angular/core';
2
@Component({
3
    selector: 'manage',
4
    template: `
5

  
6
        <a [href]="'https://beta.admin.connect.openaire.eu/dashboard?communityId='+communityId" class="uk-button uk-button-default uk-button-small portal-button" target="_blank">
7
            Manage
8
        </a>
9

  
10

  
11
    `
12
})
13

  
14
export class ManageComponent {
15
   @Input() communityId:string;
16

  
17
   constructor() {}
18
}
19

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/modal/alert.ts
6 6
  <div [class]="(!isOpen)?'uk-modal ':'uk-modal uk-open uk-animation-fade'" uk-modal  [open]="!isOpen" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
7 7
    <div class="uk-modal-dialog  uk-modal-body" role="">
8 8
         <div class="uk-modal-title" [hidden]=!alertHeader>
9
        <button class="uk-modal-close-full uk-float-right" (click)='cancel()' uk-close></button>
9
        <button class="uk-modal-close-default uk-float-right" (click)='cancel()' uk-close></button>
10 10
           <h4 class="modal-title text-center" id="myModalLabel">{{alertTitle}}</h4>
11 11
        </div>
12 12
        <div class="uk-margin  ">

Also available in: Unified diff