Project

General

Profile

« Previous | Next » 

Revision 54075

1. Simple & Advanced Search pages:
in sorting functionality for Date, add ascending (oldest) and descending (newest) options.
remove margin between paging and search results.
show and hide sorting and results per page functionalities (like paging) according to results and loading.

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/advanced/advancedSearchOrps.component.ts
88 88
        this.searchUtils.size = 10;
89 89
      }
90 90
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
91
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
91
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
92 92
        this.searchUtils.sortBy = "";
93 93
      }
94 94

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/advanced/advancedSearchDatasets.component.ts
88 88
        this.searchUtils.size = 10;
89 89
      }
90 90
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
91
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
91
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
92 92
        this.searchUtils.sortBy = "";
93 93
      }
94 94

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/advanced/advancedSearchSoftware.component.ts
89 89
        this.searchUtils.size = 10;
90 90
      }
91 91
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
92
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
92
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
93 93
        this.searchUtils.sortBy = "";
94 94
      }
95 95

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/advanced/advancedSearchPublications.component.ts
93 93
        this.searchUtils.size = 10;
94 94
      }
95 95
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
96
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
96
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
97 97
        this.searchUtils.sortBy = "";
98 98
      }
99 99

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchPage.component.html
89 89
            </div>
90 90
          </div>
91 91

  
92
<!-- uk-sticky="offset: 120" -->
93
<!-- <div *ngIf="showRefine" class="uk-width-1-5 uk-margin-top helper-left-right search-filters uk-visible@m"> -->
92 94

  
93 95
          <div  class="uk-grid uk-width-1-1">
94
            <div  *ngIf="showRefine" class=" uk-margin-top helper-left-right search-filters uk-visible@m">
96
            <div *ngIf="showRefine" class="uk-margin-top helper-left-right search-filters uk-visible@m">
97
              <!-- top: #container-1; bottom: #true; -->
98
              <!-- <div id="container-1" style="z-index: -1;" uk-sticky="top: #container-1; offset: 120; "> -->
95 99
               <helper position="left" before="true"></helper>
96 100
               <div   class="uk-width-1-1   uk-margin-small-bottom ">
97 101

  
......
138 142
               <search-filter  *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter"  [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)"  [(connectCommunityId)]=connectCommunityId></search-filter>
139 143
               <helper position="left" before="false"></helper>
140 144
            </div>
145
            <!-- </div> -->
141 146
            <helper *ngIf="!showRefine" class="uk-margin-top helper-left-right uk-visible@m" position="left"></helper>
142 147

  
143 148
            <div class="uk-width-expand@m uk-width-1-1@s uk-first-column">
144 149
            <!-- <div [class]="(showRefine)?'uk-width-expand@m uk-first-column':''" > -->
145 150
              <div *ngIf="openaireLink"> <a class="uk-margin-top   uk-button uk-button-text"  [href]=openaireLink target="_blank" >Results in OpenAIRE</a></div>
146 151
              <div  class="uk-align-center uk-margin-remove-bottom">
147
                <div class="uk-grid uk-margin-top uk-margin-bottom">
152
                <div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"
153
                      class="uk-grid uk-margin-top uk-margin-bottom">
148 154
                  <!-- <search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(searchUtils)] = "searchUtils" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-results-per-page> -->
149 155
                  <!-- <search-sorting class="uk-width-1-2@m uk-width-1-1" *ngIf="sort" [(searchUtils)] = "searchUtils" [(sortBy)]="sortBy" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-sorting> -->
150 156
                  <search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
......
164 170
                <search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"></search-download>
165 171
              </div> -->
166 172

  
167
              <div *ngIf="(searchUtils.page <= pagingLimit)" class="uk-margin-top">
173
              <div *ngIf="(searchUtils.page <= pagingLimit)" class="">
168 174
                <search-result    *ngIf="!tableView"
169 175
                                  [results]="results"
170 176
                                  [status]="searchUtils.status"
......
178 184
              </div>
179 185

  
180 186
              <div  class="uk-align-center uk-margin-remove-bottom">
181
                <div class="uk-grid uk-margin-top uk-margin-bottom">
187
                <div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"
188
                      class="uk-grid uk-margin-top uk-margin-bottom">
182 189
                  <search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
183 190
                  <!-- <search-results-per-page class="uk-width-1-2@m uk-width-1-1"></search-results-per-page> -->
184 191
                  <!--[(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"-->
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchPaging.component.ts
5 5
@Component({
6 6
    selector: 'search-paging',
7 7
    template: `
8
    <div class= "searchPaging uk-panel uk-margin-top uk-margin-bottom uk-grid">
8
    <div class= "searchPaging uk-panel uk-margin-top uk-grid">
9 9
      <div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
10 10
        {{searchUtils.totalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(searchUtils.totalResults)|number)}}
11 11
      </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchPage.component.ts
70 70
  public resultsPerPage: number = 0;
71 71
  public isPiwikEnabled;
72 72
  properties:EnvProperties;
73
  public errorCodes:ErrorCodes = new ErrorCodes();
73 74

  
74 75
  constructor (private route: ActivatedRoute,
75 76
               private location: Location,
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/advancedSearchPage.component.html
41 41
            <div class="uk-width-expand@m uk-with-1-1@s">
42 42
              <div *ngIf="openaireLink"> <a class="uk-margin-top   uk-button uk-button-text"  [href]=openaireLink target="_blank" >Results in OpenAIRE</a></div>
43 43
              <div  class="uk-align-center uk-margin-remove-bottom">
44
                <div class="uk-grid uk-margin-top uk-margin-bottom">
44
                <div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"
45
                      class="uk-grid uk-margin-top uk-margin-bottom">
45 46
                  <search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
46 47
                  <search-sorting class="uk-width-1-2@m uk-width-1-1" *ngIf="sort" [(sortBy)]="searchUtils.sortBy" (sortByChange)="sortByChanged($event)"></search-sorting>
47 48
                </div>
......
50 51

  
51 52
              <search-download class="uk-width-1-1@s uk-hidden@m" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
52 53

  
53
              <div *ngIf="(searchUtils.page <= pagingLimit)" class="uk-margin-top">
54
              <div *ngIf="(searchUtils.page <= pagingLimit)" class="">
54 55
                <search-result  [results]="results"
55 56
                                [status]=searchUtils.status
56 57
                                [type]="entityType"
......
63 64
              </div>
64 65

  
65 66
              <div  class="uk-align-center uk-margin-remove-bottom">
66
                <div class="uk-grid uk-margin-top uk-margin-bottom">
67
                <div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"
68
                      class="uk-grid uk-margin-top uk-margin-bottom">
67 69
                  <search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
68 70
                  <search-sorting class="uk-width-1-2@m uk-width-1-1" *ngIf="sort" [(sortBy)]="searchUtils.sortBy" (sortByChange)="sortByChanged($event)"></search-sorting>
69 71
                </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchSorting.component.ts
28 28
        <select class="uk-select uk-width-2-3@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
29 29
                [(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
30 30
                <option value="">Relevance</option>
31
                <option value="resultdateofacceptance,descending">Date</option>
31
                <option value="resultdateofacceptance,descending">Date (newest)</option>
32
                <option value="resultdateofacceptance,ascending">Date (oldest)</option>
32 33
        </select>
33 34
      </span>
34 35

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/advancedSearchPage.component.ts
12 12
import {SearchUtilsClass}             from './searchUtils.class';
13 13
import {ModalLoading}                 from '../../utils/modal/loading.component';
14 14
import {StringUtils, Dates}           from '../../utils/string-utils.class';
15
import {ErrorCodes}                   from '../../utils/properties/errorCodes';
15 16

  
16 17
import {PiwikService}                 from '../../utils/piwik/piwik.service';
17 18
import {EnvProperties}                from '../../utils/properties/env-properties';
......
54 55
  public resultsPerPage: number = 0;
55 56
  isPiwikEnabled = false;
56 57
  properties:EnvProperties;
58
  public errorCodes:ErrorCodes = new ErrorCodes();
59

  
57 60
  url = null;
58 61
  @Output() queryChange  = new EventEmitter();
59 62
  constructor (private route: ActivatedRoute,
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/simple/searchOrps.component.ts
98 98
        this.searchUtils.size = 10;
99 99
      }
100 100
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
101
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
101
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
102 102
        this.searchUtils.sortBy = "";
103 103
      }
104 104

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/simple/searchDatasets.component.ts
101 101
        this.searchUtils.size = 10;
102 102
      }
103 103
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
104
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
104
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
105 105
        this.searchUtils.sortBy = "";
106 106
      }
107 107

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/simple/searchSoftware.component.ts
100 100
        this.searchUtils.size = 10;
101 101
      }
102 102
      this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
103
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
103
      if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
104 104
        this.searchUtils.sortBy = "";
105 105
      }
106 106

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/simple/searchPublications.component.ts
110 110
          this.searchUtils.size = 10;
111 111
        }
112 112
        this.searchUtils.sortBy = (params['sortBy'])?params['sortBy']:'';
113
        if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending") {
113
        if(this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
114 114
          this.searchUtils.sortBy = "";
115 115
        }
116 116

  

Also available in: Unified diff