Commit ec842a8f authored by Hermann's avatar Hermann
Browse files

Various UI tweaks

parent 69163181
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"@material/drawer": "^0.30.0", "@material/drawer": "^0.30.0",
"@material/select": "^0.35.1", "@material/select": "^0.35.1",
"ajv": "^5.5.0", "ajv": "^5.5.0",
"amiv-web-ui-components": "git+https://git@gitlab.ethz.ch/amiv/web-ui-components.git#068a864cae7c8408286d835efe1850467f69098d", "amiv-web-ui-components": "git+https://git@gitlab.ethz.ch/amiv/web-ui-components.git#9c3d54e1e60bba007b44c6d293c724a96be1e991",
"axios": "^0.17.1", "axios": "^0.17.1",
"client-oauth2": "^4.2.0", "client-oauth2": "^4.2.0",
"mithril": "^1.1.6", "mithril": "^1.1.6",
......
...@@ -68,7 +68,7 @@ export default class newEvent extends EditView { ...@@ -68,7 +68,7 @@ export default class newEvent extends EditView {
beforeSubmit() { beforeSubmit() {
// Collect images seperate from everything else // Collect images seperate from everything else
const images = {}; const images = {};
['thumbnail', 'banner', 'infoscreen', 'poster'].forEach((key) => { ['thumbnail', 'infoscreen', 'poster'].forEach((key) => {
if (this.form.data[`new_${key}`]) { if (this.form.data[`new_${key}`]) {
images[`img_${key}`] = this.form.data[`new_${key}`]; images[`img_${key}`] = this.form.data[`new_${key}`];
delete this.form.data[`new_${key}`]; delete this.form.data[`new_${key}`];
...@@ -89,7 +89,7 @@ export default class newEvent extends EditView { ...@@ -89,7 +89,7 @@ export default class newEvent extends EditView {
additionalFields.properties.sbb_abo = { additionalFields.properties.sbb_abo = {
type: 'string', type: 'string',
title: 'SBB Abonnement', title: 'SBB Abonnement',
enum: ['None', 'GA', 'Halbtax', 'Gleis 7'], enum: ['None', 'GA', 'Halbtax', 'Gleis 7', 'HT + Gleis 7'],
}; };
additionalFields.required.push('sbb_abo'); additionalFields.required.push('sbb_abo');
} }
...@@ -344,7 +344,7 @@ export default class newEvent extends EditView { ...@@ -344,7 +344,7 @@ export default class newEvent extends EditView {
} }
}, },
}), }),
this.hasprice && this.form._renderField('price', { label: 'Price', type: 'number' }), ...this.hasprice && this.form.renderSchema(['price']),
m('br'), m('br'),
m(Switch, { m(Switch, {
label: 'people have to register to attend this event', label: 'people have to register to attend this event',
...@@ -408,12 +408,16 @@ export default class newEvent extends EditView { ...@@ -408,12 +408,16 @@ export default class newEvent extends EditView {
}), }),
*/ */
...this.form.renderSchema(['show_website', 'show_announce', 'show_infoscreen']), ...this.form.renderSchema(['show_website', 'show_announce', 'show_infoscreen']),
m('div', 'Please send your announce text additionally via email to info@amiv.ch ' +
'until the new announce tool is ready.'),
m('div', 'Please send an email to info@amiv.ch in order to show your event on' +
'the infoscreen until the new infoscreen tool is ready.'),
]), ]),
// page 5: images // page 5: images
m('div', { m('div', {
style: { display: (this.currentpage === 5) ? 'block' : 'none' }, style: { display: (this.currentpage === 5) ? 'block' : 'none' },
}, [ }, [
['thumbnail', 'banner', 'poster', 'infoscreen'].map(key => [ ['thumbnail', 'poster', 'infoscreen'].map(key => [
this.form.data[`img_${key}`] ? m('img', { this.form.data[`img_${key}`] ? m('img', {
src: `${apiUrl}${this.form.data[`img_${key}`].file}`, src: `${apiUrl}${this.form.data[`img_${key}`].file}`,
style: { 'max-height': '50px', 'max-width': '100px' }, style: { 'max-height': '50px', 'max-width': '100px' },
......
...@@ -416,17 +416,6 @@ export default class viewEvent extends ItemView { ...@@ -416,17 +416,6 @@ export default class viewEvent extends ItemView {
}, },
}), }),
]), ]),
m('div', [
this.data.img_banner && m('div', 'Banner'),
this.data.img_banner && m('img', {
src: `${apiUrl}${this.data.img_banner.file}`,
width: '100%',
onclick: () => {
this.modalDisplay('block');
modalImg.src = `${apiUrl}${this.data.img_banner.file}`;
},
}),
]),
]), ]),
]), ]),
]), ]),
......
...@@ -5,7 +5,7 @@ import { Card } from 'polythene-mithril'; ...@@ -5,7 +5,7 @@ import { Card } from 'polythene-mithril';
import { apiUrl } from 'networkConfig'; import { apiUrl } from 'networkConfig';
import ItemView from '../views/itemView'; import ItemView from '../views/itemView';
import { dateFormatter } from '../utils'; import { dateFormatter } from '../utils';
import { Property } from '../views/elements'; import { icons, Property, chip } from '../views/elements';
export default class viewJob extends ItemView { export default class viewJob extends ItemView {
constructor(vnode) { constructor(vnode) {
...@@ -28,16 +28,15 @@ export default class viewJob extends ItemView { ...@@ -28,16 +28,15 @@ export default class viewJob extends ItemView {
style: { 'line-height': '50px', 'margin-top': '0px' }, style: { 'line-height': '50px', 'margin-top': '0px' },
}, this.data.company), }, this.data.company),
]), ]),
m('div.maincontainer', [
m(chip, { svg: this.data.show_website ? icons.checked : icons.clear }, 'website'),
]),
// below the title, most important details are listed // below the title, most important details are listed
m('div', { style: { display: 'flex', margin: '5px 0px 0px 5px' } }, [ m('div', { style: { display: 'flex', margin: '5px 0px 0px 5px' } }, [
this.data.time_end ? m(Property, { this.data.time_end ? m(Property, {
title: 'Offer Ends', title: 'Offer Ends',
style: stdMargin, style: stdMargin,
}, `${dateFormatter(this.data.time_end)}`) : '', }, `${dateFormatter(this.data.time_end)}`) : '',
m(Property, {
title: 'Show on Website',
style: stdMargin,
}, this.data.show_website ? 'visible' : 'not visible'),
m(Property, { m(Property, {
title: 'PDF', title: 'PDF',
style: stdMargin, style: stdMargin,
......
...@@ -14,9 +14,10 @@ export default class StudydocTable { ...@@ -14,9 +14,10 @@ export default class StudydocTable {
getItemData(data) { getItemData(data) {
return [ return [
m('div', { style: { width: 'calc(100% - 32em)' } }, data.title), m('div', { style: { width: 'calc(100% - 36em)' } }, data.title),
m('div', { style: { width: '6em' } }, data.department && data.department.toUpperCase()), m('div', { style: { width: '8em' } }, data.author),
m('div', { style: { width: '6em' } }, data.semester), m('div', { style: { width: '4em' } }, data.year),
m('div', { style: { width: '4em' } }, data.semester),
m('div', { style: { width: '10em' } }, data.lecture), m('div', { style: { width: '10em' } }, data.lecture),
m('div', { style: { width: '10em' } }, data.files.map((file) => { m('div', { style: { width: '10em' } }, data.files.map((file) => {
const splittedFilenames = file.name.split('.'); const splittedFilenames = file.name.split('.');
...@@ -31,9 +32,10 @@ export default class StudydocTable { ...@@ -31,9 +32,10 @@ export default class StudydocTable {
keys: config.tableKeys, keys: config.tableKeys,
tileContent: this.getItemData, tileContent: this.getItemData,
titles: [ titles: [
{ text: 'Title', width: 'calc(100% - 32em)' }, { text: 'Title', width: 'calc(100% - 36em)' },
{ text: 'Department', width: '6em' }, { text: 'Author', width: '8em' },
{ text: 'Semester', width: '6em' }, { text: 'Year', width: '4em' },
{ text: 'Sem.', width: '4em' },
{ text: 'Lecture', width: '10em' }, { text: 'Lecture', width: '10em' },
{ text: 'Files', width: '10em' }, { text: 'Files', width: '10em' },
], ],
......
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