Update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<body>
|
||||
<h1 style="color: wheat">Just try to think creatively</h1>
|
||||
<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"
|
||||
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>
|
||||
|
@@ -9,23 +9,23 @@ cgitb.enable()
|
||||
|
||||
print("Content-type: text/html\n")
|
||||
print("<head><style>")
|
||||
print("body {background-color: coral;}")
|
||||
print("body {background-color: mintcream;}")
|
||||
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 = sorted(file_names, reverse=True)
|
||||
for lol in file_names:
|
||||
lol = 'posts/' + lol
|
||||
data = open(lol, "r")
|
||||
for i in file_names:
|
||||
i = 'posts/' + i
|
||||
data = open(i, "r")
|
||||
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('<hr>')
|
||||
print(str(data['content']) + '<br><hr>')
|
||||
for lel in data['tags']:
|
||||
print('<a href="tags-show.py?tag=' + str(lel) + '">#' + str(lel) + '</a>')
|
||||
for k in data['tags']:
|
||||
print('<a href="tags-show.py?tag=' + str(k) + '">#' + str(k) + '</a>')
|
||||
print('</div><br>')
|
||||
|
||||
print()
|
||||
print('<a href="tags-show.py">Zeig mir alle Tags!</a><br>')
|
||||
print('<a href="posts-create.py">Ich will einen neuen Post bauen!</a>')
|
||||
print('<a href="tags-show.py">Alle Tags!</a><br>')
|
||||
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('</div><br>')
|
||||
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>")
|
||||
for f in file_names:
|
||||
f = 'posts/' + f
|
||||
|
Reference in New Issue
Block a user