From 25fe57e450a5362a66a1f08388839dbffda0c6a8 Mon Sep 17 00:00:00 2001 From: wes Date: Tue, 9 Aug 2016 00:57:59 -0400 Subject: [PATCH] fix bugs with filtering semester, various responsiveness and aesthetic fixes --- src/mcmaster/classes.py | 13 +++++++++++-- src/scripts/book.tag | 2 +- src/scripts/class.tag | 4 ++-- src/scripts/search.tag | 2 +- src/search.py | 2 ++ src/styles/search.css | 14 ++++++++++++-- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/mcmaster/classes.py b/src/mcmaster/classes.py index 2103c30..d6d2ca6 100755 --- a/src/mcmaster/classes.py +++ b/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__": diff --git a/src/scripts/book.tag b/src/scripts/book.tag index 5a987c4..8565193 100644 --- a/src/scripts/book.tag +++ b/src/scripts/book.tag @@ -23,7 +23,7 @@

-

+

Couldn't find anything, sorry :(

diff --git a/src/scripts/class.tag b/src/scripts/class.tag index cf4e64c..f428c4d 100644 --- a/src/scripts/class.tag +++ b/src/scripts/class.tag @@ -21,8 +21,8 @@
-

No books at this time

-

Check back later, or verify the course has books

+

No books at this time

+

Check back later, or verify the course has books

diff --git a/src/scripts/search.tag b/src/scripts/search.tag index 88d0476..fed9c83 100644 --- a/src/scripts/search.tag +++ b/src/scripts/search.tag @@ -14,7 +14,7 @@
diff --git a/src/search.py b/src/search.py index f95cbdf..33aeb22 100755 --- a/src/search.py +++ b/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 diff --git a/src/styles/search.css b/src/styles/search.css index 51da650..8df8cfc 100644 --- a/src/styles/search.css +++ b/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; }