55 < div class ="col-md-8 ">
66 < article class ="blog-post ">
77 < h2 class ="blog-post-title "> {{ post.title }}</ h2 >
8- < p class ="blog-post-meta "> {{ post.publisher_at }}by < a href ="{% url 'users:user_profile' post.author.username %} "> {{ post.author }}</ a > </ p >
8+ < p class ="blog-post-meta "> {{ post.publisher_at }}by
9+ < a
10+ href ="{% url 'users:user_profile' post.author.username %} "
11+ hx-get ="{% url 'users:user_profile' post.author.username %} "
12+ hx-push-url ="true "
13+ hx-target ="#main-content "
14+ > {{ post.author }}</ a >
15+ </ p >
916
1017 < div class ="text ">
1118 < p > < small > {{ post.description }}</ small > </ p >
@@ -19,19 +26,34 @@ <h2 class="blog-post-title">{{ post.title }}</h2>
1926
2027 <!-- Watching count-->
2128 < div class ="mb-2 ">
22- < a href ="#main-content " class ="nav-link text-dark ">
29+ < a
30+ href ="#main-content "
31+ hx-get ="#main-content "
32+ hx-push-url ="true "
33+ hx-target ="#main-content "
34+ class ="nav-link text-dark ">
2335 < i class ="bi bi-eye "> ({{ post.watching }})</ i >
2436 </ a >
2537 </ div >
2638 <!-- Comments count -->
2739 < div class ="mb-2 ">
28- < a href ="#post_comments " class ="nav-link text-dark ">
40+ < a
41+ href ="#post_comments "
42+ hx-get ="#post_comments "
43+ hx-push-url ="true "
44+ hx-target ="#main-content "
45+ class ="nav-link text-dark ">
2946 < i class ="bi bi-chat-left-text "> ({{ post.comment_count }})</ i >
3047 </ a >
3148 </ div >
3249 <!-- Like count -->
3350 < div class ="md-2 " id ="post_like_count ">
34- < a href ="{% url 'blog:post_like' post.slug %}#post_like_count " class ="nav-link text-dark ">
51+ < a
52+ href ="{% url 'blog:post_like' post.slug %}#post_like_count "
53+ hx-get ="{% url 'blog:post_like' post.slug %}#post_like_count "
54+ hx-push-url ="true "
55+ hx-target ="#main-content "
56+ class ="nav-link text-dark ">
3557 {% if request.user.is_authenticated %}
3658 {% if post|check_like:request.user %}
3759 < i class ="bi bi-star-fill "> ({{ post.like_count }})</ i >
@@ -45,7 +67,12 @@ <h2 class="blog-post-title">{{ post.title }}</h2>
4567 </ div >
4668 <!-- Dislike count -->
4769 < div class ="md-2 " id ="post_dislike_count ">
48- < a href ="{% url 'blog:post_dislike' post.slug %}#post_dislike_count " class ="nav-link text-dark ">
70+ < a
71+ href ="{% url 'blog:post_dislike' post.slug %}#post_dislike_count "
72+ hx-get ="{% url 'blog:post_dislike' post.slug %}#post_dislike_count "
73+ hx-push-url ="true "
74+ hx-target ="#main-content "
75+ class ="nav-link text-dark ">
4976 {% if request.user.is_authenticated %}
5077 {% if post|check_dislike:request.user %}
5178 < i class ="bi bi-emoji-frown-fill "> ({{ post.dislike_count }})</ i >
@@ -61,13 +88,30 @@ <h2 class="blog-post-title">{{ post.title }}</h2>
6188 <!-- Delete, Update buttons -->
6289 {% if request.user == post.author %}
6390 < nav class ="blog-pagination mt-3 mb-3 " aria-label ="Pagination ">
64- < a class ="btn btn-outline-danger " href ="{% url 'blog:post_delete' post.slug %} "> delete</ a >
65- < a class ="btn btn-outline-warning " href ="{% url 'blog:post_update' post.slug %} "> update</ a >
91+ < a
92+ class ="btn btn-outline-danger "
93+ href ="{% url 'blog:post_delete' post.slug %} "
94+ hx-get ="{% url 'blog:post_delete' post.slug %} "
95+ hx-push-url ="true "
96+ hx-target ="#main-content "
97+ > delete</ a >
98+ < a
99+ class ="btn btn-outline-warning "
100+ href ="{% url 'blog:post_update' post.slug %} "
101+ hx-get ="{% url 'blog:post_update' post.slug %} "
102+ hx-push-url ="true "
103+ hx-target ="#main-content "
104+ > update</ a >
66105 </ nav >
67106 {% endif %}
68107 <!-- Send comment message -->
69108 < div id ="post_comments_form ">
70- < form action ="{% url 'blog:post_message' post.slug %}#post_comments_form " class ="mt-3 mb-3 ">
109+ < form
110+ action ="{% url 'blog:post_message' post.slug %}#post_comments_form "
111+ hx-get ="{% url 'blog:post_message' post.slug %}#post_comments_form "
112+ hx-push-url ="true "
113+ hx-target ="#main-content "
114+ class ="mt-3 mb-3 ">
71115 {% csrf_token %}
72116 < div class ="d-flex ">
73117 < input type ="text " name ="post_message_input " class ="form-control " placeholder ="message... " required ="">
0 commit comments