updated albums contents
This commit is contained in:
BIN
tcs_site.sqlite
BIN
tcs_site.sqlite
Binary file not shown.
@@ -33,10 +33,16 @@ def get_entries_by_criteria(request, criteria):
|
||||
results = request.dbsession.execute(query).fetchall()
|
||||
return results
|
||||
|
||||
def get_entries_by_id(request, _id):
|
||||
def get_entries_by_id(request, id):
|
||||
# is id a numeber or a string ?
|
||||
# import pdb;pdb.set_trace()
|
||||
if id.isnumeric():
|
||||
query = """SELECT *, strftime('%d/%m/%Y', created) AS create_date,
|
||||
strftime('%d/%m/%Y', edited) AS edit_date FROM entries WHERE id=:id;"""
|
||||
results = request.dbsession.execute(query, {'id':_id}).first()
|
||||
else:
|
||||
query = """SELECT *, strftime('%d/%m/%Y', created) AS create_date,
|
||||
strftime('%d/%m/%Y', edited) AS edit_date FROM entries WHERE url_id=:id;"""
|
||||
results = request.dbsession.execute(query, {'id':id}).first()
|
||||
return results
|
||||
|
||||
def get_entries_count_by_topic(request):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
def includeme(config):
|
||||
config.add_static_view('static', 'static', cache_max_age=3600)
|
||||
config.add_route('home', '/')
|
||||
config.add_route('blog', '/blog/{id:\d+}/{slug}')
|
||||
config.add_route('blog', '/blog/{id}/{slug}')
|
||||
config.add_route('blog_copy', '/blog_copy/{topic}/{id}')
|
||||
config.add_route('blog_edit', '/blog_edit/{topic}/{id}')
|
||||
config.add_route('blog_search', '/blog_search')
|
||||
|
||||
@@ -21,22 +21,24 @@
|
||||
</p>
|
||||
<hr/>
|
||||
{{ body_html | safe }}
|
||||
<hr/>
|
||||
|
||||
<br><br>
|
||||
{% if entry.source_link != '' %}
|
||||
<ul>
|
||||
<li><b>{{ scr_label }}</b> : <a href="{{ entry.source_link }}">{{ entry.source_title }}</a> - {{ entry.source_site }}</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if entry.related %}
|
||||
{% if related != None %}
|
||||
<ul>
|
||||
<li><b>{{ rel_label }}</b> : <a href="{{ request.route_url('blog', id=related.id, slug=related.title) }}">{{ related.title }}</a> - {{ related.author }}</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
{% if request.authenticated_userid %}
|
||||
Topic - Tag : <strong>{{ entry.topic_id }}</strong> - <strong>{{ entry.tag }}</strong><br>
|
||||
Description : <strong>{{ entry.description }}</strong><br>
|
||||
URL id : <strong>{{ entry.url_id }}</strong><br>
|
||||
Type : <strong>{{ entry.content_type }}</strong><br>
|
||||
Language : <strong>{{ entry.language }}</strong><br>
|
||||
Statut : <strong>{{ entry.status }}</strong><br>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Topic : <strong>{{ entry.topic_id }}</strong> - <strong>{{ entry.language }}</strong><br>
|
||||
Topic : <strong>{{ entry.topic_id }}</strong> - <strong>{{ entry.tag }}</strong><br>
|
||||
{% if blog_id != '0' %}
|
||||
Modifié le : <strong>{{ entry.edit_date }}</strong>
|
||||
{% endif %}
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
<!-- COL 2 Music -->
|
||||
<div class="card-body text-center p-3">
|
||||
<h5><a href="/blog/934/bai-hat">Bài hát</a></h5>
|
||||
<h5><a href="/blog/934/bai-hat">Bài hát</a></h5>
|
||||
<h5><a href="/blog/211/tap-nhac">Tập nhạc</a></h5>
|
||||
<h5><a href="/blog/672/cd-va-k7">CD và K7</a></h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -47,6 +47,11 @@
|
||||
<span class="hide-menu">Bài hát </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
<a class="sidebar-link" href="{{ request.route_url('blog', id=211, slug='tap-nhac') }}" aria-expanded="false">
|
||||
<span class="hide-menu">Tập nhạc </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
<a class="sidebar-link" href="{{ request.route_url('topic', topic='art') }}" aria-expanded="false">
|
||||
<span class="hide-menu">Nghệ thuât</span>
|
||||
|
||||
@@ -19,9 +19,12 @@ def blog(request):
|
||||
request.session.flash(u"Page non trouvée : %s" % blog_id, 'warning')
|
||||
return HTTPFound(location=request.route_url('home'))
|
||||
|
||||
if entry.language == 'vn':
|
||||
if entry.language == 'vi':
|
||||
scr_label = 'Nguồn'
|
||||
rel_label = 'Nội dung liên quan'
|
||||
elif entry.language == 'en':
|
||||
scr_label = 'Source'
|
||||
rel_label = 'Related Items'
|
||||
else:
|
||||
scr_label = 'Source'
|
||||
rel_label = 'Contenu corrélé'
|
||||
@@ -41,8 +44,11 @@ def blog(request):
|
||||
body_html = body
|
||||
|
||||
# lire le contenu correle
|
||||
if entry.related != '0':
|
||||
# import pdb; pdb.set_trace()
|
||||
if entry.related != "0":
|
||||
related = get_entries_by_id(request, entry.related)
|
||||
else:
|
||||
related = None
|
||||
|
||||
return {
|
||||
'page_title': entry.title,
|
||||
|
||||
Reference in New Issue
Block a user