Refactor how url loading works for static files

This commit is contained in:
Jan Tuomi
2018-01-26 08:21:33 +02:00
parent f0ea3505e4
commit 77330dffe9
21 changed files with 371 additions and 182 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ from django.core.exceptions import ValidationError
from kaehmy.models import PresetRole, CustomRole, Application, Comment
from webapp.models import BaseRole
class CheckboxSelectMultiple(forms.widgets.CheckboxSelectMultiple):
option_template_name = 'checkbox_option.html'
@@ -86,4 +87,4 @@ class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ['name', 'email', 'message', 'parent']
fields = ['name', 'email', 'message', 'parent']
+35
View File
@@ -0,0 +1,35 @@
.page-content {
margin-top: 1vh;
width: 90%;
margin-left: auto;
margin-right: auto;
}
body {
max-width: 1000px;
margin-left: auto !important;
margin-right: auto !important;
}
div.tooltip-inner {
max-width: 25rem;
}
.tooltip {
margin-left: 1rem;
}
.role-filter-form {
max-width: 30rem;
width: auto;
margin-bottom: 1rem;
}
.kaehmy-content {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
p {
overflow-wrap: break-word;
}
+34
View File
@@ -0,0 +1,34 @@
#footer-div {
height:10vh;
}
footer {
/* position: absolute; */
bottom: 0;
width: 100%;
height: 60px; /* Set the fixed height of the footer here */
/* line-height: 60px; /* Vertically center the text there */ */
margin-top: 2rem;
margin-bottom: 1rem;
}
footer .container .col .nav .nav-item {
display: inline-block;
margin-right: 3vh;
}
.lang-button {
height: 4vh;
width: 6vh;
margin-left: 1vh;
margin-right: 1vh;
}
.lang-select {
width: 10rem;
display: inline-block;
}
footer .lang-form {
margin: 1rem auto 0;
}
+37
View File
@@ -0,0 +1,37 @@
.header-content {
}
.header-content .logo {
}
.header-content .logo img {
display: block;
height: auto;
margin: auto;
}
.kaehmy-banner {
max-width: 1000px;
margin-left: auto;
margin-right: auto;
}
@media screen and (min-width: 1000px) {
.kaehmy_header-content {
position: absolute;
left: 0;
top: 0;
background-color: #052f5f;
width: 100%;
}
.kaehmy_header {
margin-bottom: 331px;
}
}
.kaehmy-banner-image {
width: 100%;
}
+11
View File
@@ -0,0 +1,11 @@
.kaehmy_navigation {
margin-bottom: 10px;
}
.navbar-border {
border-bottom: 2px solid #282b3b;
}
.navbar-light .navbar-nav .nav-link {
color: black;
}
View File
+4
View File
@@ -3,6 +3,10 @@
{% load static %}
{% load i18n %}
{% block styles %}
<link rel="stylesheet" href="{% static "css/base.css" %}">
{% endblock styles %}
{% block body %}
{% block header %}
+2 -1
View File
@@ -1,6 +1,7 @@
{% load i18n %}
{% load static %}
<link rel="stylesheet" href="/static/css/kaehmy_nav.css">
<link rel="stylesheet" href="{% static "css/nav.css" %}">
<div class="kaehmy_navigation">
<nav class="navbar-border navbar navbar-toggleable-md navbar-light bg-faded">
<div class="navbar-nav">
+6 -1
View File
@@ -1,7 +1,8 @@
"""Kaehmy urls."""
from django.conf.urls import url
# from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from kaehmy.views import view
from kaehmy.views import list_view
@@ -19,3 +20,7 @@ urlpatterns = [
url(r'^export', export_view),
url(r'^$', list_view),
]
if settings.DEBUG:
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()