aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-01-19 18:17:28 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-01-19 18:17:28 +0100
commit9849b618794d9114704fecf274b5de219bd686e8 (patch)
tree23647973121b54d0bd3477d48baa073d1cac9c0d
parent228376c1089033e1ee643db0e93d12580d5494d1 (diff)
downloadrocket-blog-9849b618794d9114704fecf274b5de219bd686e8.tar.gz
rocket-blog-9849b618794d9114704fecf274b5de219bd686e8.tar.bz2
rocket-blog-9849b618794d9114704fecf274b5de219bd686e8.zip
A bit more styling and some markup fixes in forms.
-rw-r--r--public/assets/application.css33
-rw-r--r--templates/new_post.html18
2 files changed, 42 insertions, 9 deletions
diff --git a/public/assets/application.css b/public/assets/application.css
index e25b890..299be36 100644
--- a/public/assets/application.css
+++ b/public/assets/application.css
@@ -3,3 +3,36 @@
color: #dddd84;
padding: 1mm;
}
+
+form {
+ width: 40em;
+}
+
+.field, .actions {
+ padding: 2mm;
+}
+
+.field label {
+ display: block;
+ color: #64f;
+ font-weight: bold;
+}
+
+.field textarea {
+ width: 100%;
+ height: 15em;
+ padding: 2mm;
+}
+
+.field input[type=text] {
+ width: 100%;
+ padding: 1.2mm 0;
+}
+
+.checkbox label {
+ display: inline;
+}
+
+.actions {
+ display: block;
+}
diff --git a/templates/new_post.html b/templates/new_post.html
index a3a1a0f..7ef49dd 100644
--- a/templates/new_post.html
+++ b/templates/new_post.html
@@ -1,18 +1,18 @@
<h1>Create a new post</h1>
<form id="new_post" name="post" method="post" action="/posts/create">
- <div class="field">
- <label>Title:</label>
- <input type="text" name="title" value="{{ post.title }}">
+ <div class="field string required">
+ <label for="post_title">Title:</label>
+ <input type="text" name="title" id="post_title" value="{{ post.title }}">
</div>
- <div class="field">
- <label>Contents:</label>
- <textarea name="body">{{ post.body }}</textarea>
+ <div class="field textarea required">
+ <label for="post_body">Contents:</label>
+ <textarea id="post_body" name="body">{{ post.body }}</textarea>
</div>
- <div class="field">
- <input type="checkbox" checked="{{ post.published }}">
- <label>Published</label>
+ <div class="field checkbox">
+ <input type="checkbox" id="post_published" checked="{{ post.published }}">
+ <label for="post_published">Published</label>
</div>
<div class="actions">