changed home page
@@ -15,11 +15,11 @@ requires = [
|
|||||||
'pyramid_debugtoolbar',
|
'pyramid_debugtoolbar',
|
||||||
'waitress',
|
'waitress',
|
||||||
'pyramid_mailer',
|
'pyramid_mailer',
|
||||||
'pyramid_retry',
|
# 'pyramid_retry',
|
||||||
'pyramid_tm',
|
'pyramid_tm',
|
||||||
'SQLAlchemy==1.4.54',
|
'SQLAlchemy==1.4.54',
|
||||||
|
'zope.sqlalchemy==2.0', # last version supporting python 3.9
|
||||||
'transaction',
|
'transaction',
|
||||||
'zope.sqlalchemy==2.0',
|
|
||||||
'webhelpers2', # various web building related helpers
|
'webhelpers2', # various web building related helpers
|
||||||
'passlib',
|
'passlib',
|
||||||
'python-magic',
|
'python-magic',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.4
|
||||||
Name: tcs_site
|
Name: tcs_site
|
||||||
Version: 1.0
|
Version: 1.0
|
||||||
Summary: Sunyata meditation Paris website
|
Summary: Sunyata meditation Paris website
|
||||||
@@ -16,22 +16,28 @@ Requires-Dist: pyramid_jinja2
|
|||||||
Requires-Dist: pyramid_debugtoolbar
|
Requires-Dist: pyramid_debugtoolbar
|
||||||
Requires-Dist: waitress
|
Requires-Dist: waitress
|
||||||
Requires-Dist: pyramid_mailer
|
Requires-Dist: pyramid_mailer
|
||||||
Requires-Dist: pyramid_retry
|
|
||||||
Requires-Dist: pyramid_tm
|
Requires-Dist: pyramid_tm
|
||||||
Requires-Dist: SQLAlchemy==1.4.54
|
Requires-Dist: SQLAlchemy==1.4.54
|
||||||
Requires-Dist: transaction
|
|
||||||
Requires-Dist: zope.sqlalchemy==2.0
|
Requires-Dist: zope.sqlalchemy==2.0
|
||||||
|
Requires-Dist: transaction
|
||||||
Requires-Dist: webhelpers2
|
Requires-Dist: webhelpers2
|
||||||
Requires-Dist: passlib
|
Requires-Dist: passlib
|
||||||
Requires-Dist: python-magic
|
Requires-Dist: python-magic
|
||||||
Requires-Dist: Pillow
|
Requires-Dist: Pillow
|
||||||
Requires-Dist: unidecode
|
Requires-Dist: unidecode
|
||||||
Requires-Dist: markdown
|
Requires-Dist: markdown
|
||||||
|
Requires-Dist: docutils
|
||||||
Requires-Dist: urllib3==1.26
|
Requires-Dist: urllib3==1.26
|
||||||
Provides-Extra: testing
|
Provides-Extra: testing
|
||||||
Requires-Dist: WebTest>=1.3.1; extra == "testing"
|
Requires-Dist: WebTest>=1.3.1; extra == "testing"
|
||||||
Requires-Dist: pytest>=3.7.4; extra == "testing"
|
Requires-Dist: pytest>=3.7.4; extra == "testing"
|
||||||
Requires-Dist: pytest-cov; extra == "testing"
|
Requires-Dist: pytest-cov; extra == "testing"
|
||||||
|
Dynamic: classifier
|
||||||
|
Dynamic: description
|
||||||
|
Dynamic: keywords
|
||||||
|
Dynamic: provides-extra
|
||||||
|
Dynamic: requires-dist
|
||||||
|
Dynamic: summary
|
||||||
|
|
||||||
# tcs_site
|
# tcs_site
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,17 @@ pyramid_jinja2
|
|||||||
pyramid_debugtoolbar
|
pyramid_debugtoolbar
|
||||||
waitress
|
waitress
|
||||||
pyramid_mailer
|
pyramid_mailer
|
||||||
pyramid_retry
|
|
||||||
pyramid_tm
|
pyramid_tm
|
||||||
SQLAlchemy==1.4.54
|
SQLAlchemy==1.4.54
|
||||||
transaction
|
|
||||||
zope.sqlalchemy==2.0
|
zope.sqlalchemy==2.0
|
||||||
|
transaction
|
||||||
webhelpers2
|
webhelpers2
|
||||||
passlib
|
passlib
|
||||||
python-magic
|
python-magic
|
||||||
Pillow
|
Pillow
|
||||||
unidecode
|
unidecode
|
||||||
markdown
|
markdown
|
||||||
|
docutils
|
||||||
urllib3==1.26
|
urllib3==1.26
|
||||||
|
|
||||||
[testing]
|
[testing]
|
||||||
|
|||||||
@@ -54,16 +54,6 @@ def get_entries_count_by_topic(request):
|
|||||||
results = request.dbsession.execute(query,).fetchall()
|
results = request.dbsession.execute(query,).fetchall()
|
||||||
return results
|
return results
|
||||||
|
|
||||||
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'"
|
|
||||||
if request.authenticated_userid == None:
|
|
||||||
# if user is anonym, display only published posts
|
|
||||||
query = query + " AND status='publié'"
|
|
||||||
|
|
||||||
query = query + " ORDER BY created DESC LIMIT 15;"
|
|
||||||
results = request.dbsession.execute(query).fetchall()
|
|
||||||
return results
|
|
||||||
|
|
||||||
def get_last_edited(request):
|
def get_last_edited(request):
|
||||||
# gest the last edited posts
|
# gest the last edited posts
|
||||||
|
|||||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -16,9 +16,6 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<p>
|
|
||||||
<strong>{{ entry.author }}</strong> - Publié le <strong>{{ entry.create_date }}</strong><br>
|
|
||||||
</p>
|
|
||||||
<hr/>
|
<hr/>
|
||||||
{{ body_html | safe }}
|
{{ body_html | safe }}
|
||||||
<br><br>
|
<br><br>
|
||||||
@@ -33,6 +30,9 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<hr/>
|
<hr/>
|
||||||
|
<p>
|
||||||
|
<strong>{{ entry.author }}</strong> - Publié le <strong>{{ entry.create_date }}</strong><br>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% if request.authenticated_userid %}
|
{% if request.authenticated_userid %}
|
||||||
|
|||||||
@@ -24,11 +24,14 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label required-field" for="description">Description</label>
|
||||||
|
<textarea class="form-control monospace-font" id="description" name="description" rows="2" cols="35">{{ entry.description }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label required-field" for="body">Corps du texte</label>
|
<label class="form-label required-field" for="body">Corps du texte</label>
|
||||||
<textarea class="form-control monospace-font" id="body" name="body" required rows="20" cols="35">
|
<textarea class="form-control monospace-font" id="body" name="body" required rows="20" cols="35">{{ entry.body }}</textarea>
|
||||||
{{ entry.body }}
|
|
||||||
</textarea>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<p class="text-center"><b>Hội văn hoá Trịnh Công Sơn</b>, <br>hội tụ bạn bè của nhạc sĩ Trịnh Công Sơn từ khắp nơi trên thế giới,<br>
|
<p class="text-center"><b>Hội văn hoá Trịnh Công Sơn</b>, hội tụ bạn bè của nhạc sĩ Trịnh Công Sơn từ khắp nơi trên thế giới,<br>
|
||||||
xây dựng trạm web này với mong muốn trở thành một thư viện toàn diện và nghiêm túc về Trịnh Công Sơn.
|
xây dựng trạm web này với mong muốn trở thành một thư viện toàn diện và nghiêm túc về Trịnh Công Sơn.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,8 +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/211/tap-nhac">Tập nhạc</a></h5>
|
<h5><a href="/section/english/songs-en">Songs</a></h5>
|
||||||
<h5><a href="/blog/672/cd-va-k7">CD và K7</a></h5>
|
<h5><a href="/section/francais/songs-fr">Chansons</a></h5>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,9 +49,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<!-- Container (ALBUMS Section) -->
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="card overflow-hidden hover-img">
|
||||||
|
<div class="position-relative">
|
||||||
|
<img src="{{request.static_url('tcs_site:static/img/home/home_albums.jpg')}}" class="card-img-top">
|
||||||
|
</div>
|
||||||
|
<!-- COL 1 Biography -->
|
||||||
|
<div class="card-body text-center p-3">
|
||||||
|
<h5><a href="/blog/211/tap-nhac">Tập nhạc</a></h5>
|
||||||
|
<h5><a href="/blog/211/tap-nhac">Albums</a></h5>
|
||||||
|
<h5><a href="/blog/211/tap-nhac">Recueils</a></h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="card overflow-hidden hover-img">
|
||||||
|
<div class="position-relative">
|
||||||
|
<img src="https://media.tcs-home.org/songs/TCSVTH-01.jpg" class="card-img-top border border-dark" alt="matdash-img">
|
||||||
|
</div>
|
||||||
|
<!-- COL 2 Music -->
|
||||||
|
<div class="card-body text-center p-3">
|
||||||
|
<h5><a href="/blog/232/nhac-soan-cho-ghita">Nhạc soạn cho ghita</a></h5>
|
||||||
|
<h5><a href="/blog/232/nhac-soan-cho-ghita">Guitar arrangements</a></h5>
|
||||||
|
<h5><a href="/blog/232/nhac-soan-cho-ghita">Arrangements pour guitare</a></h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="card overflow-hidden hover-img">
|
||||||
|
<div class="position-relative">
|
||||||
|
<img src="{{request.static_url('tcs_site:static/img/home/home_art.jpg')}}" class="card-img-top" alt="matdash-img">
|
||||||
|
</div>
|
||||||
|
<!-- COL 3 ART -->
|
||||||
|
<div class="card-body text-center p-3">
|
||||||
|
<h5>Tranh vẽ</h5>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<meta name="keywords" content=" Amis Friends Trinh Cong Son songs albums art biography">
|
<meta name="keywords" content=" Amis Friends Trinh Cong Son songs albums art biography">
|
||||||
<meta name="author" content="Cao Thien Phuoc">
|
<meta name="author" content="Cao Thien Phuoc">
|
||||||
<title>{{page_title}}</title>
|
<title>{{page_title}}</title>
|
||||||
<link rel="shortcut icon" href="{{request.static_url('tcs_site:static/zazen.png')}}">
|
<link rel="shortcut icon" href="{{request.static_url('tcs_site:static/favicon.ico')}}">
|
||||||
<link rel="stylesheet" href="{{request.static_url('tcs_site:static/css/styles.min.css')}}" />
|
<link rel="stylesheet" href="{{request.static_url('tcs_site:static/css/styles.min.css')}}" />
|
||||||
<script src="{{request.static_url('tcs_site:static/js/jquery.min.js')}}"></script>
|
<script src="{{request.static_url('tcs_site:static/js/jquery.min.js')}}"></script>
|
||||||
<script src="{{request.static_url('tcs_site:static/js/bootstrap.bundle.min.js')}}"></script>
|
<script src="{{request.static_url('tcs_site:static/js/bootstrap.bundle.min.js')}}"></script>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<a class="sidebar-link" href="{{ request.route_url('topic', topic='life-music') }}" aria-expanded="false">
|
<a class="sidebar-link" href="{{ request.route_url('topic', topic='life-music') }}" aria-expanded="false">
|
||||||
<span class="hide-menu">Life and music</span>
|
<span class="hide-menu">The artist</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
@@ -86,11 +86,6 @@
|
|||||||
<span class="hide-menu">Songs</span>
|
<span class="hide-menu">Songs</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
|
||||||
<a class="sidebar-link" href="{{ request.route_url('section', topic='english', tag='articles') }}" aria-expanded="false">
|
|
||||||
<span class="hide-menu">Articles</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<a class="sidebar-link" href="/blog/170/about-tcs-association-culturelle" aria-expanded="false">
|
<a class="sidebar-link" href="/blog/170/about-tcs-association-culturelle" aria-expanded="false">
|
||||||
<span class="hide-menu">About</span>
|
<span class="hide-menu">About</span>
|
||||||
@@ -106,7 +101,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<a class="sidebar-link" href="{{ request.route_url('topic', topic='vie-musique') }}" aria-expanded="false">
|
<a class="sidebar-link" href="{{ request.route_url('topic', topic='vie-musique') }}" aria-expanded="false">
|
||||||
<span class="hide-menu">Vie et musique</span>
|
<span class="hide-menu">L'artiste</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
<div class="pt-4">
|
<div class="pt-4">
|
||||||
<h4>Versions des packages</h4>
|
<h4>Versions des packages</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>tcs_site {{ app_version }}</li>
|
|
||||||
<li>Pyramid {{ pyramid_version }}</li>
|
<li>Pyramid {{ pyramid_version }}</li>
|
||||||
<li>Markdown {{ markdown_version }}</li>
|
<li>Markdown {{ markdown_version }}</li>
|
||||||
<li>SQLAlchemy {{ sqlalchemy_version }}</li>
|
<li>SQLAlchemy {{ sqlalchemy_version }}</li>
|
||||||
|
|||||||
@@ -30,9 +30,7 @@
|
|||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label required-field" for="topic_quote">Citation</label>
|
<label class="form-label required-field" for="topic_quote">Citation</label>
|
||||||
<textarea class="form-control monospace-font" id="topic_quote" name="topic_quote" required rows="10" cols="35">
|
<textarea class="form-control monospace-font" id="topic_quote" name="topic_quote" required rows="10" cols="35">{{ entry.topic_quote }}</textarea>
|
||||||
{{ entry.topic_quote }}
|
|
||||||
</textarea>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|||||||
@@ -222,8 +222,8 @@ def section(request):
|
|||||||
for item in items:
|
for item in items:
|
||||||
item_slug = urlify(item.title)
|
item_slug = urlify(item.title)
|
||||||
liste += '<tr>'
|
liste += '<tr>'
|
||||||
liste += '<td><a href="%s">%s</a></td>' % (request.route_url('blog', id=item.id, slug=item_slug), item.title)
|
liste += '<td width="%s"><a href="%s">%s</a></td>' % ('40%', request.route_url('blog', id=item.id, slug=item_slug), item.title)
|
||||||
liste += '<td>%s</td>' % item.description
|
liste += '<td width="%s">%s</td>' % ('60%', item.description)
|
||||||
if item.status != 'publié':
|
if item.status != 'publié':
|
||||||
liste += '<td><span class="label label-danger">%s</span></td>' % item.status
|
liste += '<td><span class="label label-danger">%s</span></td>' % item.status
|
||||||
liste += '</tr>'
|
liste += '</tr>'
|
||||||
|
|||||||
@@ -25,12 +25,9 @@ import transaction
|
|||||||
|
|
||||||
@view_config(route_name='home', renderer='../templates/home.jinja2')
|
@view_config(route_name='home', renderer='../templates/home.jinja2')
|
||||||
def home(request):
|
def home(request):
|
||||||
# get the last created posts
|
|
||||||
last_ten = get_last_created(request)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': "",
|
'page_title': "",
|
||||||
'last_ten': last_ten,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def captcha_validate(response, remote_addr, secret):
|
def captcha_validate(response, remote_addr, secret):
|
||||||
@@ -67,7 +64,7 @@ def settings(request):
|
|||||||
sqlalchemy_version = pkg_resources.get_distribution("sqlalchemy").version
|
sqlalchemy_version = pkg_resources.get_distribution("sqlalchemy").version
|
||||||
sqlite_version = sqlite3.sqlite_version
|
sqlite_version = sqlite3.sqlite_version
|
||||||
python_version = sys.version
|
python_version = sys.version
|
||||||
app_version = pkg_resources.require("tcs_site")[0].version
|
# app_version = pkg_resources.require("tcs_site")[0].version
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': "Paramètres",
|
'page_title': "Paramètres",
|
||||||
@@ -78,7 +75,6 @@ def settings(request):
|
|||||||
'sqlite_version' : sqlite_version,
|
'sqlite_version' : sqlite_version,
|
||||||
'sqlalchemy_version': sqlalchemy_version,
|
'sqlalchemy_version': sqlalchemy_version,
|
||||||
'python_version' : python_version,
|
'python_version' : python_version,
|
||||||
'app_version' : app_version,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||