- styling for home view component

- search view component: show automatically all records
This commit is contained in:
Arno Kaimbacher 2021-12-17 16:21:58 +01:00
parent 1ea0c15504
commit f0cb669ece
5 changed files with 985 additions and 878 deletions

1819
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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;
} }

View File

@ -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"-->

View File

@ -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("");
} }
} }

View File

@ -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">