aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-22 02:45:27 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-22 02:45:27 +0000
commit12659ff5704a04d2447f5dbf036541676c59f139 (patch)
tree68a36260059bb05bb9d589011bf9d8ca22f72b2f /views
parentdc3888553bdda4ee30e6440992459916cec8d911 (diff)
parent797b4fe83ed4ebbed47930c7d0d0a34cd37703c6 (diff)
Added passport for signup
Diffstat (limited to 'views')
-rw-r--r--views/admin.hbs69
-rw-r--r--views/exams.hbs2
-rw-r--r--views/index.hbs20
-rw-r--r--views/partials/header.hbs1
-rw-r--r--views/questions.hbs68
-rw-r--r--views/signup.hbs29
6 files changed, 113 insertions, 76 deletions
diff --git a/views/admin.hbs b/views/admin.hbs
new file mode 100644
index 0000000..ecbd46e
--- /dev/null
+++ b/views/admin.hbs
@@ -0,0 +1,69 @@
+<main id="solutions-main">
+<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
+<h4>Add Exam</h4>
+<form action="/admin/update" method="post">
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="course code"
+ name="course_code">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="year"
+ name="year">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="term"
+ name="term">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="type"
+ name="type">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="instructor1,instructor2,.."
+ name="instructors">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="page count"
+ name="page_count">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="questions count"
+ name="questions_count">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="q1,q2,q3,.."
+ name="questions_list">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="upload date"
+ name="upload_date">
+ </div>
+ <div class="form-group">
+ <input type="text"
+ class="form-control"
+ placeholder="uploader"
+ name="uploaded_by">
+ </div>
+ <input type="hidden" name="_csrf" value="{{ csrfToken }}">
+ <button type="submit" class="btn btn-primary">Submit</button>
+</form>
+</div>
+</main> \ No newline at end of file
diff --git a/views/exams.hbs b/views/exams.hbs
index 5a5955c..d7697c3 100644
--- a/views/exams.hbs
+++ b/views/exams.hbs
@@ -2,7 +2,7 @@
<div class = 'search container' id = 'solutions-div'>
<h4 class='search-head'>Search results for "{{query}}"</h4>
{{# each result}}
- <a href="/questions">
+ <a href="/questions/{{this.id}}">
<section class = 'solutions-card'>
<h3 class = 'solutions-title'>{{this.title}}</h3>
<p class = 'solutions-time' ><em>Term: </em>{{this.term}} {{this.year}}</p>
diff --git a/views/index.hbs b/views/index.hbs
index 9826209..59c589f 100644
--- a/views/index.hbs
+++ b/views/index.hbs
@@ -10,7 +10,14 @@
<div class="input-group">
<!-- Search Category Drop-Down -->
<div class="input-group-btn">
- <button type="button" class="btn btn-default dropdown-toggle search-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Courses <span class="caret"></span></button>
+ <button type="button"
+ class="btn btn-default dropdown-toggle search-button"
+ data-toggle="dropdown"
+ aria-haspopup="true"
+ aria-expanded="false">
+ Courses
+ <span class="caret"></span>
+ </button>
<ul class="dropdown-menu">
<li><a href="#">Courses</a></li>
<li><a href="#">Users</a> </li>
@@ -18,10 +25,17 @@
</div>
<!-- Search bar -->
- <input type="text" id = "user-input" class="form-control" aria-label="..." name="search" placeholder="Enter course name">
+ <input type="text"
+ id = "user-input"
+ class="form-control"
+ aria-label="..."
+ name="search"
+ placeholder="Enter course name">
<!-- Prompt Search -->
<span class="input-group-btn">
- <button id = 'go-button' class="btn btn-default search-button go-button" type="submit">Go!</button>
+ <button id = 'go-button'
+ class="btn btn-default search-button go-button"
+ type="submit">Go!</button>
</span>
</div>
</div>
diff --git a/views/partials/header.hbs b/views/partials/header.hbs
index 98ccffb..8298ce2 100644
--- a/views/partials/header.hbs
+++ b/views/partials/header.hbs
@@ -37,6 +37,7 @@
</ul>
</li>
<li><a href="#" data-toggle="modal" data-target=".login-window">Log In</a></li>
+ <li><a href="/admin">Admin Panel</a></li>
<!--<li><a href="#" data-toggle="modal" data-target=".registration-window">Sign up</a></li>-->
<li><a href="/signup" >Sign up</a></li>
<li class="dropdown">
diff --git a/views/questions.hbs b/views/questions.hbs
index 8b69f8f..ff9b3b2 100644
--- a/views/questions.hbs
+++ b/views/questions.hbs
@@ -17,65 +17,23 @@
<!-- QUESTION LISTINGS -->
- <a href="/user_solutions">
- <section class = 'solutions-card row'>
- <div class='pull-left col-sm-8 col-md-8'>
- <h3 class = 'questions-number'>Question 1</h3>
- <p><span class='questions-sol-num'>2 solutions, </span> <span class = 'questions-comment'>6 comments</span></p>
- </div>
- <div class='pull-right right-arrow'>
- <img class='rounded' src="assets/images/right-arrow.png">
- </div>
- </section>
- </a>
+ {{#each query}}
- <a href="/user_solutions">
- <section class = 'solutions-card row'>
- <div class='pull-left col-sm-8 col-md-8'>
- <h3 class = 'questions-number'>Question 2</h3>
- <p><span class='questions-sol-num'>1 solution, </span> <span class = 'questions-comment'>2 comments</span></p>
- </div>
- <div class='pull-right right-arrow'>
- <img class='rounded' src="assets/images/right-arrow.png">
- </div>
- </section>
- </a>
+ <a href="/user_solutions">
+ <section class = 'solutions-card row'>
+ <div class='pull-left col-sm-8 col-md-8'>
+ <h3 class = 'questions-number'>Question {{this.id}}</h3>
+ <p><span class='questions-sol-num'>{{this.count}} solutions, </span> <span class = 'questions-comment'>{{this.comments}} comments</span></p>
+ </div>
+ <div class='pull-right right-arrow'>
+ <img class='rounded' src="/assets/images/right-arrow.png">
+ </div>
+ </section>
+ </a>
- <a href="/user_solutions">
- <section class = 'solutions-card row'>
- <div class='pull-left col-sm-8 col-md-8'>
- <h3 class = 'questions-number'>Question 3</h3>
- <p><span class='questions-sol-num'>1 solution, </span> <span class = 'questions-comment'>2 comments</span></p>
- </div>
- <div class='pull-right right-arrow'>
- <img class='rounded' src="assets/images/right-arrow.png">
- </div>
+ {{/each}}
- </section>
- </a>
- <a href="/user_solutions">
- <section class = 'solutions-card row'>
- <div class='pull-left col-sm-8 col-md-8'>
- <h3 class = 'questions-number'>Question 4</h3>
- <p><span class='questions-sol-num'>3 solutions, </span> <span class = 'questions-comment'>2 comments</span></p>
- </div>
- <div class='pull-right right-arrow'>
- <img class='rounded' src="assets/images/right-arrow.png">
- </div>
- </section>
- </a>
- <a href="/user_solutions">
- <section class = 'solutions-card row'>
- <div class='pull-left col-sm-8 col-md-8'>
- <h3 class = 'questions-number'>Question 5</h3>
- <p><span class='questions-sol-num'>0 solutions </span> <span class = 'questions-comment'></span></p>
- </div>
- <div class='pull-right right-arrow'>
- <img class='rounded' src="assets/images/right-arrow.png">
- </div>
- </section>
- </a>
</div>
</main>
diff --git a/views/signup.hbs b/views/signup.hbs
index 252a5bb..b5fd363 100644
--- a/views/signup.hbs
+++ b/views/signup.hbs
@@ -3,21 +3,13 @@
<div class="row" id="solutions-main">
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
- {{# if success }}
- <section class="success-msgs">
- <!-- Change those to banners later -->
- <h2>Signup Successful!</h2>
- </section>
- {{ else }}
- {{# if errors }}
- <section class="error-msgs">
- <ul>
- {{# each errors }}
- <li>{{ this.msg }}</li>
- {{/each}}
- </ul>
- </section>
- {{/if}}
+
+ {{# if hasErrors}}
+ <div class="alert alert-danger">
+ {{# each messages}}
+ <p>{{this}}</p>
+ {{/each}}
+ </div>
{{/if}}
<h2><i class="fa fa-user-plus" aria-hidden="true"></i> Sign Up</h2>
<form action="/signup" method="post">
@@ -44,11 +36,14 @@
<input type="password" class="form-control" placeholder="New Password" name="confirmPassword">
</div>
<div class="form-group">
- <input type="text" class="form-control" placeholder="University (optional)">
+ <input type="number" class="form-control" placeholder="Phone Number (optional)" name="phone_num">
+ </div>
+ <div class="form-group">
+ <input type="text" class="form-control" placeholder="University (optional)" name="univ">
</div>
<div class="form-group">
- <input type="text" class="form-control" placeholder="Department (optional)">
+ <input type="text" class="form-control" placeholder="Department (optional)" name="dept">
</div>
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
<button type="signup" class="btn btn-primary">Sign Up</button>