Commit 661bbfc4 authored by Sandro Lutz's avatar Sandro Lutz Committed by lic
Browse files

Enhancement of minor design issues

parent cbea8267
...@@ -7,4 +7,4 @@ export { default as FilterView } from './FilterView'; ...@@ -7,4 +7,4 @@ export { default as FilterView } from './FilterView';
export { default as InputGroupForm } from './form/inputGroup'; export { default as InputGroupForm } from './form/inputGroup';
export { default as SelectGroupForm } from './form/selectGroup'; export { default as SelectGroupForm } from './form/selectGroup';
export { default as FileInput } from './FileInput'; export { default as FileInput } from './FileInput';
export { default as Spinner } from './EventCard'; export { default as EventCard } from './EventCard';
...@@ -42,12 +42,26 @@ footer div.copyright { ...@@ -42,12 +42,26 @@ footer div.copyright {
@media @mobile { @media @mobile {
padding: 2.2em 0 1.2em; padding: 2.2em 0 1.2em;
justify-content: center; justify-content: center;
flex-wrap: wrap;
}
> * {
@media @mobile {
width: 100%;
text-align: center;
margin-left: 0;
padding: 1em;
}
} }
a { a {
margin-left: 1em; margin-left: 1em;
color: @color-red; color: @color-red;
text-decoration: none; text-decoration: none;
@media @mobile {
margin-left: 0;
}
} }
} }
......
import m from 'mithril'; import m from 'mithril';
import { apiUrl } from 'config'; import { apiUrl } from 'config';
import { Card } from 'polythene-mithril'; import { Card } from 'polythene-mithril';
import { Spinner } from '../components'; import { Spinner } from 'amiv-web-ui-components';
import { EventCard } from '../components';
import { EventController } from '../models/events'; import { EventController } from '../models/events';
import { JobofferController } from '../models/joboffers'; import { JobofferController } from '../models/joboffers';
import { i18n, currentLanguage } from '../models/language'; import { i18n, currentLanguage } from '../models/language';
import icons from '../images/icons'; import icons from '../images/icons';
import EventCard from '../components/EventCard';
async function getData(state) { async function getData(state) {
const events = await state.eventController.upcomingEvents.getPageData(1); const events = await state.eventController.upcomingEvents.getPageData(1);
console.log(events);
if (events.length < 3) { if (events.length < 3) {
const pastEvents = await state.eventController.pastEvents.getPageData(1); const pastEvents = await state.eventController.pastEvents.getPageData(1);
const { length } = events; const { length } = events;
...@@ -91,10 +90,6 @@ export default class Frontpage { ...@@ -91,10 +90,6 @@ export default class Frontpage {
? this.jobs.map(item => this.constructor._renderJobCard(item)) ? this.jobs.map(item => this.constructor._renderJobCard(item))
: Array.from(Array(3)).map(() => this.constructor._renderJobCard(null, true)) : Array.from(Array(3)).map(() => this.constructor._renderJobCard(null, true))
), ),
m(
'div.frontpage-row',
this.socialmedia.map(item => this.constructor._renderSocialMediaCard(item))
),
]); ]);
} }
...@@ -125,33 +120,6 @@ export default class Frontpage { ...@@ -125,33 +120,6 @@ export default class Frontpage {
}); });
} }
static _renderEventCard(item, loading = false) {
let url;
let cardContent;
if (item && !loading) {
url = {
href: `${m.route.get()}events/${item._id}`,
oncreate: m.route.link,
};
if (item.img_poster) {
cardContent = m('img', {
src: `${apiUrl}${item.img_poster.file}`,
});
} else {
cardContent = m('div', [m('h2', item.getTitle()), m('span', item.getCatchphrase())]);
}
} else {
cardContent = m(Spinner, { show: true });
}
return m(Card, {
url,
content: m('div.image.ratio-paper-a-vertical', cardContent),
});
}
static _renderJobCard(item, loading = false) { static _renderJobCard(item, loading = false) {
let url; let url;
let cardContent; let cardContent;
......
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