diff --git a/Praktikum1/webteams/app/__pycache__/application.cpython-35.pyc b/Praktikum1/webteams/app/__pycache__/application.cpython-35.pyc deleted file mode 100644 index 42b38b0..0000000 Binary files a/Praktikum1/webteams/app/__pycache__/application.cpython-35.pyc and /dev/null differ diff --git a/Praktikum1/webteams/app/__pycache__/database.cpython-35.pyc b/Praktikum1/webteams/app/__pycache__/database.cpython-35.pyc deleted file mode 100644 index 96730b4..0000000 Binary files a/Praktikum1/webteams/app/__pycache__/database.cpython-35.pyc and /dev/null differ diff --git a/Praktikum1/webteams/app/__pycache__/view.cpython-35.pyc b/Praktikum1/webteams/app/__pycache__/view.cpython-35.pyc deleted file mode 100644 index ffece78..0000000 Binary files a/Praktikum1/webteams/app/__pycache__/view.cpython-35.pyc and /dev/null differ diff --git a/Praktikum1/webteams/content/webteams.css b/Praktikum1/webteams/content/webteams.css deleted file mode 100644 index e69de29..0000000 diff --git a/Praktikum1/webteams/data/webteams.json b/Praktikum1/webteams/data/webteams.json deleted file mode 100644 index 6f31cf5..0000000 --- a/Praktikum1/webteams/data/webteams.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/Praktikum1/webteams/template/form1.tpl b/Praktikum1/webteams/template/form1.tpl deleted file mode 100644 index 272bdd1..0000000 --- a/Praktikum1/webteams/template/form1.tpl +++ /dev/null @@ -1,14 +0,0 @@ - -
- - -
-
- - -
-
- - -
- \ No newline at end of file diff --git a/Praktikum1/webteams/template/form2.tpl b/Praktikum1/webteams/template/form2.tpl deleted file mode 100644 index 8c836cd..0000000 --- a/Praktikum1/webteams/template/form2.tpl +++ /dev/null @@ -1,6 +0,0 @@ -
- -
- - - \ No newline at end of file diff --git a/Praktikum1/webteams/template/list1.tpl b/Praktikum1/webteams/template/list1.tpl deleted file mode 100644 index 2ad319a..0000000 --- a/Praktikum1/webteams/template/list1.tpl +++ /dev/null @@ -1,5 +0,0 @@ - - $name1_s$vorname1_s$matrnr1_s - $name2_s$vorname2_s$matrnr2_s - bearbeiten löschen - \ No newline at end of file diff --git a/Praktikum1/webteams/template/listaufz1.tpl b/Praktikum1/webteams/template/listaufz1.tpl deleted file mode 100644 index 4b00513..0000000 --- a/Praktikum1/webteams/template/listaufz1.tpl +++ /dev/null @@ -1,7 +0,0 @@ - -
  • Gruppe $nr: bearbeiten löschen - -
  • \ No newline at end of file diff --git a/Praktikum1/Aufgabe A.pdf b/Praktikum1_Kai/Aufgabe A.pdf similarity index 100% rename from Praktikum1/Aufgabe A.pdf rename to Praktikum1_Kai/Aufgabe A.pdf diff --git a/Praktikum1/test/app/__init__.py b/Praktikum1_Kai/test/app/__init__.py similarity index 100% rename from Praktikum1/test/app/__init__.py rename to Praktikum1_Kai/test/app/__init__.py diff --git a/Praktikum1/test/app/__init__.pyc b/Praktikum1_Kai/test/app/__init__.pyc similarity index 100% rename from Praktikum1/test/app/__init__.pyc rename to Praktikum1_Kai/test/app/__init__.pyc diff --git a/Praktikum1/test/app/__pycache__/__init__.cpython-35.pyc b/Praktikum1_Kai/test/app/__pycache__/__init__.cpython-35.pyc similarity index 100% rename from Praktikum1/test/app/__pycache__/__init__.cpython-35.pyc rename to Praktikum1_Kai/test/app/__pycache__/__init__.cpython-35.pyc diff --git a/Praktikum1/test/app/__pycache__/application.cpython-35.pyc b/Praktikum1_Kai/test/app/__pycache__/application.cpython-35.pyc similarity index 100% rename from Praktikum1/test/app/__pycache__/application.cpython-35.pyc rename to Praktikum1_Kai/test/app/__pycache__/application.cpython-35.pyc diff --git a/Praktikum1/test/app/application.py b/Praktikum1_Kai/test/app/application.py similarity index 100% rename from Praktikum1/test/app/application.py rename to Praktikum1_Kai/test/app/application.py diff --git a/Praktikum1/test/app/application.pyc b/Praktikum1_Kai/test/app/application.pyc similarity index 100% rename from Praktikum1/test/app/application.pyc rename to Praktikum1_Kai/test/app/application.pyc diff --git a/Praktikum1/test/content/index.html b/Praktikum1_Kai/test/content/index.html similarity index 100% rename from Praktikum1/test/content/index.html rename to Praktikum1_Kai/test/content/index.html diff --git a/Praktikum1/test/testserver.py b/Praktikum1_Kai/test/testserver.py similarity index 100% rename from Praktikum1/test/testserver.py rename to Praktikum1_Kai/test/testserver.py diff --git a/Praktikum1/webteams/app/__init__.py b/Praktikum1_Kai/webteams/app/__init__.py similarity index 100% rename from Praktikum1/webteams/app/__init__.py rename to Praktikum1_Kai/webteams/app/__init__.py diff --git a/Praktikum1/webteams/app/__pycache__/__init__.cpython-35.pyc b/Praktikum1_Kai/webteams/app/__pycache__/__init__.cpython-35.pyc similarity index 100% rename from Praktikum1/webteams/app/__pycache__/__init__.cpython-35.pyc rename to Praktikum1_Kai/webteams/app/__pycache__/__init__.cpython-35.pyc diff --git a/Praktikum1_Kai/webteams/app/__pycache__/application.cpython-35.pyc b/Praktikum1_Kai/webteams/app/__pycache__/application.cpython-35.pyc new file mode 100644 index 0000000..cc5e836 Binary files /dev/null and b/Praktikum1_Kai/webteams/app/__pycache__/application.cpython-35.pyc differ diff --git a/Praktikum1_Kai/webteams/app/__pycache__/database.cpython-35.pyc b/Praktikum1_Kai/webteams/app/__pycache__/database.cpython-35.pyc new file mode 100644 index 0000000..d9d453e Binary files /dev/null and b/Praktikum1_Kai/webteams/app/__pycache__/database.cpython-35.pyc differ diff --git a/Praktikum1_Kai/webteams/app/__pycache__/view.cpython-35.pyc b/Praktikum1_Kai/webteams/app/__pycache__/view.cpython-35.pyc new file mode 100644 index 0000000..8d7cbb7 Binary files /dev/null and b/Praktikum1_Kai/webteams/app/__pycache__/view.cpython-35.pyc differ diff --git a/Praktikum1/webteams/app/application.py b/Praktikum1_Kai/webteams/app/application.py similarity index 82% rename from Praktikum1/webteams/app/application.py rename to Praktikum1_Kai/webteams/app/application.py index 1b2991a..c303add 100644 --- a/Praktikum1/webteams/app/application.py +++ b/Praktikum1_Kai/webteams/app/application.py @@ -14,13 +14,19 @@ class Application_cl(object): # spezielle Initialisierung können hier eingetragen werden self.db_o = Database_cl() self.view_o = View_cl() + self.liste = 0 @cherrypy.expose #------------------------------------------------------- - def index(self): + def index(self, form="NULL"): #------------------------------------------------------- - return self.createList_p() + if(form == "0"): + return self.createListAufz_p() + elif(form == "1"): + return self.createList_p() + elif(form == "NULL"): + return self.createList_p() @cherrypy.expose @@ -50,9 +56,11 @@ class Application_cl(object): data_a = [ data_opl["name1_s"] , data_opl["vorname1_s"] , data_opl["matrnr1_s"] + , data_opl["semesteranzahl1_s"] , data_opl["name2_s"] , data_opl["vorname2_s"] , data_opl["matrnr2_s"] + , data_opl["semesteranzahl2_s"] ] if id_s != "None": @@ -72,7 +80,7 @@ class Application_cl(object): # Eintrag löschen, dann Liste neu anzeigen self.db_o.delete_px(id) - return self.createList_p() + return self.createListAufz_p() @cherrypy.expose @@ -90,11 +98,22 @@ class Application_cl(object): #------------------------------------------------------- def createList_p(self): #------------------------------------------------------- + print("---------- List ----------") data_o = self.db_o.read_px() # mit diesen Daten Markup erzeugen return self.view_o.createList_px(data_o) - + + + #------------------------------------------------------- + def createListAufz_p(self): + #------------------------------------------------------- + print("---------- ListAufz ----------") + data_o = self.db_o.read_px() + # mit diesen Daten Markup erzeugen + + return self.view_o.createListAufz_px(data_o) + #------------------------------------------------------- def createForm_p(self, id_spl = None): diff --git a/Praktikum1/webteams/app/database.py b/Praktikum1_Kai/webteams/app/database.py similarity index 89% rename from Praktikum1/webteams/app/database.py rename to Praktikum1_Kai/webteams/app/database.py index de58a0a..20cfc8d 100644 --- a/Praktikum1/webteams/app/database.py +++ b/Praktikum1_Kai/webteams/app/database.py @@ -73,12 +73,17 @@ class Database_cl(object): #------------------------------------------------------- def delete_px(self, id_spl): #------------------------------------------------------- + #print("\n---------------------- DELETE ---------------------") status_b = False if id_spl in self.data_o: pass # hier müssen Sie den Code ergänzen # Löschen als Zurücksetzen auf die Default-Werte implementieren - # Ihre Ergänzung + # Ihre Ergänzung + self.data_o[id_spl] = {} + default_s = self.getDefault_px() + self.data_o[id_spl] = default_s + self.saveData_p() return status_b @@ -86,7 +91,7 @@ class Database_cl(object): #------------------------------------------------------- def getDefault_px(self): #------------------------------------------------------- - return ['', '', '', '', '', ''] # HIER müssen Sie eine Ergänzung vornehmen + return ['', '', '', '', '', '', '', ''] # HIER müssen Sie eine Ergänzung vornehmen #------------------------------------------------------- @@ -96,8 +101,9 @@ class Database_cl(object): fp_o = codecs.open(os.path.join('data', 'webteams.json'), 'r', 'utf-8') except: # Datei neu anlegen self.data_o = {} + self.data_o = {} for loop_i in range(0,15): - self.data_o[str(loop_i)] = ['', '', '', '', '', ''] # HIER müssen Sie eine Ergänzung vornehmen + self.data_o[str(loop_i)] = ['', '', '', '', '', '', '', ''] self.saveData_p() else: with fp_o: diff --git a/Praktikum1/webteams/app/view.py b/Praktikum1_Kai/webteams/app/view.py similarity index 61% rename from Praktikum1/webteams/app/view.py rename to Praktikum1_Kai/webteams/app/view.py index b166006..13e58db 100644 --- a/Praktikum1/webteams/app/view.py +++ b/Praktikum1_Kai/webteams/app/view.py @@ -35,12 +35,14 @@ class View_cl(object): # mehrfach nutzen, um die einzelnen Zeilen der Tabelle zu erzeugen for loop_i in range(0,15): data_a = data_opl[str(loop_i)] - markup_s += lineT_o.safe_substitute (name1_s=data_a[0] # HIER müssen Sie eine Ergänzung vornehmen + markup_s += lineT_o.safe_substitute (name1_s=data_a[0] , vorname1_s=data_a[1] , matrnr1_s=data_a[2] - , name2_s=data_a[3] - , vorname2_s=data_a[4] - , matrnr2_s=data_a[5] + , semesteranzahl1_s=data_a[3] + , name2_s=data_a[4] + , vorname2_s=data_a[5] + , matrnr2_s=data_a[6] + , semesteranzahl2_s=data_a[7] , id_s=str(loop_i) ) @@ -48,6 +50,33 @@ class View_cl(object): return markup_s + #------------------------------------------------------- + def createListAufz_px(self, data_opl): + #------------------------------------------------------- + # hier müsste noch eine Fehlerbehandlung ergänzt werden ! + markup_s = '' + markup_s += self.readFile_p('listaufz0.tpl') + markupV_s = self.readFile_p('listaufz1.tpl') + lineT_o = string.Template(markupV_s) + + # mehrfach nutzen, um die einzelnen Zeilen der Tabelle zu erzeugen + for loop_i in range(0,15): + data_a = data_opl[str(loop_i)] + markup_s += lineT_o.safe_substitute (name1_s=data_a[0] + , vorname1_s=data_a[1] + , matrnr1_s=data_a[2] + , semesteranzahl1_s=data_a[3] + , name2_s=data_a[4] + , vorname2_s=data_a[5] + , matrnr2_s=data_a[6] + , semesteranzahl2_s=data_a[7] + , id_s=str(loop_i) + ) + + markup_s += self.readFile_p('listaufz2.tpl') + + return markup_s + #------------------------------------------------------- def createForm_px(self, id_spl, data_opl): @@ -57,12 +86,14 @@ class View_cl(object): markup_s += self.readFile_p('form0.tpl') markupV_s = self.readFile_p('form1.tpl') lineT_o = string.Template(markupV_s) - markup_s += lineT_o.safe_substitute (name1_s=data_opl[0] # HIER müssen Sie eine Ergänzung vornehmen + markup_s += lineT_o.safe_substitute (name1_s=data_opl[0] , vorname1_s=data_opl[1] , matrnr1_s=data_opl[2] - , name2_s=data_opl[3] - , vorname2_s=data_opl[4] - , matrnr2_s=data_opl[5] + , semesteranzahl1_s=data_opl[3] + , name2_s=data_opl[4] + , vorname2_s=data_opl[5] + , matrnr2_s=data_opl[6] + , semesteranzahl2_s=data_opl[7] , id_s=id_spl ) markup_s += self.readFile_p('form2.tpl') diff --git a/Praktikum1_Kai/webteams/content/webteams.css b/Praktikum1_Kai/webteams/content/webteams.css new file mode 100644 index 0000000..577a9e3 --- /dev/null +++ b/Praktikum1_Kai/webteams/content/webteams.css @@ -0,0 +1,72 @@ +body { + font-family: "Open Sans", sans-serif; + font-size: 12pt; + padding: 0; + margin: 0; +} + +td { + border: 1px solid black; +} + +th { + height: 50px; + border: 1px solid black; +} + +li { +} + +ul { + padding-left: 30px; + list-style-type: square; + margin-bottom: 50px; +} + +label { + padding-left: 15px; +} + +input { + width: 200px; + border: none; + border-bottom: 2px solid black; + font-size: 12pt; +} + +input.button { + background-color: #eeeeee; + color: black; + padding: 5px 10px; + text-align: center; + text-decoration: none; + display: inline-block; + border: none; +} + +input.button:hover, input.button:active { + background-color: #e7e7e7; +} + +idWTForm { +} + + + +a:link, a:visited { + background-color: #eeeeee; + color: black; + padding: 5px 10px; + text-align: center; + text-decoration: none; + display: inline-block; +} + + +a:hover, a:active { + background-color: #e7e7e7; +} + +a.clDelete { +} + diff --git a/Praktikum1/webteams/content/webteams.js b/Praktikum1_Kai/webteams/content/webteams.js similarity index 69% rename from Praktikum1/webteams/content/webteams.js rename to Praktikum1_Kai/webteams/content/webteams.js index e0a29d8..2ae20fe 100644 --- a/Praktikum1/webteams/content/webteams.js +++ b/Praktikum1_Kai/webteams/content/webteams.js @@ -2,6 +2,15 @@ function confirmDelete_p (event_opl) { if ((event_opl.target.tagName.toLowerCase() == 'a') && (event_opl.target.className == "clDelete")) { // Klick auf Link zum Löschen // Ihre Ergänzung + var result = confirm("Sind Sie sicher, dass der Eintrag gelöscht werden soll?"); + if(result) + { + return true; + } + else + { + return false; + } } } diff --git a/Praktikum1_Kai/webteams/data/webteams.json b/Praktikum1_Kai/webteams/data/webteams.json new file mode 100644 index 0000000..1c9b79e --- /dev/null +++ b/Praktikum1_Kai/webteams/data/webteams.json @@ -0,0 +1 @@ +{"13": ["", "", "", "", "", "", "", ""], "12": ["", "", "", "", "", "", "", ""], "2": ["", "", "", "", "", "", "", ""], "7": ["", "", "", "", "", "", "", ""], "6": ["", "", "", "", "", "", "", ""], "0": ["", "", "", "", "", "", "", ""], "3": ["", "", "", "", "", "", "", ""], "5": ["", "", "", "", "", "", "", ""], "8": ["", "", "", "", "", "", "", ""], "11": ["", "", "", "", "", "", "", ""], "9": ["", "", "", "", "", "", "", ""], "10": ["", "", "", "", "", "", "", ""], "4": ["", "", "", "", "", "", "", ""], "1": ["", "", "", "", "", "", "", ""], "14": ["", "", "", "", "", "", "", ""]} \ No newline at end of file diff --git a/Praktikum1/webteams/server.py b/Praktikum1_Kai/webteams/server.py similarity index 100% rename from Praktikum1/webteams/server.py rename to Praktikum1_Kai/webteams/server.py diff --git a/Praktikum1/webteams/template/form0.tpl b/Praktikum1_Kai/webteams/template/form0.tpl similarity index 100% rename from Praktikum1/webteams/template/form0.tpl rename to Praktikum1_Kai/webteams/template/form0.tpl diff --git a/Praktikum1_Kai/webteams/template/form1.tpl b/Praktikum1_Kai/webteams/template/form1.tpl new file mode 100644 index 0000000..f010a75 --- /dev/null +++ b/Praktikum1_Kai/webteams/template/form1.tpl @@ -0,0 +1,37 @@ + + + +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + + +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    \ No newline at end of file diff --git a/Praktikum1_Kai/webteams/template/form2.tpl b/Praktikum1_Kai/webteams/template/form2.tpl new file mode 100644 index 0000000..00ef544 --- /dev/null +++ b/Praktikum1_Kai/webteams/template/form2.tpl @@ -0,0 +1,12 @@ +
    + +
    + + +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/Praktikum1/webteams/template/list0.tpl b/Praktikum1_Kai/webteams/template/list0.tpl similarity index 56% rename from Praktikum1/webteams/template/list0.tpl rename to Praktikum1_Kai/webteams/template/list0.tpl index 33cdf10..245a9df 100644 --- a/Praktikum1/webteams/template/list0.tpl +++ b/Praktikum1_Kai/webteams/template/list0.tpl @@ -9,9 +9,9 @@ - +
    - - + + \ No newline at end of file diff --git a/Praktikum1_Kai/webteams/template/list1.tpl b/Praktikum1_Kai/webteams/template/list1.tpl new file mode 100644 index 0000000..ac66bc5 --- /dev/null +++ b/Praktikum1_Kai/webteams/template/list1.tpl @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Praktikum1/webteams/template/list2.tpl b/Praktikum1_Kai/webteams/template/list2.tpl similarity index 68% rename from Praktikum1/webteams/template/list2.tpl rename to Praktikum1_Kai/webteams/template/list2.tpl index 5d3af45..78217cc 100644 --- a/Praktikum1/webteams/template/list2.tpl +++ b/Praktikum1_Kai/webteams/template/list2.tpl @@ -1,6 +1,7 @@
    Name (1)Vorname (1)Matr.-Nr. (1)Name (2)Vorname (2)Matr.-Nr. (2)Name (1)Vorname (1)Matr.-Nr. (1)Anzahl Semester (1)Name (2)Vorname (2)Matr.-Nr. (2)Anzahl Semester (2) Aktion
    $name1_s$vorname1_s$matrnr1_s$semesteranzahl1_s$name2_s$vorname2_s$matrnr2_s$semesteranzahl2_sbearbeiten löschen
    erfassen + Ansicht
    \ No newline at end of file diff --git a/Praktikum1/webteams/template/listaufz0.tpl b/Praktikum1_Kai/webteams/template/listaufz0.tpl similarity index 100% rename from Praktikum1/webteams/template/listaufz0.tpl rename to Praktikum1_Kai/webteams/template/listaufz0.tpl diff --git a/Praktikum1_Kai/webteams/template/listaufz1.tpl b/Praktikum1_Kai/webteams/template/listaufz1.tpl new file mode 100644 index 0000000..4241c7f --- /dev/null +++ b/Praktikum1_Kai/webteams/template/listaufz1.tpl @@ -0,0 +1,7 @@ + +
  • Gruppe $id_s: bearbeiten  löschen + +
  • \ No newline at end of file diff --git a/Praktikum1/webteams/template/listaufz2.tpl b/Praktikum1_Kai/webteams/template/listaufz2.tpl similarity index 67% rename from Praktikum1/webteams/template/listaufz2.tpl rename to Praktikum1_Kai/webteams/template/listaufz2.tpl index dfff501..ea495d4 100644 --- a/Praktikum1/webteams/template/listaufz2.tpl +++ b/Praktikum1_Kai/webteams/template/listaufz2.tpl @@ -1,6 +1,7 @@
    erfassen + Ansicht
    \ No newline at end of file