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()
|
results = request.dbsession.execute(query).fetchall()
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def get_entries_by_id(request, _id):
|
def get_entries_by_id(request, id):
|
||||||
query = """SELECT *, strftime('%d/%m/%Y', created) AS create_date,
|
# is id a numeber or a string ?
|
||||||
strftime('%d/%m/%Y', edited) AS edit_date FROM entries WHERE id=:id;"""
|
# import pdb;pdb.set_trace()
|
||||||
results = request.dbsession.execute(query, {'id':_id}).first()
|
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;"""
|
||||||
|
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
|
return results
|
||||||
|
|
||||||
def get_entries_count_by_topic(request):
|
def get_entries_count_by_topic(request):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
def includeme(config):
|
def includeme(config):
|
||||||
config.add_static_view('static', 'static', cache_max_age=3600)
|
config.add_static_view('static', 'static', cache_max_age=3600)
|
||||||
config.add_route('home', '/')
|
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_copy', '/blog_copy/{topic}/{id}')
|
||||||
config.add_route('blog_edit', '/blog_edit/{topic}/{id}')
|
config.add_route('blog_edit', '/blog_edit/{topic}/{id}')
|
||||||
config.add_route('blog_search', '/blog_search')
|
config.add_route('blog_search', '/blog_search')
|
||||||
|
|||||||
@@ -21,22 +21,24 @@
|
|||||||
</p>
|
</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
{{ body_html | safe }}
|
{{ body_html | safe }}
|
||||||
<hr/>
|
<br><br>
|
||||||
|
|
||||||
{% if entry.source_link != '' %}
|
{% if entry.source_link != '' %}
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>{{ scr_label }}</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 related != None %}
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>{{ rel_label }}</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 %}
|
||||||
|
<hr/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% if request.authenticated_userid %}
|
{% if request.authenticated_userid %}
|
||||||
Topic - Tag : <strong>{{ entry.topic_id }}</strong> - <strong>{{ entry.tag }}</strong><br>
|
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>
|
Type : <strong>{{ entry.content_type }}</strong><br>
|
||||||
Language : <strong>{{ entry.language }}</strong><br>
|
Language : <strong>{{ entry.language }}</strong><br>
|
||||||
Statut : <strong>{{ entry.status }}</strong><br>
|
Statut : <strong>{{ entry.status }}</strong><br>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<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' %}
|
{% if blog_id != '0' %}
|
||||||
Modifié le : <strong>{{ entry.edit_date }}</strong>
|
Modifié le : <strong>{{ entry.edit_date }}</strong>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
<!-- COL 2 Music -->
|
<!-- COL 2 Music -->
|
||||||
<div class="card-body text-center p-3">
|
<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/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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -47,6 +47,11 @@
|
|||||||
<span class="hide-menu">Bài hát </span>
|
<span class="hide-menu">Bài hát </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</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">
|
<li class="sidebar-item">
|
||||||
<a class="sidebar-link" href="{{ request.route_url('topic', topic='art') }}" aria-expanded="false">
|
<a class="sidebar-link" href="{{ request.route_url('topic', topic='art') }}" aria-expanded="false">
|
||||||
<span class="hide-menu">Nghệ thuât</span>
|
<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')
|
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':
|
if entry.language == 'vi':
|
||||||
scr_label = 'Nguồn'
|
scr_label = 'Nguồn'
|
||||||
rel_label = 'Nội dung liên quan'
|
rel_label = 'Nội dung liên quan'
|
||||||
|
elif entry.language == 'en':
|
||||||
|
scr_label = 'Source'
|
||||||
|
rel_label = 'Related Items'
|
||||||
else:
|
else:
|
||||||
scr_label = 'Source'
|
scr_label = 'Source'
|
||||||
rel_label = 'Contenu corrélé'
|
rel_label = 'Contenu corrélé'
|
||||||
@@ -41,8 +44,11 @@ def blog(request):
|
|||||||
body_html = body
|
body_html = body
|
||||||
|
|
||||||
# lire le contenu correle
|
# 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)
|
related = get_entries_by_id(request, entry.related)
|
||||||
|
else:
|
||||||
|
related = None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': entry.title,
|
'page_title': entry.title,
|
||||||
|
|||||||
Reference in New Issue
Block a user