Prettify frontend with a CSS template

This commit is contained in:
coolneng 2020-01-09 08:06:18 +01:00
parent 667bed6edf
commit 6caca22472
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
5 changed files with 81 additions and 38 deletions

View File

@ -46,3 +46,18 @@ def admin():
@login_required @login_required
def nuke(): def nuke():
return render_template("nuked.html", title="NUKE THE SYSTEM!") return render_template("nuked.html", title="NUKE THE SYSTEM!")
@app.route("/data")
def data():
return render_template("data.html", title="Data")
@app.route("/tables")
def tables():
return render_template("data.html", title="Data")
@app.route("/plots")
def plots():
return render_template("data.html", title="Data")

12
code/app/static/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,49 +1,55 @@
{% extends 'bootstrap/base.html' %} {% extends 'bootstrap/base.html' %}
{% block title %} {% block title %}
IGDB IGDB
{% endblock %}
{% block styles %}
<link rel="stylesheet"
href="{{url_for('.static', filename='bootstrap.min.css')}}">
{% endblock %} {% endblock %}
{% block navbar %} {% block navbar %}
<nav class="navbar navbar-default"> <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container"> <a class="navbar-brand" href="{{ url_for('index') }}">IGDB</a>
<div class="navbar-header"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="navbar-toggler-icon"></span>
<span class="sr-only">Toggle navigation</span> </button>
<span class="icon-bar"></span>
<span class="icon-bar"></span> <div class="collapse navbar-collapse" id="navbarColor01">
<span class="icon-bar"></span> <ul class="navbar-nav mr-auto">
</button> <li class="nav-item active">
<a class="navbar-brand" href="{{ url_for('index') }}">Microblog</a> <a class="nav-link" href="{{ url_for('index') }}">Home <span class="sr-only">(current)</span></a>
</div> </li>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> {% if current_user.is_anonymous %}
<ul class="nav navbar-nav"> <li class="nav-link"><a href="{{ url_for('data') }}">Data</a></li>
<li><a href="{{ url_for('index') }}">Home</a></li> {% else %}
</ul> <li class="nav-link"><a href="{{ url_for('data') }}">Data</a></li>
<ul class="nav navbar-nav navbar-right"> <li class="nav-link"><a href="{{ url_for('admin') }}">Administration</a></li>
{% if current_user.is_anonymous %} {% endif %}
<li><a href="{{ url_for('login') }}">Login</a></li> </ul>
{% else %} <ul class="navbar-nav navbar-right">
<li><a href="{{ url_for('admin') }}">Administration</a></li> {% if current_user.is_anonymous %}
<li><a href="{{ url_for('logout') }}">Logout</a></li> <li class="nav-link"><a href="{{ url_for('login') }}">Login</a></li>
{% endif %} {% else %}
</ul> <li class="nav-item"><a href="{{ url_for('logout') }}">Logout</a></li>
</div> {% endif %}
</div> </ul>
</nav> </div>
</nav>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
{% with messages = get_flashed_messages() %} {% with messages = get_flashed_messages() %}
{% if messages %} {% if messages %}
{% for message in messages %} {% for message in messages %}
<div class="alert alert-info" role="alert">{{ message }}</div> <div class="alert alert-info" role="alert">{{ message }}</div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endwith %} {% endwith %}
{# application content needs to be provided in the app_content block #} {# application content needs to be provided in the app_content block #}
{% block app_content %}{% endblock %} {% block app_content %}{% endblock %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block content %}
<h1>Hey, {{ current_user.username }}!</h1>
Wanna check out some cool data?
<li><a href="{{ url_for('tables') }}"></a></li>
<li><a href="{{ url_for('plots') }}"></a></li>
{% endblock %}

View File

@ -1,6 +1,8 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<div class="jumbotron">
<h1 id="igdb-internation-glacier-database">IGDB: Internation Glacier Database</h1> <h1 id="igdb-internation-glacier-database">IGDB: Internation Glacier Database</h1>
<p>The IGDB is a database, that uses data from the <a href="http://dx.doi.org/10.5904/wgms-fog-2018-11">WGMS</a> to illustrate the consequences of climate change.</p> <p>The IGDB is a database, that uses data from the <a href="http://dx.doi.org/10.5904/wgms-fog-2018-11">WGMS</a> to illustrate the consequences of climate change.</p>
</div>
{% endblock %} {% endblock %}