Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Added printable Version
Browse files Browse the repository at this point in the history
  • Loading branch information
cnoss committed Dec 14, 2023
1 parent c85ed3e commit 404d5ac
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/_layouts/components/moduleTools.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ exports.addCompetences = (data) => {

exports.resolveExamInfoSimple = (examInfo) => {

if(!examInfo || examInfo === undefined) return false;

const formatExamItem = (examInfo, type) => {
if(!examInfo[type]) return false;
return `${examInfo[type].art}`;
Expand Down
38 changes: 23 additions & 15 deletions src/_layouts/modulbeschreibung.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@ module.exports = {
layout: "default.11ty.js",
bodyClass: "modulbeschreibung",
},
render(data) {
render(data, context, givenData) {

const eleventy = context ? context : this;

// Für die Druckversion wird die Modulbeschreibung mit anderen Daten gerendert
const moduleData = givenData ? givenData.data : data;

const moduleTools = require('./components/moduleTools.11ty');
const peopleTools = require('./components/peopleTools.11ty');
const curriculumTools = require('./components/curriculumTools.11ty');
const utils = require('./components/utils.11ty.js');
const eleventy = this;

const translateStars = moduleTools.translateStars;

const studyProgramme = data.modulniveau;
const pathToCompetenceMap = eleventy.getCompetencesToModuleMapPath(studyProgramme);
const studyProgramme = moduleData.modulniveau;
const pathToCompetenceMap = eleventy.getCompetencesToModuleMapPath(studyProgramme) ? eleventy.getCompetencesToModuleMapPath(studyProgramme) : '';

data = moduleTools.addCompetences(data);
data = moduleTools.addCompetences(moduleData);
const idModul = eleventy.slugify(data.title);

const createRow = (label, value) => {
if(!value) return "";
Expand Down Expand Up @@ -77,7 +83,7 @@ module.exports = {
`;
});

const idBereich = this.slugify(key);
const idBereich = eleventy.slugify(key);

return `
<li id="${idBereich}">
Expand All @@ -91,7 +97,7 @@ module.exports = {

const handlungsfeldKuerzel = handlungsfelderMap.get(key);
const scoreCssClass = handlungsfeldKuerzel ? handlungsfeldKuerzel.toLowerCase() : '';
const idHandlungsfeld = this.slugify(key);
const idHandlungsfeld = eleventy.slugify(key);

return `
<div class="competence-block" id="${idHandlungsfeld}">
Expand Down Expand Up @@ -132,7 +138,7 @@ module.exports = {

const scoresTable = Object.entries(scoresHandlungsfelder).map(([key, values]) => {
const valuesList = Object.entries(values).map(([key, value]) => {
const idBereich = this.slugify(bereicheMapInverted[key]);
const idBereich = eleventy.slugify(bereicheMapInverted[key]);

return `
<li>
Expand Down Expand Up @@ -182,9 +188,9 @@ module.exports = {
<div class="chart"
data-chart='${modulkompetenzenData}'
data-handlungsfelder='${handlungsfelderMapInverted}'
data-target="competence-chart-erwerb"
data-target="competence-chart-erwerb-${idModul}"
data-direction="erwerb">
<canvas id="competence-chart-erwerb"></canvas>
<canvas id="competence-chart-erwerb-${idModul}"></canvas>
</div>
</div>
<div class="scores">
Expand Down Expand Up @@ -220,6 +226,8 @@ module.exports = {
? ''
: peopleTools.resolvePerson(data.people, data.dozierende);

const lastChanges = data.page ? createRow("Letzte Aktualisierung", utils.getDate(data.page.date)) : '';

const coreData = `
<table class="core-data">
${createRow("Modulverantwortlich", modulverantwortlich)}
Expand All @@ -242,13 +250,13 @@ module.exports = {
${createRow("Selbststudium in Stunden", data.selbstStudium)}
${createRow("Lehrformen", data.lehrform)}
${createRow("Lehrmethoden", data.lehrmethoden)}
${createRow("Letzte Aktualisierung", utils.getDate(data.page.date))}
${lastChanges}
</table>
`;

const editUrl = `${data.settings.repoEditUrl}${data.page.inputPath.replace('./src/', 'src/')}`;
const editUrl = data.settings ? `${data.settings.repoEditUrl}${data.page.inputPath.replace('./src/', 'src/')}` : '';
const status = data.meta && data.meta.status ? `is-${data.meta.status}` : '';
const meta = utils.getContentMeta(this, data.meta);
const meta = utils.getContentMeta(eleventy, data.meta);

const modulkompetenzen = !data.kompetenzen || data.kompetenzen.all.length < 2 ? '' : getModulkompetenzen(data.kompetenzen);

Expand All @@ -267,8 +275,8 @@ module.exports = {
${data.content}
</section>
${data.kuerzel ? curriculumTools.getChildModulListBySchwerpunkt(data, 'Wählbare Module', this) : ''}
${data.kuerzel ? curriculumTools.getChildModulList(data, 'Wählbare Module', this) : ''}
${data.kuerzel ? curriculumTools.getChildModulListBySchwerpunkt(data, 'Wählbare Module', eleventy) : ''}
${data.kuerzel ? curriculumTools.getChildModulList(data, 'Wählbare Module', eleventy) : ''}
${modulkompetenzen}
</main>
Expand Down
4 changes: 3 additions & 1 deletion src/_layouts/modulhandbuch.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
},
render(data) {
const utils = require('./components/utils.11ty.js');

const printUrl = data.page.url.replace(/(.*)\//, "$1-print/");
return `
<div class="content-wrap">
Expand All @@ -31,6 +31,8 @@ module.exports = {
<section class="content has-seperator">
${utils.parseContent(this, data)}
</section>
<a href="${printUrl}"><span class="icon">print</span> Druckversion zum Abheften</a>
</main>
</div>
`;
Expand Down
42 changes: 42 additions & 0 deletions src/_layouts/snippets/modulliste-print.11ty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
exports.render = (eleventy, data, attributes) => {

const modulbeschreibungTool = require('../modulbeschreibung.11ty.js');

const {id} = attributes;
const {collection} = attributes;

const cssClass = attributes.class ? attributes.class : '';

const modules = data.collections[collection].sort((a, b) => {
return a.data.order - b.data.order;
});

const modulesList = modules.map(module => {

const moduleData = {
"data": module.data,
"content": module.content,
"Demo": "Demo",
};

const modulbeschreibung = modulbeschreibungTool.render(moduleData, eleventy, moduleData)
.replace(/<h5/g, '<h6')
.replace(/<h4/g, '<h6')
.replace(/<h3/g, '<h5')
.replace(/<h2/g, '<h4')
.replace(/<h1/g, '<h3')
.replace(/<main>(.*?)<\/main>/isg, "$1");

return `
<div class="modulbeschreibung print">
${modulbeschreibung}
</div>
`;
});

return `
<div class="text ${cssClass}" id="${id}">
${modulesList.join('')}
</div>
`;
};
4 changes: 4 additions & 0 deletions src/assets/styles/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/assets/styles/scss/global/_print.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
visibility: hidden;
}

@page { margin: 2cm 1.5cm 1.5cm 3cm }
@page { margin: 2cm 1.5cm 3cm }

h1, h2 {
h1, h2, .modulbeschreibung.print header {
page-break-before: always;
}

.competence-list{
display: none;
}

.icon{
display: none;
}
}
40 changes: 40 additions & 0 deletions src/medieninformatik-bachelor/modulhandbuch-bpo5-print.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Modulhandbuch Medieninformatik Bachelor // Druckversion
name: Medieninformatik Bachelor
degree: Bachelor of Science
version: 5.0.0
date: last Modified
layout: modulhandbuch.11ty.js
inToc: false
tocs:
- bachelor
- bachelor-for-fakrat
- bachelor-for-experts
collection: modulsBPO5

---

## Studiengangbeschreibung
<snippet type="text" id="studiengangsbeschreibung" src="kurzbericht/012-profil-bachelor"></snippet>

## Absolvent\:innenprofil
<snippet type="text" id="absolventinnenprofil-allgemein" src="kurzbericht/130-absolventinnenprofil-allgemein"></snippet>
<snippet type="text" id="absolventinnenprofil-bachelor" src="kurzbericht/132-absolventinnenprofil-bachelor"></snippet>

## Studienverlaufsplan
<snippet type="curriculum" id="curriculum-bachelor" src="curricula/bpo5-standard"></snippet>

## Alternativer Studienverlaufsplan

Beim alternativen Studienverlaufsplan ist die 210 ECTS auf *zehn Semester*, statt auf *sieben Semester* verteilt, z.B. für Teilzeitstudierende.
<snippet type="curriculum" id="curriculum-bachelor" src="curricula/bpo5-alternativ"></snippet>

## Module
<snippet type="modulliste-print" id="modulliste-bachelor" collection="modulsBPO5"></snippet>

## Modulmatrix

Die Modulmatrix bildet alle Module des Studiengangs auf die Handlungsfelder und die als Absolvent:innenprofil zu erwerbenden Kompetenzen ab. Die Modulmatrix zeigt auch, welche einzelnen Module die Umsetzung der vier profilbildenden Studiengangkriterien abbilden der TH Köln. Mehr dazu finden Sie im Dokument [Lehr- und Lernkultur der TH Köln](https://www.th-koeln.de/mam/downloads/deutsch/hochschule/profil/qualitaetsmanagement/strategische_leitlinien_zu_lehre_und_studium.pdf).

<snippet type="modulmatrix" id="modulmatrix-bachelor" collection="modulsBPO5" programme="bachelor"></snippet>

38 changes: 38 additions & 0 deletions src/medieninformatik-master/modulhandbuch-mpo5-print.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Modulhandbuch Medieninformatik Master // Druckversion
name: Medieninformatik Master
degree: Master of Science
version: 5.0.0
date: last Modified
layout: modulhandbuch.11ty.js
inToc: false
tocs:
- master
- master-for-fakrat
- master-for-experts
collection: modulsMPO5

---

## Studiengangbeschreibung
<snippet type="text" id="studiengangsbeschreibung" src="kurzbericht/013-profil-master"></snippet>

## Absolvent\:innenprofil
<snippet type="text" id="absolventinnenprofil-allgemein" src="kurzbericht/130-absolventinnenprofil-allgemein"></snippet>
<snippet type="text" id="absolventinnenprofil-master" src="kurzbericht/134-absolventinnenprofil-master"></snippet>


## Studienverlaufsplan
<snippet type="curriculum" id="curriculum-master" src="curricula/mpo5-90CP-standard"></snippet>

## Alternativer Studienverlaufsplan
<snippet type="curriculum" id="curriculum-master" src="curricula/mpo5-90CP-alternativ"></snippet>

## Module
<snippet type="modulliste-print" id="modulliste-master" collection="modulsMPO5"></snippet>

## Modulmatrix

Die Modulmatrix bildet alle Module des Studiengangs auf die Handlungsfelder und die als Absolvent:innenprofil zu erwerbenden Kompetenzen ab. Die Modulmatrix zeigt auch, welche einzelnen Module die Umsetzung der vier profilbildenden Studiengangkriterien abbilden der TH Köln. Mehr dazu finden Sie im Dokument [Lehr- und Lernkultur der TH Köln](https://www.th-koeln.de/mam/downloads/deutsch/hochschule/profil/qualitaetsmanagement/strategische_leitlinien_zu_lehre_und_studium.pdf).

<snippet type="modulmatrix" id="modulmatrix-master" collection="modulsMPO5" programme="master"></snippet>

0 comments on commit 404d5ac

Please sign in to comment.