aboutsummaryrefslogtreecommitdiff
path: root/views/exams.hbs
diff options
context:
space:
mode:
authorHumairAK <humair88@hotmail.com>2016-07-25 05:57:14 +0000
committerHumairAK <humair88@hotmail.com>2016-07-25 05:57:14 +0000
commit1904de750f421cce9bec21ab89c50ea7a38a37d4 (patch)
tree813b3716d45c3c38c1ec3963bef73baf4d8c1c74 /views/exams.hbs
parent74fe077b29ee681f8e55d14afdbd7c93bc2c1048 (diff)
Added user search feature, fixed styilng, added some scripting
Diffstat (limited to 'views/exams.hbs')
-rw-r--r--views/exams.hbs29
1 files changed, 16 insertions, 13 deletions
diff --git a/views/exams.hbs b/views/exams.hbs
index b5e5092..8b179f3 100644
--- a/views/exams.hbs
+++ b/views/exams.hbs
@@ -1,18 +1,21 @@
<main id = 'solutions-main'>
<div class = 'search container' id = 'solutions-div'>
<h4 class='search-head'>Search results for "{{query}}"</h4>
- {{# each result}}
- <a href="/questions/{{this.id}}"> <!--- Attaches exam id to url --->
- <section class = 'solutions-card'>
- <h3 class = 'solutions-title'>{{this.title}}</h3>
- <p class = 'solutions-time' ><em>Term: </em>{{this.term}} {{this.year}}</p>
- <p class = 'exam-instr'><em>Instructors: </em>
- {{this.instructors}}
- </p>
- <p class = 'solutions-type'>{{result.type}}</p>
- </section>
- </a>
- {{/each}}
-
+ {{# if result }}
+ {{# each result}}
+ <a href="/questions/{{this.id}}"> <!--- Attaches exam id to url --->
+ <section class = 'solutions-card'>
+ <h3 class = 'solutions-title'>{{this.title}}</h3>
+ <p class = 'solutions-time' ><em>Term: </em>{{this.term}} {{this.year}}</p>
+ <p class = 'exam-instr'><em>Instructors: </em>
+ {{this.instructors}}
+ </p>
+ <p class = 'solutions-type'>{{result.type}}</p>
+ </section>
+ </a>
+ {{/each}}
+ {{ else }}
+ <h3 class="solutions-title"> No results found. Sorry!</h3>
+ {{/if}}
</div>
</main>