fixed blog search template

This commit is contained in:
2025-07-01 22:28:26 +02:00
parent 661fc11b69
commit 5097b112c2
4 changed files with 23 additions and 14 deletions

View File

@@ -25,12 +25,12 @@
{% if entry.source_link != '' %} {% if entry.source_link != '' %}
<ul> <ul>
<li><b>Source</b> : <a href="{{ entry.source_link }}">{{ entry.source_title }}</a> - {{ entry.source_site }}</li> <li><b>{{ scr_label }}</b> : <a href="{{ entry.source_link }}">{{ entry.source_title }}</a> - {{ entry.source_site }}</li>
</ul> </ul>
{% endif %} {% endif %}
{% if entry.related %} {% if entry.related %}
<ul> <ul>
<li><b>Contenu corrélé</b> : <a href="{{ request.route_url('blog', id=related.id, slug=related.title) }}">{{ related.title }}</a> - {{ related.author }}</li> <li><b>{{ rel_label }}</b> : <a href="{{ request.route_url('blog', id=related.id, slug=related.title) }}">{{ related.title }}</a> - {{ related.author }}</li>
</ul> </ul>
{% endif %} {% endif %}

View File

@@ -16,7 +16,6 @@
</form> </form>
<div class="row"> <div class="row">
{% for entry in items %}
<table class="table table-sm"> <table class="table table-sm">
<thead> <thead>
<tr> <tr>
@@ -27,6 +26,7 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
{% for entry in items %}
<tr> <tr>
<td> <td>
<a href="{{ request.route_url('blog', id=entry.id, slug='slug') }}"> <a href="{{ request.route_url('blog', id=entry.id, slug='slug') }}">
@@ -36,9 +36,9 @@
<td>{{ entry.tag }}</td> <td>{{ entry.tag }}</td>
<td>{{ entry.edit_date }}</td> <td>{{ entry.edit_date }}</td>
</tr> </tr>
{% endfor %}
</tbody> </tbody>
</table> </table>
{% endfor %}
</div> </div>
<br /> <br />
<br /> <br />

View File

@@ -18,6 +18,13 @@ def blog(request):
request.session.flash(u"Page non trouvée : %s" % blog_id, 'warning') request.session.flash(u"Page non trouvée : %s" % blog_id, 'warning')
return HTTPFound(location=request.route_url('home')) return HTTPFound(location=request.route_url('home'))
if entry.language == 'vn':
scr_label = 'Nguồn'
rel_label = 'Nội dung liên quan'
else:
scr_label = 'Source'
rel_label = 'Contenu corrélé'
# insèrer le path de static/img # insèrer le path de static/img
body = entry.body.replace('static/', "%s/static/" % request.application_url) body = entry.body.replace('static/', "%s/static/" % request.application_url)
# convertir de markdown en HTML # convertir de markdown en HTML
@@ -30,6 +37,8 @@ def blog(request):
'page_title': entry.title, 'page_title': entry.title,
'entry': entry, 'entry': entry,
'related': related, 'related': related,
'scr_label': scr_label,
'rel_label': rel_label,
'body_html': body_html, 'body_html': body_html,
} }

View File

@@ -14,7 +14,7 @@ pyramid.default_locale_name = en
sqlalchemy.url = sqlite:///%(here)s/cao_sunyata.sqlite sqlalchemy.url = sqlite:///%(here)s/cao_sunyata.sqlite
# images location # images location
images_dir = /pyramid/cao_sunyata/cao_sunyata/static/img/ images_dir = /home/debian/pyramid/cao_sunyata/cao_sunyata/static/img/
# reCaptcha keys # reCaptcha keys
site_key = 6LeDvVUgAAAAAOqD_-h93kd5aW8CmpeVvKYu-m0p site_key = 6LeDvVUgAAAAAOqD_-h93kd5aW8CmpeVvKYu-m0p