From 4fe6439ade96f4dd4dd52e1d775ca0189c655e73 Mon Sep 17 00:00:00 2001 From: wes Date: Sun, 7 May 2017 18:50:57 -0400 Subject: [PATCH] add routing --- src/scripts/aboutview.tag | 3 +++ src/scripts/app.tag | 10 ++++++++++ src/scripts/results.tag | 1 + src/scripts/search.js | 10 +++++++--- src/scripts/search.tag | 1 + src/scripts/searchview.tag | 24 ++++++++++++++++++++++++ src/styles/search.scss | 2 +- src/templates/search.html | 30 +++--------------------------- 8 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 src/scripts/aboutview.tag create mode 100644 src/scripts/app.tag create mode 100644 src/scripts/searchview.tag diff --git a/src/scripts/aboutview.tag b/src/scripts/aboutview.tag new file mode 100644 index 0000000..0d66e88 --- /dev/null +++ b/src/scripts/aboutview.tag @@ -0,0 +1,3 @@ + +

wat

+
diff --git a/src/scripts/app.tag b/src/scripts/app.tag new file mode 100644 index 0000000..42f7083 --- /dev/null +++ b/src/scripts/app.tag @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/scripts/results.tag b/src/scripts/results.tag index e8e9a17..1e50488 100644 --- a/src/scripts/results.tag +++ b/src/scripts/results.tag @@ -18,6 +18,7 @@ clicker() { } this.rows = []; var self = this; +self.opts = this.parent.parent.parent.parent.opts; this.opts.resultsEv.on("loading", function() { diff --git a/src/scripts/search.js b/src/scripts/search.js index afc0ddb..01b3558 100644 --- a/src/scripts/search.js +++ b/src/scripts/search.js @@ -1,18 +1,22 @@ import riot from 'riot'; +import router from 'riot-route/lib/tag'; import './book.tag'; import './class.tag'; import './results.tag'; import './row.tag'; import './search.tag'; +import './searchview.tag'; +import './aboutview.tag'; +import './app.tag'; var resultsEv = riot.observable(); function mount() { - riot.mount("search", { + riot.mount("app", { booksLoading : false, - resultsEv : resultsEv + resultsEv : resultsEv, + notLoading: true }); - riot.mount("results", {notLoading : true, resultsEv : resultsEv}); } mount(); diff --git a/src/scripts/search.tag b/src/scripts/search.tag index 80d4e13..63ce0f0 100644 --- a/src/scripts/search.tag +++ b/src/scripts/search.tag @@ -45,6 +45,7 @@ import {filterCourses, groupsof} from './helpers.js'; import 'whatwg-fetch'; var self = this; +self.opts = this.parent.parent.parent.parent.opts; submit(ev) { ev.preventDefault(); diff --git a/src/scripts/searchview.tag b/src/scripts/searchview.tag new file mode 100644 index 0000000..84d308b --- /dev/null +++ b/src/scripts/searchview.tag @@ -0,0 +1,24 @@ + + + + diff --git a/src/styles/search.scss b/src/styles/search.scss index d6cfa83..87411b3 100644 --- a/src/styles/search.scss +++ b/src/styles/search.scss @@ -1,6 +1,6 @@ $blue: #1c75bc; -header { +.app { color: $blue; } diff --git a/src/templates/search.html b/src/templates/search.html index f7327e9..9b02d07 100644 --- a/src/templates/search.html +++ b/src/templates/search.html @@ -5,35 +5,11 @@ - - - - + +