Commit 1d8245e8 authored by Jakob Schmidt's avatar Jakob Schmidt
Browse files

Einfache Sortierungsmöglichkeit in der Briefübersicht #8

parent 14f89a99
* {
margin: 0;
padding: 0;
......@@ -12,7 +14,7 @@ body {
}
.text{
line-height: 2;
line-height: 2;
margin:1em;
display:none;
}
......@@ -72,7 +74,6 @@ line-height: 2;
min-height:30px;
margin:0;
}
.pagination {
......@@ -89,6 +90,11 @@ dt {
font-size:12px;
}
filter{
color:#3e3f3a;
}
/****/
.panel-title a{
font-size:12px;
......@@ -159,11 +165,7 @@ padding-right:0;
height:60px;
}
h1{
margin:0;
display:inline;
}
#headerDiv
......@@ -215,7 +217,7 @@ a img {
border: none;
}
/*UEBERSCHRIFTEN*/
/*UEBERSCHRIFTEN
h1{
text-transform:uppercase;
color:#484848;
......@@ -223,15 +225,20 @@ h1{
font-size:14px;
margin-top: 10px;
width:450px;
}
}*/
h1{
font-size:24px;
font-family: 'Roboto', sans-serif;
}
h2{
text-transform:uppercase;
/*color:#009999;*/
font-weight:normal;
font-size:14px;
margin-top: 30px;
margin-bottom: 15px;
color:#93c54b;
display:inline;
margin:0;
}
h3
{
......@@ -240,6 +247,10 @@ h3
font-weight:normal;
font-size:12px;
}
h4.list-group-item-heading{
color:#93c54b!important;
}
h3.ergebnisSuche
{
text-indent:15px;
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0"
version="2.0" xpath-default-namespace="http://www.tei-c.org/ns/1.0"
exclude-result-prefixes="#all">
<xsl:output indent="yes" method="html" encoding="UTF-8" exclude-result-prefixes="#all"/>
<!-- alle Vorkommnisse von @ref mit #l am Anfang (außer unter "history"), sortiert nach @ref -->
......@@ -14,7 +14,7 @@
<xsl:key name="pbs" match="*[@facs]" use="substring-before(@facs, '_')"/>
<xsl:variable name="pathlist">
<xsl:text>../../text/letters?select=*.xml;recurse=yes;on-error=warning</xsl:text>
<xsl:text>../../text/letters?select=*.xml;recurse=yes;on-error=warning</xsl:text>
</xsl:variable>
<xsl:variable name="docs" select="collection($pathlist)"/>
......@@ -35,6 +35,7 @@
<!-- CUSTOM CSS-->
<link rel="stylesheet" href="../css/toggle-switch.css"/>
<link rel="stylesheet" href="../css/style.css"/>
</head>
<body>
......@@ -89,45 +90,55 @@
<!-- /.container-fluid -->
</nav>
<div class="container">
<div class="container well" style="padding:10px;">
<ul class="breadcrumb">
<li>
<a href="#">Start</a>
<span class="divider"/>
</li>
<li class="active">
Briefe
</li>
<li class="active"> Briefe </li>
</ul>
<h1>Liste aller Briefe:</h1>
<div class="list-group">
<xsl:for-each select="$docs [(contains(., 'nb'))]"> //filtern der nb-Einträge
<xsl:sort
select="(tokenize(substring-before(base-uri(.), '.xml'), '/'))[last()]"/>
<xsl:variable name="cur_doc" select="."/>
<xsl:variable name="file"
select="(tokenize(substring-before(base-uri(.), '.xml'), '/'))[last()]"/>
<a href="{$file}.html" class="list-group-item">
<h4 class="list-group-item-heading">
<xsl:value-of select="$file"/>
</h4>
<xsl:if test="$cur_doc//*[local-name() = 'titleStmt']/*[local-name() = 'title']">
<p class="list-group-item-text"><xsl:value-of
select="$cur_doc//*[local-name() = 'titleStmt']/*[local-name() = 'title']"
/></p></xsl:if>
</a>
<!-- Seite <xsl:for-each select="key('pbs', $file)">
<h1>Liste aller Briefe</h1>
<form role="form">
<div class="form-group">
<input id="searchinput" class="form-control" type="search"
placeholder="Suche... (z.B. nach Titel, Datum oder Ort)"/>
</div>
<div id="searchlist" class="list-group">
<xsl:for-each select="$docs[(contains(., 'nb'))]">
<xsl:sort
select="(tokenize(substring-before(base-uri(.), '.xml'), '/'))[last()]"/>
<xsl:variable name="cur_doc" select="."/>
<xsl:variable name="file"
select="(tokenize(substring-before(base-uri(.), '.xml'), '/'))[last()]"/>
<a href="{$file}.html" class="list-group-item">
<filter>
<h4 class="list-group-item-heading">
<xsl:value-of select="$file"/>
</h4>
<xsl:if
test="$cur_doc//*[local-name() = 'titleStmt']/*[local-name() = 'title']">
<p class="list-group-item-text">
<span>
<xsl:value-of
select="$cur_doc//*[local-name() = 'titleStmt']/*[local-name() = 'title']"
/>
</span>
</p>
</xsl:if>
</filter>
</a>
<!-- Seite <xsl:for-each select="key('pbs', $file)">
<xsl:sort select="number(@n)"/>
<xsl:variable name="cur_pb_n" select="@n"/>
für jedes erste Vorkommen eines @ref, zu dem der gerade aktuelle pb der erste vorherige pb ist
für jedes erste Vorkommen eines @ref, zu dem der gerade aktuelle pb der erste vorherige pb ist
<xsl:for-each
select="key('occ', '#l0029')[preceding::*[local-name() = 'pb'][1]/@n = $cur_pb_n][1]">
<a href="{$file}.html#{$cur_pb_n}"><xsl:value-of select="$cur_pb_n"
......@@ -137,10 +148,22 @@
</xsl:for-each>
</xsl:for-each>
</div>
</form>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"/>
<script type="text/javascript" src="../js/bootstrap-list-filter.min.js"/>
<script>
$('#searchlist').btsListFilter('#searchinput', {
itemChild: 'filter',
initial: false});
</script>
</body>
</html>
</xsl:template>
......
/*
* bootstrap-list-filter v0.3.2 - 2016-05-25
*
* Copyright 2016 Stefano Cudini
* stefano.cudini@gmail.com
* http://labs.easyblog.it/
*
* Licensed under the MIT license.
*
* Demos:
* http://labs.easyblog.it/bootstrap-list-filter/
*
* Source:
* git@github.com:stefanocudini/bootstrap-list-filter.git
*
*/
!function(a){a.fn.btsListFilter=function(b,c){"use strict";function d(a,b){return a.replace(/\{ *([\w_]+) *\}/g,function(a,c){return b[c]||""})}function e(b,d){d=d&&d.replace(new RegExp("[({[^.$*+?\\]})]","g"),"");var e=a(b).text(),f=c.initial?"^":"",g=new RegExp(f+d,c.casesensitive?"":"i");return g.test(e)}function f(a,b){var c;return b=b||300,function(){var d=this,e=arguments;clearTimeout(c),c=setTimeout(function(){a.apply(d,Array.prototype.slice.call(e))},b)}}var g,h,i=this,j=a(this),k=a(b),l=j;return c=a.extend({delay:300,minLength:1,initial:!0,casesensitive:!1,eventKey:"keyup",resetOnBlur:!0,sourceData:null,sourceTmpl:'<a class="list-group-item" href="#"><span>{title}</span></a>',sourceNode:function(a){return d(c.sourceTmpl,a)},emptyNode:function(a){return'<a class="list-group-item well" href="#"><span>No Results</span></a>'},cancelNode:function(){return'<span class="btn glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>'},loadingClass:"bts-loading-list",itemClassTmp:"bts-dynamic-item",itemEl:".list-group-item",itemChild:null,itemFilter:e},c),i.reset=function(){k.val("").trigger(c.eventKey)},a.isFunction(c.cancelNode)&&(g=a(c.cancelNode.call(i)).hide(),k.after(g),k.parents(".form-group").addClass("has-feedback"),k.prev().is(".control-label")||g.css({top:0}),g.css({"pointer-events":"auto"}),g.on("click",i.reset)),k.on(c.eventKey,f(function(b){var d=a(this).val();c.itemEl&&(l=j.find(c.itemEl)),c.itemChild&&(l=l.find(c.itemChild));var e=l.filter(function(){return c.itemFilter.call(i,this,d)}),f=l.not(e);c.itemChild&&(e=e.parents(c.itemEl),f=f.parents(c.itemEl).hide()),""!==d&&d.length>=c.minLength?(e.show(),f.hide(),g.show(),"function"===a.type(c.sourceData)?(e.hide(),f.hide(),h&&(a.isFunction(h.abort)?h.abort():a.isFunction(h.stop)&&h.stop()),j.addClass(c.loadingClass),h=c.sourceData.call(i,d,function(b){if(h=null,e.hide(),f.hide(),j.find("."+c.itemClassTmp).remove(),b&&0!==b.length)for(var g in b)a(c.sourceNode.call(i,b[g])).addClass(c.itemClassTmp).appendTo(j);else a(c.emptyNode.call(i,d)).addClass(c.itemClassTmp).appendTo(j);j.removeClass(c.loadingClass)})):(j.find("."+c.itemClassTmp).remove(),0===e.length&&a(c.emptyNode.call(i,d)).addClass(c.itemClassTmp).appendTo(j))):(e.show(),f.show(),g.hide(),j.find("."+c.itemClassTmp).remove())},c.delay)),c.resetOnBlur&&k.on("blur",function(a){i.reset()}),j}}(jQuery);
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment