Commit 0a864c86 authored by Elias Pareth's avatar Elias Pareth
Browse files

Changes to Studydocs style -- worked on the general layou:

parent c9f7edc6
#studydoc-list { #studydoc-list {
div.list-item { div.list-item {
display: grid; display: grid;
grid-template-columns: auto 20% 40%; grid-template-columns: auto 30% 20%;
grid-row-gap: 5px; grid-row-gap: 5px;
padding: 5px 0 5px 0;
&:first-of-type { &:first-of-type {
font-weight: bold; font-weight: bold;
......
...@@ -17,18 +17,27 @@ export default class StudydocDetails { ...@@ -17,18 +17,27 @@ export default class StudydocDetails {
return [ return [
m('table', [ m('table', [
m('tr', [m('td', m('b', i18n('studydocs.title'))), m('td', document.title)]), m('tr', [m('td', m('b', i18n('studydocs.title'))), m('td', document.title)]),
m('tr', [m('td', m('b', i18n('studydocs.type'))), m('td', i18n(document.type))]),
m('tr', [m('td', m('b', i18n('studydocs.lecture'))), m('td', document.lecture)]), m('tr', [m('td', m('b', i18n('studydocs.lecture'))), m('td', document.lecture)]),
m('tr', [m('td', m('b', i18n('studydocs.professor'))), m('td', document.professor)]), m('tr', [m('td', m('b', i18n('studydocs.professor'))), m('td', document.professor)]),
m('tr', [m('td', m('b', i18n('studydocs.semester'))), m('td', document.semester)]), m('tr', [m('td', m('b', i18n('studydocs.semester'))), m('td', document.semester)]),
m('tr', [m('td', m('b', i18n('studydocs.author'))), m('td', document.author)]), m('tr', [m('td', m('b', i18n('studydocs.author'))), m('td', document.author)]),
m('tr', [m('td', m('b', i18n('studydocs.department'))), m('td', document.department)]), m('tr', [m('td', m('b', i18n('studydocs.department'))), m('td', document.department)]),
m(Button, {
label: 'Download',
events: {
onclick: () => window.open(`${apiUrl}${document.files[0].file}`, '_blank'),
},
}),
]), ]),
m(
'div',
...document.files.map(item =>
m('tr', [
m('td', item.file),
m(Button, {
label: 'Download',
events: {
onclick: () => window.open(`${apiUrl}${item.file}`, '_blank'),
},
}),
])
)
),
]; ];
} }
} }
...@@ -174,7 +174,7 @@ export default class StudydocList extends FilteredListPage { ...@@ -174,7 +174,7 @@ export default class StudydocList extends FilteredListPage {
} }
get _listView() { get _listView() {
const tableHeadings = ['studydocs.title', 'studydocs.author', 'studydocs.type']; const tableHeadings = ['studydocs.title', 'studydocs.author', 'studydocs.course_year'];
return [ return [
m('div.list-item', tableHeadings.map(header => m('span', i18n(header)))), m('div.list-item', tableHeadings.map(header => m('span', i18n(header)))),
...controller.map(page => ...controller.map(page =>
...@@ -217,7 +217,7 @@ export default class StudydocList extends FilteredListPage { ...@@ -217,7 +217,7 @@ export default class StudydocList extends FilteredListPage {
m.route.set(`/${currentLanguage()}/studydocuments/${document._id}`); m.route.set(`/${currentLanguage()}/studydocuments/${document._id}`);
}, },
}, },
[m('span', document.title), m('span', document.author), m('span', i18n(document.type))] [m('span', document.title), m('span', document.author), m('span', i18n(document.course_year))]
); );
} }
} }
...@@ -118,7 +118,8 @@ export default class studydocNew { ...@@ -118,7 +118,8 @@ export default class studydocNew {
m(InputGroupForm, { m(InputGroupForm, {
name: 'course_year', name: 'course_year',
title: i18n('studydocs.course_year'), title: i18n('studydocs.course_year'),
type: 'number', type: 'date',
required: 1,
args: { args: {
placeholder: new Date().getFullYear(), placeholder: new Date().getFullYear(),
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment