diff --git a/TODO.md b/TODO.md index 76e13c97706b6444a6df28f95e5f9ea7cc2c778c..9347d69d57ec8d42d9336924b3277ae8bb43418a 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,8 @@ # TODO -- Feature Suche Frontend +- Format der Feature Suche +- Feature Count als Computed, oder direct in API - Format der vollen Suche +- Ergebnis als Component? - Bilder Anzeige - Kommentare und Code Cleanup zum Schluss diff --git a/lib.js b/lib.js index ed21169ada188ca8dcdef7f6dec6af60100ce981..d84ab283bf1738da7c3b38b93ac3643ae7340bde 100755 --- a/lib.js +++ b/lib.js @@ -174,6 +174,7 @@ module.exports = { if(res.length > 0) { result = { + collection: letterJS.TEI.teiHeader.fileDesc.titleStmt.collection._text, name: transformFilename(file), link: '/letters/' + file.slice(0, -4), url: '/api/letters/' + transformFilename(file, true), @@ -196,6 +197,7 @@ module.exports = { if(res.length > 0) { result = { + collection: letterJS.TEI.teiHeader.fileDesc.titleStmt.collection._text, name: transformFilename(file), link: '/letters/' + file.slice(0, -4), url: '/api/letters/' + transformFilename(file, true), diff --git a/src/components/Features.vue b/src/components/Features.vue index 4e4ba2f24faa2567e3f655043af75f99d955ca12..9a73127365525e747b6bb6745eae62eed6fd4db4 100644 --- a/src/components/Features.vue +++ b/src/components/Features.vue @@ -17,13 +17,27 @@ <!-- </v-flex> --> <v-flex xs12 sm4> - <v-text-field v-model="feature_category" type="text" label="Category"></v-text-field> + <v-text-field + v-model="feature_category" + type="text" label="Category" + @keyup.enter.native="find"> + </v-text-field> </v-flex> <v-flex xs12 sm4> - <v-text-field v-model="feature_type" type="text" label="Type"></v-text-field> + <v-text-field + v-model="feature_type" + type="text" + label="Type" + @keyup.enter.native="find"> + </v-text-field> </v-flex> <v-flex xs12 sm4> - <v-text-field v-model="feature_subtype" type="text" label="Subtype"></v-text-field> + <v-text-field + v-model="feature_subtype" + type="text" + label="Subtype" + @keyup.enter.native="find"> + </v-text-field> </v-flex> <v-flex xs12> @@ -36,18 +50,27 @@ <v-progress-linear indeterminate color="primary"></v-progress-linear> </v-flex> + <v-flex xs12 v-if="results"> + <v-card color="blue-grey lighten-1" class="white--text"> + <v-card-text> + Results: {{results.length}} letter(s) + </v-card-text> + </v-card> + </v-flex> + <v-flex xs12 v-if="results"> <v-card v-for="letter in results" v-bind:key="letter.url"> <v-card-title primary-title> - <div class="headline"> {{letter.name}} - Sammlung </div> + <div class="title"> {{letter.name}} - {{letter.collection}} </div> </v-card-title> <v-card-text> + <p>Count: 12</p> <ul> <li v-for="hit in letter.results">{{hit}}</li> </ul> </v-card-text> <v-card-actions> - <v-btn flat>View</v-btn> + <v-btn :href="letter.url" flat>View</v-btn> </v-card-actions> </v-card> </v-flex> @@ -90,7 +113,6 @@ export default { this.$http.get('http://localhost:3000/api/feature/', {params: params}).then(function (data) { this.results = data.body this.searching = false - console.log(data.body) }) } diff --git a/src/components/Search.vue b/src/components/Search.vue index d88005c757ac500e672fb0b2dd6d21791b4e3081..542cde9483a95c7a17cc5d1a78a89cc30949e280 100644 --- a/src/components/Search.vue +++ b/src/components/Search.vue @@ -44,10 +44,18 @@ <v-progress-linear indeterminate color="primary"></v-progress-linear> </v-flex> + <v-flex xs12 v-if="results"> + <v-card color="blue-grey lighten-1" class="white--text"> + <v-card-text> + Results: {{results.length}} + </v-card-text> + </v-card> + </v-flex> + <v-flex xs12 v-if="results"> <v-card v-for="letter in results" v-bind:key="letter.url"> <v-card-title primary-title> - <div class="headline"> {{letter.name}} - Sammlung </div> + <div class="title"> {{letter.name}} - {{letter.collection}} </div> </v-card-title> <v-card-text> <ul> @@ -55,7 +63,7 @@ </ul> </v-card-text> <v-card-actions> - <v-btn flat>View</v-btn> + <v-btn :href="letter.url" flat>View</v-btn> </v-card-actions> </v-card> </v-flex>