Skip to content

Instantly share code, notes, and snippets.

@simon-johansson
Last active December 16, 2015 10:49
Show Gist options
  • Save simon-johansson/5423240 to your computer and use it in GitHub Desktop.
Save simon-johansson/5423240 to your computer and use it in GitHub Desktop.
#WEBPROG #film_12 #snutt_7
{% extends "base.html"%}
{% block title %} {{ oneBlogPost.title|upper }} {% endblock %}
{% block content %}
<h2 class="blogPostHeading">{{ oneBlogPost.title|upper }}</h2>
<p>{{ oneBlogPost.content }}</p>
<i>Av: {{ oneBlogPost.author.first_name }} {{ oneBlogPost.author.last_name }} den {{ oneBlogPost.datetime }}</i></br></br>
<h3>Comments</h3>
<form action="" method="post"> {% csrf_token %}
<input type="text" name="firstName" placeholder="First name" />
<input type="text" name="lastName" placeholder="Last name" /><br />
<textarea name="content" rows="5" cols="55" /></textarea><br />
<input type="submit" value="Send comment"/>
</form> <br />
<section class="comments">
{% if oneBlogPost.blogcomment_set.all %}
{% for comment in oneBlogPost.blogcomment_set.all %}
<p>{{ comment.content }}</p>
<i>{{ comment.firstName }} {{ comment.lastName }}, {{ comment.datetime }}</i> <br />
{% endfor %}
{% else %}
<p>No comments yet</p>
{% endif %}
</section>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment