Skip to content

Commit 9644e9a

Browse files
committed
First commit
1 parent 86d577c commit 9644e9a

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

app.py

-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77

88
root = '/forum'
99

10-
class routes():
11-
index = root
12-
messages = root+'/(.*)/(.*)'
13-
newtopic = root+'/newtopic/(.*)'
14-
topics = root+'/(.*)'
15-
1610
class config():
1711
server = os.environ['SERVER_NAME']
1812
isLive = server=='www.example.com'

notfound.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "base.html" %}
22
{% block main %}
3-
<div class="page center">
3+
<div id="content" class="wideforum">
44
<h3>We couldn't find what you were looking for</h3>
55
<h2><a href="{{root}}">Go back to the main page</a></h2>
66
</div>

profile.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends "base.html" %}
2+
3+
{% block main %}
4+
<div id="content" class="wideforum">
5+
6+
<h2 class="forum_title">{{userid}}</h2>
7+
<h3 class="forum_desc">Edit your profile</h3>
8+
9+
<div class="nav"><a href="{{root}}">Forum</a> &raquo; <a href="{{root}}/profile/{{userid}}">Profile</a></div>
10+
11+
<p>Under construction. Come back later.</p>
12+
13+
</div>
14+
{% endblock %}

urls.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
(app.root+'' , views.Forum),
55
(app.root+'/' , views.Forum),
66
(app.root+'/newtopic/(.*)' , views.NewTopic),
7-
(app.root+'/profile/.*' , views.Profiles),
8-
(app.root+'/images/.*' , views.ImageHandler),
7+
(app.root+'/profile/(.*)' , views.Profiles),
8+
(app.root+'/images/(.*)' , views.ImageHandler),
99
(app.root+'/notfound' , views.NotFound),
1010
(app.root+'/(.*)/(.*)' , views.Messages),
1111
(app.root+'/(.*)' , views.Topics),
12-
(app.root+'/.*' , views.NotFound)
12+
(app.root+'.*' , views.NotFound)
1313
]
1414

1515
def main(): app.control(routes)

views.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import app,models,forms,utils
2+
from google.appengine.api import users
3+
24

35
class Forum(app.request):
46
def get(self):
@@ -8,7 +10,9 @@ def get(self):
810

911
class Topics(app.request):
1012
def get(self,fid):
11-
data={'forum':models.getForum(fid),'list':models.getTopics(fid)}
13+
forum = models.getForum(fid)
14+
topics = models.getTopics(fid)
15+
data = {'forum':forum,'list':topics}
1216
self.show('topics',data)
1317

1418

@@ -40,7 +44,7 @@ def post(self,fid,tid):
4044

4145
class Profiles(app.request):
4246
def get(self,pid):
43-
data={}
47+
data={'userid':pid}
4448
self.show('profile',data)
4549

4650

0 commit comments

Comments
 (0)