-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from bkd-mba-fbi/develop
3.4.0
- Loading branch information
Showing
24 changed files
with
619 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import {setListViewGrid, setSortAs} from 'kursausschreibung/framework/storage'; | ||
|
||
/** | ||
* sort value set localStroage sortAs and reload | ||
* @param {string} value | ||
*/ | ||
export function sortAs(value) { | ||
setSortAs(value); | ||
window.location.reload(); | ||
} | ||
|
||
|
||
/** | ||
* display eventlist as grid or list | ||
* true > grid | ||
* false > list | ||
* @param {boolean} bool | ||
*/ | ||
export function displayAsGrid(bool) { | ||
var list = document.getElementById('list-cards'); | ||
var btGrid = document.getElementById('bt-grid'); | ||
var btList = document.getElementById('bt-list'); | ||
|
||
if (typeof bool === "boolean") { | ||
setListViewGrid(bool); | ||
} else { | ||
setListViewGrid(false); | ||
} | ||
|
||
if(bool) { | ||
list.classList.add('uk-grid'); | ||
list.classList.add('uk-grid-match'); | ||
list.classList.add('uk-grid-stack'); | ||
list.classList.add('uk-child-width-1-2@m'); | ||
list.classList.add('uk-child-width-1-3@l'); | ||
list.classList.remove('uk-list-divider'); | ||
list.classList.remove('uk-list'); | ||
btGrid.classList.add('active-tab'); | ||
btList.classList.remove('active-tab'); | ||
|
||
} else { | ||
list.classList.add('uk-list-divider'); | ||
list.classList.add('uk-list'); | ||
list.classList.remove('uk-grid'); | ||
list.classList.remove('uk-grid-match'); | ||
list.classList.remove('uk-grid-stack'); | ||
list.classList.remove('uk-child-width-1-2@m'); | ||
list.classList.remove('uk-child-width-1-3@l'); | ||
btList.classList.add('active-tab'); | ||
btGrid.classList.remove('active-tab'); | ||
} | ||
for (const child of list.children) { | ||
|
||
if(bool) { | ||
child.classList.add('uk-card'); | ||
child.classList.add('uk-card-body'); | ||
child.classList.add('card-list'); | ||
} else { | ||
child.classList.remove('uk-card'); | ||
child.classList.remove('uk-card-body'); | ||
child.classList.remove('card-list'); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { getRootModulUrl } from "./url-helpers"; | ||
|
||
/** | ||
* create a json-ld element in head of document with schema.org course. | ||
* @param {object} allevents from getAllEvents() | ||
*/ | ||
export function setJsonLd(allEvents) { | ||
|
||
let ld = []; | ||
let areas = Object.values(allEvents.areas); | ||
|
||
areas.forEach(area => { | ||
area.events.forEach(event => { | ||
let course = {}; | ||
course['@context'] = 'https://schema.org/'; | ||
course['@type'] = 'Course'; | ||
course['name'] = event.Designation; | ||
course['description'] = getDescription(event); | ||
course['courseCode'] = event.Number; | ||
course['provider'] = {type: 'Organization', name: event.Host}; | ||
course['url'] = getRootModulUrl() + '#/uid/' + event.Id; | ||
|
||
ld.push(course); | ||
}); | ||
|
||
}); | ||
|
||
const script = document.createElement('script'); | ||
script.type = 'application/ld+json'; | ||
script.innerHTML = JSON.stringify(ld); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
} | ||
|
||
function getDescription(event){ | ||
let description = event.EventCategory + ';'; | ||
event.texts.forEach(text => { | ||
description = description + text.label + ':' + text.memo + ';'; | ||
}); | ||
return description; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.