|
|
|
@ -72,7 +72,6 @@ def home():
|
|
|
|
bigram, number = trs['prince_code'].split('_')
|
|
|
|
bigram, number = trs['prince_code'].split('_')
|
|
|
|
long_prince_bigram = inverted_prince_bigram(bigram) + '_' + number
|
|
|
|
long_prince_bigram = inverted_prince_bigram(bigram) + '_' + number
|
|
|
|
trs['prince_url'] = prince_name=long_prince_bigram.capitalize()
|
|
|
|
trs['prince_url'] = prince_name=long_prince_bigram.capitalize()
|
|
|
|
|
|
|
|
|
|
|
|
return render_template("plainsearch.html", search=search, actes=transformed_query)
|
|
|
|
return render_template("plainsearch.html", search=search, actes=transformed_query)
|
|
|
|
|
|
|
|
|
|
|
|
return render_template("home.html")
|
|
|
|
return render_template("home.html")
|
|
|
|
@ -142,14 +141,14 @@ def prince_corpus(house=None, prince=None):
|
|
|
|
"analysis": '$analysis',
|
|
|
|
"analysis": '$analysis',
|
|
|
|
"place": "$place.name",
|
|
|
|
"place": "$place.name",
|
|
|
|
"diplo_state": "$diplo_state",
|
|
|
|
"diplo_state": "$diplo_state",
|
|
|
|
"diplo_type": "$diplo_type"
|
|
|
|
"diplo_type": "$diplo_type",
|
|
|
|
|
|
|
|
"image": "$image"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
]))
|
|
|
|
transformed_query = [pr['_id'] for pr in query]
|
|
|
|
transformed_query = [pr['_id'] for pr in query]
|
|
|
|
invert_prince_bigram = {val: key for key, val in prince_bigram.items()}
|
|
|
|
invert_prince_bigram = {val: key for key, val in prince_bigram.items()}
|
|
|
|
|
|
|
|
|
|
|
|
# constructing the dateitem
|
|
|
|
# constructing the dateitem
|
|
|
|
for trs in transformed_query:
|
|
|
|
for trs in transformed_query:
|
|
|
|
trs['dateitem'] = make_timeitem_from_filename(trs['filename'])
|
|
|
|
trs['dateitem'] = make_timeitem_from_filename(trs['filename'])
|
|
|
|
@ -179,7 +178,8 @@ def acte(house=None, prince=None, dateitem=None):
|
|
|
|
#diplo=diplo_t[0].replace("_", " "), state=state[0],
|
|
|
|
#diplo=diplo_t[0].replace("_", " "), state=state[0],
|
|
|
|
output_doc=result.get('xmlcontent'), name_prince=result.get("prince_name"),
|
|
|
|
output_doc=result.get('xmlcontent'), name_prince=result.get("prince_name"),
|
|
|
|
folium=result.get("folium"),
|
|
|
|
folium=result.get("folium"),
|
|
|
|
transcribers=result.get('transcribers'))
|
|
|
|
transcribers=result.get('transcribers'),
|
|
|
|
|
|
|
|
image=result.get('image'))
|
|
|
|
|
|
|
|
|
|
|
|
@main.route("/geolocalisation")
|
|
|
|
@main.route("/geolocalisation")
|
|
|
|
def geolocalisation():
|
|
|
|
def geolocalisation():
|
|
|
|
@ -187,18 +187,17 @@ def geolocalisation():
|
|
|
|
m = folium.Map(location=[46.603354, 1.888334], zoom_start=6)
|
|
|
|
m = folium.Map(location=[46.603354, 1.888334], zoom_start=6)
|
|
|
|
for result in actecol.find():
|
|
|
|
for result in actecol.find():
|
|
|
|
place = result['place']
|
|
|
|
place = result['place']
|
|
|
|
|
|
|
|
name = place['name']
|
|
|
|
|
|
|
|
url = result['url']
|
|
|
|
if place.get('latitude') is not None:
|
|
|
|
if place.get('latitude') is not None:
|
|
|
|
folium.Marker(
|
|
|
|
folium.Marker(
|
|
|
|
location=[place['latitude'], place['longitude']],
|
|
|
|
location=[place['latitude'], place['longitude']],
|
|
|
|
popup=place['name'],
|
|
|
|
popup= f"{name}<br/><a href='{url}' target='_top'>Voir</a>",
|
|
|
|
icon=folium.Icon(color='lightgray', icon="circle", prefix='fa')
|
|
|
|
icon=folium.Icon(color='lightgray', icon="circle", prefix='fa')
|
|
|
|
#icon=folium.Icon(color='lightgray', icon='home', prefix='fa')
|
|
|
|
#icon=folium.Icon(color='lightgray', icon='home', prefix='fa')
|
|
|
|
).add_to(m)
|
|
|
|
).add_to(m)
|
|
|
|
geolocalisation = m._repr_html_()
|
|
|
|
geolocalisation = m._repr_html_()
|
|
|
|
return render_template("map.html", geolocalisation=geolocalisation)
|
|
|
|
return render_template("map.html", geolocalisation=geolocalisation)
|
|
|
|
#geolocalisation = folium_map.find_one()
|
|
|
|
|
|
|
|
#geolocalisation = geolocalisation['globalmap']
|
|
|
|
|
|
|
|
#return render_template("map.html", geolocalisation=geolocalisation)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@main.route("/contact")
|
|
|
|
@main.route("/contact")
|
|
|
|
def contact() -> t.Text:
|
|
|
|
def contact() -> t.Text:
|
|
|
|
|