Skip to content
Snippets Groups Projects
Commit 2a837dbb authored by trfloria's avatar trfloria
Browse files

Checkbox implement studydocs

parent 9ec0e0f8
No related branches found
No related tags found
1 merge request!47Listview
import m from 'mithril';
import { Checkbox } from "polythene-mithril"
import { CheckboxCSS } from 'polythene-css';
export default class CheckboxComponent {
constructor(vnode) {
this.defaultProps = {
className: 'themed-checkbox',
element: 'checkbox',
disabled: vnode.attrs.active === false,
label: 'Unnamed checkbox',
};
}
view(vnode) {
return m(Checkbox, { ...this.defaultProps, ...vnode.attrs });
}
}
export { default as Button } from './Button'; export { default as Button } from './Button';
export { default as Checkbox } from './Checkbox';
...@@ -3,7 +3,8 @@ import * as studydocs from '../../models/studydocs'; ...@@ -3,7 +3,8 @@ import * as studydocs from '../../models/studydocs';
import { apiUrl } from '../../models/config'; import { apiUrl } from '../../models/config';
import { isLoggedIn } from '../../models/auth'; import { isLoggedIn } from '../../models/auth';
import { Error401 } from '../errors'; import { Error401 } from '../errors';
import { Button } from '../../components'; import { Button, Checkbox } from '../../components';
//import { Checkbox } from "polythene-mithril"
const tableHeadings = ['title', 'type']; const tableHeadings = ['title', 'type'];
...@@ -57,6 +58,9 @@ export default class studydocList { ...@@ -57,6 +58,9 @@ export default class studydocList {
m(Button, { label: 'Search' }), m(Button, { label: 'Search' }),
] ]
), ),
m(Checkbox, {
label: 'checkbox_text'
}),
m(Button, { m(Button, {
label: 'Add new', label: 'Add new',
events: { onclick: () => m.route.set('/studydocuments/new') }, events: { onclick: () => m.route.set('/studydocuments/new') },
...@@ -86,12 +90,12 @@ export default class studydocList { ...@@ -86,12 +90,12 @@ export default class studydocList {
m('tr', this.doc.professor), m('tr', this.doc.professor),
m('tr', this.doc.semester), m('tr', this.doc.semester),
m('tr', this.doc.author), m('tr', this.doc.author),
m(Button, { m(Button, {
label: 'Download', label: 'Download',
events: { events: {
onclick: () => window.open(`${apiUrl}${this.doc.files[0].file}`, '_blank'), onclick: () => window.open(`${apiUrl}${this.doc.files[0].file}`, '_blank'),
}, },
}), }),
]), ]),
]) ])
: null, : null,
......
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