Skip to content

Commit

Permalink
hello world with templates and other dojo stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
progrium committed Mar 27, 2010
1 parent e47dd70 commit 3928910
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 4 deletions.
35 changes: 35 additions & 0 deletions NOTES
@@ -0,0 +1,35 @@
requirements
============
-members only access
-members can post updates
-members can comment on updates
-members can get emailed updates

wishlist
========
-gravatars for icons
-tags in general (pretty useful)
-linked mentions for other members
-members get notifications with notify.io
-post daily archive to staff wiki
-"share publicly" that lets bubble up to twitter
-multiple log streams (tags? tabs?)
-integrate Buzz/"activitystrea.ms" standards

model
=====
Update
-created
-updated
-body
-user

Comment
-created
-updated
-body
-user
-update (reference)

Profile
-wants_emails
10 changes: 9 additions & 1 deletion app.yaml
Expand Up @@ -4,5 +4,13 @@ runtime: python
api_version: 1

handlers:
- url: /favicon.ico
static_files: static/favicon.ico
upload: static/favicon.ico
- url: /robots.txt
static_files: static/robots.txt
upload: static/robots.txt
- url: /static
static_dir: static
- url: .*
script: main.py
script: main.py
13 changes: 10 additions & 3 deletions main.py
@@ -1,10 +1,17 @@
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import util, template

class Update(db.Model):
user = db.UserProperty(auto_current_user_add=True)
body = db.StringProperty(required=True)
created = db.DateTimeProperty(auto_now_add=True)



class MainHandler(webapp.RequestHandler):
def get(self):
self.response.out.write('Hello world!')
your_name = "Jeff"
self.response.out.write(template.render('templates/main.html', locals()))


def main():
Expand Down
Binary file added static/dojo_icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions static/robots.txt
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
33 changes: 33 additions & 0 deletions static/style.css
@@ -0,0 +1,33 @@
body { font-family: Verdana,Arial,sans-serif; margin: 0px;}
#wrapper { margin-left: auto; margin-right: auto; width: 700px; }

#top a:visited { color: blue;}
#top { height: 20px; border-bottom: 1px solid #ccc; text-align: right; font-size: 12px; padding-right: 5px; padding-top: 4px; }

#header { margin-left: auto; margin-right: auto; width: 670px; height: 125px;}
#header img { margin-right: 10px;}
#header h1 { font-size: 42px; margin-top: 20px; padding-top: 10px; margin-bottom: 0px; padding-bottom: 0px;}
#header h2 { font-size: x-large; margin: 0px; }

.step span { color: white; background-color: #b10026; padding: 1px; padding-left: 4px; padding-right: 4px;}
.step.inactive span { background-color: gray;}
.step.inactive { color: gray; }

h3 { margin-top: 0px;}
h4 { margin-bottom: 0px;}

table td { padding-left: 10px; padding-top: 4px;}

form div { margin-top: 10px; }

label { display: block; font-size: smaller;}

a:visited { color: blue;}

#content { border-top: 3px solid #d50025; background: #eee; padding: 10px; }
#primary { background: white; width: 660px; padding: 10px; -moz-border-radius: 8px; -webkit-border-radius: 8px;}
h4 { font-size: smaller; }

.label { font-size: smaller; font-weight: bold; margin-top: 10px;}
#content h2 { margin-bottom: 5px; margin-top: 5px;}
#content table { margin-bottom: 20px;}
26 changes: 26 additions & 0 deletions templates/base.html
@@ -0,0 +1,26 @@
<html>
<head>
<title>Hacker Dojo Log</title>
<link href="/static/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="top">
{% if user %}
<span><strong>{{user.email}}</strong> | <a href="{{logout_url}}">Logout</a></span>
{% else %}
<span><a style="font-weight: bold;" href="{{login_url}}">Login</a> | <a href="http://signup.hackerdojo.com/upgrade/needaccount">Need an account?</a></span>
{% endif %}
</div>
<div id="wrapper">
<div id="header">
<img src="/static/dojo_icon.png" style="float: left;" />
<h1>Hacker Dojo</h1>
<h2 style="font-size: x-large;">Log</h2>
</div>
<div id="content">
{% block content %}{% endblock %}
</div>
</div>

</body>
</html>
6 changes: 6 additions & 0 deletions templates/main.html
@@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% block content %}

Hello world, {{your_name}}!

{% endblock %}

0 comments on commit 3928910

Please sign in to comment.