mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add collapse button
This commit is contained in:
parent
fe907aaf74
commit
6fff16a999
@ -299,9 +299,17 @@ createWidget('post-contents', {
|
|||||||
|
|
||||||
const repliesBelow = state.repliesBelow;
|
const repliesBelow = state.repliesBelow;
|
||||||
if (repliesBelow.length) {
|
if (repliesBelow.length) {
|
||||||
result.push(h('section.embedded-posts.bottom', repliesBelow.map(p => {
|
result.push(h('section.embedded-posts.bottom', [
|
||||||
return this.attach('embedded-post', p, { model: this.store.createRecord('post', p) });
|
this.attach('button', {
|
||||||
})));
|
title: 'post.collapse',
|
||||||
|
icon: 'chevron-up',
|
||||||
|
action: 'toggleRepliesBelow',
|
||||||
|
className: 'btn collapse-up'
|
||||||
|
}),
|
||||||
|
repliesBelow.map(p => {
|
||||||
|
return this.attach('embedded-post', p, { model: this.store.createRecord('post', p) });
|
||||||
|
})
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -376,7 +384,15 @@ createWidget('post-article', {
|
|||||||
return this.attach('embedded-post', p, { model: this.store.createRecord('post', p), state: { above: true } });
|
return this.attach('embedded-post', p, { model: this.store.createRecord('post', p), state: { above: true } });
|
||||||
});
|
});
|
||||||
|
|
||||||
rows.push(h('div.row', h('section.embedded-posts.top.topic-body.offset2', replies)));
|
rows.push(h('div.row', h('section.embedded-posts.top.topic-body.offset2', [
|
||||||
|
this.attach('button', {
|
||||||
|
title: 'post.collapse',
|
||||||
|
icon: 'chevron-down',
|
||||||
|
action: 'toggleReplyAbove',
|
||||||
|
className: 'btn collapse-down'
|
||||||
|
}),
|
||||||
|
replies
|
||||||
|
])));
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.push(h('div.row', [this.attach('post-avatar', attrs), this.attach('post-body', attrs)]));
|
rows.push(h('div.row', [this.attach('post-avatar', attrs), this.attach('post-body', attrs)]));
|
||||||
|
@ -1897,6 +1897,7 @@ en:
|
|||||||
deleted_by_author:
|
deleted_by_author:
|
||||||
one: "(post withdrawn by author, will be automatically deleted in %{count} hour unless flagged)"
|
one: "(post withdrawn by author, will be automatically deleted in %{count} hour unless flagged)"
|
||||||
other: "(post withdrawn by author, will be automatically deleted in %{count} hours unless flagged)"
|
other: "(post withdrawn by author, will be automatically deleted in %{count} hours unless flagged)"
|
||||||
|
collapse: "collapse"
|
||||||
expand_collapse: "expand/collapse"
|
expand_collapse: "expand/collapse"
|
||||||
gap:
|
gap:
|
||||||
one: "view 1 hidden reply"
|
one: "view 1 hidden reply"
|
||||||
|
Loading…
Reference in New Issue
Block a user