diff --git a/__pycache__/daapinterface.cpython-37.pyc b/__pycache__/daapinterface.cpython-37.pyc new file mode 100644 index 0000000..47794fc Binary files /dev/null and b/__pycache__/daapinterface.cpython-37.pyc differ diff --git a/daapinterface.py b/daapinterface.py index 4ad0efc..133ef13 100644 --- a/daapinterface.py +++ b/daapinterface.py @@ -31,22 +31,46 @@ sparql3 = SPARQLWrapper("https://query.daap.bannerrepeater.org/proxy/wdqs/bigdat @app.route("/") def home(): # this doesn't show any results yet because I just added the data and I guess the query builder needs to be reloaded again, but the query code should work correctly. + # sparql.setQuery(''' + # SELECT ?work ?workLabel ?image ?date ?dateadded + # WHERE { + # SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } + # ?work wdt:P1 wd:Q1; + # wdt:P87 ?dateadded. + # OPTIONAL { ?work wdt:P30 ?image. } + # OPTIONAL { ?work wdt:P13 ?date. } + # FILTER(?work != wd:Q57) + # } + # ORDER BY (?dateadded) + # LIMIT 24 + # ''') + # sparql.setReturnFormat(JSON) + # results = sparql.query().convert() + # return render_template('home.html', results=results) sparql.setQuery(''' - SELECT ?work ?workLabel ?image ?date ?dateadded - WHERE { - SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } - ?work wdt:P1 wd:Q1; - wdt:P87 ?dateadded. - OPTIONAL { ?work wdt:P30 ?image. } - OPTIONAL { ?work wdt:P13 ?date. } - FILTER(?work != wd:Q57) - } - ORDER BY (?dateadded) - LIMIT 24 + SELECT ?work ?workLabel ?image ?date WHERE { + SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } + ?work wdt:P1 wd:Q1. + OPTIONAL { ?work p:P30 ?statement. + ?statement ps:P30 ?image; + pq:P54 wd:Q90.} + OPTIONAL { ?work wdt:P13 ?date. } + FILTER(?work != wd:Q57) +} +ORDER BY (?workLabel) ''') sparql.setReturnFormat(JSON) results = sparql.query().convert() - return render_template('home.html', results=results) + # print(results) + for publication in results["results"]["bindings"]: + publication_title = publication["workLabel"]["value"] + publication_uri = publication["work"]["value"] + #if key exists + if "date" in publication: + publication_date = publication["date"]["value"] + if "image" in publication: + publication_image = publication["image"]["value"] + return render_template('browsethearchive.html', results=results) @app.route("/browsethearchive") diff --git a/static/css/style.css b/static/css/style.css index 790a9ed..59f5b74 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -155,11 +155,11 @@ div#footer-title-socials{ grid-area: 1 / 3 / 2 / 4; } -div#footer-title-subscribe{ +div#footer-title-contact{ grid-area: 1 / 4 / 2 / 5; } -div#footer-title-br p, div#footer-title-others p, div#footer-title-subscribe p, div#footer-title-socials p{ +div#footer-title-br p, div#footer-title-others p, div#footer-title-contact p, div#footer-title-socials p{ text-transform: uppercase; font-family: 'Roboto Condensed', sans-serif; color:#7f7f7f; @@ -200,10 +200,23 @@ div#footer-socials-links a{ font-family: 'Roboto Condensed', sans-serif; } -div#footer-subscribe{ +div#footer-contact{ grid-area: 2 / 4 / 3 / 5; padding-top: 5%; - +} +div#contactform{ + background-color: #1B42D8; + width: 250px; + height: 55px; + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; +} +div#footer-contact a{ + text-decoration: none; + color: #FFFFFF; + font-weight: bold; } @@ -253,9 +266,15 @@ input.submitemail{ /*Titles all pages*/ -div#home-recent-title, div#browsethearchive-title, div#artistsindex-title, div#publishersindex-title, div#selfpublishedindex-title, div#zinesindex-title{ +/*div#home-recent-title, div#browsethearchive-title, div#artistsindex-title, div#publishersindex-title, div#selfpublishedindex-title, div#zinesindex-title, */ +div.pagetitle{ margin-top: 60px; margin-bottom: 30px; + font-size: 25px; + font-family: 'Roboto Condensed', sans-serif; + font-weight: bold; + text-transform: uppercase; + margin-left: 81px; } /******************************************************/ @@ -298,12 +317,6 @@ tbody tr th.description{ font-size: 16px; } -/* Titles */ -div#artistsindex-title, div#publishersindex-title, div#selfpublishedindex, div#zinesindex-title{ - font-weight: bold; - font-size: 25px; - font-family: 'Roboto Condensed', sans-serif; -} /************ RECENTLY ADDED + HOME ************/ @@ -317,15 +330,7 @@ div#home-top-div{ border:blue solid 1px; } -/*Recent stuff*/ -div#home-recent-title{ - font-size: 25px; - font-family: 'Roboto Condensed', sans-serif; - font-weight: bold; - max-width: 90%; - margin: 0 auto; - padding-left: 20px; -} + img.home-recent-imgs{ /*max-height: 200px;*/ width: 200px; @@ -389,11 +394,7 @@ img.browsethearchive-imgs{ width: 200px; } -div#browsethearchive-title{ - font-size: 25px; - font-family: 'Roboto Condensed', sans-serif; - font-weight: bold; -} + div.browsethearchive-items{ display: inline-block; @@ -530,16 +531,20 @@ img.person_creatorof-imgs{ /************ ABOUT ************/ -div#about-intro{ - text-align: center; - padding-top: 5em; -} -div#about-intro h3, div#about-intro p { - text-align: center; - width: 50%; - margin: auto; +div#about-content{ + padding-left: 81px; + padding-right: 81px; + } +div#about-content-top{ +} +div#about-content-top-left{ + +} +div#about-content-top-right{ + +} /************ TUTORIALS ************/ div#tutorials-intro{ diff --git a/static/imgs/Pages/mockup_page_artwork-min.jpg b/static/imgs/Pages/mockup_page_artwork-min.jpg new file mode 100644 index 0000000..37b4048 Binary files /dev/null and b/static/imgs/Pages/mockup_page_artwork-min.jpg differ diff --git a/templates/about.html b/templates/about.html index 854adc8..598a92d 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,13 +1,100 @@ {% extends "layout.html" %} {% block content %} -
About page upcoming
-