42 lines
1.4 KiB
HTML
42 lines
1.4 KiB
HTML
@use crate::comments::{Cache, CommentNode};
|
|
@use crate::templates::comments::{nodes, profile_box};
|
|
@use hyaenidae_toolkit::templates::link;
|
|
@use hyaenidae_toolkit::templates::{nested_children, nested_node};
|
|
|
|
@(node: &CommentNode, cache: &Cache, parent: &CommentNode, logged_in: bool, dark: bool)
|
|
|
|
@if let Some(comment) = node.comment(cache) {
|
|
@:nested_node({
|
|
@:profile_box(&node.author(cache), comment.published(), parent, cache, dark, {
|
|
<div class="comment-links">
|
|
@if !comment.deleted() {
|
|
<div>
|
|
@if let Some(l) = node.view_link(cache) {
|
|
@:link(&l, {
|
|
@if logged_in {
|
|
reply
|
|
} else {
|
|
view
|
|
}
|
|
})
|
|
}
|
|
</div>
|
|
@if let Some(state) = node.edit_link(cache) {
|
|
<div>
|
|
@:link(&state, { edit })
|
|
</div>
|
|
}
|
|
}
|
|
</div>
|
|
}, {
|
|
@comment.body()
|
|
})
|
|
})
|
|
}
|
|
@if node.has_children() {
|
|
@:nested_children({
|
|
@for child in &node.children {
|
|
@:nodes(child, cache, node, logged_in, dark)
|
|
}
|
|
})
|
|
}
|