replace google search by internal search
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="input-group 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>
|
<button class="btn btn-primary" type="submit" name="form.submitted">Rechercher</button>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Titre</th>
|
<th>Titre</th>
|
||||||
<th>Tags</th>
|
<th>Topic</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -37,7 +37,10 @@
|
|||||||
{{ entry.title }}
|
{{ entry.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</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>
|
<td>{{ entry.edit_date }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -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/simplebar.js')}}"></script>
|
||||||
<script src="{{request.static_url('cao_sunyata:static/js/sidebarmenu.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>
|
<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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -233,9 +230,18 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<!-- Search blog input -->
|
||||||
{% if request.path != '/blog_search' %}
|
{% if request.path != '/blog_search' %}
|
||||||
<div class="gcse-search"></div>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- display page content-->
|
<!-- display page content-->
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>No content</p>
|
<p>No content</p>
|
||||||
|
|||||||
@@ -187,13 +187,15 @@ def blog_edit(request):
|
|||||||
|
|
||||||
@view_config(route_name='blog_search', renderer='../templates/blog_search.jinja2')
|
@view_config(route_name='blog_search', renderer='../templates/blog_search.jinja2')
|
||||||
def blog_search(request):
|
def blog_search(request):
|
||||||
|
if 'criteria' in request.params :
|
||||||
|
criteria = request.params['criteria']
|
||||||
|
else:
|
||||||
|
items = []
|
||||||
criteria = ''
|
criteria = ''
|
||||||
|
|
||||||
items = []
|
if 'form.submitted' in request.params or criteria:
|
||||||
if 'form.submitted' in request.params:
|
# criteria = request.params['criteria']
|
||||||
criteria = request.params['criteria']
|
# si afficher tous les fiches trouves ?
|
||||||
# si afficher tous les fiches ?
|
|
||||||
items = get_entries_by_criteria(request, criteria)
|
items = get_entries_by_criteria(request, criteria)
|
||||||
|
|
||||||
if 'form.replace' in request.params:
|
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')
|
request.session.flash("Le changement a été effectué avec succès !", 'success')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': "Recherche interne",
|
'page_title': "Recherche",
|
||||||
'items': items,
|
'items': items,
|
||||||
'criteria': criteria,
|
'criteria': criteria,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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> %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
|
||||||
|
|
||||||
@@ -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> %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
|
||||||
|
|
||||||
@@ -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> %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
|
||||||
|
|
||||||
@@ -3,7 +3,15 @@ Lister tous les noms de fichier d'un dossier
|
|||||||
Formater pour les affichier dans une liste
|
Formater pour les affichier dans une liste
|
||||||
"""
|
"""
|
||||||
import os
|
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
|
# Chemin du répertoire que vous souhaitez explorer
|
||||||
collection = 'S3-TiengHatGiuaTroi'
|
collection = 'S3-TiengHatGiuaTroi'
|
||||||
@@ -19,11 +27,15 @@ n = 0
|
|||||||
|
|
||||||
for filename in sorted_items:
|
for filename in sorted_items:
|
||||||
if filename != '.DS_Store':
|
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('.')
|
w = filename.split('.')
|
||||||
s = w[0] + '. ' + w[1].replace('_',' ')+ '.' + w[2]
|
s = w[0] + '. ' + w[1].replace('_',' ')+ '.' + w[2]
|
||||||
title = ' '.join(elem.capitalize() for elem in s.split())
|
title = ' '.join(elem.capitalize() for elem in s.split())
|
||||||
ligne = '<p class="fs-4 ps-4">'
|
ligne = '<p class="fs-4 ps-4">'
|
||||||
ligne += '<a href="https://media.meditation-sunyata.paris/TuyenTapNiSu/%s/%s"><span><i class="ti ti-volume fs-6"></i> %s</a></p>' % (collection, filename, title)
|
ligne += '<a href="https://media.meditation-sunyata.paris/%s/%s"><span><i class="ti ti-volume fs-6"></i> %s</a> (%s)</p>' % (collection, filename, title, duration)
|
||||||
print(ligne)
|
print(ligne)
|
||||||
n += 1
|
n += 1
|
||||||
|
|
||||||
@@ -31,3 +43,12 @@ print("<br>")
|
|||||||
|
|
||||||
print('Total %s ' % n)
|
print('Total %s ' % n)
|
||||||
|
|
||||||
|
|
||||||
|
def mutagen_length(path):
|
||||||
|
try:
|
||||||
|
audio = MP3(path)
|
||||||
|
length = audio.info.length
|
||||||
|
return length
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -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> %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
|
||||||
|
|
||||||
Reference in New Issue
Block a user