css, html, delete
This commit is contained in:
parent
5332dfa3f4
commit
d315cd1009
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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
|
@ -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
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"anzahlMitarbeiter": "anzahlMitarbeiter",
|
||||
"schwerpunkt": "schwerpunkt",
|
||||
"id": "0",
|
||||
"sitz": "sitz",
|
||||
"branche": "branche",
|
||||
"name": "name"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"voraussetzungen": "voraussetzungen",
|
||||
"beschreibung": "beschreibung",
|
||||
"firmenbetreuer": "firmenbetreuer",
|
||||
"company": "company",
|
||||
"id": "0",
|
||||
"name": "name"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"vorname": "vorname3",
|
||||
"name": "name3",
|
||||
"id": "33",
|
||||
"matrikelnummer": "3"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"vorname": "vorname2",
|
||||
"name": "name2",
|
||||
"id": "34",
|
||||
"matrikelnummer": "2"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"vorname": "vorname1",
|
||||
"name": "name1",
|
||||
"id": "35",
|
||||
"matrikelnummer": "1"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"titel": "titel",
|
||||
"id": "0",
|
||||
"lehrgebiet": "lehrgebiet",
|
||||
"name": "name",
|
||||
"vorname": "vorname"
|
||||
}
|
@ -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,8 +11,20 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function highlight(e) {
|
||||
|
BIN
Praktikum2/ppm1/static/img/logo.png
Normal file
BIN
Praktikum2/ppm1/static/img/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 97 KiB |
@ -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;
|
||||
}
|
||||
|
@ -11,11 +11,20 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="idSiteHeader" class="clSiteHeader">
|
||||
${data['category']}: Ihre Daten
|
||||
<a href="/index" title="Zurück 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üllen/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ück zur Startseite">Zurück zur Startseite</a>
|
||||
<a href="/category/?cat=${data['category']}" title="Zurueck zur Startseite">Zurück zur übersicht</a>
|
||||
<input type="submit" value="Speichern" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,7 +11,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="idSiteHeader" class="clSiteHeader">
|
||||
Praxisphasenmanager (PPM)
|
||||
<a href="/index" title="Zurück zur Startseite">Praxisphasenmanager (PPM)</a>
|
||||
</h1>
|
||||
<div class="clContent">
|
||||
<h2 id="idContentHeader" class="clContentHeader">Module</h2>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<body>
|
||||
|
||||
<h1 id="idSiteHeader" class="clSiteHeader">
|
||||
Praxisphasenmanager (PPM)
|
||||
<a href="/index" title="Zurück 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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user