diff --git a/js/src/forum/components/PollsPage.tsx b/js/src/forum/components/PollsPage.tsx index 28b2f2d8..11634a5a 100644 --- a/js/src/forum/components/PollsPage.tsx +++ b/js/src/forum/components/PollsPage.tsx @@ -8,6 +8,8 @@ import Poll from './Poll'; import PollList from './Poll/PollList'; import extractText from 'flarum/common/utils/extractText'; import PollListState from '../states/PollListState'; +import Button from 'flarum/common/components/Button'; +import SelectDropdown from 'flarum/common/components/SelectDropdown'; export default class PollsPage extends Page { oninit(vnode: Mithril.Vnode) { @@ -44,7 +46,39 @@ export default class PollsPage extends Page { } sidebarItems() { - return IndexPage.prototype.sidebarItems(); + const items = new ItemList(); + const canStartPoll = app.forum.attribute('canStartPoll') || !app.session.user; + console.info(canStartPoll); + + items.add( + 'newGlobalPoll', + + ); + + items.add( + 'nav', + + {this.navItems().toArray()} + + ); + + return items; } // actionItems() { diff --git a/resources/less/forum.less b/resources/less/forum.less index 55cb184f..6c5db7a3 100755 --- a/resources/less/forum.less +++ b/resources/less/forum.less @@ -399,6 +399,15 @@ } } +@media @desktop-up { + .PollsPage .item-newGlobalPoll .Button { + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + } +} + .Poll { // display: flex; // gap: 10px; diff --git a/resources/locale/en.yml b/resources/locale/en.yml index 8d1181ff..fb2f6d01 100755 --- a/resources/locale/en.yml +++ b/resources/locale/en.yml @@ -25,6 +25,8 @@ fof-polls: poll: cannot_change_vote: You cannot change your vote after voting. submit_button: Vote + start_poll_button: Start Global Poll + cannot_start_poll_button: Cannot Start Poll composer_discussion: add_poll: => fof-polls.forum.moderation.add