diff --git a/mar/tree/comments.hoon b/mar/tree/comments.hoon index 7987e1a12..cc3c0fe33 100644 --- a/mar/tree/comments.hoon +++ b/mar/tree/comments.hoon @@ -6,7 +6,7 @@ !: :::: :: -|_ all/(list (pair time manx)) +|_ all/(list (pair time {ship marl})) :: ++ grow :: convert to |% @@ -14,9 +14,9 @@ :- %a %+ turn (sort all |=({a/* b/*} (lor b a))) - |= {a/time b/manx} ^- ^json - =. a.g.b [id+(time-to-id a) a.g.b] - (jobe time+(jode a) body+(react-to-json:react b) ~) + |= {a/time b/ship c/marl} ^- ^json + =+ bod=[[%div id+(time-to-id a) ~] c] + (jobe time+(jode a) user+(jape +:) body+(react-to-json:react bod) ~) -- ++ grab |% :: convert from ++ noun (list {time manx}) :: clam from %noun diff --git a/ren/tree/comments.hoon b/ren/tree/comments.hoon index c8b801554..8a2175c93 100644 --- a/ren/tree/comments.hoon +++ b/ren/tree/comments.hoon @@ -2,8 +2,14 @@ :::: /hoon/comments/tree/ren :: /? 310 -/: /%/comments /_ @da /&elem&/md/ +/: /%/comments /_ @da + /; |= a/manx ^- {ship marl} + ~| a + ?> ?=(_[/div ;/(~) ~[[%h2 **] ~[[%code **] ;/(who=**)]] kid=**] a) + => .(a ^+([/div ;/(~) ~[[%h2 **] ~[[%code **] ;/(who=*tape)]] kid=*marl] a)) + [(slav %p (crip who.a)) kid.a] + /&elem&/md/ :: :::: :: -`(list (pair time manx))`-.- +`(list (pair time {ship marl}))`-.- diff --git a/web/tree/main.js b/web/tree/main.js index 8c49a64c8..94f85a9f6 100644 --- a/web/tree/main.js +++ b/web/tree/main.js @@ -563,7 +563,7 @@ module.exports = recl({ },{}],5:[function(require,module,exports){ -var Comment, Ship, TreeActions, a, clas, code, div, form, img, input, load, p, query, reactify, recl, ref, rele, textarea, util; +var Comment, Ship, TreeActions, a, clas, code, div, form, h2, img, input, load, p, query, reactify, recl, ref, rele, textarea, util; clas = require('classnames'); @@ -581,7 +581,7 @@ recl = React.createClass; rele = React.createElement; -ref = React.DOM, div = ref.div, p = ref.p, img = ref.img, a = ref.a, form = ref.form, textarea = ref.textarea, input = ref.input, code = ref.code; +ref = React.DOM, div = ref.div, p = ref.p, h2 = ref.h2, img = ref.img, a = ref.a, form = ref.form, textarea = ref.textarea, input = ref.input, code = ref.code; Ship = function(name) { return code({ @@ -590,13 +590,13 @@ Ship = function(name) { }; Comment = function(arg) { - var body, loading, ref1, time; - time = arg.time, body = arg.body, loading = (ref1 = arg.loading) != null ? ref1 : false; + var body, loading, ref1, time, user; + time = arg.time, user = arg.user, body = arg.body, loading = (ref1 = arg.loading) != null ? ref1 : false; return div({ className: clas("comment", { loading: loading }) - }, "" + (window.urb.util.toDate(new Date(time))), reactify(body, "comt", { + }, "" + (window.urb.util.toDate(new Date(time))), h2({}, Ship(user)), reactify(body, "comt", { components: {} })); }; @@ -621,26 +621,20 @@ module.exports = query({ } }, onSubmit: function(e) { - var body, value; + var body, user, value; value = this.refs["in"].comment.value; TreeActions.addComment(this.props.path, this.props.spur, value); body = { - gn: 'div', - c: [ - { - gn: 'h2', - c: ["~" + urb.user] - }, { - gn: 'p', - c: [value] - } - ] + gn: 'p', + c: [value] }; + user = urb.user; this.setState({ value: "", loading: { 'loading': 'loading', body: body, + user: urb.user, time: Date.now() } });