Skip to content
Snippets Groups Projects
Commit 66105f08 authored by Elias Asikainen's avatar Elias Asikainen
Browse files

Radiogroup study docs

parent 9ec0e0f8
No related branches found
No related tags found
1 merge request!47Listview
import m from 'mithril';
import { RadioGroup } from 'polythene-mithril';
export default class RadioGroupComponent {
constructor(vnode) {
this.defaultProps = {
className: 'blue-RadioGroup',
element: 'RadioGroup',
disabled: vnode.attrs.active === false,
label: 'Unnamed RadioGroup',
};
}
view(vnode) {
return m(RadioGroup, { ...this.defaultProps, ...vnode.attrs });
}
}
export { default as Button } from './Button';
export { default as RadioGroup } from './RadioGroup';
......@@ -3,7 +3,7 @@ import * as studydocs from '../../models/studydocs';
import { apiUrl } from '../../models/config';
import { isLoggedIn } from '../../models/auth';
import { Error401 } from '../errors';
import { Button } from '../../components';
import { Button, RadioGroup } from '../../components';
const tableHeadings = ['title', 'type'];
......@@ -61,6 +61,19 @@ export default class studydocList {
label: 'Add new',
events: { onclick: () => m.route.set('/studydocuments/new') },
}),
m(RadioGroup, {
name: 'Departement',
buttons: [
{
value: '1',
label: 'D-MAVT',
},
{
value: '2',
label: 'D-ITET',
},
],
}),
]),
m('div.content', [
m('table', [
......@@ -70,7 +83,7 @@ export default class studydocList {
studydocs
.getList()
.map(doc =>
m('tr', { class:'list-items', onclick: () => this.selectDocument(doc) }, [
m('tr', { class: 'list-items', onclick: () => this.selectDocument(doc) }, [
m('td', doc.title),
m('td', doc.type),
])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment