From 251b33fb53279dbf43fac840c2173990fb0a0503 Mon Sep 17 00:00:00 2001 From: Theenoro Date: Fri, 3 May 2019 21:20:24 +0200 Subject: [PATCH] 2.2 - added new Template and Template selection --- package.json | 2 +- public/main.css | 5 + public/templates/wochenbericht_2.ptt | 1086 ++++++++++++++++++++++++++ src/jsx/ui/components/templates.jsx | 73 +- src/jsx/ui/print.jsx | 14 +- src/jsx/ui/print_modi/week.jsx | 19 +- src_less/form_elements.less | 5 + src_less/main.less | 4 + src_less/print.less | 2 +- 9 files changed, 1174 insertions(+), 36 deletions(-) create mode 100644 public/templates/wochenbericht_2.ptt create mode 100644 src_less/form_elements.less diff --git a/package.json b/package.json index 8ee9e58..e788018 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,6 @@ "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", - "less": "less-watch-compiler ./src_less ./public/ main.less" + "less": "npx less-watch-compiler ./src_less ./public/ main.less" } } diff --git a/public/main.css b/public/main.css index 6596aba..df04e60 100644 --- a/public/main.css +++ b/public/main.css @@ -1,3 +1,8 @@ +select { + padding: 5px; + height: 34px; + box-sizing: border-box; +} @font-face { font-family: 'Exo'; font-style: normal; diff --git a/public/templates/wochenbericht_2.ptt b/public/templates/wochenbericht_2.ptt new file mode 100644 index 0000000..689b194 --- /dev/null +++ b/public/templates/wochenbericht_2.ptt @@ -0,0 +1,1086 @@ + +{% for id, week in weeks %} +
+
+

Berichtsheft für die kaufmännische Berufsausbildung

+
+

+ + + + + + + + + + + +
+

Name und Vorname

+
+

{{name}}

+
+

Ausbildungsabteilung

+
+

Fachdienst IT-Service

+
+

+ + + + + + + + + + + +
+

Ausbildungsnachweis Nr.

+
+

{{week.num}}

+
+

 

+
+

 

+
+

 

+
+

 

+
+

+ + + + + + + + + + + + + + + +
+

Art der ausgeführten Ausbildungsarbeit

+
+

Vom

+
+

26/02/2018

+
+

bis

+
+

02/03/2018

+
+ + {% for day in week.data %} + + + + + + + + + {% endfor %} +
+

{{day[1]}}

+
+

{{day[2]}} - {{day[4]}}

+
+ {% for task in day[5] %} +
{{task}}
+ {% endfor %} +
+
+
+

Bemerkungen des Ausbilders

+ + + + + + +
+

Bemerkungen über ausgeführte Ausbildungsarbeiten, + Zwischenprüfungen, Ausbildungslehrgänge, Ausbildungsnachweis usw.

+

+
+

Unterschriften

+ + + + + + + + +
+

+

Für die Richtigkeit aller

+

Angaben:

+

+

+

+

_______________________

+

Auszubildender

+

Unterschrift und Datum

+
+

+

Für die Richtigkeit aller

+

Angaben über die betriebliche Ausbildung:

+

+

+

_______________________

+

Ausbilder

+

Unterschrift und Datum

+
+

+

Gesehen:

+

+

+

+

+

__________________________________________________

+

        Betriebsrat        Gesetzlicher + Vertreter

+

        Sichtvermerk und + Datum        Sichtvermerk und Datum

+
+

+
+{% endfor %} \ No newline at end of file diff --git a/src/jsx/ui/components/templates.jsx b/src/jsx/ui/components/templates.jsx index acd7afd..c02c97d 100644 --- a/src/jsx/ui/components/templates.jsx +++ b/src/jsx/ui/components/templates.jsx @@ -5,50 +5,63 @@ export class Templates{ static template = { header:"", wochenbericht:"", + wochenbericht_2:"", monatsbericht:"", arbeitszeiten:"", footer:"" }; static getTemplates(){ axios.get('/templates/header.ptt') - .then ((result) => { - Templates.template.header = result.data; - }) - .catch ((error) => { - console.log(error); - }) + .then ((result) => { + Templates.template.header = result.data; + }) + .catch ((error) => { + console.log(error); + }) + + axios.get('/templates/wochenbericht.ptt') - .then ((result) => { + .then ((result) => { + + Templates.template.wochenbericht = result.data; + }) + .catch ((error) => { + console.log(error); + }) + + axios.get('/templates/wochenbericht_2.ptt') + .then ((result) => { + + Templates.template.wochenbericht_2 = result.data; + }) + .catch ((error) => { + console.log(error); + }) - Templates.template.wochenbericht = result.data; - }) - .catch ((error) => { - console.log(error); - }) axios.get('/templates/monatsbericht.ptt') - .then ((result) => { + .then ((result) => { - Templates.template.monatsbericht = result.data; - }) - .catch ((error) => { - console.log(error); - }) + Templates.template.monatsbericht = result.data; + }) + .catch ((error) => { + console.log(error); + }) axios.get('/templates/arbeitszeiten.ptt') - .then ((result) => { + .then ((result) => { - Templates.template.arbeitszeiten = result.data; - }) - .catch ((error) => { - console.log(error); - }) + Templates.template.arbeitszeiten = result.data; + }) + .catch ((error) => { + console.log(error); + }) axios.get('/templates/footer.ptt') - .then ((result) => { + .then ((result) => { - Templates.template.footer = result.data; - }) - .catch ((error) => { - console.log(error); - }) + Templates.template.footer = result.data; + }) + .catch ((error) => { + console.log(error); + }) } printTimes(){ return `` diff --git a/src/jsx/ui/print.jsx b/src/jsx/ui/print.jsx index 4f36924..c636ff1 100644 --- a/src/jsx/ui/print.jsx +++ b/src/jsx/ui/print.jsx @@ -18,12 +18,14 @@ export class Print extends React.Component { startWeek:0, endWeek:0, diff:0, - html:"" + html:"", + choosenTemplate:"wochenbericht" } this.preview = this.preview.bind(this); this.print = this.print.bind(this); this.handleChangeStart = this.handleChangeStart.bind(this); this.handleChangeEnd = this.handleChangeEnd.bind(this); + this.handleChangeTemplate = this.handleChangeTemplate.bind(this); Templates.getTemplates() } preview(){ @@ -33,7 +35,7 @@ export class Print extends React.Component { var start = moment(this.state.start); var end = moment(this.state.end); var me = this; - Modi_Week.preview(name,anfang,start,end,me) + Modi_Week.preview(name,anfang,start,end,me,this.state.choosenTemplate) } print(){ @@ -65,6 +67,9 @@ export class Print extends React.Component { this.setState({diff:diff}); console.log(diff); } + handleChangeTemplate(e){ + this.setState({choosenTemplate: e.target.value}); + } render(){ return ( @@ -75,6 +80,11 @@ export class Print extends React.Component {
Start:
Ende:
+
Vorlage: +