Browse Source

support button + new categories

master
zeroth 3 years ago
parent
commit
592e150e4b
  1. 60
      daapinterface.py
  2. 5
      static/css/style.css
  3. 3
      templates/browsebycategory.html
  4. 2
      templates/browsethearchive.html
  5. 31
      templates/layout.html

60
daapinterface.py

@ -131,6 +131,66 @@ def browsebycategory():
# CATEGORIES TO BE BROWSED
#########################
######################### OLDEST INDEX
@app.route("/datesindex_asc")
def datesindex_asc():
sparql.setQuery('''
SELECT ?work ?workLabel ?image ?date WHERE {
{
SELECT ?work ?workLabel (SAMPLE(?date) AS ?date)
WHERE
{ ?work wdt:P1 wd:Q1;
wdt:P13 ?date.
FILTER(?work != wd:Q57)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?work ?workLabel
ORDER BY ?workLabel
}
?work wdt:P1 wd:Q1.
OPTIONAL {?work p:P90 ?statement.
?statement ps:P90 ?image;
pq:P54 wd:Q90.}
FILTER(?work != wd:Q57)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ASC(?date)
''')
sparql.setReturnFormat(JSON)
results = sparql.query().convert()
return render_template('oldestindex.html', results=results)
######################### NEWEST INDEX
@app.route("/datesindex_desc")
def datesindex_desc():
sparql.setQuery('''
SELECT ?work ?workLabel ?image ?date WHERE {
{
SELECT ?work ?workLabel (SAMPLE(?date) AS ?date)
WHERE
{ ?work wdt:P1 wd:Q1;
wdt:P13 ?date.
FILTER(?work != wd:Q57)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?work ?workLabel
ORDER BY ?workLabel
}
?work wdt:P1 wd:Q1.
OPTIONAL {?work p:P90 ?statement.
?statement ps:P90 ?image;
pq:P54 wd:Q90.}
FILTER(?work != wd:Q57)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?date)
''')
sparql.setReturnFormat(JSON)
results = sparql.query().convert()
return render_template('newestindex.html', results=results)
######################### ARTIST INDEX
@app.route("/artistsindex")

5
static/css/style.css

@ -2214,10 +2214,11 @@ div#tutorials-intro h3, div#tutorials-intro p {
margin-right: 10px;
}
#header-keyword-search {
display: none;
div#header-top div.primary-button {
display: none;
}
/********** MAIN **********/
#home-top-div > img {

3
templates/browsebycategory.html

@ -4,6 +4,9 @@
<div class="pagetitle" id="browseby-title">BROWSE BY</div>
<div id="browsebycategory-listcategories">
<div class="browsebycategory-categories primary-button"><a href="{{ url_for('datesindex_asc') }}">BROWSE BY DATE FROM OLDEST</a></div>
<div class="browsebycategory-categories primary-button"><a href="{{ url_for('datesindex_desc') }}">BROWSE BY DATE FROM NEWEST</a></div>
<div class="browsebycategory-categories primary-button"><a href="{{ url_for('artistsindex') }}">BROWSE BY CREATOR/CONTRIBUTOR</a></div>
<div class="browsebycategory-categories primary-button"><a href="{{ url_for('publishersindex') }}">BROWSE BY PUBLISHER</a></div>
<div class="browsebycategory-categories primary-button"><a href="{{ url_for('selfpublishedindex') }}">BROWSE ALL SELF-PUBLISHED</a></div>

2
templates/browsethearchive.html

@ -2,7 +2,7 @@
{% block content %}
<div id="browsethearchive-all">
<div class="pagetitle" id="browsethearchive-title">BROWSE THE ARCHIVE</div>
<div class="pagetitle" id="browsethearchive-title">BROWSE THE ARCHIVE FROM A–Z</div>
<div id="browsethearchive-grid">

31
templates/layout.html

@ -39,18 +39,19 @@
<a href="{{ url_for('home') }}">DAAP</a>
</div>
<a id="link-search" href="https://daap.bannerrepeater.org/w/index.php?search=&search=&title=Special%3ASearch&go=Go" >
<div id="header-keyword-search">
<input type="text" id="fname" name="fname" value="" placeholder="Keyword search">
</div>
</a>
<!-- <div class="container" onclick="myFunction(this)">
</div> -->
<!-- <div class="web-dev-placeholder">
<p>WEBSITE IN DEVELOPMENT</p>
</div> -->
<div class="browsebycategory-categories primary-button primary-button" style="
padding: 12px 50px;
">
<a href="/support">SUPPORT THE DAAP
<img src="css/Icons/heart-solid.svg" alt="heart icon and link to donation page" title="Support our work" style="
margin-left: 10px;
margin-bottom: -4px;
width: 22px;
filter: invert(23%) sepia(99%) saturate(2460%) hue-rotate(313deg) brightness(1000%) contrast(108%);
"></a>
</div>
<a id="mobtop" class="mobile-nav-icon mob-menu-icon" onclick="showMenu('navigationmobile'); toggleMenu();"></a>
</div>
@ -66,13 +67,7 @@
<div id="nav-tutorials"><a href="{{ url_for('tutorials') }}">Tutorials</a></div>
<div id="nav-upload"><a href="{{ url_for('upload') }}">Upload</a></div>
<div id="nav-login"><a href="https://daap.bannerrepeater.org/w/index.php?title=Special:UserLogin&returnto=Main+Page">Log in</a></div>
<a id="nav-heart" href="{{ url_for('support') }}">
<img
src="css/Icons/heart-solid.svg"
alt="heart icon and link to donation page"
title="Support our work"
/>
</a>
</div>
</div>
</div>

Loading…
Cancel
Save