Browse Source

support button + new categories

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

60
daapinterface.py

@ -131,6 +131,66 @@ def browsebycategory():
# CATEGORIES TO BE BROWSED # 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 ######################### ARTIST INDEX
@app.route("/artistsindex") @app.route("/artistsindex")

3
static/css/style.css

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

3
templates/browsebycategory.html

@ -4,6 +4,9 @@
<div class="pagetitle" id="browseby-title">BROWSE BY</div> <div class="pagetitle" id="browseby-title">BROWSE BY</div>
<div id="browsebycategory-listcategories"> <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('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('publishersindex') }}">BROWSE BY PUBLISHER</a></div>
<div class="browsebycategory-categories primary-button"><a href="{{ url_for('selfpublishedindex') }}">BROWSE ALL SELF-PUBLISHED</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 %} {% block content %}
<div id="browsethearchive-all"> <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"> <div id="browsethearchive-grid">

29
templates/layout.html

@ -39,18 +39,19 @@
<a href="{{ url_for('home') }}">DAAP</a> <a href="{{ url_for('home') }}">DAAP</a>
</div> </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"> <div class="browsebycategory-categories primary-button primary-button" style="
<p>WEBSITE IN DEVELOPMENT</p> padding: 12px 50px;
</div> --> ">
<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> <a id="mobtop" class="mobile-nav-icon mob-menu-icon" onclick="showMenu('navigationmobile'); toggleMenu();"></a>
</div> </div>
@ -66,13 +67,7 @@
<div id="nav-tutorials"><a href="{{ url_for('tutorials') }}">Tutorials</a></div> <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-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> <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> </div>
</div> </div>

Loading…
Cancel
Save