author | Todd Larsen <tlarsen@google.com> |
Tue, 26 Aug 2008 21:49:54 +0000 | |
changeset 109 | 620f9b141567 |
parent 88 | 9a8180f0941a |
child 141 | e120c24b89e2 |
permissions | -rw-r--r-- |
79
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
2 |
# |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
4 |
# |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
8 |
# |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
10 |
# |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
16 |
|
88
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
17 |
"""Site-wide Melange home page views. |
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
18 |
|
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
19 |
public: how the general public sees the site home page of a Melange |
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
20 |
site |
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
21 |
|
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
22 |
There may (eventually) be different views of the site home page for |
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
23 |
logged-in Users (such as a debug() view for logged-in Developers). |
79
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
24 |
""" |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
25 |
|
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
26 |
__authors__ = [ |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
27 |
'"Pawel Solyga" <pawel.solyga@gmail.com>', |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
28 |
] |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
29 |
|
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
30 |
|
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
31 |
from google.appengine.api import users |
81
b03b1ec17727
Moved soc/site/home.html to soc/site/home/public.html and updated default template for public() in home.py
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
79
diff
changeset
|
32 |
from soc.views.helpers import response_helpers |
79
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
33 |
|
88
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
34 |
|
81
b03b1ec17727
Moved soc/site/home.html to soc/site/home/public.html and updated default template for public() in home.py
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
79
diff
changeset
|
35 |
def public(request, template='soc/site/home/public.html'): |
88
9a8180f0941a
Some additional __doc__ comments (with some ideas for future plans) and removal
Todd Larsen <tlarsen@google.com>
parents:
81
diff
changeset
|
36 |
"""How the "general public" sees the Melange site home page. |
79
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
37 |
|
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
38 |
Args: |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
39 |
request: the standard django request object. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
40 |
template: the template path to use for rendering the template. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
41 |
|
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
42 |
Returns: |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
43 |
A subclass of django.http.HttpResponse with generated template. |
58001ec7720c
Home site templates and basic view.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
44 |
""" |
81
b03b1ec17727
Moved soc/site/home.html to soc/site/home/public.html and updated default template for public() in home.py
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
79
diff
changeset
|
45 |
return response_helpers.respond(request, |
b03b1ec17727
Moved soc/site/home.html to soc/site/home/public.html and updated default template for public() in home.py
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
79
diff
changeset
|
46 |
template, {'template': template}) |