fixed behavior for broken umd

This commit is contained in:
Isaac Visintainer 2018-11-06 22:55:34 -08:00 committed by ixv
parent 71c1161599
commit 1e1f9231b9
5 changed files with 55 additions and 21 deletions

View File

@ -431,6 +431,9 @@
=/ parent-path (scag (dec (lent pax)) pax)
::
?- -.new
::
%error
(ta-hall-lin parent-path 'error')
::
%collection
=. ta-this
@ -474,6 +477,9 @@
=/ parent (scag (dec (lent pax)) pax)
:: recurse for children
?- -.old
::
%error
(ta-hall-lin parent 'error')
::
%collection
=. ta-this
@ -558,6 +564,18 @@
=. ta-this (ta-remove-item [%raw raw.old] pax)
(ta-update-collection col.old col.new pax)
::
::
?: &(?=(%error -.old) ?=(%error -.new))
ta-this
?: &(?=(%error -.old) ?=(%collection -.new))
(ta-insert-item new pax)
?: &(?=(%error -.old) ?=(%raw -.new))
(ta-insert-item new pax)
?: &(?=(%error -.old) ?=(%both -.new))
(ta-insert-item new pax)
?: ?=(%error -.new)
(ta-hall-lin pax 'error')
::
ta-this
::
++ ta-update-raw-item
@ -584,19 +602,6 @@
:: delete comments
(ta-remove (weld pax /collections-config))
::
:: check if file has been modified
:: and if so update last modified field
:: =/ told (trip data.old)
:: =/ newt (trip data.new)
:: =/ old-con (slag (need (find ";>" told)) told)
:: =/ new-con (slag (need (find ";>" newt)) newt)
:: =? ta-this !=(old-con new-con)
:: =/ contents=@t
:: %+ update-umd-front
:: (~(put by meta.new) %last-modified (scot %da now.bol))
:: data.new
:: (ta-write (weld pax /umd) %umd !>(contents))
::
ta-this
::
++ ta-update-collection
@ -733,7 +738,7 @@
act t.act
==
::
++ ta-hall-create-circle ::
++ ta-hall-create-circle
|= [pax=path description=@t]
^+ ta-this
=/ circ=circle:hall (path-to-circle pax)

View File

@ -8,10 +8,11 @@
|%
+= collection [meta=config data=(map nom=knot =item)]
+= item
$~ [%raw %umd ~ %$]
$~ [%error ~]
$% [%collection col=collection]
[%raw raw=raw-item]
[%both col=collection raw=raw-item]
[%error ~]
==
+= raw-item
$% [%umd meta=(map knot cord) data=@t]
@ -53,6 +54,22 @@
$% [%umd @t]
[%collections-config config]
==
::
++ collection-error
|= col=collection
^- ?
|-
=/ vals=(list item) ~(val by data.col)
%+ roll vals
|= [i=item out=_|]
^- ?
?: out out
?+ -.i
%.n
%error %.y
%collection ^$(col col.i)
%both ^$(col col.i)
==
::::
:::: /mar/snip
::::
@ -99,6 +116,7 @@
|= itm=item
^- json
?- -.itm
%error (frond:enjs:format %error ~)
::
%collection
%+ frond:enjs:format

View File

@ -21,6 +21,8 @@
;div.container
;+
?+ -.itm !!
%error ;div: 404
::
%collection
?+ sho !!
::
@ -87,13 +89,17 @@
|= col=collection:collections
^- manx
;ul.vanilla
;* %+ turn
;* %+ roll
%+ sort ~(tap by data.col)
|= [[knot a=item:collections] [knot b=item:collections]]
=/ a-dat (extract-date-created a)
=/ b-dat (extract-date-created b)
(lth a-dat b-dat)
|= [nom=knot ite=item:collections]
|= [[nom=knot ite=item:collections] out=marl]
^- marl
?: ?=(%error -.ite)
out
:_ out
^- manx
;li.collection-post.mt-6
;+ (item-to-snip nom ite)
@ -142,7 +148,8 @@
;div.mr-2
=urb-component "Sigil"
=urb-ship "{(trip owner)}"
=urb-size "18";
=urb-size "18"
=urb-suffix "true";
;div
;a.vanilla.text-mono.text-small.text-700.mr-4
=href "/~~/landscape/profile"
@ -170,6 +177,7 @@
|= i=item:collections
^- @da
?- -.i
%error *@da
%collection date-created.meta.col.i
%both date-created.meta.col.i
%raw (slav %da (~(got by meta.raw.i) %date-created))
@ -181,6 +189,8 @@
|= [nom=knot itm=item:collections]
^- manx
?- -.itm
%error
;div: 404
%collection
(collection-to-snip nom col.itm)
%raw
@ -276,6 +286,7 @@
%+ weld mat
^- mart
?- -.itm
%error ~
%collection
=* met meta.col.itm
:~ [%urb-name (trip name.met)]

View File

@ -24,7 +24,7 @@
==
?~ raw
?~ col
!!
[%error ~]
[%collection col]
?~ col
[%raw raw]

View File

@ -34,7 +34,7 @@
^- item:collections
?~ col
?~ raw
!!
[%error ~]
[%raw raw]
::
?: ?=(%no-config -.col)
@ -43,7 +43,7 @@
[%collection *config:collections items.col]
[%both [*config:collections items.col] raw]
?~ raw
!!
[%error ~]
[%raw raw]
?~ raw
[%collection config.col items.col]