fixed bug in entry.title_url

This commit is contained in:
Phuoc Cao
2026-04-20 15:55:38 +02:00
parent 91331b7355
commit cd30421a95
4 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ def get_entries_count_by_topic(request):
def get_last_created(request):
# gest the 10 last created posts
query = "SELECT strftime('%d/%m/%Y', created) AS create_date, id, title, author, status FROM entries WHERE topic_id <> '_admin'"
query = "SELECT strftime('%d/%m/%Y', created) AS create_date, id, title, author, status, title_url FROM entries WHERE topic_id <> '_admin'"
if request.authenticated_userid == None:
# if user is anonym, display only published posts
query = query + " AND status='publié'"
@@ -61,7 +61,7 @@ def get_last_created(request):
def get_last_edited(request):
# gest the last edited posts
query = "SELECT strftime('%d/%m/%Y', edited) AS edit_date, id, title, author, status FROM entries WHERE topic_id <> '_admin'"
query = "SELECT strftime('%d/%m/%Y', edited) AS edit_date, id, title, author, status, title_url FROM entries WHERE topic_id <> '_admin'"
if request.authenticated_userid == None:
# if user is anonym, display only published posts
query = query + " AND status='publié'"
+2 -1
View File
@@ -12,8 +12,9 @@
<input type="text" class="form-control" name="criteria">
<button class="btn btn-primary" type="submit" name="form.submitted">Rechercher</button>
</div>
<!--
<button class="btn btn-warning" type="submit" name="form.replace">Remplacer title_url</button>
-->
</div>
</form>
+1 -1
View File
@@ -136,7 +136,7 @@
<tr>
<td>{{ entry.create_date }}</td>
<td>
<a href="{{ request.route_url('blog', id=entry.id, slug='entry.title_url') }}">{{ entry.title }}</a>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.title_url) }}">{{ entry.title }}</a>
</td>
<td>{{ entry.author }}</td>
{% if entry.status != 'publié' %}
+1 -1
View File
@@ -71,7 +71,7 @@
<td>{{ entry.edit_date }}</td>
<td>{{ entry.editor }}</td>
<td>
<a href="{{ request.route_url('blog', id=entry.id, slug='entry.title_url') }}">{{ entry.title }}</a>
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.title_url) }}">{{ entry.title }}</a>
</td>
<td>{{ entry.tag }}</td>
{% if entry.status != 'publié' %}