-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
517 additions
and
532 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export default class Acl { | ||
static canManagePools():boolean { | ||
return true; | ||
} | ||
static canManagePools(): boolean { | ||
return true; | ||
} | ||
|
||
static canStartPoll():boolean { | ||
return true; | ||
//app.forum.attribute('canStartPoll') || !app.session.user; | ||
} | ||
} | ||
static canStartPoll(): boolean { | ||
return true; | ||
//app.forum.attribute('canStartPoll') || !app.session.user; | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export const slug = 'fof-polls'; | ||
export const slug = 'fof-polls'; |
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 |
---|---|---|
@@ -1,46 +1,46 @@ | ||
import Mithril from "mithril"; | ||
import app from "flarum/forum/app"; | ||
import Component from "flarum/common/Component"; | ||
import {slug} from "../../common"; | ||
import LinkButton from "flarum/common/components/LinkButton"; | ||
import Mithril from 'mithril'; | ||
import app from 'flarum/forum/app'; | ||
import Component from 'flarum/common/Component'; | ||
import { slug } from '../../common'; | ||
import LinkButton from 'flarum/common/components/LinkButton'; | ||
|
||
const t = app.translator.trans.bind(app.translator); | ||
const prfx = `${slug}.forum.compose`; | ||
|
||
export default class ComposePollHero extends Component { | ||
view(): Mithril.Children { | ||
const { poll } = this.attrs; | ||
view(): Mithril.Children { | ||
const { poll } = this.attrs; | ||
|
||
return ( | ||
<div className='ComposeGoodieCollectionHero Hero IndexPageHero'> | ||
<div className='container'> | ||
<div className='containerNarrow'> | ||
<h2 className='Hero-title'> | ||
{t(`${prfx}.${!!poll.id() ? 'edit' : 'add'}_title`)} | ||
</h2> | ||
<div className='IndexPageHero-controls'> | ||
<LinkButton | ||
icon='far fa-edit' | ||
className='Button Button--primary IndexPage-newDiscussion GoodiesManagerLink' | ||
itemClassName='App-primaryControl' | ||
href={app.route('fof_polls_directory')}> | ||
{t(`${prfx}.polls_manager`)} | ||
</LinkButton> | ||
{poll.exists && ( | ||
<LinkButton | ||
icon='far fa-arrow-up-right-from-square' | ||
className='Button Button--primary IndexPage-newDiscussion GoodiePreviewLink' | ||
itemClassName='App-primaryControl' | ||
href={app.route('fof_polls_directory', { id: poll.id() })} | ||
external={true} | ||
target='_blank'> | ||
{t(`${prfx}.polls_preview`)} | ||
</LinkButton> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
return ( | ||
<div className="ComposeGoodieCollectionHero Hero IndexPageHero"> | ||
<div className="container"> | ||
<div className="containerNarrow"> | ||
<h2 className="Hero-title">{t(`${prfx}.${!!poll.id() ? 'edit' : 'add'}_title`)}</h2> | ||
<div className="IndexPageHero-controls"> | ||
<LinkButton | ||
icon="far fa-edit" | ||
className="Button Button--primary IndexPage-newDiscussion GoodiesManagerLink" | ||
itemClassName="App-primaryControl" | ||
href={app.route('fof_polls_directory')} | ||
> | ||
{t(`${prfx}.polls_manager`)} | ||
</LinkButton> | ||
{poll.exists && ( | ||
<LinkButton | ||
icon="far fa-arrow-up-right-from-square" | ||
className="Button Button--primary IndexPage-newDiscussion GoodiePreviewLink" | ||
itemClassName="App-primaryControl" | ||
href={app.route('fof_polls_directory', { id: poll.id() })} | ||
external={true} | ||
target="_blank" | ||
> | ||
{t(`${prfx}.polls_preview`)} | ||
</LinkButton> | ||
)} | ||
</div> | ||
); | ||
} | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
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
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
Oops, something went wrong.