mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 01:50:07 +00:00
more tweaking to sort...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f1b71c69d8
commit
5bf57405df
@ -2474,7 +2474,7 @@ module.System = {
|
||||
<div>
|
||||
<b>Nested pages:</b><br>
|
||||
<div style="padding-left: 30px">
|
||||
<macro src="./*" join="<br>" else="@slot(nested)">
|
||||
<macro src="./*:$ARGS" join="<br>" else="@slot(nested)">
|
||||
<a href="#@source(s ./path)">@source(./title)</a>
|
||||
</macro>
|
||||
</div>
|
||||
|
||||
@ -897,6 +897,12 @@ module.BaseStore = {
|
||||
// actual existing pages, while in non-strict mode the pattern will
|
||||
// match all sub-paths.
|
||||
//
|
||||
// Handled path arguments:
|
||||
// all
|
||||
// sort=<methods>
|
||||
// sortnewlast (default)
|
||||
// sortnewfirst
|
||||
//
|
||||
__match_args__: {
|
||||
//
|
||||
// <tag-name>: function(value, args){
|
||||
@ -974,6 +980,11 @@ module.BaseStore = {
|
||||
|
||||
var all = args.all
|
||||
var sort = args.sort
|
||||
var newlast =
|
||||
args.sortnewlast
|
||||
?? !(args.sortnewfirst
|
||||
// default is sortnewlast...
|
||||
?? false)
|
||||
var test = await this.__match_args(args)
|
||||
args = pwpath.joinArgs('', args)
|
||||
|
||||
@ -1034,7 +1045,10 @@ module.BaseStore = {
|
||||
that
|
||||
.sort(this, ...sort.split(/\s*[,\s]+/g))
|
||||
:this
|
||||
.sortAs(order) })
|
||||
.sortAs(order,
|
||||
newlast ?
|
||||
'head'
|
||||
: 'tail') })
|
||||
.map(function(p){
|
||||
return p+args })}
|
||||
// direct search...
|
||||
|
||||
@ -37,9 +37,6 @@
|
||||
* -
|
||||
*
|
||||
*
|
||||
* XXX sort: for saved order, how do we handle items not in the metadata?
|
||||
* ...there are three ways to handle this, put them first, last or
|
||||
* add an option with a reasonable default...
|
||||
* XXX sort: revise how we store order...
|
||||
* .metadata.order = [ .. ]
|
||||
* .metadata.order_<name> = [ .. ]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user