Browse Source

fix bugs with filtering semester, various responsiveness and aesthetic

fixes
master
wes 9 years ago
parent
commit
25fe57e450
  1. 13
      src/mcmaster/classes.py
  2. 2
      src/scripts/book.tag
  3. 4
      src/scripts/class.tag
  4. 2
      src/scripts/search.tag
  5. 2
      src/search.py
  6. 14
      src/styles/search.css

13
src/mcmaster/classes.py

@ -118,10 +118,19 @@ class Section(dict):
self.time = time.encode("UTF-8")
self.loc = loc.encode("UTF-8")
self.prof = prof.encode("UTF-8")
self.sem = sem.encode("UTF-8")
self._sem = sem.encode("UTF-8")
self._date = False
self._day = False
@property
def sem(self):
if self._sem == fall:
return "Fall"
elif self._sem == winter:
return "Winter"
else:
return "Spring/Summer"
@property
def date(self):
if self.time != "TBA":
@ -341,7 +350,7 @@ def getCourses(semester, threadcount=10):
def allCourses():
return chain.from_iterable(
(getCourses(sem, threadcount=10)
(getCourses(sem, threadcount=25)
for sem in (fall, winter, spring_summer)))
if __name__ == "__main__":

2
src/scripts/book.tag

@ -23,7 +23,7 @@
</button>
</a>
</p>
<p class="centered" if={ noResources }>
<p class="centered wraptext" if={ noResources }>
Couldn't find anything, sorry :(
</p>
</dd>

4
src/scripts/class.tag

@ -21,8 +21,8 @@
</div>
</div>
<div class="toast" if={ !books }>
<p>No books at this time</p>
<p>Check back later, or verify the course has books</p>
<p class="wraptext">No books at this time</p>
<p class="wraptext">Check back later, or verify the course has books</p>
</div>
</class>

2
src/scripts/search.tag

@ -14,7 +14,7 @@
<select class="form-select" aria-labelledby="dLabel" name="sem">
<option value="Fall">Fall</option>
<option value="Winter" selected>Winter</option>
<option value="Summer">Summer</option>
<option value="Spring/Summer">Spring/Summer</option>
</select>
</div>
<div class="col-sm-2 form-item">

2
src/search.py

@ -9,6 +9,7 @@ from json import dumps, loads
from itertools import chain, imap
from hashlib import sha1
from syslog import syslog
from textbookExceptions import UnIndexable
@ -170,6 +171,7 @@ def searchTerms(terms):
"""
Run a search for courses
"""
syslog(repr(terms))
# A list of all the queries we want to run
qs = [searchers[field](term) for

14
src/styles/search.css

@ -43,9 +43,18 @@ a {
background-color: #1c75bc !important;
}
.courses {
@media (min-width: 1335px) {
.courses {
margin-top: 100px;
max-width: 75%;
}
}
@media (max-width: 1366px) {
.courses {
margin-top: 100px;
max-width: 85%;
}
}
.course {
@ -140,8 +149,9 @@ a {
}
.help-toast {
background-color: #1c75bc !important;
background-color: rgba(28,117,188, 0.7) !important;
font-size: 0.8em;
max-width: 55%;
margin-top: -10px;
border: none;
}

Loading…
Cancel
Save