-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 69b47f9 Author: IanM <[email protected]> Date: Thu Feb 1 09:25:46 2024 +0000 add isGlobal peroperty to js model commit d130f6b Author: IanM <[email protected]> Date: Thu Feb 1 09:21:04 2024 +0000 list polls only shows global polls commit 0a4dcf4 Author: IanM <[email protected]> Date: Wed Jan 31 16:49:15 2024 +0000 add unauthorized api test commit 6e52663 Author: IanM <[email protected]> Date: Wed Jan 31 16:45:33 2024 +0000 fix: phpstan error commit a322750 Author: StyleCI Bot <[email protected]> Date: Wed Jan 31 16:42:20 2024 +0000 Apply fixes from StyleCI commit c8e60a0 Author: IanM <[email protected]> Date: Wed Jan 31 16:42:10 2024 +0000 feat: allow creation of polls without post id (global poll) commit 7abeebe Author: IanM <[email protected]> Date: Wed Jan 31 11:49:25 2024 +0000 ensure poll is associated with postId commit 20b5917 Author: StyleCI Bot <[email protected]> Date: Wed Jan 31 11:45:37 2024 +0000 Apply fixes from StyleCI commit fa69a3c Author: IanM <[email protected]> Date: Wed Jan 31 11:45:24 2024 +0000 test: create post poll via api commit 97d6348 Author: IanM <[email protected]> Date: Wed Jan 31 08:34:08 2024 +0000 fix: provider visibility commit 03d355f Author: IanM <[email protected]> Date: Wed Jan 31 08:32:26 2024 +0000 fix: provider visibility commit 325cc32 Author: StyleCI Bot <[email protected]> Date: Wed Jan 31 08:30:15 2024 +0000 Apply fixes from StyleCI commit 822ddbf Author: IanM <[email protected]> Date: Wed Jan 31 08:29:56 2024 +0000 chore: add test for existing create poll functionality via posts commit 4799bba Author: StyleCI Bot <[email protected]> Date: Tue Jan 30 14:37:24 2024 +0000 Apply fixes from StyleCI commit 4d197f3 Author: IanM <[email protected]> Date: Tue Jan 30 14:37:13 2024 +0000 use sort commit f897796 Author: IanM <[email protected]> Date: Tue Jan 30 14:26:03 2024 +0000 chore: ts-ignore commit f1e00db Author: IanM <[email protected]> Date: Tue Jan 30 14:22:36 2024 +0000 fix: return type commit d56bf39 Author: StyleCI Bot <[email protected]> Date: Tue Jan 30 14:18:49 2024 +0000 Apply fixes from StyleCI commit d49c1f9 Author: IanM <[email protected]> Date: Tue Jan 30 14:18:37 2024 +0000 feat: list polls controller commit 8fb8cc6 Author: IanM <[email protected]> Date: Tue Jan 30 14:18:13 2024 +0000 chore: format commit ee37ee6 Author: IanM <[email protected]> Date: Tue Jan 30 14:15:49 2024 +0000 fix: some model props incorrect commit 1857a44 Author: StyleCI Bot <[email protected]> Date: Tue Jan 30 08:16:56 2024 +0000 Apply fixes from StyleCI commit 4b461a5 Author: IanM <[email protected]> Date: Tue Jan 30 08:16:27 2024 +0000 wip: add polls route, begin to setup state, controls, etc commit adf5393 Author: IanM <[email protected]> Date: Mon Jan 29 16:22:08 2024 +0000 add nav item commit d4032dc Author: IanM <[email protected]> Date: Mon Jan 29 16:09:52 2024 +0000 chore: ts commit 7365c67 Author: IanM <[email protected]> Date: Mon Jan 29 14:01:09 2024 +0000 chore: add tests for forum serializer props (#85) * chore: forum serializer test * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> commit f460073 Author: IanM <[email protected]> Date: Mon Jan 29 11:46:12 2024 +0000 chore: cleanup extend, create serializer mutators (#84) * chore: cleanup extend, create serializer mutators * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> commit 9acbd74 Author: IanM <[email protected]> Date: Mon Jan 29 11:10:32 2024 +0000 Chore: include discuss link commit a2af115 Author: IanM <[email protected]> Date: Mon Jan 29 11:00:51 2024 +0000 chore: use 1.x workflows
- Loading branch information
1 parent
1bcfee8
commit d2eb935
Showing
47 changed files
with
1,524 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
vendor | ||
composer.lock | ||
js/dist | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import app from 'flarum/forum/app'; | ||
import { extend } from 'flarum/common/extend'; | ||
import IndexPage from 'flarum/forum/components/IndexPage'; | ||
import LinkButton from 'flarum/common/components/LinkButton'; | ||
|
||
export default function addNavItem() { | ||
extend(IndexPage.prototype, 'navItems', (items) => { | ||
items.add( | ||
'fof-polls-directory', | ||
LinkButton.component( | ||
{ | ||
href: app.route('fof_polls_directory'), | ||
icon: 'fas fa-poll', | ||
}, | ||
app.translator.trans('fof-polls.forum.page.nav') | ||
), | ||
35 | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
import app from 'flarum/forum/app'; | ||
import Page from 'flarum/common/components/Page'; | ||
import extractText from 'flarum/common/utils/extractText'; | ||
import IndexPage from 'flarum/forum/components/IndexPage'; | ||
import ItemList from 'flarum/common/utils/ItemList'; | ||
import listItems from 'flarum/common/helpers/listItems'; | ||
import SelectDropdown from 'flarum/common/components/SelectDropdown'; | ||
import LinkButton from 'flarum/common/components/LinkButton'; | ||
import Select from 'flarum/common/components/Select'; | ||
import Button from 'flarum/common/components/Button'; | ||
import Mithril from 'mithril'; | ||
|
||
export default class PollsDirectory extends Page { | ||
oncreate(vnode: Mithril.Vnode) { | ||
super.oncreate(vnode); | ||
|
||
app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav'))); | ||
} | ||
|
||
view() { | ||
return ( | ||
<div className="IndexPage"> | ||
{IndexPage.prototype.hero()} | ||
<div className="container"> | ||
<div className="sideNavContainer"> | ||
<nav className="IndexPage-nav sideNav"> | ||
<ul>{listItems(this.sidebarItems().toArray())}</ul> | ||
</nav> | ||
<div className="IndexPage-results sideNavOffset"> | ||
<div className="IndexPage-toolbar"> | ||
<ul className="IndexPage-toolbar-view">{listItems(this.viewItems().toArray())}</ul> | ||
<ul className="IndexPage-toolbar-action">{listItems(this.actionItems().toArray())}</ul> | ||
</div> | ||
{/* <UserDirectoryList state={this.state} /> */} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
/** | ||
* Our own sidebar. Re-uses Index.sidebarItems as the base | ||
* Elements added here will only show up on the user directory page | ||
*/ | ||
sidebarItems(): ItemList<Mithril.Children> { | ||
const items = IndexPage.prototype.sidebarItems(); | ||
|
||
items.setContent( | ||
'nav', | ||
SelectDropdown.component( | ||
{ | ||
buttonClassName: 'Button', | ||
className: 'App-titleControl', | ||
}, | ||
this.navItems().toArray() | ||
) | ||
); | ||
|
||
return items; | ||
} | ||
|
||
/** | ||
* Our own sidebar navigation. Re-uses Index.navItems as the base | ||
* Elements added here will only show up on the user directory page | ||
*/ | ||
navItems(): ItemList<Mithril.Children> { | ||
const items = IndexPage.prototype.navItems(); | ||
const params = this.stickyParams(); | ||
|
||
items.setContent( | ||
'fof-polls-directory', | ||
LinkButton.component( | ||
{ | ||
href: app.route('fof_polls_directory', params), | ||
icon: 'fas fa-poll', | ||
}, | ||
app.translator.trans('fof-polls.forum.page.nav') | ||
) | ||
); | ||
|
||
return items; | ||
} | ||
|
||
stickyParams() { | ||
return { | ||
sort: m.route.param('sort'), | ||
q: m.route.param('q'), | ||
}; | ||
} | ||
|
||
changeParams(sort: string) { | ||
const params = this.params(); | ||
|
||
if (sort === app.forum.attribute('pollsDirectoryDefaultSort')) { | ||
delete params.sort; | ||
} else { | ||
params.sort = sort; | ||
} | ||
|
||
this.state.refreshParams(params); | ||
|
||
const routeParams = { ...params }; | ||
delete routeParams.qBuilder; | ||
|
||
m.route.set(app.route('fof_polls_directory', routeParams)); | ||
} | ||
|
||
viewItems() { | ||
const items = new ItemList(); | ||
const sortMap = this.state.sortMap(); | ||
|
||
const sortOptions = {}; | ||
for (const i in sortMap) { | ||
sortOptions[i] = app.translator.trans('fof-polls.lib.sort.' + i); | ||
} | ||
|
||
items.add( | ||
'sort', | ||
Select.component({ | ||
options: sortOptions, | ||
value: this.state.getParams().sort || app.forum.attribute('pollsDirectoryDefaultSort'), | ||
onchange: this.changeParams.bind(this), | ||
}), | ||
100 | ||
); | ||
|
||
return items; | ||
} | ||
|
||
actionItems(): ItemList<Mithril.Children> { | ||
const items = new ItemList<Mithril.Children>(); | ||
|
||
items.add( | ||
'refresh', | ||
Button.component({ | ||
title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'), | ||
icon: 'fas fa-sync', | ||
className: 'Button Button--icon', | ||
onclick: () => { | ||
this.state.refresh(); | ||
}, | ||
}) | ||
); | ||
|
||
return items; | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.