Updated to Blog Detail

Improved the Blog Detailed page and added the link from news page to Blog Detailed page
pull/3/head
surya 2024-07-16 21:55:12 +05:30
parent e232fec118
commit 6a3eecddb9
8 changed files with 2 additions and 5 deletions

View File

@ -40,7 +40,6 @@ def news(request):
class BlogDetailView(DetailView):
model = Blog
template_name = 'blog/blogDetail.html'
context_object_name = 'objects'
class BlogCreateView(LoginRequiredMixin, CreateView):

View File

@ -4,17 +4,15 @@
{% load markdown_extras %}
<div class="container mt-5">
{% for object in objects %}
<div class="card mb-3">
<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>
</div>
<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>
</div>
</div>
{% endfor %}
</div>

View File

@ -17,7 +17,7 @@
<!-- Posts will be dynamically added here -->
<div class="card mb-3">
<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>
</div>
</div>