Commit 4f30fbc5 authored by Hermann's avatar Hermann
Browse files

xMerge branch 'master' into fix/departmentnone

parents b60dcec6 25f819b2
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"start": "webpack-dev-server --hot --inline", "start": "webpack-dev-server --hot --inline",
"build": "webpack -p --config webpack.config.prod.js", "build": "webpack -p --config webpack.config.prod.js",
"build-dev": "webpack -p --config webpack.config.dev.js", "build-dev": "webpack -p --config webpack.config.dev.js",
"lint": "eslint src/**.js" "lint": "eslint src/**/*.js src/*.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"compression-webpack-plugin": "^1.1.11", "compression-webpack-plugin": "^1.1.11",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"eslint": "^4.10.0", "eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0", "eslint-config-airbnb-base": "^12.1.0",
"eslint-loader": "^1.9.0", "eslint-loader": "^1.9.0",
"eslint-plugin-import": "^2.9.0", "eslint-plugin-import": "^2.9.0",
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
TextField, TextField,
Button, Button,
} from 'polythene-mithril'; } from 'polythene-mithril';
import Stream from 'mithril/stream';
import { styler } from 'polythene-core-css'; import { styler } from 'polythene-core-css';
import { DropdownCard, DatalistController } from 'amiv-web-ui-components'; import { DropdownCard, DatalistController } from 'amiv-web-ui-components';
// eslint-disable-next-line import/extensions // eslint-disable-next-line import/extensions
...@@ -134,6 +135,7 @@ export default class viewEvent extends ItemView { ...@@ -134,6 +135,7 @@ export default class viewEvent extends ItemView {
this.emailAdresses = false; this.emailAdresses = false;
this.emaillist = ['']; this.emaillist = [''];
this.showAllEmails = false; this.showAllEmails = false;
this.modalDisplay = Stream('none');
} }
oninit() { oninit() {
...@@ -192,6 +194,10 @@ export default class viewEvent extends ItemView { ...@@ -192,6 +194,10 @@ export default class viewEvent extends ItemView {
let displaySpots = '-'; let displaySpots = '-';
const stdMargin = { margin: '5px' }; const stdMargin = { margin: '5px' };
// Get the image and insert it inside the modal -
// use its "alt" text as a caption
const modalImg = document.getElementById('modalImg');
if (this.data.spots !== 0) { if (this.data.spots !== 0) {
displaySpots = this.data.spots; displaySpots = this.data.spots;
} }
...@@ -289,7 +295,7 @@ export default class viewEvent extends ItemView { ...@@ -289,7 +295,7 @@ export default class viewEvent extends ItemView {
]), ]),
// a list of email adresses of all participants, easy to copy-paste // a list of email adresses of all participants, easy to copy-paste
m(DropdownCard, { title: 'Email Adresses' }, [ m(DropdownCard, { title: 'Email Adresses', style: { margin: '10px 0' } }, [
m(Switch, { m(Switch, {
defaultChecked: false, defaultChecked: false,
label: 'show unaccepted', label: 'show unaccepted',
...@@ -300,8 +306,61 @@ export default class viewEvent extends ItemView { ...@@ -300,8 +306,61 @@ export default class viewEvent extends ItemView {
}), }),
m(EmailList, { list: this.emaillist }), m(EmailList, { list: this.emaillist }),
]), ]),
]),
m(DropdownCard, { title: 'Images' }, [
m('div', {
style: {
display: 'flex',
},
}, [
m('div', {
style: {
width: '40%',
padding: '5px',
},
}, [
this.data.img_poster && m('div', 'Poster'),
this.data.img_poster && m('img', {
src: `${apiUrl}${this.data.img_poster.file}`,
width: '100%',
onclick: () => {
this.modalDisplay('block');
modalImg.src = `${apiUrl}${this.data.img_poster.file}`;
},
}),
]),
m('div', {
style: {
width: '52%',
padding: '5px',
},
}, [
m('div', [
this.data.img_infoscreen && m('div', 'Infoscreen'),
this.data.img_infoscreen && m('img', {
src: `${apiUrl}${this.data.img_infoscreen.file}`,
width: '100%',
onclick: () => {
this.modalDisplay('block');
modalImg.src = `${apiUrl}${this.data.img_infoscreen.file}`;
},
}),
]),
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}`;
},
}),
]),
]),
]),
]),
]),
m('div.viewcontainercolumn', [ m('div.viewcontainercolumn', [
this.data.time_register_start ? m(ParticipantsTable, { this.data.time_register_start ? m(ParticipantsTable, {
where: { accepted: true, event: this.data._id }, where: { accepted: true, event: this.data._id },
...@@ -313,7 +372,46 @@ export default class viewEvent extends ItemView { ...@@ -313,7 +372,46 @@ export default class viewEvent extends ItemView {
}) : '', }) : '',
]), ]),
]), ]),
m('div', {
id: 'imgModal',
style: {
display: this.modalDisplay(),
position: 'fixed',
'z-index': '100',
'padding-top': '100px',
left: 0,
top: 0,
width: '100vw',
height: '100vh',
overflow: 'auto',
'background-color': 'rgba(0, 0, 0, 0.9)',
},
}, [
m('img', {
id: 'modalImg',
style: {
margin: 'auto',
display: 'block',
'max-width': '80vw',
'max-heigth': '80vh',
},
}),
m('div', {
onclick: () => {
this.modalDisplay('none');
},
style: {
top: '15px',
right: '35px',
color: '#f1f1f1',
transition: '0.3s',
'z-index': 10,
position: 'absolute',
'font-size': '40px',
'font-weight': 'bold',
},
}, 'x'),
]),
], [ ], [
m(Button, { m(Button, {
label: 'Clone Event', label: 'Clone Event',
......
...@@ -2,7 +2,6 @@ import m from 'mithril'; ...@@ -2,7 +2,6 @@ import m from 'mithril';
import { DatalistController } from 'amiv-web-ui-components'; import { DatalistController } from 'amiv-web-ui-components';
import { studydocuments as config } from '../resourceConfig.json'; import { studydocuments as config } from '../resourceConfig.json';
import TableView from '../views/tableView'; import TableView from '../views/tableView';
import { dateFormatter } from '../utils';
import { ResourceHandler } from '../auth'; import { ResourceHandler } from '../auth';
......
import m from 'mithril'; import m from 'mithril';
// eslint-disable-next-line import/extensions
import { apiUrl } from 'networkConfig';
import ItemView from '../views/itemView'; import ItemView from '../views/itemView';
import { Property } from '../views/elements'; import { Property } from '../views/elements';
......
...@@ -29,7 +29,7 @@ export default class EditView extends ItemView { ...@@ -29,7 +29,7 @@ export default class EditView extends ItemView {
* @param {object} embedded [any embedding query that should be added * @param {object} embedded [any embedding query that should be added
* to API requests for this resource] * to API requests for this resource]
*/ */
constructor(vnode,) { constructor(vnode) {
super(vnode); super(vnode);
// the form is valid in case that the item controller is in edit mode // the form is valid in case that the item controller is in edit mode
const validInitially = this.controller.modus === 'edit'; const validInitially = this.controller.modus === 'edit';
......
import m from 'mithril'; import m from 'mithril';
import { IconButton, Toolbar, ToolbarTitle, Dialog, Button } from 'polythene-mithril'; import { IconButton, Toolbar, Dialog, Button } from 'polythene-mithril';
import { ButtonCSS } from 'polythene-css'; import { ButtonCSS } from 'polythene-css';
import { colors } from '../style'; import { colors } from '../style';
import { loadingScreen } from '../layout'; import { loadingScreen } from '../layout';
......
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