-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Large rewrite of site navbar and related css/python
- Navbar layout redesigned - Past hunts is now part of base.html (on all pages) and is a dropdown - Right-side user/"profile" dropdown is nicer and cleaner - Added home icon next to site title for clarity - Info pages are now a dropdown for size reasons - Navbar now collapses only at XS and no longer at SM - Added template tags to get current hunt, previous hunts, and hunt from puzzle - Fixed bug where registration containers were misaligned at sm and xs sizes - Fixed bug where font was slightly different between hunt and info bases - Fixed bug where messages weren't rendered at the right width on xs and sm sizes - Moved S2020 chat status polling script to separate JS file - Changed the dev navbar to say "Dev Site" instead of "DEVELOPMENT SITE" - Changed the dev navabr color to light yellow for my sanity
- Loading branch information
Showing
7 changed files
with
170 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
$(document).ready(function() { | ||
function is_visible(){ | ||
var stateKey, keys = { | ||
hidden: "visibilitychange", | ||
webkitHidden: "webkitvisibilitychange", | ||
mozHidden: "mozvisibilitychange", | ||
msHidden: "msvisibilitychange" | ||
}; | ||
for (stateKey in keys) { | ||
if (stateKey in document) { | ||
return !document[stateKey]; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
var get_posts = function() { | ||
if(is_visible()){ | ||
$.getJSON("/chat/status/") | ||
.done(function(result){ | ||
num_messages = result['num_messages'] | ||
if(num_messages > 0) { | ||
$("#num_messages").css("background-color", "indianred"); | ||
} else { | ||
$("#num_messages").css("background-color", ""); | ||
} | ||
$("#num_messages").text(num_messages); | ||
}) | ||
.fail( function(xhr, textStatus, errorThrown) { | ||
console.log(xhr); | ||
}); | ||
} | ||
} | ||
|
||
setInterval(get_posts, 120000); //Two minutes | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,46 @@ | ||
{% extends 'base.html' %} | ||
{% load bootstrap_tags %} | ||
{% load hunt_tags %} | ||
{% load static %} | ||
{% load flatpages %} | ||
|
||
{% block base_includes %} | ||
<link rel="stylesheet" type="text/css" href="{% static "huntserver/info_base.css" %}"> | ||
<link rel="stylesheet" type="text/css" href="{% static "huntserver/navbar.css" %}"> | ||
{% endblock base_includes %} | ||
|
||
{% block left-header %} | ||
{% get_flatpages '/extra/' as flatpages %} | ||
<li class='{% active_page request "index" %} visible-sm visible-xs'><a href="{% url 'huntserver:index' %}"> Homepage </a></li> | ||
<li class='{% active_page request "current_hunt" %}'><a href="{% url 'huntserver:current_hunt' %}"> Current Hunt </a></li> | ||
<li class='{% active_page request "current_hunt_info" %}'><a href="{% url 'huntserver:current_hunt_info' %}"> Hunt Info</a></li> | ||
<li class='{% active_page request "previous_hunts" %}'><a href="{% url 'huntserver:previous_hunts' %}"> Previous Hunts </a></li> | ||
{% for page in flatpages|dictsort:"url" %} | ||
<li class='{% active_page request page.url %}'><a href="/info{{ page.url }}"> {{ page.title }} </a></li> | ||
{% endfor %} | ||
<li class='{% active_page request "contact_us" %}'><a href="{% url 'huntserver:contact_us' %}"> Contact Us </a></li> | ||
{% get_flatpages '/extra/' as flatpages %} | ||
<li class="dropdown hidden-xs"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Information <span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li class='{% active_page request "current_hunt_info" %}'> | ||
<a href="{% url 'huntserver:current_hunt_info' %}"> Hunt Details </a> | ||
</li> | ||
{% for page in flatpages|dictsort:"url" %} | ||
<li class='{% active_page request page.url %}'> | ||
<a href="/info{{ page.url }}"> {{ page.title }} </a> | ||
</li> | ||
{% endfor %} | ||
<li class='{% active_page request "contact_us" %}'> | ||
<a href="{% url 'huntserver:contact_us' %}"> Contact Us </a> | ||
</li> | ||
</ul> | ||
</li> | ||
|
||
<li class='visible-xs-block {% active_page request "current_hunt_info" %}'> | ||
<a href="{% url 'huntserver:current_hunt_info' %}"> Hunt Details </a> | ||
</li> | ||
{% for page in flatpages|dictsort:"url" %} | ||
<li class='visible-xs-block {% active_page request page.url %}'> | ||
<a href="/info{{ page.url }}"> {{ page.title }} </a> | ||
</li> | ||
{% endfor %} | ||
<li class='visible-xs-block {% active_page request "contact_us" %}'> | ||
<a href="{% url 'huntserver:contact_us' %}"> Contact Us </a> | ||
</li> | ||
|
||
<li class='{% active_page request "current_hunt" %}'> | ||
{% set_curr_hunt %} | ||
<a href="{% url 'huntserver:current_hunt' %}"> Latest Hunt </a> | ||
</li> | ||
{% endblock %} |
Oops, something went wrong.