Commit 32c0ead5 authored by Daniel Bond's avatar Daniel Bond
Browse files

Merge branch 'master' of

parents 5db2114b 105f9dc5
......@@ -120,10 +120,21 @@ we do I will have instructions on how to deploy the code here.
* Get all restaurants displaying correct open times on the page. AKA. make
extensive tests.
* Sort by location view
* Get a decent UI
* Get a usable admin interface UI, currently it is very confusing to add a
restaurant and schedule.
* Get a decent UI (make sure everything is pretty and usable)
* Add times until opening/closing for restaurants that are close, and exact
times for those that aren't.
* Add yellow close-to-closing condition.
* Possible: Make an API?
* Make page refresh, or more preferably have the data refresh. For
example, with AJAX calls.
* Create more useful API calls. Document them.
* Allow switching between campuses. In the database, mark which campus each
restauraunt is on, include this information in the JSON object returned at
`ajax/schedule` and store the campus choice in the user's cookies
so that when they come back the page will already be set to their campus.
Default would be Fairfax of course.
[jquery-cookie]( would be useful
fo[jquery-cookie]( would be useful
for this.
* Create a more user-friendly way of creating restaurants and updating
schedules on the admin site. This could be done by modifying the admin site
or creating our own Django forms and doing it outside the admin site.
......@@ -22,6 +22,7 @@ body {
font-size: 50px;
font-weight: 900;
line-height: 50px;
#grid div[class*='span']{
......@@ -50,6 +51,7 @@ body {
text-align: center;
padding-top: 15px;
ul.ui-autocomplete {
list-style: none;
function sort_restaurants(restaurants) {
var open = $.grep(restaurants,
var restaurants = [];
function sort_restaurants(filtered_restaurants) {
var open = $.grep(filtered_restaurants,
function (r, idx) { return ( === true) });
var closed = $.grep(restaurants,
var closed = $.grep(filtered_restaurants,
function (r, idx) { return ( === false) });
return $.merge(open, closed);
function construct_grid(restaurants) {
restaurants = sort_restaurants(restaurants);
$.each(restaurants, function (idx, restaurant) {
function construct_grid(filtered_restaurants) {
// Hide footer while generating grid to prevent it flying across the screen
$('#grid').html('<div class="row"></div>');
if (filtered_restaurants.length == 0) {
$('#grid').append('<span class="span2 offset5">No results found.</span>');
sorted_restaurants = sort_restaurants(filtered_restaurants);
$.each(sorted_restaurants, function (idx, restaurant) {
var open_class = 'closed';
if ( {
open_class = 'opened';
......@@ -25,16 +35,13 @@ function construct_grid(restaurants) {
url: '/ajax/schedule/',
}).done(function (data) {
// Hide footer while generating grid to prevent it flying across the screen
$('#grid').html('<div class="row"></div>');
var restaurants =;
restaurants =;
$.each(restaurants, function (idx, restaurant) {
var now = new Date();
var date = new Date().setHours(0,0,0,0);
......@@ -101,5 +108,4 @@ $.ajax({
......@@ -2,38 +2,27 @@ $.ajax({
url: '/ajax/schedule/',
}).done(function (data) {
//collecting list of restaurant names from server data
var restaurants = [];
var rest_names = [];
for (var i = 0; i <; i++) {
//Monitors for keyboard activity to detect when the input field is empty
$('#searchBar').keyup(function() {
var value = $('#searchBar').val();
if (value == 0){
//resets all backgrounds to white if the search bar is empty
// For doumentation on jQuery's autocomplete: (
source: restaurants,
source: rest_names,
//making it so the search result list doesn't physically appear
messages: {
noResults: '',
results: function(){}
minLength: 0,
response: function(event, ui) {
//resets all backgrounds to white if the search bar is edited
//ui.content array contains all names that are returned from the search
for (var result in ui.content){
//Highlights all search results
results = $.map(ui.content, function(r) { return r.value; });
filtered = $.grep(restaurants, function (r, idx) {
return ($.inArray(, results) != -1);
// To prevent the page width from extending
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment