diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c9b0b40 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +default: + mkdir build; + mkdir build/scripts; + mkdir build/styles; + mkdir build/templates; + riot ./src/scripts/ ./build/scripts/tags.js; + cp -r ./src/scripts/search.js ./build/scripts/; + cp -r ./src/styles/* ./build/styles/; + cp -r ./src/templates/search.html ./build/templates/; + cp -r ./src/{archive.py,openlibrary.py,predictions.py,search.py,website.py,textbookExceptions.py} ./build/; + cp ./src/appconfig ./build/; + +clean: + rm -r ./build; diff --git a/src/appconfig b/src/appconfig index e69de29..d4bb73d 100644 --- a/src/appconfig +++ b/src/appconfig @@ -0,0 +1,2 @@ +SERVER_NAME="localhost:8001" +APPLICATION_ROOT="/" diff --git a/src/scripts/search.js b/src/scripts/search.js index 6ce6f00..f33d2a0 100644 --- a/src/scripts/search.js +++ b/src/scripts/search.js @@ -1,5 +1,3 @@ -var root = "mgoal.ca/search"; - function makeResourceGetter(self) { function getResources(ev) { ev.preventDefault(); @@ -9,7 +7,7 @@ function makeResourceGetter(self) { "title" : this.booktitle, "author" : this.bookauthor }; - var url = "https://"+root+"/resources"; + var url = "/resources"; console.log(params); $.getJSON(url, { data : JSON.stringify(params) diff --git a/src/scripts/search.tag b/src/scripts/search.tag index 32e39dd..ba364bd 100644 --- a/src/scripts/search.tag +++ b/src/scripts/search.tag @@ -21,7 +21,7 @@ function submit(ev) { console.log("submitted"); var params = $(ev.currentTarget).serialize(); - $.getJSON("https://"+root+"/fc?"+params, + $.getJSON("/fc?"+params, function(courses) { var fcourses = filterCourses(courses); var cgroups = groupsof(4, fcourses); diff --git a/src/search.py b/src/search.py index a56e9d3..848b455 100755 --- a/src/search.py +++ b/src/search.py @@ -12,8 +12,6 @@ from hashlib import sha1 from textbookExceptions import UnIndexable -from mcmaster.classes import allCourses - # Generic instance of elasticsearch right now es = elasticsearch.Elasticsearch() @@ -228,11 +226,3 @@ searchers = { "prof" : search("prof"), "day" : search("day"), } - -#print searchTerms({"title" : "PHILOS"}) -#createIndex("oersearch") -#for c in imap(classToJSON, allCourses()): - #try: - #print indexListing(c) - #except UnIndexable as e: - ##print e diff --git a/src/templates/search.html b/src/templates/search.html index efb7889..49c355c 100644 --- a/src/templates/search.html +++ b/src/templates/search.html @@ -27,21 +27,17 @@ {% block styles %} + {{super()}} - - + + {% endblock %} -{{ url_for('send_script', filename='') }} + {% block scripts %} {{super()}} - - - - - - - + + {% endblock %}