Commits

Jimmy Yuen Ho Wong  committed 68fe8a0

index page

  • Participants
  • Parent commits a65ce05

Comments (0)

Files changed (4)

File src/pythonhk/controllers.py

 
 from pythonhk import api
 
+
 class Root(object):
 
     @cherrypy.expose
     def index(self):
-        raise HTTPRedirect("/admin")
-
-
-class AdminRoot(object):
-
-    @cherrypy.expose
-    def index(self):
-        pass
+        template = cherrypy.request.app.template_loader.get_template("index.html")
+        return template.render()

File templates/404.html

+<!doctype html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Page Not Found :(</title>
+  <style>
+	  body { text-align: center;}
+	  h1 { font-size: 50px; text-align: center }
+	  span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
+	  body { font: 20px Constantia, 'Hoefler Text',  "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
+	  ::-moz-selection{ background:#FF5E99; color:#fff; }
+	  ::selection { background:#FF5E99; color:#fff; } 
+	  article {display:block; text-align: left; width: 500px; margin: 0 auto; }
+	  
+	  a { color: rgb(36, 109, 56); text-decoration:none; }
+	  a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
+  </style>
+</head>
+<body>
+     <article>
+	  <h1>Not found <span frown>:(</span></h1>
+	   <div>
+	       <p>Sorry, but the page you were trying to view does not exist.</p>
+	       <p>It looks like this was the result of either:</p>
+	       <ul>
+		   <li>a mistyped address</li>
+		   <li>an out-of-date link</li>
+	       </ul>
+	   </div>
+	    
+	    <script>
+	    var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),
+		GOOG_FIXURL_SITE = location.host;
+	    </script>
+	    <script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
+     </article>
+</body>
+</html>

File templates/base.html

+<!doctype html>
+<html>
+  <head>
+    {% block head %}
+
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="description" content="">
+    <meta name="author" content="">
+    <meta name="viewport" content="width=device-width,initial-scale=1">
+    
+    <title>PythonHK - {% block title %}{% endblock title %}</title>
+    
+    <link type="text/css" rel="stylesheet" href="/css/screen.css" media="screen, projection">
+    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
+    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min.js"></script>
+    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.5.3/backbone-min.js"></script>
+    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js"></script>
+    <script type="text/javascript">
+    //<![CDATA[
+      window.jQuery || document.write('<script src="/js/libs/jquery-1.6.4.js"><\/script>');
+      window._ || document.write('<script src="/js/libs/underscore.js"><\/script>');
+      window.Backbone || document.write('<script src="/js/libs/backbone.js"><\/script>');
+      window.Modernizr || document.write('<script src="/js/libs/modernizr-2.0.6.js"><\/script>');
+    //]]>
+    </script>
+    
+    {% endblock head %}
+  </head>
+  <body>
+    <div id="container">
+      <header>
+        <h1>PythonHK</h1>
+      </header>
+      <div id="main" role="main">
+        {% block content %}{% endblock content %}
+      </div>
+      <footer>
+        <p>&copy; PythonHK 2011</p>
+      </footer>
+    </div>
+  </body>
+</html>

File templates/index.html

+{% extends "base.html" %}
+{% block title %}Index{% endblock title %}
+{% block head %}
+    {{ super() }}
+{% endblock head %}
+{% block content %}
+<a href="/user/register">Register</a>
+{% endblock content %}