File tree Expand file tree Collapse file tree 4 files changed +78
-1
lines changed
personal_portfolio/templates Expand file tree Collapse file tree 4 files changed +78
-1
lines changed Original file line number Diff line number Diff line change 1+ {% extends "base.html" %}
2+ {% block page_content %}
3+ < div class ="col-md-8 offset-md-2 ">
4+ < h1 > {{ category | title }}</ h1 >
5+ < hr >
6+ {% for post in posts %}
7+ < h2 > < a href ="{% url 'blog_detail' post.pk%} "> {{ post.title }}</ a > </ h2 >
8+ < small >
9+ {{ post.created_on.date }} |
10+ Categories:
11+ {% for category in post.categories.all %}
12+ < a href ="{% url 'blog_category' category.name %} ">
13+ {{ category.name }}
14+ </ a >
15+ {% endfor %}
16+ </ small >
17+ < p > {{ post.body | slice:":400" }}...</ p >
18+ {% endfor %}
19+ </ div >
20+ {% endblock %}
Original file line number Diff line number Diff line change 1+ {% extends "base.html" %}
2+ {% block page_content %}
3+ < div class ="col-md-8 offset-md-2 ">
4+ < h1 > {{ post.title }}</ h1 >
5+ < small >
6+ {{ post.created_on.date }} |
7+ Categories:
8+ {% for category in post.categories.all %}
9+ < a href ="{% url 'blog_category' category.name %} ">
10+ {{ category.name }}
11+ </ a >
12+ {% endfor %}
13+ </ small >
14+ < p > {{ post.body | linebreaks }}</ p >
15+ < h3 > Leave a comment:</ h3 >
16+ < form action ="/blog/{{ post.pk }}/ " method ="post ">
17+ {% csrf_token %}
18+ < div class ="form-group ">
19+ {{ form.author }}
20+ </ div >
21+ < div class ="form-group ">
22+ {{ form.body }}
23+ </ div >
24+ < button type ="submit " class ="btn btn-primary "> Submit</ button >
25+ </ form >
26+ < h3 > Comments:</ h3 >
27+ {% for comment in comments %}
28+ < p >
29+ On {{comment.created_on.date }}
30+ < b > {{ comment.author }}</ b > wrote:
31+ </ p >
32+ < p > {{ comment.body }}</ p >
33+ < hr >
34+ {% endfor %}
35+ </ div >
36+ {% endblock %}
Original file line number Diff line number Diff line change 1+ {% extends "base.html" %}
2+
3+ {% block page_content %}
4+ < div class ="col-md-8 offset-md-2 ">
5+ < h1 > Blog Index</ h1 >
6+ < hr >
7+ {% for post in posts %}
8+ < h2 > < a href ="{% url 'blog_detail' post.pk%} "> {{ post.title }}</ a > </ h2 >
9+ < small >
10+ {{ post.created_on.date }} |
11+ Categories:
12+ {% for category in post.categories.all %}
13+ < a href ="{% url 'blog_category' category.name %} ">
14+ {{ category.name }}
15+ </ a >
16+ {% endfor %}
17+ </ small >
18+ < p > {{ post.body | slice:":400" }}...</ p >
19+ {% endfor %}
20+ </ div >
21+ {% endblock %}
Original file line number Diff line number Diff line change 1313 < a class ="nav-link " href ="{% url 'project_index' %} "> Home</ a >
1414 </ li >
1515 < li class ="nav-item ">
16- < a class ="nav-link " href ="# "> Blog</ a >
16+ < a class ="nav-link " href ="{% url 'blog_index' %} "> Blog</ a >
1717 </ li >
1818 </ ul >
1919 </ div >
You can’t perform that action at this time.
0 commit comments