1
0
Fork 0
mirror of https://github.com/shouptech/humulus.git synced 2026-02-03 18:19:42 +00:00

Compare commits

...

2 commits

Author SHA1 Message Date
95e5a35295
Implement HTTP Cats
Closes #15
2019-07-09 19:08:07 -06:00
de9f4f1e68
Make stats footer collapsible (#21)
Closes #14
2019-07-09 13:57:41 -06:00
4 changed files with 49 additions and 2 deletions

View file

@ -16,7 +16,7 @@
import os
from flask import Flask
from flask import Flask, render_template
def create_app(test_config=None):
@ -55,4 +55,22 @@ def create_app(test_config=None):
from . import filters
filters.create_filters(app)
# Register custom error handlers
app.register_error_handler(400, bad_request)
app.register_error_handler(404, page_not_found)
return app
def bad_request(e):
return (
render_template('_error.html', code=400, message='400 Bad Request'),
400
)
def page_not_found(e):
return (
render_template('_error.html', code=404, message='404 Not Found'),
404
)

View file

@ -33,5 +33,5 @@ body {
}
.above-footer {
padding-bottom: 12rem;
padding-bottom: 14rem;
}

View file

@ -0,0 +1,24 @@
{#-
Copyright 2019 Mike Shoup
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-#}
{% extends '_base.html' %}
{% block title %}Home{% endblock %}
{% block body %}
<div class="text-center">
<img src="https://http.cat/{{ code }}" alt="{{ message }}">
<p>Error messages from <a href="https://http.cat/">HTTP Cats</a></p>
</div>
{% endblock %}

View file

@ -137,6 +137,11 @@
<div class="bg-info text-white">
<div class="container">
<div class="row">
<div class="col text-right">
<a class="text-white" href="#" data-toggle="collapse" data-target="#statsRow">[ Show/Hide ]</a>
</div>
</div>
<div class="row collapse show" id="statsRow">
<div class="col">
<dl>
<dt>Original Gravity</dt>