diff --git a/Praktikum2/AufgabePrak2A.pdf b/Praktikum2/AufgabePrak2A.pdf index 805da36..c30bad1 100644 Binary files a/Praktikum2/AufgabePrak2A.pdf and b/Praktikum2/AufgabePrak2A.pdf differ diff --git a/Praktikum2/ppm1/app/__pycache__/__init__.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/__init__.cpython-35.pyc index cbc0267..245d099 100644 Binary files a/Praktikum2/ppm1/app/__pycache__/__init__.cpython-35.pyc and b/Praktikum2/ppm1/app/__pycache__/__init__.cpython-35.pyc differ diff --git a/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc index 8d86f70..7b1db4d 100644 Binary files a/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc and b/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc differ diff --git a/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc index f3200f4..96cdd88 100644 Binary files a/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc and b/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc differ diff --git a/Praktikum2/ppm1/app/__pycache__/view.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/view.cpython-35.pyc index e14dd6c..a9040be 100644 Binary files a/Praktikum2/ppm1/app/__pycache__/view.cpython-35.pyc and b/Praktikum2/ppm1/app/__pycache__/view.cpython-35.pyc differ diff --git a/Praktikum2/ppm1/app/application.py b/Praktikum2/ppm1/app/application.py index df8b4e0..6db7bb9 100644 --- a/Praktikum2/ppm1/app/application.py +++ b/Praktikum2/ppm1/app/application.py @@ -58,12 +58,10 @@ class Application_cl(object): @cherrypy.expose #------------------------------------------------------- - def delete(self, id, form=None): + def delete(self, cat=None, id=None): #------------------------------------------------------- - # Eintrag löschen, dann Liste neu anzeigen - self.db_o.delete_px(id) - print("Delete",form) - return self.createList_p(form) + print("Delete",cat,id) + return self.GenerateDelete(cat, id) @cherrypy.expose #------------------------------------------------------- @@ -125,4 +123,13 @@ class Application_cl(object): self.db.Save(dataTmp, category) return self.GenerateList(category) + #------------------------------------------------------- + def GenerateDelete(self, category, id): + #------------------------------------------------------- + if(category == None or id == None): + return self.view.CreateIndex() + else: + self.db.Delete(category, id) + return self.GenerateList(category) + #EOF \ No newline at end of file diff --git a/Praktikum2/ppm1/app/database.py b/Praktikum2/ppm1/app/database.py index 4ff87e5..b252136 100644 --- a/Praktikum2/ppm1/app/database.py +++ b/Praktikum2/ppm1/app/database.py @@ -85,7 +85,7 @@ class Database_cl(object): #------------------------------------------------------- status_b = False if id in self.data[category]: - os.remove(os.path.join('data', category, id+'json')) + os.remove(os.path.join('data', category, id+'.json')) del self.data[category][id] return status_b diff --git a/Praktikum2/ppm1/data/companies/0.json b/Praktikum2/ppm1/data/companies/0.json deleted file mode 100644 index b043baf..0000000 --- a/Praktikum2/ppm1/data/companies/0.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "anzahlMitarbeiter": "anzahlMitarbeiter", - "schwerpunkt": "schwerpunkt", - "id": "0", - "sitz": "sitz", - "branche": "branche", - "name": "name" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/offerings/0.json b/Praktikum2/ppm1/data/offerings/0.json deleted file mode 100644 index 68841ca..0000000 --- a/Praktikum2/ppm1/data/offerings/0.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "voraussetzungen": "voraussetzungen", - "beschreibung": "beschreibung", - "firmenbetreuer": "firmenbetreuer", - "company": "company", - "id": "0", - "name": "name" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/students/33.json b/Praktikum2/ppm1/data/students/33.json deleted file mode 100644 index 2e62f63..0000000 --- a/Praktikum2/ppm1/data/students/33.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "vorname": "vorname3", - "name": "name3", - "id": "33", - "matrikelnummer": "3" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/students/34.json b/Praktikum2/ppm1/data/students/34.json deleted file mode 100644 index 223fa94..0000000 --- a/Praktikum2/ppm1/data/students/34.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "vorname": "vorname2", - "name": "name2", - "id": "34", - "matrikelnummer": "2" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/students/35.json b/Praktikum2/ppm1/data/students/35.json deleted file mode 100644 index c51c230..0000000 --- a/Praktikum2/ppm1/data/students/35.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "vorname": "vorname1", - "name": "name1", - "id": "35", - "matrikelnummer": "1" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/teachers/0.json b/Praktikum2/ppm1/data/teachers/0.json deleted file mode 100644 index 8f598bd..0000000 --- a/Praktikum2/ppm1/data/teachers/0.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "titel": "titel", - "id": "0", - "lehrgebiet": "lehrgebiet", - "name": "name", - "vorname": "vorname" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/static/functions.js b/Praktikum2/ppm1/static/functions.js index 43c6849..e6781de 100644 --- a/Praktikum2/ppm1/static/functions.js +++ b/Praktikum2/ppm1/static/functions.js @@ -3,7 +3,7 @@ var selected = table.getElementsByClassName('selected'); var selectedId = 'None'; table.onclick = highlight; -function select(category) { +function select(category, mode) { var id = selectedId; if (id == 'None') { @@ -11,7 +11,19 @@ function select(category) { } else { + if(mode == 0){ window.location.href = '/detail/?cat=' + category + '&id=' + id; + } + else { + var result = confirm("Sind Sie sicher, dass der Eintrag gelöscht werden soll?"); + if(result) { + window.location.href = '/delete/?cat=' + category + '&id=' + id; + return true; + } + else { + return false; + } + } } } diff --git a/Praktikum2/ppm1/static/img/logo.png b/Praktikum2/ppm1/static/img/logo.png new file mode 100644 index 0000000..40801c4 Binary files /dev/null and b/Praktikum2/ppm1/static/img/logo.png differ diff --git a/Praktikum2/ppm1/static/style.css b/Praktikum2/ppm1/static/style.css index 9390cb4..10ad1ad 100644 --- a/Praktikum2/ppm1/static/style.css +++ b/Praktikum2/ppm1/static/style.css @@ -19,12 +19,26 @@ body { text-align: center; text-shadow:black 3px 2px; font-family: "Open Sans", sans-serif; - color: #FFFFFF; background-color: #084791; border: none; border-radius: 60px; } +.clSiteHeader a { + text-decoration: none; + color: white; +} + +.clSiteHeader:hover { + background-color: #0D71E4; + cursor: pointer; +} + +.clSiteHeader a:visited, a:active { + color: white; + text-decoration: none; +} + .clContent { position: absolute; top: 150px; /* height, padding, border, margin von idSiteHeader beachten */ @@ -33,7 +47,7 @@ body { bottom: 0; margin: 0; padding: 5px; - background-image: url("https://lionel.kr.hs-niederrhein.de/logo_hs_02.png"); + background-image: url("/img/logo.png"); background-repeat: no-repeat; background-position: bottom left; } diff --git a/Praktikum2/ppm1/templates/detail.tpl b/Praktikum2/ppm1/templates/detail.tpl index 0bbc301..20133c3 100644 --- a/Praktikum2/ppm1/templates/detail.tpl +++ b/Praktikum2/ppm1/templates/detail.tpl @@ -2,7 +2,7 @@