forked from geolba/tethys.frontend
- styling for home view component
- search view component: show automatically all records
This commit is contained in:
parent
1ea0c15504
commit
f0cb669ece
1819
package-lock.json
generated
1819
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -44,12 +44,24 @@ h6 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.field.has-addons .control:last-child:not(:only-child) .button,
|
||||||
|
.field.has-addons .control:last-child:not(:only-child) .input,
|
||||||
|
.field.has-addons .control:last-child:not(:only-child) .select select {
|
||||||
|
// border-bottom-left-radius: 0;
|
||||||
|
// border-top-left-radius: 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
input{
|
input{
|
||||||
border-width:0;
|
border-width:0;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
.search-button-icon {
|
.search-button-icon {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
.main-search-from-bg {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
//contact apge
|
//contact apge
|
||||||
.page-breaker {
|
.page-breaker {
|
||||||
|
@ -68,4 +80,3 @@ input{
|
||||||
.partner-logos {
|
.partner-logos {
|
||||||
padding: 3em 0;
|
padding: 3em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<input class="form-control mr-sm-2 border-0" type="text" placeholder="Search" aria-label="Search" />
|
<input class="form-control mr-sm-2 border-0" type="text" placeholder="Search" aria-label="Search" />
|
||||||
<button class="btn btn-secondary m-0" type="submit"><i class="fas fa-search text-white"></i></button>
|
<button class="btn btn-secondary m-0" type="submit"><i class="fas fa-search text-white"></i></button>
|
||||||
</form> -->
|
</form> -->
|
||||||
<div class="field has-addons">
|
<div class="field has-addons main-search-from-bg">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
<input id="search_query" class="input is-medium" type="text" name="q" autocomplete="off" v-model="display" />
|
<input id="search_query" class="input is-medium" type="text" name="q" autocomplete="off" v-model="display" />
|
||||||
<!-- <p>Message is: {{ display }}</p> v-on:input="searchChanged"-->
|
<!-- <p>Message is: {{ display }}</p> v-on:input="searchChanged"-->
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { ActiveFilterCategories } from "@/models/solr";
|
||||||
})
|
})
|
||||||
export default class SearchViewComponent extends Vue {
|
export default class SearchViewComponent extends Vue {
|
||||||
@Prop()
|
@Prop()
|
||||||
display?: string;
|
display!: string;
|
||||||
|
|
||||||
results: Array<Dataset> = [];
|
results: Array<Dataset> = [];
|
||||||
|
|
||||||
|
@ -49,10 +49,32 @@ export default class SearchViewComponent extends Vue {
|
||||||
// private rdrAPI!: DatasetService;
|
// private rdrAPI!: DatasetService;
|
||||||
private error = "";
|
private error = "";
|
||||||
|
|
||||||
|
get stringSearchTerm(): string {
|
||||||
|
if (typeof this.searchTerm === "string") {
|
||||||
|
return this.searchTerm;
|
||||||
|
} else if (this.searchTerm instanceof Suggestion) {
|
||||||
|
return this.searchTerm.value + " (" + this.searchTerm.type + ")";
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hasSearchTerm(): boolean {
|
||||||
|
if (typeof this.searchTerm === "string" && this.searchTerm !== "") {
|
||||||
|
return true;
|
||||||
|
} else if (this.searchTerm instanceof Suggestion && this.searchTerm.value !== "") {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
beforeMount(): void {
|
beforeMount(): void {
|
||||||
// this.rdrAPI = new DatasetService();
|
// this.rdrAPI = new DatasetService();
|
||||||
if (this.display != undefined && this.display != "") {
|
if (this.display != undefined && this.display != "") {
|
||||||
this.onSearch(this.display);
|
this.onSearch(this.display);
|
||||||
|
} else {
|
||||||
|
this.onSearch("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div v-if="results.length > 0" class="result-list-info">
|
<div v-if="results.length > 0" class="result-list-info">
|
||||||
<div class="resultheader">
|
<div class="resultheader" v-if="hasSearchTerm()">
|
||||||
Your search yielded
|
Your search term {{ "'" + stringSearchTerm + "'" }} yielded <strong>{{ numFound }}</strong> results:
|
||||||
<strong>{{ numFound }}</strong> results:
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="results.length == 0">
|
<div v-else-if="results.length == 0">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user