Updated to Blog Detail
Improved the Blog Detailed page and added the link from news page to Blog Detailed pagepull/3/head
parent
e232fec118
commit
6a3eecddb9
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -40,7 +40,6 @@ def news(request):
|
||||||
class BlogDetailView(DetailView):
|
class BlogDetailView(DetailView):
|
||||||
model = Blog
|
model = Blog
|
||||||
template_name = 'blog/blogDetail.html'
|
template_name = 'blog/blogDetail.html'
|
||||||
context_object_name = 'objects'
|
|
||||||
|
|
||||||
|
|
||||||
class BlogCreateView(LoginRequiredMixin, CreateView):
|
class BlogCreateView(LoginRequiredMixin, CreateView):
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,15 @@
|
||||||
{% load markdown_extras %}
|
{% load markdown_extras %}
|
||||||
<div class="container mt-5">
|
<div class="container mt-5">
|
||||||
|
|
||||||
{% for object in objects %}
|
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{ object.title | markdown | safe }}</h5>
|
<h3 class="card-title">{{ object.title | markdown | safe }}</h3>
|
||||||
<p class="card-text">{{ object.content | markdown | safe }}</p>
|
<p class="card-text">{{ object.content | markdown | safe }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
By <cite title="{{ object.author }}"><a href="#">{{ object.author }}</a></cite> on <cite title="{{ object.date_posted }}">{{ object.date_posted|date:"M j, o" }}</cite>
|
By <cite title="{{ object.author }}"><a href="#">{{ object.author }}</a></cite> on <cite title="{{ object.date_posted }}">{{ object.date_posted|date:"M j, o" }}</cite>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<!-- Posts will be dynamically added here -->
|
<!-- Posts will be dynamically added here -->
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{ post.title }} <a href="#" class="link text-secondary lead">@{{ post.author }}</a></h5>
|
<h4 class="card-title"><a href="{% url 'Blog' post.id %}" class="text-dark">{{ post.title }}</a></h4>
|
||||||
<p class="card-text">{{ post.content | markdown | safe }}</p>
|
<p class="card-text">{{ post.content | markdown | safe }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue