0.2.1
This commit is contained in:
parent
18479a3f56
commit
85d0d6a721
10 changed files with 107 additions and 13 deletions
|
|
@ -1 +1,17 @@
|
||||||
# Create your views here.
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
|
||||||
|
def bad_request(request, exception):
|
||||||
|
return render(request, "400.html", status=400)
|
||||||
|
|
||||||
|
|
||||||
|
def permission_denied(request, exception):
|
||||||
|
return render(request, "403.html", status=403)
|
||||||
|
|
||||||
|
|
||||||
|
def not_found(request, exception):
|
||||||
|
return render(request, "404.html", status=404)
|
||||||
|
|
||||||
|
|
||||||
|
def server_error(request):
|
||||||
|
return render(request, "500.html", status=500)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
||||||
background-color: $focus-blue;
|
background-color: $blue;
|
||||||
|
|
||||||
&--error {
|
&--error {
|
||||||
background-color: $error-red;
|
background-color: $error-red;
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
margin: 0 0 5px 0;
|
margin: 0 0 5px 0;
|
||||||
padding: 15px 0;
|
padding: 10px 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
background-color: $white;
|
background-color: $white;
|
||||||
box-shadow: 0px 5px darken($azureish-white, +10%);
|
|
||||||
|
|
||||||
ol {
|
ol {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -28,7 +27,7 @@
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
|
||||||
background-color: $azureish-white;
|
background-color: darken($azureish-white, 20%);
|
||||||
|
|
||||||
&:hover{
|
&:hover{
|
||||||
background-color: lighten($azureish-white, +5%);
|
background-color: lighten($azureish-white, +5%);
|
||||||
|
|
@ -36,6 +35,7 @@
|
||||||
|
|
||||||
& a {
|
& a {
|
||||||
@extend .button;
|
@extend .button;
|
||||||
|
color: $white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: darken($azureish-white, +10%);
|
background-color: $focus-blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--selected {
|
&--selected {
|
||||||
background-color: darken($azureish-white, +10%);
|
background-color: $focus-blue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
$white: rgba(255, 255, 255, 1);
|
|
||||||
$black: rgba(0, 0, 0, 1);
|
|
||||||
|
|
||||||
$dark: rgba(0, 0, 0, 0.4);
|
|
||||||
|
|
||||||
// light blue
|
// light blue
|
||||||
$azureish-white: rgba(205, 230, 245, 1);
|
$azureish-white: rgba(205, 230, 245, 1);
|
||||||
|
|
||||||
|
|
@ -34,5 +29,11 @@ $confirm-green: $success-green;
|
||||||
$cancel-red: $error-red;
|
$cancel-red: $error-red;
|
||||||
|
|
||||||
$border-gray: rgba(227, 227, 227, 1);
|
$border-gray: rgba(227, 227, 227, 1);
|
||||||
$focus-blue: darken($azureish-white, +50%);
|
|
||||||
|
$focus-blue: darken($azureish-white, +10%);
|
||||||
$default-font-color: rgba(48, 51, 53, 1);
|
$default-font-color: rgba(48, 51, 53, 1);
|
||||||
|
|
||||||
|
$white: rgba(255, 255, 255, 1);
|
||||||
|
$black: rgba(0, 0, 0, 1);
|
||||||
|
$blue: darken($azureish-white, +50%);
|
||||||
|
$dark: rgba(0, 0, 0, 0.4);
|
||||||
|
|
|
||||||
18
src/newsreader/templates/400.html
Normal file
18
src/newsreader/templates/400.html
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load static i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<main class="main">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card__header">
|
||||||
|
<h1>{% trans "Bad request" %}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="card__content">
|
||||||
|
<p>
|
||||||
|
Head back to the <a href="{% url 'accounts:login' %}">login page</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="card__footer" />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
||||||
18
src/newsreader/templates/403.html
Normal file
18
src/newsreader/templates/403.html
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load static i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<main class="main">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card__header">
|
||||||
|
<h1>{% trans "Permission denied" %}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="card__content">
|
||||||
|
<p>
|
||||||
|
Head back to the <a href="{% url 'accounts:login' %}">login page</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="card__footer" />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
||||||
18
src/newsreader/templates/404.html
Normal file
18
src/newsreader/templates/404.html
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load static i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<main class="main">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card__header">
|
||||||
|
<h1>{% trans "Page not found" %}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="card__content">
|
||||||
|
<p>
|
||||||
|
Head back to the <a href="{% url 'accounts:login' %}">login page</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="card__footer" />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
||||||
18
src/newsreader/templates/500.html
Normal file
18
src/newsreader/templates/500.html
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load static i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<main class="main">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card__header">
|
||||||
|
<h1>{% trans "Server error" %}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="card__content">
|
||||||
|
<p>
|
||||||
|
Head back to the <a href="{% url 'accounts:login' %}">login page</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="card__footer" />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -30,6 +30,11 @@ urlpatterns = [
|
||||||
path("api/auth/", include("rest_framework.urls"), name="rest_framework"),
|
path("api/auth/", include("rest_framework.urls"), name="rest_framework"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
handler400 = "newsreader.core.views.bad_request"
|
||||||
|
handler403 = "newsreader.core.views.permission_denied"
|
||||||
|
handler404 = "newsreader.core.views.not_found"
|
||||||
|
handler500 = "newsreader.core.views.server_error"
|
||||||
|
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
import debug_toolbar
|
import debug_toolbar
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue