Project

General

Profile

« Previous | Next » 

Revision 51036

Add subjects

View differences:

modules/uoa-connect-portal/trunk/src/app/community/community.component.html
16 16
              <p> {{community.description}}</p>
17 17
            </div>
18 18
          </blockquote>
19
          <p><span class="uk-label">Nature</span>&nbsp;<span class=" uk-label uk-label-danger">Life science</span>&nbsp;<span class="uk-label uk-label-success">Environment</span></p>
20
          <div *ngFor='let manager of community.managers; let i = index'>
21
            <p> <span>Curated by: {{manager}} </span> <span class="uk-margin-left"> Created: 26-01-2018</span> </p>
19
          <div *ngIf="community.subjects != null">
20
            <p *ngFor='let subject of community.subjects; let i = index'> <span class="uk-label"> {{subject}}</span>&nbsp;</p>
22 21
          </div>
22
            <p><span *ngIf="community.managers !=null">
23
                  <span *ngFor='let manager of community.managers; let i = index'>Curated by: {{manager}} </span>
24
                </span>
25
                <span class="uk-margin-left"> Created: 26-01-2018</span>
26
            </p>
23 27
      </div>
24 28
      <div class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-grid" uk-grid="">
25 29
        <div class="uk-first-column">
modules/uoa-connect-portal/trunk/src/app/community/community.service.ts
112 112
              community['description'] = resData[0].description;
113 113

  
114 114
              if(resData[0].managers != null) {
115

  
116 115
                  if(community['managers'] == undefined) {
117 116
                    community['managers'] = new Array<string>();
118 117
                  }
......
126 125
                  }
127 126
              }
128 127

  
128
              if(resData[0].subjects != null) {
129
                  if(community['subjects'] == undefined) {
130
                    community['subjects'] = new Array<string>();
131
                  }
132

  
133
                  let subjects = resData[0].subjects;
134
                  let length = Array.isArray(subjects) ? subjects.length : 1;
135

  
136
                  for(let i=0; i<length; i++) {
137
                    let subject = Array.isArray(subjects) ? subjects[i] : subjects;
138
                    community.subjects[i] = subject;
139
                  }
140
              }
141

  
129 142
          } else if(!Array.isArray(resData)) {
130 143

  
131 144
              community['title'] = resData.name;
......
148 161
                    community.managers[i] = manager;
149 162
                  }
150 163
              }
164

  
165
              if(resData.subjects != null) {
166
                  if(community['subjects'] == undefined) {
167
                    community['subjects'] = new Array<string>();
168
                  }
169

  
170
                  let subjects = resData.subjects;
171
                  let length = Array.isArray(subjects) ? subjects.length : 1;
172

  
173
                  for(let i=0; i<length; i++) {
174
                    let subject = Array.isArray(subjects) ? subjects[i] : subjects;
175
                    community.subjects[i] = subject;
176
                  }
177
              }
151 178
          }
152 179
      }
153 180
      return community;
modules/uoa-connect-portal/trunk/src/app/community/community.component.ts
84 84
      community => {
85 85
            this.community = community;
86 86
            this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
87
            //console.log(community);
87
            console.log(community);
88 88
      });
89 89

  
90 90
    this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid='+this.communityId).subscribe(
modules/uoa-connect-portal/trunk/src/app/communities/communities.service.ts
46 46
                    }
47 47
                }
48 48

  
49
                if(resData[0].subjects != null) {
50
                    if(result['subjects'] == undefined) {
51
                      result['subjects'] = new Array<string>();
52
                    }
53

  
54
                    let subjects = resData[0].subjects;
55
                    let length = Array.isArray(subjects) ? subjects.length : 1;
56

  
57
                    for(let i=0; i<length; i++) {
58
                      let subject = Array.isArray(subjects) ? subjects[i] : subjects;
59
                      result.subjects[i] = subject;
60
                    }
61
                }
62

  
49 63
            } else {
50 64
                result['title'] = resData.name;
51 65
                result['shortTitle'] = resData.shortName;
......
67 81
                      result.managers[i] = manager;
68 82
                    }
69 83
                }
84

  
85
                if(resData.subjects != null) {
86
                    if(result['subjects'] == undefined) {
87
                      result['subjects'] = new Array<string>();
88
                    }
89

  
90
                    let subjects = resData.subjects;
91
                    let length = Array.isArray(subjects) ? subjects.length : 1;
92

  
93
                    for(let i=0; i<length; i++) {
94
                      let subject = Array.isArray(subjects) ? subjects[i] : subjects;
95
                      result.subjects[i] = subject;
96
                    }
97
                }
70 98
            }
71 99
            communities.push(result);
72 100
        }
modules/uoa-connect-portal/trunk/src/app/utils/communityInfo.ts
6 6
  logoUrl: string;
7 7
  description: string;
8 8
  managers: string[];
9
  date:string;
10
  subject: string[];
9
  date:Date;
10
  subjects: string[];
11 11
}

Also available in: Unified diff