Commit 74c82041 authored by Sandro Lutz's avatar Sandro Lutz Committed by Sandro Lutz
Browse files

Remove what's hot section on frontpage

parent a2c3a9aa
...@@ -5,8 +5,7 @@ import Spinner from 'amiv-web-ui-components/src/spinner'; ...@@ -5,8 +5,7 @@ import Spinner from 'amiv-web-ui-components/src/spinner';
import EventCard from '../components/EventCard'; import EventCard from '../components/EventCard';
import EventController from '../models/events/EventController'; import EventController from '../models/events/EventController';
import JobofferController from '../models/joboffers/JobofferController'; import JobofferController from '../models/joboffers/JobofferController';
import { i18n, currentLanguage } from '../models/language'; import { i18n } from '../models/language';
import icons from '../images/icons';
async function getData(state) { async function getData(state) {
const events = await state.eventController.upcomingEvents.getPageData(1); const events = await state.eventController.upcomingEvents.getPageData(1);
...@@ -30,10 +29,8 @@ export default class Frontpage { ...@@ -30,10 +29,8 @@ export default class Frontpage {
); );
this.jobOfferController = new JobofferController({ max_results: 3 }); this.jobOfferController = new JobofferController({ max_results: 3 });
this.hot = [];
this.events = []; this.events = [];
this.jobs = []; this.jobs = [];
this.socialmedia = [];
} }
oncreate() { oncreate() {
...@@ -42,40 +39,10 @@ export default class Frontpage { ...@@ -42,40 +39,10 @@ export default class Frontpage {
this.jobs = result.jobs; this.jobs = result.jobs;
m.redraw(); m.redraw();
}); });
// MOCKDATA
this.hot = [
{
getTitle: () => {
if (currentLanguage() === 'de') return 'richtig heiss';
return 'super hot';
},
imageurl:
'https://www.heilpraxisnet.de/wp-content/uploads/2016/04/bier-lagern-1024x724.jpg',
},
{
getTitle: () => {
if (currentLanguage() === 'de') return 'auch ziemlich heiss';
return 'also pretty hot';
},
imageurl:
'https://image.shutterstock.com/z/stock-photo-group-of-happy-people-isolated-over-white-background-102307264.jpg',
},
{
title_en: 'kinda hot',
title_de: 'lauwarm',
getTitle: () => {
if (currentLanguage() === 'de') return 'lauwarm';
return 'kinda hot';
},
imageurl: 'https://bit.ly/2OUjN5w',
},
];
} }
view() { view() {
return m('div#frontpage-container', [ return m('div#frontpage-container', [
m('div.hot-row', this.hot.map((item, index) => this.constructor._renderHotCard(item, index))),
m('h2', i18n('events.title')), m('h2', i18n('events.title')),
m( m(
'div.frontpage-row', 'div.frontpage-row',
...@@ -93,34 +60,6 @@ export default class Frontpage { ...@@ -93,34 +60,6 @@ export default class Frontpage {
]); ]);
} }
static _renderHotCard(item, index) {
return m(Card, {
className: index === 0 ? 'hot-first-card' : 'hot-card',
content: [
{
media: {
origin: 'center',
ratio: 'landscape',
content: m('img', {
src: item.imageurl ? item.imageurl : icons.logoWheel,
alt: item.getTitle(),
}),
overlay: {
sheet: true,
content: [
{
primary: {
title: item.getTitle(),
},
},
],
},
},
},
],
});
}
static _renderEventCard(item, loading = false) { static _renderEventCard(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