diff --git a/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc index 5346384..b2731a4 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 f6548b9..23e9473 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/application.py b/Praktikum2/ppm1/app/application.py index 37b5d4f..df8b4e0 100644 --- a/Praktikum2/ppm1/app/application.py +++ b/Praktikum2/ppm1/app/application.py @@ -38,9 +38,13 @@ class Application_cl(object): #------------------------------------------------------- def detail(self, cat=None, id=None): #------------------------------------------------------- - print("Add: ", cat) if(cat!=None): - return self.GenerateDetail(cat) + if(id!=None): + print("ID!=None Cat=", cat, " id=", id) + return self.GenerateDetail(cat, id) + else: + print("ID=None Cat=", cat) + return self.GenerateDetail(cat) else: return self.GenerateIndex() @cherrypy.expose @@ -102,11 +106,12 @@ class Application_cl(object): def GenerateDetail(self, category, id=None): #------------------------------------------------------- data = {} + data['category'] = category if(id != None): + data['id'] = id data['content'] = self.db.ReadEntry(category, id) else: data['id'] = None - data['category'] = category data['content'] = self.db.GetDefault(category) print(data, "\n") return self.view.CreateDetail(data) diff --git a/Praktikum2/ppm1/app/database.py b/Praktikum2/ppm1/app/database.py index 70ff0e5..4ff87e5 100644 --- a/Praktikum2/ppm1/app/database.py +++ b/Praktikum2/ppm1/app/database.py @@ -46,6 +46,7 @@ class Database_cl(object): #------------------------------------------------------- def ReadEntry(self, category = None, id = None): #------------------------------------------------------- + print("ReadEntry: ", category, id) data = None if id == None: data = self.data @@ -53,6 +54,7 @@ class Database_cl(object): if id in self.data[category]: data = self.data[category][id] + print(data, "\n") return data #------------------------------------------------------- diff --git a/Praktikum2/ppm1/data/students/33.json b/Praktikum2/ppm1/data/students/33.json index 6aa4721..2e62f63 100644 --- a/Praktikum2/ppm1/data/students/33.json +++ b/Praktikum2/ppm1/data/students/33.json @@ -1,6 +1,6 @@ { - "matrikelnummer": "matrikelnummer", - "vorname": "vorname", + "vorname": "vorname3", + "name": "name3", "id": "33", - "name": "name" + "matrikelnummer": "3" } \ No newline at end of file diff --git a/Praktikum2/ppm1/data/students/34.json b/Praktikum2/ppm1/data/students/34.json index 292d1fb..223fa94 100644 --- a/Praktikum2/ppm1/data/students/34.json +++ b/Praktikum2/ppm1/data/students/34.json @@ -1,6 +1,6 @@ { - "matrikelnummer": "test", - "name": "test", - "vorname": "test", - "id": "34" + "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 index 610e7df..c51c230 100644 --- a/Praktikum2/ppm1/data/students/35.json +++ b/Praktikum2/ppm1/data/students/35.json @@ -1,6 +1,6 @@ { + "vorname": "vorname1", + "name": "name1", "id": "35", - "matrikelnummer": "1234", - "vorname": "test2", - "name": "test2" + "matrikelnummer": "1" } \ No newline at end of file diff --git a/Praktikum2/ppm1/static/functions.js b/Praktikum2/ppm1/static/functions.js new file mode 100644 index 0000000..43c6849 --- /dev/null +++ b/Praktikum2/ppm1/static/functions.js @@ -0,0 +1,23 @@ +var table = document.getElementById('idList'); +var selected = table.getElementsByClassName('selected'); +var selectedId = 'None'; +table.onclick = highlight; + +function select(category) { + var id = selectedId; + if (id == 'None') + { + alert("Kein Eintrag ausgewaehlt!"); + } + else + { + window.location.href = '/detail/?cat=' + category + '&id=' + id; + } +} + +function highlight(e) { + if (selected[0]) selected[0].className = ''; + e.target.parentNode.className = 'selected'; + var tr = e.target.parentNode; + selectedId = tr.getAttribute('id'); +} \ No newline at end of file diff --git a/Praktikum2/ppm1/static/style.css b/Praktikum2/ppm1/static/style.css new file mode 100644 index 0000000..bd4c1a3 --- /dev/null +++ b/Praktikum2/ppm1/static/style.css @@ -0,0 +1,138 @@ +body { + font-family: "Open Sans", sans-serif; + font-size: 12pt; + + padding: 0; + margin: 0; +} + +.clSiteHeader { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 100px; + line-height: 100px; + margin: 0; + padding: 5px; + font-size: 40pt; + text-align: center; + text-shadow:black 3px 2px; + font-family: cursive, fantasy; + color: #920B19; + background-color: #B6B6B7; +} + +.clContent { + position: absolute; + top: 110px; /* height, padding, border, margin von idSiteHeader beachten */ + left: 0; + right: 0; + bottom: 0; + margin: 0; + padding: 5px; +} + +.clContentHeader { + position: absolute; + top: 20px; + left: 0; + right: 0; + height: 30px; + line-height: 30px; + margin: 0; + padding: 5px; + font-size: 18pt; + text-align: center; +} + +.clContentArea { + position: absolute; + top: 80px; /* height, padding, border, margin von idContentHeader beachten */ + left: 0; + right: 0; + bottom: 40px; /* height, padding, border, margin von idButtonArea beachten */ + margin: 10px 0; + margin-left: 10px; + padding: 5px; +} + +.clButtonArea { + position: absolute; + left: 0; + right: 0; + /*float: left; width: 10px:*/ + bottom: 0; + height: 80px; + line-height: 80px; + margin: 0; + padding: 5px; + text-align: center; + background-color: #B6B6B7; +} + +.clButtonArea a, input[type="submit"] { + margin: 0 5px; + padding: 3px 6px; + font-size: 14pt; + text-decoration: none; + border: 2px solid; + color: black; + background-color: buttonface; +} + +.clButtonArea a:hover, a:visited, a:active { + color: black; +} + +#idList { + table-layout: fixed; + width: auto; + border: 2px solid; + border-collapse: collapse; + margin:auto; +} + +#idList th { + text-align: center; + padding-left: 5px; + background-color: #FFFFFF; +} + +#idList th, #idList td { + padding: 3px; + border: 2px solid; + cursor: pointer; +} + +#idForm .clContentArea { + width: 500px; + margin: auto; +} + +.selected { + background-color: brown; + color: #FFF; +} + +.clFormRow { + position: relative; + height: 30px; + margin-bottom: 10px; +} + +.clFormRow label { + position: absolute; + top: 0; + left: 0; + width: 240px; + text-align: center; +} + +.clFormRow input { + position: absolute; + top: 0; + left: 250px; + width: 250px; +} +/* EOF */ \ No newline at end of file diff --git a/Praktikum2/ppm1/templates/detail.tpl b/Praktikum2/ppm1/templates/detail.tpl index 4bdf155..7fa4513 100644 --- a/Praktikum2/ppm1/templates/detail.tpl +++ b/Praktikum2/ppm1/templates/detail.tpl @@ -21,10 +21,12 @@ % for field in data['content']: -
- - -
+ % if field!='id': +
+ + +
+ % endif % endfor
diff --git a/Praktikum2/ppm1/templates/list.tpl b/Praktikum2/ppm1/templates/list.tpl index de79f28..c39cb65 100644 --- a/Praktikum2/ppm1/templates/list.tpl +++ b/Praktikum2/ppm1/templates/list.tpl @@ -5,12 +5,12 @@ Praxisphasenmanager (PPM) - +

Praxisphasenmanager (PPM)

@@ -44,25 +44,28 @@ % if data['content']!= None: % for entries in data['content']: - + % for entry in data['content'][entries]: % if entry!='id': - ${data['content'][entries][entry]} + ${data['content'][entries][entry]} % endif % endfor - + % endfor % endif - +
- +
Neu Startseite
+ \ No newline at end of file