mirror of
https://github.com/urbit/shrub.git
synced 2025-01-08 06:00:27 +03:00
formally render topics, collections, or the index
using ren/urb/collections
This commit is contained in:
parent
3300dc8af8
commit
59543455e5
47
mar/collections/collection.hoon
Normal file
47
mar/collections/collection.hoon
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
:: /mar/collections/config/hoon
|
||||||
|
::
|
||||||
|
/- *collections
|
||||||
|
|_ col=collection
|
||||||
|
::
|
||||||
|
++ grow
|
||||||
|
|%
|
||||||
|
++ elem :: web display
|
||||||
|
;div
|
||||||
|
;h1: {(trip desc.conf.col)}
|
||||||
|
;p: updated {<mod.conf.col>}
|
||||||
|
::TODO public, visible
|
||||||
|
::
|
||||||
|
;h2: Topics:
|
||||||
|
;ul
|
||||||
|
;* %+ turn (sort ~(tap by tops.col) dor)
|
||||||
|
|= [top=@da topicful]
|
||||||
|
;li
|
||||||
|
;a/"{<top>}/": {(trip tit.info)} ({<~(wyt by coms)>} comments)
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
;hr;
|
||||||
|
::
|
||||||
|
;h2: Post topic:
|
||||||
|
;script@"/lib/js/easy-form.js";
|
||||||
|
;form(onsubmit "return easy_form.submit(this)")
|
||||||
|
;input(type "hidden", name "easy_form:mark", value "collections-action");
|
||||||
|
;input(type "hidden", name "easy_form:tag", value "submit");
|
||||||
|
::
|
||||||
|
:: hmm we really want the filename here
|
||||||
|
;input(type "hidden", name "col", value "{<mod.conf.col>}");
|
||||||
|
::
|
||||||
|
;input(name "tit", placeholder "Title");
|
||||||
|
;br;
|
||||||
|
;textarea(name "wat", placeholder "Enter topic text");
|
||||||
|
;br;
|
||||||
|
;input(type "submit");
|
||||||
|
==
|
||||||
|
==
|
||||||
|
--
|
||||||
|
::
|
||||||
|
++ grab
|
||||||
|
|%
|
||||||
|
++ noun collection
|
||||||
|
--
|
||||||
|
--
|
46
mar/collections/topic-full.hoon
Normal file
46
mar/collections/topic-full.hoon
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
:: /mar/collections/config/hoon
|
||||||
|
::
|
||||||
|
/- *collections
|
||||||
|
/+ time-to-id
|
||||||
|
|_ top=topicful
|
||||||
|
::
|
||||||
|
::
|
||||||
|
++ grow
|
||||||
|
|%
|
||||||
|
++ elem :: web display
|
||||||
|
;div
|
||||||
|
;h1: {(trip tit.info.top)}
|
||||||
|
;b: {<who.info.top>}
|
||||||
|
;pre: {(of-wall:format (turn wat.info.top trip))}
|
||||||
|
:: ;h2: Post comment:
|
||||||
|
:: ;script@"/lib/js/easy-form.js";
|
||||||
|
:: ;form(onsubmit "return easy_form.submit(this)")
|
||||||
|
:: ;input(type "hidden", name "easy_form:mark", value "collections-action");
|
||||||
|
:: ;input(type "hidden", name "easy_form:tag", value "commet");
|
||||||
|
:: ::
|
||||||
|
:: ;input(type "hidden", name "col", value XX)
|
||||||
|
:: ;input(type "hidden", name "top", value XX)
|
||||||
|
:: ;input(type "hidden", name "com", value XX)
|
||||||
|
:: ::
|
||||||
|
:: ;br;
|
||||||
|
:: ;textarea(name "wat", placeholder "Enter comment");
|
||||||
|
:: ;br;
|
||||||
|
:: ;input(type "submit");
|
||||||
|
:: ==
|
||||||
|
;* ?: =(~ coms.top) ~
|
||||||
|
:- ;h2: Comments
|
||||||
|
%+ turn (sort ~(tap by coms.top) dor)
|
||||||
|
|= [wen=@da mod=@da com=comment]
|
||||||
|
=/ id (time-to-id wen)
|
||||||
|
;div(id id)
|
||||||
|
;hr;
|
||||||
|
;pre: {(of-wall:format (turn wat.com trip))}
|
||||||
|
; ;{b -<who.com>}, at ;{a/"#{id}" -<wen>}
|
||||||
|
== ==
|
||||||
|
--
|
||||||
|
::
|
||||||
|
++ grab
|
||||||
|
|%
|
||||||
|
++ noun topicful
|
||||||
|
--
|
||||||
|
--
|
@ -2,11 +2,5 @@
|
|||||||
/+ rekey
|
/+ rekey
|
||||||
/^ collections
|
/^ collections
|
||||||
/; (rekey %da)
|
/; (rekey %da)
|
||||||
/^ (map knot collection:collections)
|
/_ /collections-collection/
|
||||||
/_ /. /@ /collections-config/
|
|
||||||
/= tops
|
|
||||||
/; (rekey %da)
|
|
||||||
/^ (map knot topicful:collections)
|
|
||||||
/_ /collections-topic-full/
|
|
||||||
==
|
|
||||||
-.-
|
-.-
|
||||||
|
10
ren/collections/collection.hoon
Normal file
10
ren/collections/collection.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/- collections
|
||||||
|
/+ rekey
|
||||||
|
/^ collection:collections
|
||||||
|
/. /@ /collections-config/
|
||||||
|
/= tops
|
||||||
|
/; (rekey %da)
|
||||||
|
/^ (map knot topicful:collections)
|
||||||
|
/_ /collections-topic-full/
|
||||||
|
==
|
||||||
|
-.-
|
@ -1,9 +1,9 @@
|
|||||||
/- collections
|
/- collections
|
||||||
/+ rekey
|
/+ rekey
|
||||||
/_ /. /@ /collections-topic/
|
/^ topicful:collections
|
||||||
/= comt
|
/. /@ /collections-topic/
|
||||||
/; (rekey %da)
|
/= comt
|
||||||
/_ /@ /collections-comment/
|
/; (rekey %da)
|
||||||
==
|
/_ /@ /collections-comment/
|
||||||
^- topicful:collections
|
==
|
||||||
-.-
|
-.-
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/, /web/pages
|
/, /web/pages
|
||||||
/; urb-split /# /!hymn/
|
/; urb-split /# /!hymn/
|
||||||
/web/collections
|
/web/collections
|
||||||
/; urb-split /# /&hymn&/collections/ ::XX only bod hash?
|
/urb-collections/
|
||||||
/
|
/
|
||||||
/urb-tree/
|
/urb-tree/
|
||||||
==
|
==
|
||||||
|
13
ren/urb/collections.hoon
Normal file
13
ren/urb/collections.hoon
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
:: Combine /tree-head/ and /tree-body/
|
||||||
|
::
|
||||||
|
:::: /hoon/tree/urb/ren
|
||||||
|
::
|
||||||
|
/? 310
|
||||||
|
/= bod /# /& elem
|
||||||
|
/|(/collections-topic-full/ /collections-collection/ /collections/)
|
||||||
|
^- {hed/{@uvH marl} bod/{@uvH marl}}
|
||||||
|
::
|
||||||
|
::REVIEW is head static?
|
||||||
|
::TODO css/js includes?
|
||||||
|
:- [-.bod ;(title:"Collections")]
|
||||||
|
[-.bod +.bod ~]
|
Loading…
Reference in New Issue
Block a user