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. 12
      src/styles/search.css

13
src/mcmaster/classes.py

@ -118,10 +118,19 @@ class Section(dict):
self.time = time.encode("UTF-8") self.time = time.encode("UTF-8")
self.loc = loc.encode("UTF-8") self.loc = loc.encode("UTF-8")
self.prof = prof.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._date = False
self._day = 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 @property
def date(self): def date(self):
if self.time != "TBA": if self.time != "TBA":
@ -341,7 +350,7 @@ def getCourses(semester, threadcount=10):
def allCourses(): def allCourses():
return chain.from_iterable( return chain.from_iterable(
(getCourses(sem, threadcount=10) (getCourses(sem, threadcount=25)
for sem in (fall, winter, spring_summer))) for sem in (fall, winter, spring_summer)))
if __name__ == "__main__": if __name__ == "__main__":

2
src/scripts/book.tag

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

4
src/scripts/class.tag

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

2
src/scripts/search.tag

@ -14,7 +14,7 @@
<select class="form-select" aria-labelledby="dLabel" name="sem"> <select class="form-select" aria-labelledby="dLabel" name="sem">
<option value="Fall">Fall</option> <option value="Fall">Fall</option>
<option value="Winter" selected>Winter</option> <option value="Winter" selected>Winter</option>
<option value="Summer">Summer</option> <option value="Spring/Summer">Spring/Summer</option>
</select> </select>
</div> </div>
<div class="col-sm-2 form-item"> <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 itertools import chain, imap
from hashlib import sha1 from hashlib import sha1
from syslog import syslog
from textbookExceptions import UnIndexable from textbookExceptions import UnIndexable
@ -170,6 +171,7 @@ def searchTerms(terms):
""" """
Run a search for courses Run a search for courses
""" """
syslog(repr(terms))
# A list of all the queries we want to run # A list of all the queries we want to run
qs = [searchers[field](term) for qs = [searchers[field](term) for

12
src/styles/search.css

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

Loading…
Cancel
Save