DAAP_interface/templates/selfpublishedindex.html

81 lines
2.3 KiB
HTML
Raw Normal View History

2020-09-26 18:10:28 +02:00
{% extends "layout.html" %}
{% block content %}
<div id="selfpublishedindex-all">
<div class="pagetitle" id="selfpublishedindex-title">INDEX OF SELF-PUBLISHED WORKS</div>
<div id="selfpublishedindex-grid">
2020-09-26 18:10:28 +02:00
{% for x in results['results']['bindings']%}
<div class="selfpublishedindex-items">
<div class="selfpublishedindex-items-top">
{% if "image" in x %}
<a href='/artwork?id={{ x["work"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="selfpublishedindex-imgs" src='{{ x["image"]["value"] | replace("wiki/File:","wiki/Special:Redirect/file/") }}'>
</a> <br>
{% else %}
<a href='/artwork?id={{ x["work"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
<img class="selfpublishedindex-imgs" src="{{ url_for('static', filename='/imgs/Icons/placeholder_no-image2.png') }}"><br>
</a>
{% endif %}
</div>
<div class="selfpublishedindex-items-bottom">
<a class="title" href='/artwork?id={{ x["work"]["value"] | replace("http://daap.bannerrepeater.org/entity/", "") }}'>
{{ x["workLabel"]["value"]}}
</a> <br>
<span class="date">
{% if "date" in x %}
{{ x["date"]["value"] | replace("T00:00:00Z", "") }}
</span>
{% endif %}
</div>
</div>
2020-09-26 18:10:28 +02:00
{% endfor %}
</div>
2020-09-26 18:10:28 +02:00
<div id="selfpublishedindex-pagination">
<ul id="selfpublishedindex-pagin">
</ul>
</div>
2020-09-26 18:10:28 +02:00
<script type="text/javascript">
//Pagination
2020-11-15 22:03:49 +01:00
pageSize = 24;
2020-09-26 18:10:28 +02:00
var pageCount = $(".selfpublishedindex-items").length / pageSize;
for(var i = 0 ; i<pageCount;i++){
$("#selfpublishedindex-pagin").append('<li><a href="#">'+(i+1)+'</a></li> ');
}
$("#selfpublishedindex-pagin li").first().addClass("current")
showPage = function(page) {
$(".selfpublishedindex-items").hide();
$(".selfpublishedindex-items").each(function(n) {
if (n >= pageSize * (page - 1) && n < pageSize * page)
$(this).show();
});
}
showPage(1);
$("#selfpublishedindex-pagin li").click(function() {
$("#selfpublishedindex-pagin li").removeClass("current");
$(this).addClass("current");
showPage(parseInt($(this).text()))
2020-09-26 18:10:28 +02:00
});
2020-09-26 18:10:28 +02:00
</script>
</div>
{% endblock content %}
2020-09-26 18:10:28 +02:00