From b8c1115280c18546364f0aeb1a4192647897e9d2 Mon Sep 17 00:00:00 2001 From: moogdo49 <moogdo49@mi.fu-berlin.de> Date: Wed, 12 Jul 2017 14:07:59 +0200 Subject: [PATCH] =?UTF-8?q?=09ge=C3=A4ndert:=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20Sparql.py=20=09ge=C3=A4ndert:=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20api.py=20=09ge=C3=A4ndert:=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20static/stylesheet.css=20=09?= =?UTF-8?q?ge=C3=A4ndert:=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20temp?= =?UTF-8?q?lates/index.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sparql.py | 9 --------- api.py | 16 ++++++++++++++++ static/stylesheet.css | 30 ++++++++++++++++++++++++++++++ templates/index.html | 3 ++- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/Sparql.py b/Sparql.py index f562f3d..3bcda4e 100644 --- a/Sparql.py +++ b/Sparql.py @@ -32,16 +32,7 @@ def sendSparqlQuery(name): def send(name): print("Bearbeite") print(""" - PREFIX owl: <http://www.w3.org/2002/07/owl#> - PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> - PREFIX dc: <http://purl.org/dc/elements/1.1/> - PREFIX : <http://dbpedia.org/resource/> - PREFIX dbpedia2: <http://dbpedia.org/property/> - PREFIX dbpedia: <http://dbpedia.org/> - PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX dbo: <http://dbpedia.org/ontology/># diff --git a/api.py b/api.py index b6d15d5..e73a3f9 100644 --- a/api.py +++ b/api.py @@ -239,5 +239,21 @@ def filterDatum(datum): return render_template('index.html', objects = merke, searchBool = True, text = text) +@app.route('/detail/<path:bild>', methods=['GET']) +def detail(bild): + text = bild + urlQuery = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/resource/resourceLink/text()) return $x").execute() + actorQuery = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/actor/name/text()) return $x").execute() + birth = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/actor/geburtsjahr/text()) return $x").execute() + death = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/actor/todesjahr/text()) return $x").execute() + place = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/eventPlace/text()) return $x").execute() + mase = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/objectIdentification/displayObjectMeasurements/text()) return $x").execute() + + kunstler = sendSparqlQuery(actorQuery) + kunstlerDict = {"name" : kunstler[0],"geschlecht" : kunstler[1], "geburtsdatum" : kunstler[2],"todesdatum" : kunstler[3],"beschreibung" : kunstler[4]} + merke = {"url" : urlQuery, "actor" : actorQuery, "birth" : birth, "death" : death, "title" : bild, "place" : place, "maße" : mase} + return render_template('detail.html', object = merke, kunstler = kunstlerDict) + + if __name__ == "__main__": app.run(host="0.0.0.0", port=5000, debug=True) \ No newline at end of file diff --git a/static/stylesheet.css b/static/stylesheet.css index 8ac4641..0da6b75 100644 --- a/static/stylesheet.css +++ b/static/stylesheet.css @@ -452,3 +452,33 @@ span.ellipse.clickable { width: 100%; } } + + +/* Detailseite */ +.flex-container { +display: -webkit-flex; +-webkit-flex-flow: row wrap; +flex-flow: row wrap; + text-align: justify; + hyphens: auto; +position: absolute; +} + +.flex-container > * { +padding: 5em; +-webkit-flex: 1 100%; +flex: 1 100%; +margin: 30px; +float: right; +} + +.article { +text-align: left; +} + +.img {background: #eee;} + +@media all and (min-width: 768px) { +.img {text-align:left;-webkit-flex: 1 auto;flex:1 auto;-webkit-order:1;order:1;} +.article {-webkit-flex:5 0px;flex:5 0px;-webkit-order:2;order:2;} +} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 5b7591a..42065c1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -34,7 +34,8 @@ <div class="column"> <figure class="{{ loop.index }}"> {{ loop.index }} - <img src="{{ object.url }}" onclick="openModal();currentSlide({{ loop.index }})" class="hover-shadow" style="width: 350px; height: 260px; padding: 10px;"> + <img src="{{ object.url }}" class="hover-shadow" style="width: 350px; height: 260px; padding: 10px;"> + <a href="{{ url_for('.detail',bild=object.title) }}">Details</a> <!-- Hovereffekt muss überarbeitet werden, IST: Beschriftung ü+berlagert sich zur Zeit --> <figcaption>Künstler: {{ object.actor }} <br> Titel: {{ object.title }} </figcaption> </figure> -- GitLab