Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add path to search via roomnumber

  • Loading branch information...
commit c1c514b29cfe86b618eafc19b25712bf78011518 1 parent 3738365
Coding Pony authored
6 config_file
View
@@ -1,6 +0,0 @@
-[/]
-tools.staticdir.root = "/static"
-
-[/layout.css]
-tools.staticfile.on = True
-tools.staticfile.filename = "/static/layout.css"
7 cpapp/config_file
View
@@ -10,3 +10,10 @@ tools.staticfile.filename = cpapp.current_dir + '/static/layout.css'
tools.staticfile.on = True
tools.staticfile.filename = cpapp.current_dir + '/static/avatar.jpg'
+[/prototype.js]
+tools.staticfile.on = True
+tools.staticfile.filename = cpapp.current_dir + '/static/prototype.js'
+
+[/control.js]
+tools.staticfile.on = True
+tools.staticfile.filename = cpapp.current_dir + '/static/control.js'
36 cpapp/static/control.js
View
@@ -0,0 +1,36 @@
+var database;
+var initialize = function(){
+};
+
+
+function direkt(){
+ var form=$('form1');
+ $('dir').remove();
+ $('indir').remove();
+ form.insert('<input type="Text" id="Raumnr" name="Raumnr" label="Raumnr"/>');
+ $('Raumnr').insert({before : '<div>', after: '</div>'});
+ form.insert('<input type="Button" id="Weiter" name="Weiter" label="Weiter" value="Weiter" onClick="validiereRaumnr();"/>');
+ $('Weiter').insert({before : '<div>', after: '</div>'});
+};
+
+function validiereRaumnr(){
+ var form=$('form1');
+ var input=form['Raumnr']
+ pattern=/^[A-Z][1-4]|E[0-9]{2}/;
+ if(pattern.test($F(input).toUpperCase())){
+ sucheraumnr();
+ }
+ else{
+ console.log($('warnung1'));
+ if($('warnung1')==null)
+ $('Raumnr').insert({after:'<p class="warnung" id="warnung1"> Eingabe muss aus Gebaeudebuchstaben gefolgt von Raumnr sein.</p>'});
+ }
+
+};
+
+function indirekt(){
+ var form=$('form1');
+ $('dir').hide();
+ $('indir').hide();
+}
+
1  cpapp/static/layout.css
View
@@ -1,4 +1,3 @@
p {
color: red;
-
}
6,082 cpapp/static/prototype.js
View
6,082 additions, 0 deletions not shown
13 cpapp/templ/index.html
View
@@ -4,13 +4,18 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Terminverwaltung - Termin&uuml;bersicht</title>
+ <title>Raumsuche</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" type="text/css" href="layout.css" />
+ <script type="text/javascript" src="prototype.js"></script>
+ <script type="text/javascript" src="control.js"></script>
</head>
- <body>
- <p> hello world </p>
- <img src="avatar.jpg"/>
+ <body onLoad="initialize();">
+ <h1>Raumsuche FH-Niederrhein Campus Sued</h1>
+ <form id="form1" action="" method="post">
+ <input type="Button" id="dir" name="dir" label="Raum per Raumnummer suchen" value="Raum per Raumnummer suchen" onClick="direkt();"/>
+ <input type="Button" id="indir" name="indir" label="Raum per Raumeigenschaften suchen" value="Raum per Raumeigenschaften suchen" onClick="indirekt();"/>
+ </form>
</body>
</html>
23 server.py
View
@@ -1,23 +0,0 @@
-#! /usr/bin/python
-# coding:utf-8
-
-import cherrypy
-import os.path
-import pickle
-import mako
-from pprint import pprint
-from mako.template import Template
-from mako.lookup import TemplateLookup
-from copy import deepcopy
-current_dir = os.path.dirname(os.path.abspath(__file__))
-myconfig = os.path.join(os.path.dirname(__file__),'config_file')
-
-mylookup = TemplateLookup(directories=['./templ'], module_directory='/tmp/mako_modules')
-
-class Root(object):
- def index(self):
- template=mylookup.get_template('index.html')
- return template.render()
- index.exposed = True
-import cpapp
-cherrypy.quickstart(Root(),config=myconfig)
4 static/layout.css
View
@@ -1,4 +0,0 @@
-p {
- font-color: red;
-
- }
15 templ/index.html
View
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title>Terminverwaltung - Termin&uuml;bersicht</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="imagetoolbar" content="no" />
- <link rel="stylesheet" type="text/css" href="layout.css" />
- </head>
- <body>
- <p> hello world </p>
- </body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.