To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 73653753 authored by Lionel Trebuchon's avatar Lionel Trebuchon
Browse files

Merge branch 'master' into jobcreation

parents 8170fe39 4f30fbc5
......@@ -7,7 +7,7 @@
"start": "webpack-dev-server --hot --inline",
"build": "webpack -p --config webpack.config.prod.js",
"build-dev": "webpack -p --config webpack.config.dev.js",
"lint": "eslint src/**.js"
"lint": "eslint src/**/*.js src/*.js"
},
"repository": {
"type": "git",
......@@ -18,7 +18,7 @@
"@material/drawer": "^0.30.0",
"@material/select": "^0.35.1",
"ajv": "^5.5.0",
"amiv-web-ui-components": "git+https://git@gitlab.ethz.ch/amiv/web-ui-components.git#61e129378f57e98d3f60106298251c3b0f4b2286",
"amiv-web-ui-components": "git+https://git@gitlab.ethz.ch/amiv/web-ui-components.git#217aaba4e1ba269d4f27f134e95df8947036ea20",
"axios": "^0.17.1",
"client-oauth2": "^4.2.0",
"html-escape": "^2.0.0",
......@@ -38,7 +38,7 @@
"babel-preset-env": "^1.7.0",
"compression-webpack-plugin": "^1.1.11",
"css-loader": "^0.28.11",
"eslint": "^4.10.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-import": "^2.9.0",
......
......@@ -7,6 +7,7 @@ import {
TextField,
Button,
} from 'polythene-mithril';
import Stream from 'mithril/stream';
import { styler } from 'polythene-core-css';
import { DropdownCard, DatalistController } from 'amiv-web-ui-components';
// eslint-disable-next-line import/extensions
......@@ -134,6 +135,7 @@ export default class viewEvent extends ItemView {
this.emailAdresses = false;
this.emaillist = [''];
this.showAllEmails = false;
this.modalDisplay = Stream('none');
}
oninit() {
......@@ -192,6 +194,10 @@ export default class viewEvent extends ItemView {
let displaySpots = '-';
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) {
displaySpots = this.data.spots;
}
......@@ -289,7 +295,7 @@ export default class viewEvent extends ItemView {
]),
// 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, {
defaultChecked: false,
label: 'show unaccepted',
......@@ -300,8 +306,61 @@ export default class viewEvent extends ItemView {
}),
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', [
this.data.time_register_start ? m(ParticipantsTable, {
where: { accepted: true, event: this.data._id },
......@@ -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, {
label: 'Clone Event',
......
......@@ -2,7 +2,6 @@ import m from 'mithril';
import { DatalistController } from 'amiv-web-ui-components';
import { studydocuments as config } from '../resourceConfig.json';
import TableView from '../views/tableView';
import { dateFormatter } from '../utils';
import { ResourceHandler } from '../auth';
......
import m from 'mithril';
// eslint-disable-next-line import/extensions
import { apiUrl } from 'networkConfig';
import ItemView from '../views/itemView';
import { Property } from '../views/elements';
......
......@@ -18,6 +18,7 @@ export default class UserEdit extends EditView {
'div', { style },
m(RadioGroup, {
name: 'Membership',
default: this.form.data.membership,
values: [
{
value: 'none',
......@@ -46,6 +47,7 @@ export default class UserEdit extends EditView {
'div', { style },
m(RadioGroup, {
name: 'Sex',
default: this.form.data.gender,
values: [
{ value: 'female', label: 'Female' },
{ value: 'male', label: 'Male' },
......@@ -60,6 +62,7 @@ export default class UserEdit extends EditView {
'div', { style },
m(RadioGroup, {
name: 'Departement',
default: this.form.data.department,
values: [
{ value: 'itet', label: 'ITET' },
{ value: 'mavt', label: 'MAVT' },
......
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 { colors } from '../style';
import { loadingScreen } from '../layout';
......
Markdown is supported
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