-
-
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.
chore: design first iteration of refined polls
- Loading branch information
1 parent
effb511
commit ca72c92
Showing
7 changed files
with
229 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { extend } from 'flarum/common/extend'; | ||
import IndexPage from 'flarum/forum/components/IndexPage'; | ||
import LinkButton from 'flarum/common/components/LinkButton'; | ||
|
||
import app from 'flarum/forum/app'; | ||
|
||
export default function () { | ||
extend(IndexPage.prototype, 'navItems', function (items) { | ||
items.add( | ||
'polls', | ||
<LinkButton icon="fas fa-poll" href={app.route('polls')}> | ||
Polls | ||
</LinkButton>, | ||
-11 | ||
); | ||
}); | ||
} |
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,74 @@ | ||
import * as Mithril from 'mithril'; | ||
import Component from 'flarum/common/Component'; | ||
|
||
export default class IndexPolls extends Component { | ||
view(): Mithril.Children { | ||
return ( | ||
<div className="Index-poll"> | ||
<b>Polls</b> | ||
<p>Lorem Ipsum Dolor Sit amet Consectetur Adipiscing Elit </p> | ||
<form> | ||
<fieldset> | ||
<legend className="sr-only">Privacy setting</legend> | ||
<div className="aaa"> | ||
<label className="ba bbb"> | ||
<input | ||
type="radio" | ||
name="privacy-setting" | ||
value="Public access" | ||
className="ccc" | ||
aria-labelledby="privacy-setting-0-label" | ||
aria-describedby="privacy-setting-0-description" | ||
/> | ||
<span className="ddd"> | ||
<span id="privacy-setting-0-label" className="fff"> | ||
Public access | ||
</span> | ||
<span id="privacy-setting-0-description" className="ggg"> | ||
This project would be available to anyone who has the link | ||
</span> | ||
</span> | ||
</label> | ||
<label className="bbb"> | ||
<input | ||
type="radio" | ||
name="privacy-setting" | ||
value="Private to Project Members" | ||
className="ccc" | ||
aria-labelledby="privacy-setting-1-label" | ||
aria-describedby="privacy-setting-1-description" | ||
/> | ||
<span className="ddd"> | ||
<span id="privacy-setting-1-label" className="fff"> | ||
Private to Project Members | ||
</span> | ||
<span id="privacy-setting-1-description" className="ggg"> | ||
Only members of this project would be able to access | ||
</span> | ||
</span> | ||
</label> | ||
<label className="bba bbb"> | ||
<input | ||
type="radio" | ||
name="privacy-setting" | ||
value="Private to you" | ||
className="ccc" | ||
aria-labelledby="privacy-setting-2-label" | ||
aria-describedby="privacy-setting-2-description" | ||
/> | ||
<span className="ddd"> | ||
<span id="privacy-setting-2-label" className="fff"> | ||
Private to you | ||
</span> | ||
<span id="privacy-setting-2-description" className="ggg"> | ||
You are the only one able to access this project | ||
</span> | ||
</span> | ||
</label> | ||
</div> | ||
</fieldset> | ||
</form> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import app from 'flarum/forum/app'; | ||
import Page from 'flarum/common/components/Page'; | ||
import ItemList from 'flarum/common/utils/ItemList'; | ||
import listItems from 'flarum/common/helpers/listItems'; | ||
import IndexPage from 'flarum/forum/components/IndexPage'; | ||
import Poll from './Poll'; | ||
|
||
export default class PollsPage extends Page { | ||
oninit(vnode) { | ||
super.oninit(vnode); | ||
} | ||
|
||
oncreate(vnode) { | ||
super.oncreate(vnode); | ||
} | ||
|
||
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"> | ||
<Poll /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
sidebarItems() { | ||
return IndexPage.prototype.sidebarItems(); | ||
} | ||
|
||
navItems() { | ||
return IndexPage.prototype.navItems(); | ||
} | ||
} |
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