mirror of https://github.com/dyne/webnomad.git
misc fixes to indexing
This commit is contained in:
parent
c7f194f2b1
commit
5be5585483
|
|
@ -117,7 +117,7 @@ apache alias. To configure this use `FILES_ROOT` in config.zsh.
|
||||||
|
|
||||||
Bleeding edge is on GitHub. see https://github.com/dyne/webnomad
|
Bleeding edge is on GitHub. see https://github.com/dyne/webnomad
|
||||||
|
|
||||||
Pull requests may be welcome.
|
Pull requests and translations of this documentation are welcome.
|
||||||
|
|
||||||
Come on IRC channel #dyne via https://irc.dyne.org to get in touch.
|
Come on IRC channel #dyne via https://irc.dyne.org to get in touch.
|
||||||
|
|
||||||
|
|
|
||||||
27
index
27
index
|
|
@ -303,16 +303,19 @@ EOF
|
||||||
index_long_preview() {
|
index_long_preview() {
|
||||||
dir="${1}"
|
dir="${1}"
|
||||||
func "index_long_preview \"$dir\""
|
func "index_long_preview \"$dir\""
|
||||||
|
func "index data: $archive/$dir"
|
||||||
|
func "index url: $url / $dir"
|
||||||
|
|
||||||
|
{ test -d "$archive/$dir" } || { error "cannot index: not a directory '$archive/$dir'"; return 1 }
|
||||||
|
|
||||||
{ test -d "$dir" } || { error "cannot index: not a directory '$dir'"; return 1 }
|
|
||||||
files=()
|
files=()
|
||||||
ttmp=`ls -l --time-style=long-iso "$dir" | awk '
|
ttmp=`ls -l --time-style=long-iso "${archive}/${dir}" | awk '
|
||||||
/^total/ { next }
|
/^total/ { next }
|
||||||
/^$/ { next }
|
/^$/ { next }
|
||||||
{ printf "files+=(\"%s;%s;%s\");", $8, $5, $6 }
|
{ printf "files+=(\"%s;%s;%s\");", $8, $5, $6 }
|
||||||
'`
|
'`
|
||||||
{ test $? = 0 } || {
|
{ test $? = 0 } || {
|
||||||
error "Error parsing directory: $dir"
|
error "Error parsing directory: ${archive}/${dir}"
|
||||||
return 1 }
|
return 1 }
|
||||||
|
|
||||||
eval "$ttmp"
|
eval "$ttmp"
|
||||||
|
|
@ -334,6 +337,24 @@ index_long_preview() {
|
||||||
<th class="col-sm-3 col-md-4 col-lg-5">Preview</th>
|
<th class="col-sm-3 col-md-4 col-lg-5">Preview</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# if not parent offer to go up
|
||||||
|
[[ "$dir" = "" ]] || {
|
||||||
|
func "parent: $parent"
|
||||||
|
cat <<EOF
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align:middle;">
|
||||||
|
<a href="${parent}/index${EXTENSION}">
|
||||||
|
<img src="${WEB_ROOT}/icons${THUMB_SIZE}/go-up.png"
|
||||||
|
alt="parent directory" title="go to parent"></a></td>
|
||||||
|
<td style="vertical-align:middle;font-size:1.5em;word-wrap:break-word" colspan="4">
|
||||||
|
<a href="${parent}/index${EXTENSION}">
|
||||||
|
.. [ parent ]</a></td>
|
||||||
|
</tr>
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
for f in ${files}; do
|
for f in ${files}; do
|
||||||
name="${f[(ws:;:)1]}"
|
name="${f[(ws:;:)1]}"
|
||||||
size="${f[(ws:;:)2]}"
|
size="${f[(ws:;:)2]}"
|
||||||
|
|
|
||||||
4
test
4
test
|
|
@ -5,9 +5,9 @@ STYLING=0
|
||||||
# make it work to browse results on file://
|
# make it work to browse results on file://
|
||||||
baseurl="file://`pwd`/test/"
|
baseurl="file://`pwd`/test/"
|
||||||
|
|
||||||
includejs+=(jquery.min.js jquery.sidr.js)
|
# includejs+=(jquery.min.js jquery.sidr.js)
|
||||||
|
|
||||||
includecss+=(jquery.sidr.dark.css)
|
# includecss+=(jquery.sidr.dark.css)
|
||||||
|
|
||||||
{ test "$STYLING" = "1" } || { render_test_footer() { return 0 }; return 0 }
|
{ test "$STYLING" = "1" } || { render_test_footer() { return 0 }; return 0 }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue