Compare commits

..

3 Commits

Author SHA1 Message Date
phuoc d67484ecac replace google search by internal search 2026-10-10 12:03:48 +02:00
phuoc 8f69a2bb8a fixed missing quote 2026-09-19 18:31:29 +02:00
phuoc 1a8ef2facf removed phapthoai.jinja2 2026-09-19 18:24:38 +02:00
12 changed files with 301 additions and 45 deletions
-1
View File
@@ -11,7 +11,6 @@ def includeme(config):
config.add_route('login', '/login')
config.add_route('logout', '/logout')
config.add_route('maintenance', '/maintenance')
config.add_route('phapthoai', '/phapthoai')
config.add_route('related_edit', '/related_edit/{topic}/{id}/{id_related}')
config.add_route('settings', '/settings')
config.add_route('stats_pages', '/stats_pages')
+6 -3
View File
@@ -9,7 +9,7 @@
<div class="mb-3">
<div class="input-group mb-3">
<input type="text" class="form-control" name="criteria">
<input type="text" class="form-control" name="criteria" value="{{ criteria }}"">
<button class="btn btn-primary" type="submit" name="form.submitted">Rechercher</button>
</div>
<!--
@@ -24,7 +24,7 @@
<thead>
<tr>
<th>Titre</th>
<th>Tags</th>
<th>Topic</th>
<th>Date</th>
<th></th>
</tr>
@@ -37,7 +37,10 @@
{{ entry.title }}
</a>
</td>
<td>{{ entry.tag }}</td>
<td>
<a href="{{ request.route_url('topic', topic=entry.topic_id) }}">
{{ entry.topic_id }} - {{ entry.tag }}
</td>
<td>{{ entry.edit_date }}</td>
</tr>
{% endfor %}
+3
View File
@@ -167,6 +167,9 @@
<span class="menu-item">
<a href="{{ request.route_url('topic', topic='tu_tap') }}">[ Tu tập ]</a>&nbsp;
</span>
<span class="menu-item">
<a href="{{ request.route_url('topic', topic='phapthoai') }}">[ Pháp thoại ]</a>&nbsp;
</span>
<span class="menu-item">
<a href="{{ request.route_url('topic', topic='qigong') }}">[ Khí Công ]</a>&nbsp;
</span>
+12 -6
View File
@@ -15,9 +15,6 @@
<script src="{{request.static_url('cao_sunyata:static/js/simplebar.js')}}"></script>
<script src="{{request.static_url('cao_sunyata:static/js/sidebarmenu.js')}}"></script>
<script src="{{request.static_url('cao_sunyata:static/js/app.min.js')}}"></script>
<!-- moteur de recherche Google -->
<script async src="https://cse.google.com/cse.js?cx=b1b21623144614306">
</script>
</head>
<body>
@@ -85,7 +82,7 @@
</a>
</li>
<li class="sidebar-item">
<a class="sidebar-link" href="{{ request.route_url('phapthoai') }}" aria-expanded="false">
<a class="sidebar-link" href="{{ request.route_url('topic', topic='phapthoai') }}" aria-expanded="false">
<span><i class="ti ti-microphone fs-6"></i></span>
<span class="hide-menu">Pháp thoại</span>
</a>
@@ -233,9 +230,18 @@
{% endfor %}
</p>
{%if request.path != '/blog_search'%}
<div class="gcse-search"></div>
<!-- Search blog input -->
{% if request.path != '/blog_search' %}
<form id="search-form" class="form-horizontal" role="form" action="/blog_search" method="post">
<div class="mb-3">
<div class="input-group mb-3">
<input type="text" class="form-control" name="criteria">
<button class="btn btn-primary" type="submit" name="form.submitted">Rechercher</button>
</div>
</div>
</form>
{% endif %}
<!-- display page content-->
{% block content %}
<p>No content</p>
-21
View File
@@ -1,21 +0,0 @@
{% extends "layout.jinja2" %}
{% block content %}
<div class="card mb-0">
<div class="card-body">
<ul>
<li><a href="static/TuyenTapNiSu/01-GIA_TỘC_&_TIEN_TRINH_TU_CUA_DUC_PHAT_THICH_CA.mp3">01. Gia Tộc & Tien Trinh Tu Cua Duc Phat Thich Ca.mp3</a></li>
<li><a href="static/TuyenTapNiSu/02-TIẾN_TRÌNH_CHỨNG_NGỘ_BA_MINH.mp3">02. Tiến Trình Chứng Ngộ Ba Minh.mp3</a></li>
<li><a href="static/TuyenTapNiSu/03-TIẾN_TRÌNH_CHỨNG_NGỘ_LÝ_DUYÊN_KHỞI.mp3">03. Tiến Trình Chứng Ngộ Lý Duyên Khởi.mp3</a></li>
<li><a href="static/TuyenTapNiSu/04-VÀI_ĐẶC_ĐIỂM_CỦA_ĐỨC_PHẬT_THÍCH_CA_&_GIÁO_PHÁP.mp3">04. Vài Đặc Điểm Của Đức Phật Thích Ca & Giáo Pháp.mp3</a></li>
<li><a href="static/TuyenTapNiSu/05-KHÁI_QUÁT_VỀ_TÂM.mp3">05. Khái Quát Về Tâm.mp3</a></li>
<li><a href="static/TuyenTapNiSu/06-NGUỒN_GỐC_CỦA_KHỔ.mp3">06. Nguồn Gốc Của Khổ.mp3</a></li>
<li><a href="static/TuyenTapNiSu/07-LẬU_HOẶC.mp3">07. Lậu Hoặc.mp3</a></li>
<li><a href="static/TuyenTapNiSu/08-HAI_SẮC_THÁI_TÂM.mp3">08. Hai Sắc Thái Tâm.mp3</a></li>
<li><a href="static/TuyenTapNiSu/09-NHẤT_DẠ_HIỀN_GIẢ.mp3">09. Nhất Dạ Hiền Giả.mp3</a></li>
<li><a href="static/TuyenTapNiSu/10-TIẾN_TRÌNH_THÀNH_LẬP_TÂM.mp3">10. Tiến Trình Thành Lập Tâm.mp3</a></li>
</ul>
</div>
</div>
{% endblock %}
+9 -13
View File
@@ -187,13 +187,15 @@ def blog_edit(request):
@view_config(route_name='blog_search', renderer='../templates/blog_search.jinja2')
def blog_search(request):
criteria = ''
items = []
if 'form.submitted' in request.params:
if 'criteria' in request.params :
criteria = request.params['criteria']
# si afficher tous les fiches ?
else:
items = []
criteria = ''
if 'form.submitted' in request.params or criteria:
# criteria = request.params['criteria']
# si afficher tous les fiches trouves ?
items = get_entries_by_criteria(request, criteria)
if 'form.replace' in request.params:
@@ -201,7 +203,7 @@ def blog_search(request):
request.session.flash("Le changement a été effectué avec succès !", 'success')
return {
'page_title': "Recherche interne",
'page_title': "Recherche",
'items': items,
'criteria': criteria,
}
@@ -365,9 +367,3 @@ def maintenance(request):
'page_title': "Maintenance de BD",
}
@view_config(route_name='phapthoai', renderer='../templates/phapthoai.jinja2')
def phapthoai(request):
return {
'page_title': "Tuyển tập pháp thoại",
}
+54
View File
@@ -0,0 +1,54 @@
"""
Lister tous les noms de fichier d'un dossier
Formater pour les affichier dans une liste
"""
import os
from mutagen.mp3 import MP3
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
# Chemin du répertoire que vous souhaitez explorer
collection = 'khoa-thien'
chemin = '/Users/phuoc/pyramid/cao_sunyata_media/TuyenTapNiSu/' + collection
# Obtenir la liste de tous les fichiers et dossiers
items = os.listdir(chemin)
sorted_items = sorted(items)
# Afficher le contenu
print("<br>")
n = 0
for filename in sorted_items:
if filename != '.DS_Store':
# get duration of mp3 file
length = mutagen_length(chemin + '/' + filename)
duration = str(int(length/60)) + ':' + str(int(length%60))
w = filename.split('-')
s = w[0] + '. ' + w[1].replace('_',' ')
title = ' '.join(elem.capitalize() for elem in s.split())
ligne = '<p class="fs-4 ps-4">'
ligne += '<a href="https://media.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a> (%s)</p>' % (collection, filename, title, duration)
print(ligne)
n += 1
print("<br>")
print('Total %s ' % n)
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
+54
View File
@@ -0,0 +1,54 @@
"""
Lister tous les noms de fichier d'un dossier
Formater pour les affichier dans une liste
"""
import os
from mutagen.mp3 import MP3
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
# Chemin du répertoire que vous souhaitez explorer
collection = 'S2-SuoiNguonHanhPhuc'
chemin = '/Users/phuoc/pyramid/cao_sunyata_media/TuyenTapNiSu/' + collection
# Obtenir la liste de tous les fichiers et dossiers
items = os.listdir(chemin)
sorted_items = sorted(items)
# Afficher le contenu
print("<br>")
n = 0
for filename in sorted_items:
if filename != '.DS_Store':
# get duration of mp3 file
length = mutagen_length(chemin + '/' + filename)
duration = str(int(length/60)) + ':' + str(int(length%60))
w = filename.split('.')
s = w[0] + '. ' + w[1].replace('_',' ')+ '.' + w[2]
title = ' '.join(elem.capitalize() for elem in s.split())
ligne = '<p class="fs-4 ps-4">'
ligne += '<a href="https://media.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a> (%s)</p>' % (collection, filename, title, duration)
print(ligne)
n += 1
print("<br>")
print('Total %s ' % n)
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
+54
View File
@@ -0,0 +1,54 @@
"""
Lister tous les noms de fichier d'un dossier
Formater pour les affichier dans une liste
"""
import os
from mutagen.mp3 import MP3
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
# Chemin du répertoire que vous souhaitez explorer
collection = 'S1-TamTinhVoiNhau'
chemin = '/Users/phuoc/pyramid/cao_sunyata_media/TuyenTapNiSu/' + collection
# Obtenir la liste de tous les fichiers et dossiers
items = os.listdir(chemin)
sorted_items = sorted(items)
# Afficher le contenu
print("<br>")
n = 0
for filename in sorted_items:
if filename != '.DS_Store':
# get duration of mp3 file
length = mutagen_length(chemin + '/' + filename)
duration = str(int(length/60)) + ':' + str(int(length%60))
w = filename.split('.')
s = w[0] + '. ' + w[1].replace('_',' ')+ '.' + w[2]
title = ' '.join(elem.capitalize() for elem in s.split())
ligne = '<p class="fs-4 ps-4">'
ligne += '<a href="https://media.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a> (%s)</p>' % (collection, filename, title, duration)
print(ligne)
n += 1
print("<br>")
print('Total %s ' % n)
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
+54
View File
@@ -0,0 +1,54 @@
"""
Lister tous les noms de fichier d'un dossier
Formater pour les affichier dans une liste
"""
import os
from mutagen.mp3 import MP3
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
# Chemin du répertoire que vous souhaitez explorer
collection = 'S3-TiengHatGiuaTroi'
chemin = '/Users/phuoc/pyramid/cao_sunyata_media/TuyenTapNiSu/' + collection
# Obtenir la liste de tous les fichiers et dossiers
items = os.listdir(chemin)
sorted_items = sorted(items)
# Afficher le contenu
print("<br>")
n = 0
for filename in sorted_items:
if filename != '.DS_Store':
# get duration of mp3 file
length = mutagen_length(chemin + '/' + filename)
duration = str(int(length/60)) + ':' + str(int(length%60))
w = filename.split('.')
s = w[0] + '. ' + w[1].replace('_',' ')+ '.' + w[2]
title = ' '.join(elem.capitalize() for elem in s.split())
ligne = '<p class="fs-4 ps-4">'
ligne += '<a href="https://media.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a> (%s)</p>' % (collection, filename, title, duration)
print(ligne)
n += 1
print("<br>")
print('Total %s ' % n)
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
+54
View File
@@ -0,0 +1,54 @@
"""
Lister tous les noms de fichier d'un dossier
Formater pour les affichier dans une liste
"""
import os
from mutagen.mp3 import MP3
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
# Chemin du répertoire que vous souhaitez explorer
collection = 'phapthoai-2025'
chemin = '/Users/phuoc/pyramid/cao_sunyata_media/TuyenTapNiSu/' + collection
# Obtenir la liste de tous les fichiers et dossiers
items = os.listdir(chemin)
sorted_items = sorted(items)
# Afficher le contenu
print("<br>")
n = 0
for filename in sorted_items:
if filename != '.DS_Store':
# get duration of mp3 file
length = mutagen_length(chemin + '/' + filename)
duration = str(int(length/60)) + ':' + str(int(length%60))
w = filename.split('-')
s = w[0] + '. ' + w[1].replace('_',' ')
title = ' '.join(elem.capitalize() for elem in s.split())
ligne = '<p class="fs-4 ps-4">'
ligne += '<a href="https://mp3.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a> (%s)</p>' % (collection, filename, title, duration)
print(ligne)
n += 1
print("<br>")
print('Total %s ' % n)
def mutagen_length(path):
try:
audio = MP3(path)
length = audio.info.length
return length
except:
return None
+1 -1
View File
@@ -24,7 +24,7 @@ for filename in sorted_items:
title = ' '.join(elem.capitalize() for elem in s.split())
title_corrige = unicodedata.normalize('NFD', title)
ligne = '<p class="fs-4 ps-4">'
ligne += '<a href="https://media.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a></p>' % (collection, filename, title_corrige)
ligne += '<a href="https://media.meditation-sunyata.paris/TuyenTapNiSu/%s/%s"><span><i class="ti ti-volume fs-6"></i>&nbsp;&nbsp;&nbsp;%s</a></p>' % (collection, filename, title_corrige)
print(ligne)
n += 1