css, html, delete

This commit is contained in:
darthsandmann 2016-11-16 16:52:00 +01:00
parent 5332dfa3f4
commit d315cd1009
19 changed files with 60 additions and 57 deletions

Binary file not shown.

View File

@ -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

View File

@ -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

View File

@ -1,8 +0,0 @@
{
"anzahlMitarbeiter": "anzahlMitarbeiter",
"schwerpunkt": "schwerpunkt",
"id": "0",
"sitz": "sitz",
"branche": "branche",
"name": "name"
}

View File

@ -1,8 +0,0 @@
{
"voraussetzungen": "voraussetzungen",
"beschreibung": "beschreibung",
"firmenbetreuer": "firmenbetreuer",
"company": "company",
"id": "0",
"name": "name"
}

View File

@ -1,6 +0,0 @@
{
"vorname": "vorname3",
"name": "name3",
"id": "33",
"matrikelnummer": "3"
}

View File

@ -1,6 +0,0 @@
{
"vorname": "vorname2",
"name": "name2",
"id": "34",
"matrikelnummer": "2"
}

View File

@ -1,6 +0,0 @@
{
"vorname": "vorname1",
"name": "name1",
"id": "35",
"matrikelnummer": "1"
}

View File

@ -1,7 +0,0 @@
{
"titel": "titel",
"id": "0",
"lehrgebiet": "lehrgebiet",
"name": "name",
"vorname": "vorname"
}

View File

@ -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;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>
Praxisphasenmanager (PPM)
Praxisphasenmanager (PPM)
</title>
<meta charset="UTF-8" />
<style type="text/css">
@ -11,11 +11,20 @@
</head>
<body>
<h1 id="idSiteHeader" class="clSiteHeader">
${data['category']}: Ihre Daten
<a href="/index" title="Zur&uumlck zur Startseite">Praxisphasenmanager (PPM)</a>
</h1>
<form id="idForm" class="clContent" action="/save/?cat=${data['category']}" method="POST">
<h2 id="idContentHeader" class="clContentHeader">
Das Formular ausf&uumlllen/korrigieren und auf "speichern" klicken:
% if data['category'] == 'students':
Studenten: Ihre Daten
% elif data['category'] == 'teachers':
Lehrende: Ihre Daten
% elif data['category'] == 'companies':
Firmen: Ihre Daten
% elif data['category'] == 'offerings':
Angebote: Ihre Daten
% endif
</h2>
<div id="idContentArea" class="clContentArea">
<input type="hidden" value="${data['id']}" id="id" name="id" />
@ -30,7 +39,8 @@
% endfor
<div id="idButtonArea" class="clButtonArea">
<a href="/index" title="Zurueck zur Startseite">Zurueck</a>
<a href="/index" title="Zur&uumlck zur Startseite">Zur&uumlck zur Startseite</a>
<a href="/category/?cat=${data['category']}" title="Zurueck zur Startseite">Zur&uumlck zur &uumlbersicht</a>
<input type="submit" value="Speichern" />
</div>
</div>

View File

@ -11,7 +11,7 @@
</head>
<body>
<h1 id="idSiteHeader" class="clSiteHeader">
Praxisphasenmanager (PPM)
<a href="/index" title="Zur&uumlck zur Startseite">Praxisphasenmanager (PPM)</a>
</h1>
<div class="clContent">
<h2 id="idContentHeader" class="clContentHeader">Module</h2>

View File

@ -12,7 +12,7 @@
<body>
<h1 id="idSiteHeader" class="clSiteHeader">
Praxisphasenmanager (PPM)
<a href="/index" title="Zur&uumlck zur Startseite">Praxisphasenmanager (PPM)</a>
</h1>
<div id="idContent" class="clContent">
<h2 id="idContentHeader" class="clContentHeader">
@ -61,7 +61,8 @@
<div id="idButtonArea" class="clButtonArea">
<a href="/index" class="clButton">Startseite</a>
<a href="/detail/?cat=${data['category']}" class="clButton">Neu</a>
<a class="clButton" onclick="select('${data['category']}')">Bearbeiten</a>
<a class="clButton" onclick="select('${data['category']}', 0)">Bearbeiten</a>
<a class="clButton" onclick="select('${data['category']}', 1)">Loeschen</a>
</div>
</div>
</body>