Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
New default picture of meals & Sort exams
Browse files Browse the repository at this point in the history
  • Loading branch information
wiomoc committed Jul 15, 2020
1 parent 27319ff commit eb53e4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/MealPicture.vue
Expand Up @@ -2,7 +2,7 @@
<div class="fullscreen">
<div class="photo">
<img :src="'https://sws2.maxmanager.xyz/assets/' + (meal.photo? meal.photo:
'fotos/musikhochschule/Speisefotos/0-1/27816947m_dummy_speisen.jpg')"
'fotos/dummies/foto-kommt-noch.jpg')"
:alt="$t('page.meals.imageNotLoaded')">
<fa-icon icon="times" class="lu-icon lu-times-circle close" @click="$router.back()" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Meals.vue
Expand Up @@ -22,7 +22,7 @@
<div v-for="meal in meals" class="meal article">
<router-link :to="{name: 'mealpicture', params: {meal}}" class="photo">
<div :style="'background-image: url(\'https://sws2.maxmanager.xyz/assets/' + (meal.photo? meal.photo:
'fotos/musikhochschule/Speisefotos/0-1/27816947m_dummy_speisen.jpg') +'\')'"
'fotos/dummies/foto-kommt-noch.jpg') +'\')'"
:alt="$t('page.meals.imageNotLoaded')" loading="lazy" class="img" />
</router-link>
<div class="data">
Expand Down
13 changes: 9 additions & 4 deletions src/stores/lsf.js
Expand Up @@ -64,6 +64,9 @@ export const Client = {
let columns = rows[rowIndex].children;
if (columns[0].className === 'qis_kontoOnTop') continue;

const semesterParts = columns[2].textContent.trim().split(' ');
const semester = semesterParts[semesterParts.length - 1];

exams.push({
id: columns[0].textContent.trim(),
title: columns[1].textContent.trim(),
Expand All @@ -72,10 +75,12 @@ export const Client = {
cp: parseFloat(columns[5].textContent.trim()),
try: parseInt(columns[7].textContent.trim()),
date: columns[8].textContent.trim() || null,
semester,
});
}

exams = exams.reverse();
exams = exams.sort((a, b) => a.date && b.date ? b.date - a.date : 0);
exams = exams.sort((a, b) => b.semester.localeCompare(a.semester));

return {exams, fullname};
},
Expand Down Expand Up @@ -117,7 +122,7 @@ export const Client = {
const row = rows[rowIndex + 2];

const columns = row.children;
let skip = rowIndex % 4 ? 1 : 2;
let skip = rowIndex % 4 ? 1 : 2;

for (let columnIndex = skip; columnIndex < columns.length; columnIndex++) {
const column = columns[columnIndex];
Expand Down Expand Up @@ -172,7 +177,7 @@ export const Client = {
}
}
}
return lectures.sort((a,b) => a.start - b.start);
return lectures.sort((a, b) => a.start - b.start);
},

async loadSubjects() {
Expand Down Expand Up @@ -211,7 +216,7 @@ export const Client = {
'&breadcrumb=schedule&topitem=lectures');
const url = dom.querySelector('.content_max > form').getAttribute('action');

await fetchDOM(url + '&par=old&PlanSpeichern=PlanSpeichern &'+
await fetchDOM(url + '&par=old&PlanSpeichern=PlanSpeichern &' +
courses.map(ref => `&add.${ref.id}=${ref.subjectId}`).join(''))
}
};
Expand Down

0 comments on commit eb53e4e

Please sign in to comment.