burningTyger 4 ani în urmă
părinte
comite
a7ae6712da

+ 1 - 1
components/einstellungen.svelte

@@ -77,7 +77,7 @@
 </div>
 
 <script>
-  export let schueler, privat, einstellungen = {}
+  export let privat, einstellungen = {}
   let check_sv, check_prowo, check_db
   const { Pool } = R('pg')
   const pool = new Pool({ connectionString: privat.mein_bk_db})

+ 0 - 37
components/projektwoche-drucksache.svelte

@@ -56,8 +56,6 @@
 	import marked from 'marked'
   export let privat
   let projekte = []
-  let pp
-  let modal = false
   const { Pool } = R('pg')
   const _ = R('lodash')
   const pool = new Pool({ connectionString: privat.mein_bk_db})
@@ -79,39 +77,4 @@
       (err, resp) => projekte = resp.rows)
   }
   projekte_laden()
-  function modal_toggle (p) {
-    pp = p
-    modal = true
-  }
-  function loeschen (p) {
-    const query = `DELETE FROM projekte
-                   WHERE id = $1`
-    pool.query(query, [p.id], (err, res) => {
-      if (err) {
-        console.log(err)
-        return
-      }
-      projekte = projekte.filter(pp => pp !== p)
-    })
-  }
-  function speichern (pp) {
-    const query = `UPDATE projekte
-                   SET (titel, leitung, beschreibung, bildung, max_teilnehmer,
-                     schulnah, ort, treffpunkt, woche, mo_di, mi_do, vortermin,
-                     material, kosten, info_an_organisationsteam, raumwunsch,
-                     medienwunsch, presi) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18)
-                   WHERE projekte.id = $19
-                   RETURNING *`
-    const value = [pp.titel, pp.leitung, pp.beschreibung, pp.bildung, pp.max_teilnehmer,
-                   pp.schulnah, pp.ort, pp.treffpunkt, pp.woche, pp.mo_di, pp.mi_do, pp.vortermin,
-                   pp.material, pp.kosten, pp.info_an_organisationsteam, pp.raumwunsch,
-                   pp.medienwunsch, pp.presi,
-                   pp.id]
-    pool.query(query, value, (err, res) => {
-      err && console.log(err)
-      pp = res[0]
-      projekte = projekte
-      modal = false
-    })
-  }
 </script>

+ 1 - 1
components/projektwoche-schueler.svelte

@@ -139,7 +139,7 @@
 {/if}
 
 <script>
-  export let schueler, privat, knexConfig
+  export let schueler, privat
   let nur_irrlaeufer = true
   let projekte = [];
   let klassen = {}

+ 1 - 5
components/vouchers.svelte

@@ -42,15 +42,11 @@
 </div>
 
 <script>
-  import Papa from 'papaparse.min.js'
+  import Papa from '../papaparse.min.js'
   export let schueler, privat
   const { Pool } = R('pg')
   const pool = new Pool({ connectionString: privat.mein_bk_db})
   let vouchers = ''
-  function vouchers_value () {
-    const arr = Papa.parse(vouchers, {comments: '#'})
-    return arr.filter(e=>!e.startsWith('#')).map(e=>'(\'' + e.substring(2,13) + '\')').join(',')
-  }
   const update_vouchers = async () => {
     const res = await Papa.parse(vouchers, {comments: '#'})
     const values = res.data.map(e => '(\'' + e[0].trim() + '\')').join(',')

+ 1 - 1
Übersicht.svelte

@@ -66,7 +66,7 @@
   import SVWahl from './components/svwahl.svelte'
   import Einstellungen from './components/einstellungen.svelte'
   import Infos from './components/infos.svelte'
-  export let schueler, knexConfig, privat
+  export let knexConfig, privat
   let active = ProjektwocheDrucksache
   let suche = ''