Skip to content

Commit

Permalink
minor CSS fixes following major update
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Dec 23, 2015
1 parent 3fcf050 commit 5bed945
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 21 deletions.
6 changes: 6 additions & 0 deletions huntserver/static/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions huntserver/static/bootstrap.min.js

Large diffs are not rendered by default.

Binary file added huntserver/static/huntserver/background.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion huntserver/static/huntserver/base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background: url(http://www.millionaireinvestor.asia/images/Background.jpg);
background: url(/static/huntserver/background.jpg);
}

.content {
Expand Down
19 changes: 8 additions & 11 deletions huntserver/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{% load bootstrap_tags %}
<!DOCTYPE html>
<html>
<head>
<title>{% block title %} Puzzlehunt! {% endblock title %}</title>
<script src="{{ STATIC_URL }}jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<link rel="stylesheet" href="{{ STATIC_URL }}bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}huntserver/base.css">
<script src="{{ STATIC_URL }}jquery.min.js"></script>
<script src="{{ STATIC_URL }}bootstrap.min.js"></script>
{% block includes %} {% endblock includes %}
</head>
<body>
Expand All @@ -32,12 +30,11 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% block left-header %}
<li class='{% active_page request "index" %}'><a href="{% url 'huntserver:index' %}"> Puzzles </a></li>
{% if user.is_authenticated %}
<li class="active"><a href="#">Link </a></li>
<li><a href="#">Link</a></li>
{% else %}
<li class="active"><a href="#">Link </a></li>
<li><a href="#">Link</a></li>
<li class='{% active_page request "unlockables" %}'><a href="{% url 'huntserver:unlockables' %}"> Unlockables </a></li>
<li class='{% active_page request "chat" %}'><a href="{% url 'huntserver:chat' %}"> Chat </a></li>
{% else %}
<li><a href="/registration/">Register</a></li>
{% endif %}
{% endblock %}
Expand Down
21 changes: 12 additions & 9 deletions huntserver/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
{% load i18n %}

{% block content %}
<br>
Please enter your team's username and password:
<div class="container">
<div class="row content">
<br>
Please enter your team's username and password:

<form method="post" action=".">
{% csrf_token %}
{{ form.as_p }}

<input type="submit" value="{% trans 'Log in' %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
<form method="post" action=".">
{% csrf_token %}
{{ form.as_p }}

<input type="submit" value="{% trans 'Log in' %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
</div>
</div>
{% endblock %}
Empty file.
12 changes: 12 additions & 0 deletions huntserver/templatetags/bootstrap_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django import template
register = template.Library()

@register.simple_tag
def active_page(request, view_name):
from django.core.urlresolvers import resolve, Resolver404
if not request:
return ""
try:
return "active" if resolve(request.path_info).url_name == view_name else ""
except Resolver404:
return ""

0 comments on commit 5bed945

Please sign in to comment.