Commit bab58aab authored by Falk, Dennis Nikolas's avatar Falk, Dennis Nikolas
Browse files

Merge branch 'Dennis_2020_06_16' into 'master'

Dennis 2020 06 16

See merge request !11
parents 25fe3e69 28f235d4
......@@ -11,7 +11,6 @@ to work properly. These are:
* start-page: The start-page, of course :) Change content to something nice
* impress: Fill with impress data
* contact: Contact information of the page owner
* 404: Error page content
There are also some sample-article, which only exist to demonstration purposes.
......@@ -86,7 +85,7 @@ To start the application, run
`manage.py runserver --insecure`
The `--insecure` statement is necessary to provide static content and our nicer 404 page for error cases.
The `--insecure` statement is necessary to provide static content and our nicer HTTP error page for error cases.
Otherwise, an external web server would be necessary.
### Check if it worked
......
......@@ -44,21 +44,6 @@
"slug": "start"
}
},
{
"model": "blog.blog",
"pk": 9,
"fields": {
"identifier": "404",
"title": "Artikel nicht gefunden",
"description": "<p>Das ist nicht der Artikel, den du suchst&nbsp;<img alt=\"sad\" src=\"http://127.0.0.1:8000/static/ckeditor/ckeditor/plugins/smiley/images/sad_smile.png\" style=\"height:23px; width:23px\" title=\"sad\" /></p>",
"date": "2020-06-22T18:16:09Z",
"image": "",
"created": "2020-06-22",
"edited": "2020-06-22",
"status": 1,
"slug": "404"
}
},
{
"model": "blog.blog",
"pk": 10,
......
# Generated by Django 3.0.7 on 2020-06-16 19:16
import ckeditor_uploader.fields
import datetime
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('identifier', models.CharField(default=uuid.UUID('ff6dc37b-1cb8-44da-925d-e2d2df66ea4e'), max_length=500, unique=True)),
('title', models.CharField(default='Titel', max_length=200)),
('description', ckeditor_uploader.fields.RichTextUploadingField(blank=True)),
('date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
('image', models.ImageField(blank=True, upload_to='images/')),
('created', models.DateField(auto_now_add=True)),
('edited', models.DateField(auto_now=True)),
('status', models.IntegerField(default=1)),
('slug', models.SlugField(max_length=300, unique=True)),
],
),
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('author', models.TextField(max_length=150)),
('text', models.TextField(max_length=1000)),
('date', models.DateTimeField(default=datetime.datetime.now)),
('related_blog', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='blog.Blog')),
],
),
]
......@@ -61,4 +61,4 @@ footer a:hover {
.color2 { color: #0433BF; }
.color3 { color: #032CA6; }
.color4 { color: #021859; }
.color5 { color: #0B9ED9; }
.color5 { color: #0B9ED9; }
\ No newline at end of file
......@@ -23,9 +23,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'y_hwiort47(hes1ez+x!h5zw1mdnl4yfk*p^xb2-z4r84ayri%'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['127.0.0.1', ]
# Application definition
......@@ -125,10 +125,10 @@ USE_TZ = True
STATIC_URL = '/static/'
PROJECT_DIR=os.path.dirname(__file__)
PROJECT_DIR = os.path.dirname(__file__)
# TODO: STATIC_ROOT must be eventually edited
STATIC_ROOT = os.path.join(PROJECT_DIR,'static/')
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static/')
CKEDITOR_UPLOAD_PATH = "uploads/"
......
window.onload = () => {
document.getElementById("startpage_button").addEventListener("click", goHome);
document.getElementsByClassName("container blogcard")[0].addEventListener(
"click",goToDetails)
}
function goToDetails(event) {
var card = event.currentTarget;
card = event.target;
var targetclassName = card.className.toLowerCase();
if (targetclassName != 'card-deck'){
let id = card.parentNode.children.item(3).innerHTML
openDetails(id);
}
}
function openDetails(id){
window.location.replace(id);
}
//TODO gohome doesn't work yet
function goHome(){
window.location.replace(home);
}
\ No newline at end of file
......@@ -24,7 +24,6 @@ body {
margin-top: 1em;
margin-bottom: 1em;
border-radius: 5px;
box-shadow: 3px 3px 3px #010748;
padding: 1em;
}
......@@ -56,4 +55,4 @@ h4, h5, h6 {
.color2 { color: #0433BF; }
.color3 { color: #032CA6; }
.color4 { color: #021859; }
.color5 { color: #0B9ED9; }
.color5 { color: #0B9ED9; }
\ No newline at end of file
Dummy File for collectstatic command
\ No newline at end of file
{% extends 'blog/all_blogs.html' %}
{% load bootstrap4 %}
{% block page-title %}
Error 400
{% endblock %}
{% block heading %}
<h1 class="display-2">Error 400</h1>
{% endblock %}
{% block content %}
<div class="container">
<h2>Hmm?! Irgendwas stimmt mit deiner Anfrage nicht!</h2>
<a href="{% url 'blog:all_blogs' %}" class="btn btn-primary">Home</a>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'blog/all_blogs.html' %}
{% load bootstrap4 %}
{% block page-title %}
Error 403
{% endblock %}
{% block heading %}
<h1 class="display-2">Error 403</h1>
{% endblock %}
{% block content %}
<div class="container">
<h2>Der Zugriff wurde verweigert!</h2>
<a href="{% url 'blog:all_blogs' %}" class="btn btn-primary">Home</a>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'blog/base.html' %}
{% load bootstrap4 %}
{% block page-title %}
Error 404
{% endblock %}
{% block heading %}
<h1 class="display-2">Error 404</h1>
{% endblock %}
{% block content %}
<div class="container">
<h2>Ups! Die Seite wurde leider nicht gefunden!</h2>
<a href="{% url 'blog:all_blogs' %}" class="btn btn-primary">Home</a>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'blog/all_blogs.html' %}
{% load bootstrap4 %}
{% block page-title %}
Error 500
{% endblock %}
{% block heading %}
<h1 class="display-2">Error 500</h1>
{% endblock %}
{% block content %}
<div class="container">
<h2>Hoppla! Der Server hat gerade schluckauf. Versuche es später noch einmal!</h2>
<a href="{% url 'blog:all_blogs' %}" class="btn btn-primary">Home</a>
</div>
{% endblock %}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment