-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from RandyInVictoria/search
MEM-577 Use new search API calls: Displaying X out of Y Results
- Loading branch information
Showing
3 changed files
with
167 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,157 +1,158 @@ | ||
<div class="spinner-container full-screen" *ngIf="loading" [@visibility]> | ||
<div class="spinner-new rotating"></div> | ||
<div class="spinner-new rotating"></div> | ||
</div> | ||
|
||
<div class="hero-banner search-banner"> | ||
<div class="container"> | ||
<div class="container__inner-container"> | ||
<div class="hero-banner__content"> | ||
<h1 id="pgTitle">Find Documents...</h1> | ||
|
||
<form #f="ngForm" class="search-form ui form" (ngSubmit)="onSubmit()"> | ||
|
||
<div class="search-form__basic-search-fields"> | ||
<div class="form-group mb-0"> | ||
<input class="form-control" type="text" placeholder="Enter Keywords..." name="keywordInput" id="keywordInput" | ||
[disabled]="protoSearchActive" [(ngModel)]="terms.keywords"/> | ||
</div> | ||
</div> | ||
|
||
<div class="search-form__advanced-search-fields mt-4" id="advancedSearchFields" [hidden]="!showAdvancedFields"> | ||
<div class="form-group mb-4"> | ||
<label for="projects">Project</label> | ||
<tag-input class="form-control" name='projectInput' | ||
[secondaryPlaceholder]="'Enter a Project Name'" | ||
[identifyBy]="'_id'" | ||
[displayBy]="'name'" | ||
[(ngModel)]="terms.projects"> | ||
<tag-input-dropdown | ||
[identifyBy]="'_id'" | ||
[displayBy]="'name'" | ||
[autocompleteItems]="projects"> | ||
</tag-input-dropdown> | ||
</tag-input> | ||
</div> | ||
<div class="form-group mb-4"> | ||
<label for="operatorInput">Operator</label> | ||
<tag-input class="form-control" name='operatorInput' | ||
[secondaryPlaceholder]="'Enter an Operator Name'" | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[(ngModel)]="terms.proponents"> | ||
<tag-input-dropdown | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[autocompleteItems]="proponents"> | ||
</tag-input-dropdown> | ||
</tag-input> | ||
</div> | ||
<div class="form-group mb-4"> | ||
<label for="ownerInput">Owner</label> | ||
<tag-input class="form-control" name='ownerInput' | ||
[secondaryPlaceholder]="'Enter an Owner Name'" | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[(ngModel)]="terms.ownerships"> | ||
<tag-input-dropdown | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[autocompleteItems]="proponents"> | ||
</tag-input-dropdown> | ||
</tag-input> | ||
</div> | ||
<div class="form-group mb-0"> | ||
<label>Date Range</label> | ||
<div class="form-inline"> | ||
<label class="sr-only" for="dateRangeStart">Start Date</label> | ||
<input class="form-control" type="text" placeholder="Start Date" name="dateRangeStartInput" id="dateRangeStart" | ||
#dateRangeStart="ngbDatepicker" | ||
ngbDatepicker | ||
readonly | ||
[disabled]="protoSearchActive" | ||
(click)="dateRangeStart.toggle();dateRangeEnd.close();" | ||
[(ngModel)]="terms.dateStart"/> | ||
<span class="date-range__spacer"> - </span> | ||
<label class="sr-only" for="dateRangeEnd">End Date</label> | ||
<input class="form-control" type="text" placeholder="End Date" name="dateRangeEndInput" id="dateRangeEnd" | ||
#dateRangeEnd="ngbDatepicker" | ||
ngbDatepicker | ||
readonly | ||
[disabled]="protoSearchActive" | ||
(click)="dateRangeEnd.toggle();dateRangeStart.close();" | ||
[(ngModel)]="terms.dateEnd"/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="search-form__btn-container"> | ||
<button class="search-form__search-btn btn btn-primary slide-l-btn" | ||
[hidden]="protoSearchActive" | ||
type="submit"> | ||
<i class="material-icons">search</i><span>Search</span> | ||
</button> | ||
|
||
<button class="search-form__search-btn btn btn-primary slide-l-btn" | ||
[hidden]="!protoSearchActive" | ||
disabled> | ||
<i class="material-icons">search</i><span>Searching...</span> | ||
</button> | ||
|
||
<button class="search-form__toggle-advanced-btn btn btn-link" type="button" (click)="toggleAdvancedSearch()"> | ||
<span *ngIf="!showAdvancedFields"> | ||
<i class="material-icons">add_box</i> Show Advanced | ||
</span> | ||
<span *ngIf="showAdvancedFields"> | ||
<i class="material-icons">indeterminate_check_box</i> Hide Advanced | ||
</span> | ||
</button> | ||
</div> | ||
|
||
</form> | ||
<div class="container"> | ||
<div class="container__inner-container"> | ||
<div class="hero-banner__content"> | ||
<h1 id="pgTitle">Find Documents...</h1> | ||
|
||
<form #f="ngForm" class="search-form ui form" (ngSubmit)="onSubmit()"> | ||
|
||
<div class="search-form__basic-search-fields"> | ||
<div class="form-group mb-0"> | ||
<input class="form-control" type="text" placeholder="Enter Keywords..." name="keywordInput" id="keywordInput" | ||
[disabled]="protoSearchActive" [(ngModel)]="terms.keywords"/> | ||
</div> | ||
</div> | ||
|
||
<div class="search-form__advanced-search-fields mt-4" id="advancedSearchFields" [hidden]="!showAdvancedFields"> | ||
<div class="form-group mb-4"> | ||
<label for="projects">Project</label> | ||
<tag-input class="form-control" name='projectInput' | ||
[secondaryPlaceholder]="'Enter a Project Name'" | ||
[identifyBy]="'_id'" | ||
[displayBy]="'name'" | ||
[(ngModel)]="terms.projects"> | ||
<tag-input-dropdown | ||
[identifyBy]="'_id'" | ||
[displayBy]="'name'" | ||
[autocompleteItems]="projects"> | ||
</tag-input-dropdown> | ||
</tag-input> | ||
</div> | ||
<div class="form-group mb-4"> | ||
<label for="operatorInput">Operator</label> | ||
<tag-input class="form-control" name='operatorInput' | ||
[secondaryPlaceholder]="'Enter an Operator Name'" | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[(ngModel)]="terms.proponents"> | ||
<tag-input-dropdown | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[autocompleteItems]="proponents"> | ||
</tag-input-dropdown> | ||
</tag-input> | ||
</div> | ||
<div class="form-group mb-4"> | ||
<label for="ownerInput">Owner</label> | ||
<tag-input class="form-control" name='ownerInput' | ||
[secondaryPlaceholder]="'Enter an Owner Name'" | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[(ngModel)]="terms.ownerships"> | ||
<tag-input-dropdown | ||
[identifyBy]="'_id'" | ||
[displayBy]="'company'" | ||
[autocompleteItems]="proponents"> | ||
</tag-input-dropdown> | ||
</tag-input> | ||
</div> | ||
<div class="form-group mb-0"> | ||
<label>Date Range</label> | ||
<div class="form-inline"> | ||
<label class="sr-only" for="dateRangeStart">Start Date</label> | ||
<input class="form-control" type="text" placeholder="Start Date" name="dateRangeStartInput" id="dateRangeStart" | ||
#dateRangeStart="ngbDatepicker" | ||
ngbDatepicker | ||
readonly | ||
[disabled]="protoSearchActive" | ||
(click)="dateRangeStart.toggle();dateRangeEnd.close();" | ||
[(ngModel)]="terms.dateStart"/> | ||
<span class="date-range__spacer"> - </span> | ||
<label class="sr-only" for="dateRangeEnd">End Date</label> | ||
<input class="form-control" type="text" placeholder="End Date" name="dateRangeEndInput" id="dateRangeEnd" | ||
#dateRangeEnd="ngbDatepicker" | ||
ngbDatepicker | ||
readonly | ||
[disabled]="protoSearchActive" | ||
(click)="dateRangeEnd.toggle();dateRangeStart.close();" | ||
[(ngModel)]="terms.dateEnd"/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="search-form__btn-container"> | ||
<button class="search-form__search-btn btn btn-primary slide-l-btn" | ||
[hidden]="protoSearchActive" | ||
type="submit"> | ||
<i class="material-icons">search</i><span>Search</span> | ||
</button> | ||
|
||
<button class="search-form__search-btn btn btn-primary slide-l-btn" | ||
[hidden]="!protoSearchActive" | ||
disabled> | ||
<i class="material-icons">search</i><span>Searching...</span> | ||
</button> | ||
|
||
<button class="search-form__toggle-advanced-btn btn btn-link" type="button" (click)="toggleAdvancedSearch()"> | ||
<span *ngIf="!showAdvancedFields"> | ||
<i class="material-icons">add_box</i> Show Advanced | ||
</span> | ||
<span *ngIf="showAdvancedFields"> | ||
<i class="material-icons">indeterminate_check_box</i> Hide Advanced | ||
</span> | ||
</button> | ||
</div> | ||
|
||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container" id="anchor-point"> | ||
<main> | ||
|
||
<!-- SEARCH RESULTS TEMPLATE --> | ||
<section class="add-spacer" *ngIf="ranSearch"> | ||
<h2 class="search-results__title" *ngIf="ranSearch && results && results.length > 0">Showing {{results.length}} Document<span *ngIf="results.length > 1">s</span></h2> | ||
<ul class="search-results list-group"> | ||
<li *ngFor="let item of results" class="list-group-item search-results-item"> | ||
<h3 class="search-results-item__project-name" | ||
*ngIf="item.project.name">{{item.project.name}} | ||
</h3> | ||
<a class="search-results-item__title mb-0" href="{{item.hostname}}/api/document/{{item._id}}/fetch" | ||
target="_blank">{{item.displayName}}</a> | ||
<div class="search-results-item__meta">{{item.documentDate | date:'yyyy-MM-dd'}}</div> | ||
<div class="search-results-item__description mt-3" | ||
*ngIf="item.description">{{item.description}} | ||
</div> | ||
</li> | ||
</ul> | ||
|
||
<section class="search-results__no-results" *ngIf="results && results.length < 1" > | ||
<h2>No Documents Found</h2> | ||
<p class="mb-0">Sorry, we were unable to locate any documents matching your search criteria.</p> | ||
</section> | ||
|
||
<div class="search-results__footer mt-3" *ngIf="ranSearch && noMoreResults"> | ||
<button class="btn content-btn-alt" disabled>No More Results</button> | ||
</div> | ||
|
||
<div class="search-results__footer mt-3" *ngIf="ranSearch && results && results.length > 0 && !noMoreResults"> | ||
<button class="btn content-btn-alt" (click)="loadMore()">Show More</button> | ||
</div> | ||
|
||
</section> | ||
|
||
<section> | ||
<h2>How to use this page...</h2> | ||
<p>You can use this tool to search for documents available on the BC Mine Information website. The advanced search feature allows you to narrow your search results by mine, proponent/operator, and/or a specific date range. At this time, search results generated by this tool do not include the contents of individual documents.</p> | ||
</section> | ||
</main> | ||
<main> | ||
|
||
<!-- SEARCH RESULTS TEMPLATE --> | ||
<section class="add-spacer" *ngIf="ranSearch"> | ||
<h2 class="search-results__title" *ngIf="ranSearch && results && results.length > 0">Showing {{results.length}} out of {{count}} Document<span *ngIf="count != 1">s</span></h2> | ||
<ul class="search-results list-group"> | ||
<li *ngFor="let item of results" class="list-group-item search-results-item"> | ||
<h3 class="search-results-item__project-name" | ||
*ngIf="item.project.name">{{item.project.name}} | ||
</h3> | ||
<a class="search-results-item__title mb-0" href="{{item.hostname}}/api/document/{{item._id}}/fetch" | ||
target="_blank">{{item.displayName}}</a> | ||
<div class="search-results-item__meta">{{item.documentDate | date:'yyyy-MM-dd'}}</div> | ||
<div class="search-results-item__description mt-3" | ||
*ngIf="item.description">{{item.description}} | ||
</div> | ||
</li> | ||
</ul> | ||
|
||
<section class="search-results__no-results" *ngIf="results && results.length < 1" > | ||
<h2>No Documents Found</h2> | ||
<p class="mb-0">Sorry, we were unable to locate any documents matching your search criteria.</p> | ||
</section> | ||
|
||
<div class="search-results__footer mt-3" *ngIf="ranSearch && noMoreResults"> | ||
<button class="btn content-btn-alt" disabled>No More Results</button> | ||
</div> | ||
|
||
<div class="search-results__footer mt-3" *ngIf="ranSearch && results && results.length > 0 && !noMoreResults"> | ||
<button class="btn content-btn-alt" (click)="loadMore()">Show More</button> | ||
</div> | ||
|
||
<h2 class="search-results__title" *ngIf="ranSearch && results && results.length > 0">Showing {{results.length}} out of {{count}} Document<span *ngIf="count != 1">s</span></h2> | ||
</section> | ||
|
||
<section> | ||
<h2>How to use this page...</h2> | ||
<p>You can use this tool to search for documents available on the BC Mine Information website. The advanced search feature allows you to narrow your search results by mine, proponent/operator, and/or a specific date range. At this time, search results generated by this tool do not include the contents of individual documents.</p> | ||
</section> | ||
</main> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters