aboutsummaryrefslogtreecommitdiff
path: root/views
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
parent74fe077b29ee681f8e55d14afdbd7c93bc2c1048 (diff)
Added user search feature, fixed styilng, added some scripting
Diffstat (limited to 'views')
-rw-r--r--views/exams.hbs29
-rw-r--r--views/index.hbs16
-rw-r--r--views/partials/header.hbs17
3 files changed, 39 insertions, 23 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>
diff --git a/views/index.hbs b/views/index.hbs
index 59c589f..c3cbeab 100644
--- a/views/index.hbs
+++ b/views/index.hbs
@@ -1,7 +1,7 @@
<header>
<div class="header-content">
- <form action="/search" method="get">
+ <form action="/search/courses" method="get" id="search-field">
<section class="header-content-inner">
<p><strong>The solutions to all your problems</strong></p>
<hr> <!-- Divider -->
@@ -14,13 +14,17 @@
class="btn btn-default dropdown-toggle search-button"
data-toggle="dropdown"
aria-haspopup="true"
- aria-expanded="false">
- Courses
+ aria-expanded="false" id="search-drop-down">
+ <span id="drop-down-value">Courses</span>
<span class="caret"></span>
</button>
- <ul class="dropdown-menu">
- <li><a href="#">Courses</a></li>
- <li><a href="#">Users</a> </li>
+ <ul class="dropdown-menu" id="search-type">
+
+ <!-- add classes to <a> refs, on click, check texts, hide/adjust,
+ change action etc. accordingly -->
+
+ <li><a href="#" class="search-menu">Courses</a></li>
+ <li><a href="#" class="search-menu">Users</a> </li>
</ul>
</div>
diff --git a/views/partials/header.hbs b/views/partials/header.hbs
index 901b249..08dc92f 100644
--- a/views/partials/header.hbs
+++ b/views/partials/header.hbs
@@ -30,10 +30,14 @@
<li><a href="exams.html">Exams Pages</a></li>-->
<li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Courses <span class="caret"></span></a>
+ <a href="#"
+ class="dropdown-toggle"
+ data-toggle="dropdown"
+ role="button" aria-haspopup="true"
+ aria-expanded="false">Courses <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
- <a tabindex="-1" href="#">First Year<i class="fa fa-chevron-right pull-right"></i></a>
+ <a tabindex="-1" href="#">First Year</a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="/exams/csc108">CSC108</a></li>
<li><a href="/exams/csc148">CSC148</a></li>
@@ -62,7 +66,12 @@
<li><a href="/user/signup" >Sign up</a></li>
{{/if}}
<li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Links <span class="caret"></span></a>
+ <a href="#"
+ class="dropdown-toggle"
+ data-toggle="dropdown"
+ role="button"
+ aria-haspopup="true"
+ aria-expanded="false">Links <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="/user_solutions">Solutions Page</a></li>
<li><a href="/user/user_profile">Profile Page</a></li>
@@ -79,4 +88,4 @@
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
-</nav> \ No newline at end of file
+</nav> <!-- Ignore error, opening tag will be generated at render time --> \ No newline at end of file