CSS for post page
This commit is contained in:
parent
09c3294aa7
commit
b5948c60b2
|
@ -28,7 +28,7 @@ body {
|
|||
}
|
||||
|
||||
.thought {
|
||||
padding: 20px 30px;
|
||||
margin: 20px 30px;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
|
@ -73,10 +73,11 @@ hr.thought-end {
|
|||
|
||||
header {
|
||||
padding: 4% 30px 15px;
|
||||
font-size: 3em;
|
||||
}
|
||||
header .text {
|
||||
color: var(--text-color);
|
||||
font-size: 3em;
|
||||
|
||||
font-family: Georgia, Libre Baskerville, serif;
|
||||
border-bottom: 4px solid var(--accent-color);
|
||||
}
|
||||
|
@ -85,6 +86,10 @@ header .text {
|
|||
display: none;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
textarea.thought {
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
width: calc(100% - 60px);
|
||||
resize: none;
|
||||
background: none;
|
||||
border-right: 0;
|
||||
border: none;
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
#post-button {
|
||||
border-radius: 0;
|
||||
background: none;
|
||||
outline: none;
|
||||
border: none;
|
||||
margin: 30px;
|
||||
padding: 0;
|
||||
font-size: 32px;
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
}
|
|
@ -9,7 +9,9 @@
|
|||
<link href="{% static "main/main.css" %}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<header><span class="text">Thoughts</span></header>
|
||||
<header><span class="text">Thoughts</span>{% if authenticated %}
|
||||
<a href="/post" class="text" style="border: none">Post</a>
|
||||
{% endif %}</header>
|
||||
|
||||
<section class="main-wrap">
|
||||
{% for thought in thoughts %}
|
||||
|
@ -22,9 +24,9 @@
|
|||
{% endfor %}
|
||||
</section>
|
||||
|
||||
<footer>Copyright Matthias @2020{% if authenticated %}
|
||||
<a href="/post" style="color: var(--text-color); margin-left: 100px; text-decoration: none">POST</a>
|
||||
{% endif %}</footer>
|
||||
<!-- <footer>Copyright Matthias @2020{% if authenticated %}-->
|
||||
<!-- <a href="/post" style="color: var(--text-color); margin-left: 100px; text-decoration: none">POST</a>-->
|
||||
<!-- {% endif %}</footer>-->
|
||||
|
||||
<script>
|
||||
const els = document.querySelectorAll(".thought");
|
||||
|
|
|
@ -2,21 +2,26 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Title</title>
|
||||
|
||||
{% load static %}
|
||||
<link href="{% static "main/main.css" %}" rel="stylesheet">
|
||||
<link href="{% static "main/post.css" %}" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<header><a href="/" class="text" style="border: none">Thoughts</a> <span class="text">Post</span></header>
|
||||
|
||||
<form action="{% url 'post'%}" method="post">
|
||||
{% csrf_token %}
|
||||
<textarea name="text" id="text"></textarea>
|
||||
<textarea name="extended_text" id="extended_text"></textarea>
|
||||
<textarea name="text" id="text" class="thought"></textarea>
|
||||
<hr class="thought-end">
|
||||
<textarea name="extended_text" id="extended_text" class="thought"></textarea>
|
||||
<hr class="thought-end">
|
||||
<input type="hidden" name="timezone_offset" id="timezone_offset">
|
||||
|
||||
<input type="submit">
|
||||
<input type="submit" id="post-button" value="Submit">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -25,6 +25,9 @@ def post(request):
|
|||
return render(request, "whispermaphone/login.html", status=401)
|
||||
|
||||
if request.method == "POST":
|
||||
if len(request.POST["text"]) == 0:
|
||||
return HttpResponse("Need some text.", status=400)
|
||||
|
||||
Thought(
|
||||
text=request.POST["text"],
|
||||
extended_text=request.POST["extended_text"],
|
||||
|
|
Loading…
Reference in New Issue