diff --git a/deploy/pip_packages.txt b/deploy/pip_packages.txt index 0a8e975bd7bb8490c546e2b8c17ebaa39ed3cd64..d02e1aa0ea41de89714e1a2580f0145ac67ecaa7 100644 --- a/deploy/pip_packages.txt +++ b/deploy/pip_packages.txt @@ -41,3 +41,4 @@ django-jenkins==0.17.0 #webassets #pyScss #cssmin +django-bootstrap3 diff --git a/django/website/hid/templates/hid/dashboard.html b/django/website/hid/templates/hid/dashboard.html index b0ff1966ba606facee50aefd66cf48614d68393e..3354687ec76ce45d13836bd7402f1e119a1bd18c 100644 --- a/django/website/hid/templates/hid/dashboard.html +++ b/django/website/hid/templates/hid/dashboard.html @@ -1,8 +1,8 @@ {% extends "base.html" %} {% load i18n %} -{% block content %} +{% block maincontent %} <p>{% trans "This is the dashboard page." %}</p> <p><a href="{% url "logout" %}">{% trans "Log out" %}</a></p> -{% endblock content %} \ No newline at end of file +{% endblock maincontent %} \ No newline at end of file diff --git a/django/website/media/css/styles.css b/django/website/media/css/styles.css new file mode 100644 index 0000000000000000000000000000000000000000..9102416dd35fca81f7c63ef0b162cc7e3349b8ab --- /dev/null +++ b/django/website/media/css/styles.css @@ -0,0 +1,17 @@ +@CHARSET "UTF-8"; + +.internews-sidebar { + background-color: #000; + color: #FFF; + position: fixed; +} + +html, body { + height: 100%; + overflow: hidden; +} + +.internews-main, .internews-sidebar { + margin-bottom: -9999px; + padding-bottom: 9999px; +} \ No newline at end of file diff --git a/django/website/settings.py b/django/website/settings.py index fba7fefda8edfdc9b56914da9363a50691f9b645..ee05e819ff7adbcb3e77602a30adcc1b54d19ee3 100644 --- a/django/website/settings.py +++ b/django/website/settings.py @@ -126,7 +126,7 @@ DJANGO_APPS = ( ) THIRD_PARTY_APPS = ( - + 'bootstrap3', ) LOCAL_APPS = ( diff --git a/django/website/templates/base.html b/django/website/templates/base.html index f03fad9e7e85fb7d6bafb00df9666c0454c56207..672cad43099d40aec85bba0c1c04558967b15119 100644 --- a/django/website/templates/base.html +++ b/django/website/templates/base.html @@ -1,5 +1,6 @@ <!doctype html> - +{% load bootstrap3 %} +{% load i18n %} <html> <head> <meta charset="utf-8"> @@ -7,11 +8,34 @@ <title>internewshid</title> <meta name="description" content="internewshid - Humanitarian Information Dashboard for Internews"> <meta name="author" content="Mark Skipper"> + {% bootstrap_css %} + <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> + <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> + <!--[if lt IE 9]> + <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> + <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> + <![endif]--> + {% if 'javascript_in_head'|bootstrap_setting %}{% bootstrap_javascript jquery=True %}{% endif %} + {% block bootstrap3_extra_head %}{% endblock %} + <link href="{{ STATIC_URL }}css/styles.css" media="all" rel="stylesheet" /> </head> <body> {% block content %} + <meta name="viewport" content="width=device-width,initial-scale=1"> + <div class="container-fluid"> + <div class="row-fluid"> + <div class="col-sm-2 col-sd-2 sidebar internews-sidebar"> + <h2>{% trans "Internews" %}</h2> + <p>{% trans "humanitarian information dashboard (HID)" %} <a href=".">{% trans "info" %}</a></p> + </div> + <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main internews-main"> + {% block maincontent %} + {% endblock maincontent %} + </div> + </div> + </div> {% endblock content %} </body> diff --git a/django/website/templates/registration/logged_out.html b/django/website/templates/registration/logged_out.html index 1d215ef32079eae55f98146d9be37e6121305c72..0b36bb04b8ba610cdfbd7d2188406182a2eba14e 100644 --- a/django/website/templates/registration/logged_out.html +++ b/django/website/templates/registration/logged_out.html @@ -2,10 +2,10 @@ {% load i18n %} -{% block content %} +{% block maincontent %} <h1>{% trans "Logged out" %}</h1> <p> You are logged out. <a href="{% url "login" %}">{% trans "Log in again." %}</a> </p> -{% endblock content %} \ No newline at end of file +{% endblock maincontent %} \ No newline at end of file diff --git a/django/website/templates/registration/login.html b/django/website/templates/registration/login.html index dffe3662077bd5ddbc3bd88d64eb2e0dfd3319b7..22112a9229e035901daa72196ad7bd24bd9b4b55 100644 --- a/django/website/templates/registration/login.html +++ b/django/website/templates/registration/login.html @@ -1,11 +1,13 @@ {% extends "base.html" %} {% load i18n %} +{% load bootstrap3 %} -{% block content %} -<form action="." method="post">{% csrf_token %} -<h1>{% trans "Log in" %}</h1> -{{ form.as_p }} -<input type="submit" name="submit" value="{% trans "Submit" %}" /> -</form> -{% endblock content %} \ No newline at end of file +{% block maincontent %} + <div class="login_form"> + <form action="." method="post">{% csrf_token %} + {% bootstrap_form form show_label=False %} + <a href=".">{% trans "forgot password?" %}</a> {% bootstrap_button "Log in" button_type="submit" value="Log in" %} + </form> + </div> +{% endblock maincontent %} \ No newline at end of file