Update
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1 style="color: wheat">Just try to think creatively</h1>
|
<h1 style="color: wheat">Just try to think creatively</h1>
|
||||||
<form action="posts-store.py" method="POST">
|
<form action="posts-store.py" method="POST">
|
||||||
<input type="text" name="title" placeholder="kreativen Titel hier platzieren" style="width: 487px;" required><br><br>
|
<input type="text" name="title" placeholder="Titel hier platzieren" style="width: 487px;" required><br><br>
|
||||||
<textarea name="content"
|
<textarea name="content"
|
||||||
placeholder="" style="width: 1500px; height: 330px;" required></textarea><br><br>
|
placeholder="" style="width: 1500px; height: 330px;" required></textarea><br><br>
|
||||||
<input type="text" name="tags" placeholder="place tags #here" style="width: 487px;" required><br><br>
|
<input type="text" name="tags" placeholder="place tags #here" style="width: 487px;" required><br><br>
|
||||||
|
@@ -9,23 +9,23 @@ cgitb.enable()
|
|||||||
|
|
||||||
print("Content-type: text/html\n")
|
print("Content-type: text/html\n")
|
||||||
print("<head><style>")
|
print("<head><style>")
|
||||||
print("body {background-color: coral;}")
|
print("body {background-color: mintcream;}")
|
||||||
print("</style></head>")
|
print("</style></head>")
|
||||||
print("""<h1 style="color:blue;">MEIN TOLLER BLOG</h1>""")
|
print("""<h1 style="color:black;">Blog</h1>""")
|
||||||
file_names= [f for f in os.listdir('posts') if os.path.isfile(os.path.join('posts', f))]
|
file_names= [f for f in os.listdir('posts') if os.path.isfile(os.path.join('posts', f))]
|
||||||
file_names = sorted(file_names, reverse=True)
|
file_names = sorted(file_names, reverse=True)
|
||||||
for lol in file_names:
|
for i in file_names:
|
||||||
lol = 'posts/' + lol
|
i = 'posts/' + i
|
||||||
data = open(lol, "r")
|
data = open(i, "r")
|
||||||
data = json.load(data)
|
data = json.load(data)
|
||||||
print('<div style="background-color: palevioletred; border: 5px solid seagreen; border-radius: 10px; padding: 10px;">')
|
print('<div style="background-color: mintcream; border: 5px solid seagreen; border-radius: 10px; padding: 10px;">')
|
||||||
print(str(data['title']) + '<br>Datum: ' + str(data['prettytime']))
|
print(str(data['title']) + '<br>Datum: ' + str(data['prettytime']))
|
||||||
print('<hr>')
|
print('<hr>')
|
||||||
print(str(data['content']) + '<br><hr>')
|
print(str(data['content']) + '<br><hr>')
|
||||||
for lel in data['tags']:
|
for k in data['tags']:
|
||||||
print('<a href="tags-show.py?tag=' + str(lel) + '">#' + str(lel) + '</a>')
|
print('<a href="tags-show.py?tag=' + str(k) + '">#' + str(k) + '</a>')
|
||||||
print('</div><br>')
|
print('</div><br>')
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print('<a href="tags-show.py">Zeig mir alle Tags!</a><br>')
|
print('<a href="tags-show.py">Alle Tags!</a><br>')
|
||||||
print('<a href="posts-create.py">Ich will einen neuen Post bauen!</a>')
|
print('<a href="posts-create.py">Einen neuen Post verfassen!</a>')
|
||||||
|
@@ -35,7 +35,7 @@ if tag:
|
|||||||
print('<a href="tags-show.py?tag=' + str(i) + '">#' + str(i) + '</a>')
|
print('<a href="tags-show.py?tag=' + str(i) + '">#' + str(i) + '</a>')
|
||||||
print('</div><br>')
|
print('</div><br>')
|
||||||
else:
|
else:
|
||||||
print('<div style="background-color: palevioletred; border: 5px solid seagreen; border-radius: 10px; padding: 10px;">')
|
print('<div style="background-color: mintcream; border: 5px solid seagreen; border-radius: 10px; padding: 10px;">')
|
||||||
print("Tags<br>")
|
print("Tags<br>")
|
||||||
for f in file_names:
|
for f in file_names:
|
||||||
f = 'posts/' + f
|
f = 'posts/' + f
|
||||||
|
Reference in New Issue
Block a user