Sammlung
This commit is contained in:
1
Sammlung/web_p4/ID_File.txt
Normal file
1
Sammlung/web_p4/ID_File.txt
Normal file
@ -0,0 +1 @@
|
||||
7
|
44
Sammlung/web_p4/app/Absolventenfeier.py
Normal file
44
Sammlung/web_p4/app/Absolventenfeier.py
Normal file
@ -0,0 +1,44 @@
|
||||
import cherrypy
|
||||
import json
|
||||
import os
|
||||
from mako.template import Template
|
||||
from mako.lookup import TemplateLookup
|
||||
from mako import exceptions
|
||||
from app import view
|
||||
from app import account
|
||||
|
||||
class Absolventenfeier_cl( object ):
|
||||
|
||||
def __init__( self ):
|
||||
self._view = view.view()
|
||||
self._account = account.Account()
|
||||
|
||||
@cherrypy.expose
|
||||
def index( self ):
|
||||
return self._view.index()
|
||||
|
||||
@cherrypy.expose
|
||||
def registration_form( self ):
|
||||
return self._view.registration_form()
|
||||
|
||||
@cherrypy.expose
|
||||
def edit_form( self, ident = -1 ):
|
||||
return self._view.edit_form( ident )
|
||||
|
||||
@cherrypy.expose
|
||||
def save( self, **form_input ):
|
||||
if( not form_input.get( 'ID' ) ):
|
||||
self._account.registration( **form_input )
|
||||
else:
|
||||
if( not self._account.edit( **form_input ) ):
|
||||
return self._view.error_page( "Die Eingabe war fehlerhaft!" )
|
||||
return self._view.index()
|
||||
|
||||
@cherrypy.expose
|
||||
def default(self, *arglist, **kwargs):
|
||||
msg_s = "unbekannte Anforderung: " + \
|
||||
str(arglist) + \
|
||||
' ' + \
|
||||
str(kwargs)
|
||||
raise cherrypy.HTTPError(404, msg_s)
|
||||
|
2
Sammlung/web_p4/app/__init__.py
Normal file
2
Sammlung/web_p4/app/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
# python package initialization
|
||||
|
BIN
Sammlung/web_p4/app/__pycache__/Absolventenfeier.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/Absolventenfeier.cpython-34.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/Absolventenfeier.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/Absolventenfeier.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/__init__.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/__init__.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/__init__.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/__init__.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/account.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/account.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/account.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/account.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/application.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/application.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/converter.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/converter.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/converter.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/converter.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/counter.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/counter.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/counter.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/counter.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/database.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/database.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/database.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/database.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/registration.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/registration.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/validator.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/validator.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/validator.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/validator.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/view.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/view.cpython-34.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/view.cpython-35.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/view.cpython-35.pyc
Normal file
Binary file not shown.
BIN
Sammlung/web_p4/app/__pycache__/welcomepage.cpython-34.pyc
Normal file
BIN
Sammlung/web_p4/app/__pycache__/welcomepage.cpython-34.pyc
Normal file
Binary file not shown.
33
Sammlung/web_p4/app/account.py
Normal file
33
Sammlung/web_p4/app/account.py
Normal file
@ -0,0 +1,33 @@
|
||||
import json
|
||||
from app import converter
|
||||
from app import counter
|
||||
from app import database
|
||||
from app import validator
|
||||
|
||||
class Account( object ):
|
||||
|
||||
def __init__( self ):
|
||||
self._path = "./data/"
|
||||
self._file_extension = ".json"
|
||||
self._counter = counter.Counter()
|
||||
self._converter = converter.Converter()
|
||||
self._database = database.Database( self._path, self._file_extension )
|
||||
self._validator = validator.Validator( self._database, self._counter )
|
||||
|
||||
def registration( self, **form_data ):
|
||||
new_ident = str( self._counter.read() )
|
||||
self._counter.increase( 1 )
|
||||
form_data.update( {'ID':new_ident} )
|
||||
json_data = self._converter.jsonify( **form_data )
|
||||
self._database.write( new_ident, form_data )
|
||||
|
||||
def edit( self, **form_data ):
|
||||
if( self._validator.validate( "vorname", "nachname", "passwort", **form_data ) ):
|
||||
if( form_data.get( 'loeschen' ) == "yes" ):
|
||||
self._database.erase( form_data.get( 'ID' ) )
|
||||
else:
|
||||
self._database.write( form_data.get( 'ID' ), form_data )
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
6
Sammlung/web_p4/app/converter.py
Normal file
6
Sammlung/web_p4/app/converter.py
Normal file
@ -0,0 +1,6 @@
|
||||
import json
|
||||
|
||||
class Converter( object ):
|
||||
|
||||
def jsonify( self, **form_input ):
|
||||
return json.dumps( form_input, separators=(',',':') )
|
29
Sammlung/web_p4/app/counter.py
Normal file
29
Sammlung/web_p4/app/counter.py
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
class Counter( object ):
|
||||
|
||||
#counter_file = open('./ID_File.txt', 'r+')
|
||||
|
||||
def read( self ):
|
||||
counter_file = open('./ID_File.txt', 'r')
|
||||
counter = counter_file.read()
|
||||
counter = int( counter )
|
||||
counter_file.close()
|
||||
return counter
|
||||
|
||||
def increase( self, n ):
|
||||
counter_file = open('./ID_File.txt', 'r')
|
||||
counter = counter_file.read()
|
||||
counter = int( counter )
|
||||
counter_file.close()
|
||||
counter += n
|
||||
counter_file = open( './ID_File.txt', 'w')
|
||||
counter_file.write( str( counter ) )
|
||||
counter_file.close()
|
||||
|
||||
def decrease( self, n ):
|
||||
counter_file = open('./ID_File.txt', 'w')
|
||||
counter = counter_file.read()
|
||||
counter = int( counter )
|
||||
counter -= n
|
||||
counter_file.write( str( counter ) )
|
||||
counter_file.close()
|
24
Sammlung/web_p4/app/database.py
Normal file
24
Sammlung/web_p4/app/database.py
Normal file
@ -0,0 +1,24 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
class Database( object ):
|
||||
|
||||
def __init__( self, path, file_extension ):
|
||||
self._path = path
|
||||
self._file_extension = file_extension
|
||||
|
||||
def write( self, filename, data ):
|
||||
with open( self._path + str(filename) + self._file_extension, 'w' ) as outfile:
|
||||
json.dump( data, outfile )
|
||||
|
||||
def read( self, filename ):
|
||||
json_data = open( self._path + str(filename) + self._file_extension, 'r' )
|
||||
data = json.load( json_data )
|
||||
json_data.close()
|
||||
return data
|
||||
|
||||
def erase( self, filename ):
|
||||
os.remove( self._path + str(filename) + self._file_extension )
|
||||
|
||||
def exists( self, filename ):
|
||||
return os.path.exists( self._path + str(filename) + self._file_extension )
|
28
Sammlung/web_p4/app/validator.py
Normal file
28
Sammlung/web_p4/app/validator.py
Normal file
@ -0,0 +1,28 @@
|
||||
from mako import exceptions
|
||||
import json
|
||||
from app import database
|
||||
from app import view
|
||||
|
||||
class Validator( object ):
|
||||
|
||||
def __init__( self, database, counter ):
|
||||
self._database = database
|
||||
self._counter = counter
|
||||
|
||||
def validate( self, *to_check, **form_input ):
|
||||
counter = 0
|
||||
fails = ""
|
||||
ident = form_input.get( 'ID' )
|
||||
data = self._database.read( ident )
|
||||
if( not self._database.exists( ident ) ):
|
||||
pass # Fehlerbehandlung
|
||||
return 0
|
||||
for key in to_check:
|
||||
if( form_input.get( key ) == data[key] ):
|
||||
counter += 1
|
||||
else:
|
||||
fails += key + ", "
|
||||
if( counter == len( to_check ) ):
|
||||
return 1
|
||||
else:
|
||||
return 0
|
39
Sammlung/web_p4/app/view.py
Normal file
39
Sammlung/web_p4/app/view.py
Normal file
@ -0,0 +1,39 @@
|
||||
from mako import exceptions
|
||||
from mako.template import Template
|
||||
from mako.lookup import TemplateLookup
|
||||
|
||||
class view( object ):
|
||||
def index( self ):
|
||||
try:
|
||||
index_template = Template(filename='./content/index.txt')
|
||||
return index_template.render()
|
||||
except:
|
||||
return exceptions.html_error_template().render()
|
||||
|
||||
def registration_form( self ):
|
||||
try:
|
||||
registration_form_template = Template(filename='./content/registration_form.txt')
|
||||
return registration_form_template.render()
|
||||
except:
|
||||
return exceptions.html_error_template().render()
|
||||
|
||||
def password_form( self, ident ):
|
||||
try:
|
||||
password_form_template = Template(filename='./content/password_form.txt')
|
||||
return password_form_template.render( ident )
|
||||
except:
|
||||
return exceptions.html_error_template().render()
|
||||
|
||||
def edit_form( self, ident ):
|
||||
try:
|
||||
edit_form_template = Template(filename='./content/edit_form.txt')
|
||||
return edit_form_template.render( ID=ident )
|
||||
except:
|
||||
return exceptions.html_error_template().render()
|
||||
|
||||
def error_page( self, msg ):
|
||||
try:
|
||||
error_page_template = Template(filename='./content/error_page.txt')
|
||||
return error_page_template.render( MSG=msg )
|
||||
except:
|
||||
return exceptions.html_error_template().render()
|
80
Sammlung/web_p4/content/edit_form.txt
Normal file
80
Sammlung/web_p4/content/edit_form.txt
Normal file
@ -0,0 +1,80 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<%!
|
||||
import os
|
||||
import json
|
||||
import cherrypy
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Anmeldung bearbeiten</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Bearbeitungsformular der eigenen Anmeldung</h1>
|
||||
</header>
|
||||
<section>
|
||||
<div id="subSection2">
|
||||
<h3 class="alert">
|
||||
Information: Name, Vorname und Kennwort sind unveränderbar.
|
||||
Die mit '*' markierten Felder müssen ausgefüllt werden!
|
||||
</h3>
|
||||
<form name="EditForm" action="save" method="post">
|
||||
<table class="form">
|
||||
<%
|
||||
json_data = open( "./data/%s.json" % ID )
|
||||
data = json.load( json_data )
|
||||
%>
|
||||
<tr>
|
||||
<td>Vorname<span class="alert">*</span>:</td>
|
||||
<td><input type="text" name="vorname" value="${data['vorname']}" placeholder="Vorname" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nachname<span class="alert">*</span>:</td>
|
||||
<td><input type="text" name="nachname" value="${data['nachname']}" placeholder="Nachname" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Anzahl Begleitpersonen:</td>
|
||||
<td><select name="begleitpersonen" >
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Studiengang:</td>
|
||||
<td><input type="text" name="studiengang" placeholder="z.B Informatik B.Sc" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Betreuer:</td>
|
||||
<td><input type="text" name="betreuer" placeholder="Name des Betreuers" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kennwort<span class="alert">*</span>:</td>
|
||||
<td><input type="password" name="passwort" placeholder="Kennwort" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="loeschen" value="yes">Meine Anmeldung loeschen!</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="hidden" name="ID" value="${ID}"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="Speichern!"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<p>
|
||||
<form action="./index" method="get">
|
||||
<button>Abbrechen</button>
|
||||
</form>
|
||||
</div>
|
||||
</html>
|
15
Sammlung/web_p4/content/error_page.txt
Normal file
15
Sammlung/web_p4/content/error_page.txt
Normal file
@ -0,0 +1,15 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<%!
|
||||
import os
|
||||
import json
|
||||
import cherrypy
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<h1>${MSG}</h1>
|
||||
<a href="./index">Zur Hauptseite zurückkehren!</a>
|
||||
</html>
|
82
Sammlung/web_p4/content/index.txt
Normal file
82
Sammlung/web_p4/content/index.txt
Normal file
@ -0,0 +1,82 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<%!
|
||||
import os
|
||||
import json
|
||||
import cherrypy
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Absolventenfeier
|
||||
</title>
|
||||
<link rel="stylesheet" type="text/css" href="./style.css"></link>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="./js/select.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1 id="mainHeadline">Absolventenfeier Informatik</h1>
|
||||
</header>
|
||||
<nav id="mainNav">
|
||||
<a href="./registration_form" id="navButton1">Registrieren</a>
|
||||
</nav>
|
||||
<div id="verticalLineLeft">
|
||||
<section>
|
||||
<div id="subSection1">
|
||||
<p>
|
||||
Auf dieser Website wird die diesjährige Absolventenfeier des Studiengangs Informatik organisiert.
|
||||
|
||||
<table id="table1">
|
||||
<tr>
|
||||
<td>Wann?</td>
|
||||
<td>15.07.2014</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Beginnt um:</td>
|
||||
<td>15:00 Uhr</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Wo? </td>
|
||||
<td>Audimax</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
In der untenstehenden Liste sind die bisher angemeldeten Teilnehmer einzusehen. Möchten Sie sich zu dieser Absolventenfeier verbindlich anmelden, nutzen Sie bitte
|
||||
den obigen Schalter <i>Registrieren</i>.
|
||||
<p>
|
||||
Möchten Sie eine bestehende Anmeldung bearbeiten oder löschen, können Sie ihren Namen in der Teilnehmerliste unten selektieren und dann auf den Schalter
|
||||
<i>Bearbeiten</i> drücken.
|
||||
<p>
|
||||
</div>
|
||||
<div id="divideSection"></div>
|
||||
<div id="subSection2">
|
||||
<h2>Teilnehmerliste:</h2>
|
||||
|
||||
<table id="table2">
|
||||
% for filename in os.listdir('./data'):
|
||||
<%
|
||||
json_data = open( "./data/%s" % filename )
|
||||
data = json.load( json_data )
|
||||
%>
|
||||
<tr class="attendendee">
|
||||
<td onclick='SelectRow( ${data['ID']} )' id="${data['ID']}">${data['vorname']} ${data['nachname']}</td>
|
||||
</tr>
|
||||
<%
|
||||
json_data.close()
|
||||
%>
|
||||
% endfor
|
||||
</table>
|
||||
<p>
|
||||
<button type="button" onclick="GetEditForm()">Bearbeiten</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<footer>
|
||||
Verantwortlich für diese Seite: Philipp<p>
|
||||
Contact information: <a href="mailto:someone@example.com">someone@example.com</a>.
|
||||
<div id="footerBottomLine"><div>
|
||||
</footer>
|
||||
</html>
|
29
Sammlung/web_p4/content/js/select.js
Normal file
29
Sammlung/web_p4/content/js/select.js
Normal file
@ -0,0 +1,29 @@
|
||||
var cell = -1;
|
||||
function SelectRow( row ) {
|
||||
if( cell != -1 ) {
|
||||
cell.removeAttribute( "class" );
|
||||
}
|
||||
cell = document.getElementById( row );
|
||||
cell.setAttribute( "class", "selected" );
|
||||
}
|
||||
function GetIdFromRow() {
|
||||
return cell.id;
|
||||
}
|
||||
function GetEditForm() {
|
||||
if( cell == -1 ) {
|
||||
alert( "Zum Bearbeiten ihrer Anmeldung müssen Sie ihren Namen in der Liste selektieren!" );
|
||||
return;
|
||||
}
|
||||
var link = "./edit_form?ident=";
|
||||
link += GetIdFromRow();
|
||||
window.location.href=link;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
$(document).ready(function() {
|
||||
$("tr").click(function(){
|
||||
$(this).addClass("selected").siblings().removeClass("selected");
|
||||
});
|
||||
});
|
||||
*/
|
27
Sammlung/web_p4/content/password_form.txt
Normal file
27
Sammlung/web_p4/content/password_form.txt
Normal file
@ -0,0 +1,27 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<%!
|
||||
import os
|
||||
import json
|
||||
import cherrypy
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Passwort erforderlich</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Bitte authentifizieren Sie sich:</h1>
|
||||
</header>
|
||||
<section>
|
||||
<form action="edit_form" method="POST">
|
||||
Passwort:<input type="password" name="password">
|
||||
<input type="hidden" name="ID" value="${ID}">
|
||||
<input type="submit" value="Bestätigen">
|
||||
</form>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
57
Sammlung/web_p4/content/registration_form.txt
Normal file
57
Sammlung/web_p4/content/registration_form.txt
Normal file
@ -0,0 +1,57 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Registrierung</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Registrierung</h1>
|
||||
</header>
|
||||
<section>
|
||||
<form name="RegisterForm" action="save" method="post">
|
||||
<table class="form">
|
||||
<tr>
|
||||
<td>Vorname:</td>
|
||||
<td><input type="text" name="vorname" placeholder="Vorname" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nachname:</td>
|
||||
<td><input type="text" name="nachname" placeholder="Nachname" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Anzahl Begleitpersonen:</td>
|
||||
<td><select name="begleitpersonen" >
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Studiengang:</td>
|
||||
<td><input type="text" name="studiengang" placeholder="z.B Informatik B.Sc" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Betreuer:</td>
|
||||
<td><input type="text" name="betreuer" placeholder="Name des Betreuers" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kennwort:</td>
|
||||
<td><input type="password" name="passwort" placeholder="Kennwort" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="Anmelden!"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<form action="./index" method="get">
|
||||
<button>Abbrechen</button>
|
||||
</form>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
118
Sammlung/web_p4/content/style.css
Normal file
118
Sammlung/web_p4/content/style.css
Normal file
@ -0,0 +1,118 @@
|
||||
/* background-grey: #EFEFEF */
|
||||
|
||||
|
||||
header {
|
||||
display: block;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
section {
|
||||
background-color: #EFEFEF; /*#F8F8F8;*/
|
||||
border-top-right-radius: 40px;
|
||||
}
|
||||
|
||||
footer {
|
||||
background-color: #EFEFEF;
|
||||
border-bottom-left-radius: 30px;
|
||||
border-bottom-right-radius: 30px;
|
||||
padding-top: 1%;
|
||||
padding-left: 1%;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color:#FFFFFF;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: black;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: grey;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
/*background-color: black;*/
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #ADFF2F;
|
||||
}
|
||||
|
||||
.form {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.alert {
|
||||
color: #FF6E6E;
|
||||
}
|
||||
|
||||
#mainNav li {
|
||||
display: inline;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li+li {
|
||||
border-left: 2px solid grey;
|
||||
}
|
||||
|
||||
#mainNav {
|
||||
background-color: #424242;
|
||||
color: white;
|
||||
width: 60%;
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
|
||||
#navButton1 {
|
||||
color: #FCFCFC;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
padding-left: 2%;
|
||||
padding-right: 2%;
|
||||
}
|
||||
|
||||
#divideSection {
|
||||
width: 30%;
|
||||
border-bottom: 1px solid #000000;
|
||||
}
|
||||
|
||||
#subSection2 {
|
||||
padding-left: 1%;
|
||||
}
|
||||
|
||||
#subSection1 {
|
||||
padding-left: 1%;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
#table1 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
#verticalLineLeft {
|
||||
border-left: 1px solid #000000;
|
||||
}
|
||||
|
||||
/*
|
||||
#footerBottomLine {
|
||||
margin-left: auto;
|
||||
width: 40%;
|
||||
border-bottom: 1px solid #000000;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
tr.attendendee:hover, .selected {
|
||||
background-color: #ADFF2F;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
1
Sammlung/web_p4/data/5.json
Normal file
1
Sammlung/web_p4/data/5.json
Normal file
@ -0,0 +1 @@
|
||||
{"betreuer": "Betreuer", "vorname": "Vorname", "studiengang": "Informatik", "nachname": "Nachname", "ID": "5", "begleitpersonen": "2", "passwort": "1234"}
|
1
Sammlung/web_p4/data/6.json
Normal file
1
Sammlung/web_p4/data/6.json
Normal file
@ -0,0 +1 @@
|
||||
{"ID": "6", "betreuer": "Betreuer", "vorname": "Vorname2", "studiengang": "Informatik", "nachname": "Nachname2", "passwort": "1234", "begleitpersonen": "0"}
|
40
Sammlung/web_p4/server.py
Normal file
40
Sammlung/web_p4/server.py
Normal file
@ -0,0 +1,40 @@
|
||||
import os
|
||||
import cherrypy
|
||||
from app import Absolventenfeier
|
||||
|
||||
def main():
|
||||
# Get current directory
|
||||
try:
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
except:
|
||||
current_dir = os.path.dirname(os.path.abspath(sys.executable))
|
||||
|
||||
# disable autoreload and timeout_monitor
|
||||
cherrypy.engine.autoreload.unsubscribe()
|
||||
cherrypy.engine.timeout_monitor.unsubscribe()
|
||||
|
||||
# Static content config
|
||||
static_config = {
|
||||
'/': {
|
||||
'tools.staticdir.root': current_dir,
|
||||
'tools.staticdir.on': True,
|
||||
'tools.staticdir.dir': './content',
|
||||
'tools.staticdir.index': '/index'
|
||||
}
|
||||
}
|
||||
|
||||
# Mount static content handler
|
||||
app = Absolventenfeier.Absolventenfeier_cl()
|
||||
root_o = cherrypy.tree.mount(app, '/', static_config)
|
||||
|
||||
# suppress traceback-info
|
||||
cherrypy.config.update({'request.show_tracebacks': False})
|
||||
|
||||
# Start server
|
||||
cherrypy.engine.start()
|
||||
cherrypy.engine.block()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
Reference in New Issue
Block a user