Browse Source

template item for person org and collective

master
jules 3 years ago
parent
commit
0890a7514a
  1. 392
      daapinterface.py
  2. 4
      templates/artistsindex.html
  3. 4
      templates/artwork.html
  4. 563
      templates/item.html
  5. 4
      templates/publishersindex.html
  6. 9
      templates/searchtools.html
  7. 2
      templates/tutorials.html

392
daapinterface.py

@ -221,7 +221,7 @@ def zinesindex():
''')
sparql.setReturnFormat(JSON)
results = sparql.query().convert()
print(results)
# print(results)
return render_template('zinesindex.html', results=results)
@ -264,7 +264,7 @@ def artwork():
sparql.setReturnFormat(JSON)
artworkimages = sparql.query().convert()
print(artworkimages)
# print(artworkimages)
# Links and downloads
sparql.setQuery('''
@ -545,51 +545,156 @@ def artwork():
######################### CONTRIBUTOR : PERSON - ORGANISATION
@app.route("/contributor", methods=['GET'])
def contributor():
contributor_id = request.args.get('id')
@app.route("/item", methods=['GET'])
def item():
item_id = request.args.get('id')
# Intro
sparql.setQuery('''
SELECT ?item ?itemLabel ?itemDescription ?itemtypeLabel
{
VALUES ?item {wd:'''+contributor_id+'''}
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P1 ?itemtype.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
contributorintro = sparql.query().convert()
# print("person intro")
# print(contributorintro)
# print("==========")
itemintro = sparql.query().convert()
# image
sparql.setQuery('''
SELECT ?image ?depictsLabel ?licenseLabel
WHERE
{
VALUES ?item {wd:'''+contributor_id+'''}
?item wdt:P30 ?image.
OPTIONAL { ?work p:P30 ?statement2.
?statement2 ps:P30 ?image;
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P90 ?image.
OPTIONAL { ?work p:P90 ?statement2.
?statement2 ps:P90 ?image;
pq:P54 ?depicts;
pq:P56 ?license.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en".}
}
''')
sparql.setReturnFormat(JSON)
contributorimage = sparql.query().convert()
# print(contributorimage)
# print("==========")
itemimage = sparql.query().convert()
# official website
sparql.setQuery('''
SELECT ?website
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P61 ?website.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
itemwebsite = sparql.query().convert()
# wikidata id
sparql.setQuery('''
SELECT ?WikidataID
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P3 ?WikidataID.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
itemwikidataID = sparql.query().convert()
# viaf ID
sparql.setQuery('''
SELECT ?VIAFID
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P80 ?VIAFID.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
itemviafID = sparql.query().convert()
# PERSON gender
# for test:Q82}
sparql.setQuery('''
SELECT ?genderLabel
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P86 ?gender.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
persongender = sparql.query().convert()
# PERSON pronouns
sparql.setQuery('''
SELECT ?pronounLabel
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P85 ?pronoun.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
personpronouns = sparql.query().convert()
# ORGANISATION location
sparql.setQuery('''
SELECT ?locationLabel
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P83 ?location.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
orglocation = sparql.query().convert()
# ORGANISATION country
sparql.setQuery('''
SELECT ?countryLabel
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P84 ?country.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
orgcountry = sparql.query().convert()
# COLLECTIVE MEMBERS
# for test:Q309}
sparql.setQuery('''
SELECT ?members ?membersLabel
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P74 ?members.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
collectivemembers = sparql.query().convert()
# biography
# PERSON biography
sparql.setQuery('''
SELECT ?accessURLbioPage ?authorBioPageLabel ?dateBioPage ?sourceBioPageLabel
WHERE
{
VALUES ?item {wd:'''+contributor_id+'''}
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P67 ?bioPage.
OPTIONAL { ?bioPage wdt:P4 ?accessURLbioPage. }
OPTIONAL { ?bioPage wdt:P9 ?authorBioPage. }
@ -599,17 +704,57 @@ def contributor():
}
''')
sparql.setReturnFormat(JSON)
contributorbiography = sparql.query().convert()
personbiography = sparql.query().convert()
for x in contributorbiography['results']['bindings']:
for x in personbiography['results']['bindings']:
if "accessURLbioPage" in x:
accessURLbioURL = x["accessURLbioPage"]["value"]
desc_url = re.search(r':Q(.*)', accessURLbioURL, re.DOTALL)
desc_id=desc_url.group(1)
# # get the description content from wiki
contributorbiocontenturl = "https://daap.bannerrepeater.org/w/index.php?title=Biography:Q"+desc_id+"&action=render"
personbiocontenturl = "https://daap.bannerrepeater.org/w/index.php?title=Biography:Q"+desc_id+"&action=render"
# # Make a GET request to fetch the raw HTML content
html_content = requests.get(personbiocontenturl).text
# # Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# # print(soup.prettify()) # print the parsed data of html
text=soup.find("div" , {"class" : "mw-parser-output"})
# text=soup.find_all("p")
# text=Markup(text)
# artworkdescriptiontext.append(text)
x["text"] = text
else:
# print("url for description absent")
text="<p>Information not available</p>"
x["text"] = text
# COLLECTIVE AND INSTITUTION DESCRIPTION
sparql.setQuery('''
SELECT ?accessURLdescriptionPage ?authordescriptionPageLabel ?datedescriptionPage ?sourcedescriptionPageLabel
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?item wdt:P65 ?descriptionPage.
OPTIONAL { ?descriptionPage wdt:P4 ?accessURLdescriptionPage. }
OPTIONAL { ?descriptionPage wdt:P9 ?authordescriptionPage. }
OPTIONAL { ?descriptionPage wdt:P13 ?datedescriptionPage. }
OPTIONAL { ?descriptionPage wdt:P50 ?sourcedescriptionPage. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
''')
sparql.setReturnFormat(JSON)
colorgdescription = sparql.query().convert()
for x in colorgdescription['results']['bindings']:
if "accessURLdescriptionPage" in x:
accessURLdescURL = x["accessURLdescriptionPage"]["value"]
desc_url = re.search(r':Q(.*)', accessURLdescURL, re.DOTALL)
desc_id=desc_url.group(1)
# # get the description content from wiki
itemdesccontenturl = "https://daap.bannerrepeater.org/w/index.php?title=Description:Q"+desc_id+"&action=render"
# # Make a GET request to fetch the raw HTML content
html_content = requests.get(contributorbiocontenturl).text
html_content = requests.get(itemdesccontenturl).text
# # Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# # print(soup.prettify()) # print the parsed data of html
@ -632,7 +777,7 @@ def contributor():
SELECT ?Works ?WorksLabel (SAMPLE(?dateWorks) AS ?dateWorks)
WHERE
{
VALUES ?item {wd:'''+contributor_id+'''}
VALUES ?item {wd:'''+item_id+'''}
?Works wdt:P1 wd:Q1;
wdt:P9 ?item;
wdt:P13 ?dateWorks.
@ -646,10 +791,10 @@ def contributor():
SELECT ?Works ?WorksLabel (SAMPLE(?image) AS ?image)
WHERE
{
VALUES ?item {wd:'''+contributor_id+'''}
VALUES ?item {wd:'''+item_id+'''}
?Works wdt:P1 wd:Q1;
wdt:P9 ?item.
OPTIONAL {?Works wdt:P30 ?image.}
OPTIONAL {?Works wdt:P90 ?image.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?Works ?WorksLabel
@ -658,9 +803,8 @@ def contributor():
}
''')
sparql.setReturnFormat(JSON)
contributor_creatorof = sparql.query().convert()
# print(contributor_creatorof)
# print("==========")
item_creatorof = sparql.query().convert()
# publisher of
sparql.setQuery('''
@ -670,7 +814,7 @@ def contributor():
SELECT ?Works ?WorksLabel (SAMPLE(?dateWorks) AS ?dateWorks)
WHERE
{
VALUES ?item {wd:'''+contributor_id+'''}
VALUES ?item {wd:'''+item_id+'''}
?Works wdt:P1 wd:Q1;
wdt:P10 ?item;
wdt:P13 ?dateWorks.
@ -684,10 +828,10 @@ def contributor():
SELECT ?Works ?WorksLabel (SAMPLE(?image) AS ?image)
WHERE
{
VALUES ?item {wd:'''+contributor_id+'''}
VALUES ?item {wd:'''+item_id+'''}
?Works wdt:P1 wd:Q1;
wdt:P10 ?item.
OPTIONAL {?Works wdt:P30 ?image.}
OPTIONAL {?Works wdt:P90 ?image.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?Works ?WorksLabel
@ -696,16 +840,47 @@ def contributor():
}
''')
sparql.setReturnFormat(JSON)
contributor_publisherof = sparql.query().convert()
# print(contributor_publisherof)
# print("============")
item_publisherof = sparql.query().convert()
# commissioned
sparql.setQuery('''
SELECT ?Works ?WorksLabel ?image ?dateWorks
WHERE {
{
SELECT ?Works ?WorksLabel (SAMPLE(?dateWorks) AS ?dateWorks)
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?Works wdt:P1 wd:Q1;
wdt:P14 ?item;
wdt:P13 ?dateWorks.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?Works ?WorksLabel
ORDER BY ?WorksLabel
}
{
SELECT ?Works ?WorksLabel (SAMPLE(?image) AS ?image)
WHERE
{
VALUES ?item {wd:'''+item_id+'''}
?Works wdt:P1 wd:Q1;
wdt:P14 ?item.
OPTIONAL {?Works wdt:P90 ?image.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?Works ?WorksLabel
ORDER BY ?WorksLabel
}
}
''')
sparql.setReturnFormat(JSON)
item_commissioned = sparql.query().convert()
contributor_url = ""
contributor_name = "the name"
contributor_description = "short bio"
return render_template("contributor.html", contributor_id=contributor_id, contributor_creatorof=contributor_creatorof, contributor_publisherof=contributor_publisherof, contributorintro=contributorintro, contributorimage=contributorimage, contributorbiography=contributorbiography)
return render_template("item.html", item_id=item_id, item_creatorof=item_creatorof, itemwebsite=itemwebsite, itemwikidataID=itemwikidataID, itemviafID=itemviafID, item_publisherof=item_publisherof, item_commissioned=item_commissioned, itemintro=itemintro, itemimage=itemimage, personbiography=personbiography, persongender=persongender, personpronouns=personpronouns, collectivemembers=collectivemembers, orglocation=orglocation, orgcountry=orgcountry, colorgdescription=colorgdescription)
######################### ORGANISATION
@ -719,10 +894,6 @@ def organisation():
# PAGES FROM WIKI
#########################
######################### SEARCH TOOLS
@app.route("/searchtools")
def searchtools():
return render_template('searchtools.html')
######################### ABOUT
@app.route("/about")
@ -750,20 +921,6 @@ def about():
text=Markup(text)
return render_template('about.html', text=text)
######################### TUTORIAL
@app.route("/tutorials")
def tutorials():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorials&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html')
######################### UPLOAD
@app.route("/upload")
@ -814,6 +971,127 @@ def codeofconduct():
return render_template('codeofconduct.html', text=text)
# #################### SEARCH TOOLS
@app.route("/searchtools")
def searchtools():
url="https://daap.bannerrepeater.org/w/index.php?title=Search_Tools&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('searchtools.html', text=text)
######################### TUTORIAL
@app.route("/tutorials")
def tutorials():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorials&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### TUTORIAL 1
@app.route("/tutorial_1")
def tutorial_1():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorial_1&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### TUTORIAL 2
@app.route("/tutorial_2")
def tutorial_2():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorial_2&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### TUTORIAL 3
@app.route("/tutorial_3")
def tutorial_3():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorial_3&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### TUTORIAL 4
@app.route("/tutorial_4")
def tutorial_4():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorial_4&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### TUTORIAL 5
@app.route("/tutorial_5")
def tutorial_5():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorial_5&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### TUTORIAL 6
@app.route("/tutorial_6")
def tutorial_6():
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorial_6&action=render"
# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text
# Parse the html content
soup = BeautifulSoup(html_content, "lxml")
# print(soup.prettify()) # print the parsed data of html
text=soup.find("html")
text=Markup(text)
return render_template('tutorials.html', text=text)
######################### LOGIN

4
templates/artistsindex.html

@ -15,8 +15,8 @@
<tbody>
{% for x in results['results']['bindings']%}
<tr>
<th class="idnumber"><a href="contributor?id={{ x['creators']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x['creators']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}</a></th>
<th class="label"><a href="contributor?id={{ x['creators']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x["creatorsLabel"]['value'] }}</a></th>
<th class="idnumber"><a href="item?id={{ x['creators']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x['creators']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}</a></th>
<th class="label"><a href="item?id={{ x['creators']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x["creatorsLabel"]['value'] }}</a></th>
<th class="altaliases">
{% if "creatorsAltLabel" in x %}
{{ x["creatorsAltLabel"]["value"] }}

4
templates/artwork.html

@ -197,7 +197,7 @@
{% for x in artworkcontributors['results']['bindings'] %}
<!-- name surname -->
<div class="metadata-link">
<a href='/contributor?id={{ x["creators"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<a href='/item?id={{ x["creators"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<span>{{ x['creatorsLabel']['value'] }}</span>
</a>
<!-- role/function -->
@ -243,7 +243,7 @@
<!-- name, surname -->
<div class="metadata-link artwork-rightcolumn-top-publishers-item">
{% if 'publishersLabel' in x %}
<a href='/contributor?id={{ x["publishers"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'><span>{{ x['publishersLabel']['value'] }}</span></a>
<a href='/item?id={{ x["publishers"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'><span>{{ x['publishersLabel']['value'] }}</span></a>
{% endif %}
<!-- role -->
{% if 'role' in x %}

563
templates/item.html

@ -0,0 +1,563 @@
{% extends "layout.html" %}
{% block content %}
<!-- START OF BLOCK -->
<div>
<!-- ITEM TITLE AND SHORT INTRO FOR ALL-->
<div>
<!-- TITLE label in rectangle -->
<!-- switch label depending on label -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
<div class="artwork-box">
<span>{{ x['itemtypeLabel']['value'] }}</span>
</div>
{% else %}
<div class="artwork-box">
<span>UNKNOWN</span>
</div>
{% endif %}
<!-- Item name -->
<div class="artwork-title">
{{ x['itemLabel']['value'] }}
</div>
<!-- ITEM intro-description -->
<div class="artwork-intro">
{% if 'itemDescription' in x %}
{{ x['itemDescription']['value'] }}
{% endif %}
</div>
{% endfor %}
</div>
<!-- END TITLE SHORT INTRO OF ITEM-->
<!-- ########################### -->
<!-- BLOCK IMAGE/DATA AND BIO -->
<!-- ############################ -->
<div class="artwork-about">
<!-- LEFT COLUMN IDENTITAL FOR ALL ITEMS-->
<div class="artwork-leftcolumn">
<!-- ITEM IMAGES -->
<div class="my-slider">
{% if itemimage['results']['bindings']==[] %}
<img src="{{ url_for('static', filename='/imgs/Icons/placeholder_no-image2.png') }}">
{% else %}
{% for x in itemimage['results']['bindings'] %}
<div class="item">
<!-- START GROUP IMG + LABELS -->
{% if "image" in x %}
<img src='{{ x["image"]["value"] | replace("wiki/File:","wiki/Special:Redirect/file/") }}'>
<!-- copyright and front or back -->
{% endif %}
{% if "depictsLabel" in x %}
<p>{{ x['depictsLabel']['value'] }}</p>
{% endif %}
{% if "licenseLabel" in x %}
<p>License: {{ x['licenseLabel']['value'] }}</p>
{% endif %}
<!-- END GROUP IMG + LABELS -->
</div>
{% endfor %}
{% endif %}
</div>
<!-- END CONTRIBUTOR IMAGES -->
</div>
<!-- end of left column, which has only images actually -->
<!-- RIGHT COLUMN -->
<div class="artwork-rightcolumn">
<!-- ##################### -->
<!-- RIGHT TOP : DATA SECTION SECTION -->
<!-- ##################### -->
<div class="artwork-rightcolumn-top">
<!-- div for right top left -->
<div class="artwork-rightcolumn-top-contributors">
<!-- THE DATA FOR PERSON -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if x['itemtypeLabel']['value'] == 'contributor' %}
<!-- person gender -->
<p class="label-item">GENDER</p>
{% if persongender['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
{% for x in persongender['results']['bindings'] %}
<span>
{{ x['genderLabel']['value'] }}
</span>
{% endfor %}
{% endif %}
<!-- end person gender -->
<!-- person pronouns -->
<p class="label-item">PREFERRED PRONOUNS</p>
{% if personpronouns['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
{% for x in personpronouns['results']['bindings'] %}
<span>
{{ x['pronounLabel']['value'] }}
</span>
{% endfor %}
{% endif %}
<!-- end personpronouns -->
<!-- official website -->
<p class="label-item">OFFICIAL WEBSITE</p>
{% if itemwebsite['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in itemwebsite['results']['bindings'] %}
<div class="metadata-link">
<a target="_blank" href="{{ x['website']['value'] }}">
<span>{{ x['website']['value'] }}</span>
</a>
</div>
{% endfor %}
{% endif %}
<!-- end official website -->
{% endif %}
{% endif %}
{% endfor %}
<!-- END OF DATA FOR PERSON -->
<!-- THE DATA FOR INSTITUTION -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if x['itemtypeLabel']['value'] == 'organisation' %}
<!-- location -->
<p class="label-item">LOCATION</p>
{% if orglocation['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in orglocation['results']['bindings'] %}
<span>{{ x['locationLabel']['value'] }}</span>
{% endfor %}
{% endif %}
<!-- end location -->
<!-- country -->
<p class="label-item">COUNTRY</p>
{% if orgcountry['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in orgcountry['results']['bindings'] %}
<span>{{ x['countryLabel']['value'] }}</span>
{% endfor %}
{% endif %}
<!-- end country -->
<!-- official website -->
<p class="label-item">OFFICIAL WEBSITE</p>
{% if itemwebsite['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in itemwebsite['results']['bindings'] %}
<!-- name surname -->
<div class="metadata-link">
<a target="_blank" href="{{ x['website']['value'] }}">
<span>{{ x['website']['value'] }}</span>
</a>
</div>
{% endfor %}
{% endif %}
<!-- end official website -->
{% endif %}
{% endif %}
{% endfor %}
<!-- END OF DATA FOR INSTITUTION -->
<!-- THE DATA FOR COLLECTIVE -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if x['itemtypeLabel']['value'] == 'collective' %}
<!-- collective members -->
<p class="label-item">MEMBERS</p>
{% if collectivemembers['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in collectivemembers['results']['bindings'] %}
<!-- name surname -->
<div class="metadata-link">
<a target="_blank" href="item?id={{ x['members']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">
<span>{{ x['membersLabel']['value'] }}</span>
</a>
</div>
{% endfor %}
{% endif %}
<!-- end collective members -->
<!-- official website -->
<p class="label-item">OFFICIAL WEBSITE</p>
{% if itemwebsite['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in itemwebsite['results']['bindings'] %}
<!-- name surname -->
<div class="metadata-link">
<a target="_blank" href="{{ x['website']['value'] }}">
<span>{{ x['website']['value'] }}</span>
</a>
</div>
{% endfor %}
{% endif %}
<!-- end official website -->
{% endif %}
{% endif %}
{% endfor %}
<!-- END OF DATA FOR COLLECTIVE -->
</div>
<!-- IDENTIFIERS FOR PERSON INSTITUTION AND COLLECTIVE -->
<div class="artwork-rightcolumn-top-date">
<p>Identifiers in other databases</p>
<!-- WIKIDATA ID -->
<p class="label-item">WIKIDATA ID</p>
{% if itemwikidataID['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in itemwikidataID['results']['bindings'] %}
<!-- name surname -->
<div class="metadata-link">
<a target="_blank" href="{{ x['WikidataID']['value'] }}">
<span>{{ x['WikidataID']['value'] }}</span>
</a>
</div>
{% endfor %}
{% endif %}
<!-- end WIKIDATA ID -->
<!-- VIAFID -->
<p class="label-item">VIAFID</p>
{% if itemviafID['results']['bindings']==[] %}
<div>information not available</div>
{% else %}
<!-- else loop through available data -->
{% for x in itemviafID['results']['bindings'] %}
<!-- name surname -->
<div class="metadata-link">
<a target="_blank" href="{{ x['VIAFID']['value'] }}">
<span>{{ x['VIAFID']['value'] }}</span>
</a>
</div>
{% endfor %}
{% endif %}
<!-- end VIAFID -->
</div>
<!-- END IDENTIFIERS FOR PERSON INSTITUTION AND COLLECTIVE -->
</div>
<!-- ##################### -->
<!-- EN OF RIGHT TOP -->
<!-- ##################### -->
<!-- ##################### -->
<!-- RIGHT BOTTOM : BIO/DESCRIPTION SECTION -->
<!-- ##################### -->
<!-- IF LABEL IS PERSON add biography -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if x['itemtypeLabel']['value'] == 'contributor' %}
<div class="des-exh-section">
<p class="label-item des">BIOGRAPHY</p>
{% if personbiography['results']['bindings']==[] %}
<p>information not available</p>
<p><a href="">Log in to add the biography text</a></p>
{% else %}
<!-- For loop -->
{% for x in personbiography['results']['bindings'] %}
<div class="artwork-rightcolumn-bottom">
<!-- left part with the description text already coming in a div from wiki-->
<div class="text-description">
{{ x["text"] | safe }}
</div>
</div>
{% endfor %}
{% endif %}
</div>
{% endif %}
{% endif %}
{% endfor %}
<!-- end of PERSON biography -->
<!-- IF LABEL IS ORGANISATION OR COLLECTIVE add description -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if (x['itemtypeLabel']['value'] == 'organisation') or (x['itemtypeLabel']['value'] == 'collective') %}
<div class="des-exh-section">
<p class="label-item des">DESCRIPTION</p>
{% if colorgdescription['results']['bindings']==[] %}
<p>information not available</p>
<p><a href="">Log in to add the description text</a><p>
{% else %}
<!-- For loop -->
{% for x in colorgdescription['results']['bindings'] %}
<div class="artwork-rightcolumn-bottom">
<!-- left part with the description text already coming in a div from wiki-->
<div class="text-description">
{{ x["text"] | safe }}
</div>
</div>
{% endfor %}
{% endif %}
</div>
{% endif %}
{% endif %}
{% endfor %}
<!-- end of description -->
<!-- ##################### -->
<!-- END OF RIGHT BOTTOM -->
<!-- ##################### -->
</div>
<!-- END OF RIGHT COLUMN -->
</div>
<!-- ########################### -->
<!-- END OF BLOCK IMAGE/DATA AND BIO -->
<!-- ############################ -->
<!-- ---------------------------------------------------------------------- -->
<!-- ########################### -->
<!-- START COMMISSIONED PUBLISHER CREATOR OF -->
<!-- ############################ -->
<!-- COLLECTIVE AND PERSON : CREATOR OF -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if (x['itemtypeLabel']['value'] == 'contributor') or (x['itemtypeLabel']['value'] == 'collective') %}
<div class="artwork-relatedwrapper">
<div class="Heading_C">Creator of</div>
<!-- all the works if any-->
{% for x in item_creatorof['results']['bindings'] %}
<div class="artwork-relatedworks">
<!-- image -->
<div class="artwork-relatedworks-img-div">
{% if "image" in x %}
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="artwork-relatedworks-imgs" src='{{ x["image"]["value"] | replace("wiki/File:","wiki/Special:Redirect/file/") }}'>
</a>
<br>
{% else %}
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="artwork-relatedworks-imgs" src="{{ url_for('static', filename='/imgs/Icons/placeholder_no-image2.png') }}">
</a>
<br>
{% endif %}
</div>
<!-- title -->
<div class="artwork-relatedworks-tile">
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>{{ x["WorksLabel"]["value"]}}</a>
</div>
<!-- year -->
<div class="artwork-relatedworks-date">
{% if "dateWorks" in x %}
{{ x["dateWorks"]["value"] | replace("T00:00:00Z", "") }}
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endfor %}
<!-- END CREATOR OF -->
<!-- INSTITUTION : COMMISSIONED -->
{% for x in itemintro['results']['bindings'] %}
{% if 'itemtypeLabel' in x %}
{% if x['itemtypeLabel']['value'] == 'organisation' %}
<div class="artwork-relatedwrapper">
<div class="Heading_C">Commissioned</div>
<!-- all the works if any-->
{% for x in item_commissioned['results']['bindings'] %}
<div class="artwork-relatedworks">
<!-- image -->
<div class="artwork-relatedworks-img-div">
{% if "image" in x %}
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="artwork-relatedworks-imgs" src='{{ x["image"]["value"] | replace("wiki/File:","wiki/Special:Redirect/file/") }}'>
</a>
<br>
{% else %}
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="artwork-relatedworks-imgs" src="{{ url_for('static', filename='/imgs/Icons/placeholder_no-image2.png') }}">
</a>
<br>
{% endif %}
</div>
<!-- title -->
<div class="artwork-relatedworks-tile">
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>{{ x["WorksLabel"]["value"]}}</a>
</div>
<!-- year -->
<div class="artwork-relatedworks-date">
{% if "dateWorks" in x %}
{{ x["dateWorks"]["value"] | replace("T00:00:00Z", "") }}
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endfor %}
<!-- END COMMISSIONED -->
<!-- COLLECTIVE + INSTITUTION + PERSON : PUBLISHER OF -->
<div class="artwork-relatedwrapper">
<div class="Heading_C">Publisher of</div>
<!-- all the works if any-->
{% for x in item_publisherof['results']['bindings'] %}
<div class="artwork-relatedworks">
<!-- image -->
<div class="artwork-relatedworks-img-div">
{% if "image" in x %}
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="artwork-relatedworks-imgs" src='{{ x["image"]["value"] | replace("wiki/File:","wiki/Special:Redirect/file/") }}'>
</a>
<br>
{% else %}
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="artwork-relatedworks-imgs" src="{{ url_for('static', filename='/imgs/Icons/placeholder_no-image2.png') }}">
</a>
<br>
{% endif %}
</div>
<!-- title -->
<div class="artwork-relatedworks-tile">
<a href='/artwork?id={{ x["Works"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>{{ x["WorksLabel"]["value"]}}</a>
</div>
<!-- year -->
<div class="artwork-relatedworks-date">
{% if "dateWorks" in x %}
{{ x["dateWorks"]["value"] | replace("T00:00:00Z", "") }}
{% endif %}
</div>
</div>
{% endfor %}
</div>
<!-- END PUBLISHER OF -->
</div>
<!-- END OF OVERALL BLOCK -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js"></script>
<script type="text/javascript">
var slider = tns({
container: '.my-slider',
items: 1,
responsive: {
640: {
edgePadding: 20,
gutter: 20,
items: 1
},
700: {
gutter: 30
},
900: {
items: 1
}
}
});
</script>
{% endblock content %}

4
templates/publishersindex.html

@ -15,8 +15,8 @@
<tbody>
{% for x in results['results']['bindings']%}
<tr>
<th class="idnumber"><a href="contributor?id={{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}</a></th>
<th class="label"><a href="contributor?id={{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x["publishersLabel"]['value'] }}</a></th>
<th class="idnumber"><a href="item?id={{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}</a></th>
<th class="label"><a href="item?id={{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }}">{{ x["publishersLabel"]['value'] }}</a></th>
<th class="altaliases">
{% if "publishersAltLabel" in x %}
{{ x["publishersAltLabel"]["value"] }}

9
templates/searchtools.html

@ -1,6 +1,13 @@
{% extends "layout.html" %}
{% block content %}
<p class="soon">Coming soon...</p>
{{ text }}
<style type="text/css">
div#toc{
display: none
}
</style>
{% endblock content %}

2
templates/tutorials.html

@ -10,6 +10,4 @@
}
</style>
<p class="soon">Coming soon...</p>
{% endblock content %}
Loading…
Cancel
Save