-
-
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.
- adapt CreatePollHandler to the new data structure (similar to edit) - add translations
- Loading branch information
Showing
6 changed files
with
126 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +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"; | ||
|
||
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; | ||
|
||
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('goodie-collection', { id: poll.id() })} | ||
external={true} | ||
target='_blank'> | ||
{t(`${prfx}.goodie_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