app/soc/views/sitemap/sitemap.py
author Sverre Rabbelier <srabbelier@gmail.com>
Sun, 16 Nov 2008 23:03:37 +0000
changeset 494 5e9c656a1b68
parent 493 app/urls.py@6976c4d8d0ac
child 613 4880ffa9f3ba
permissions -rw-r--r--
Refactored SiteMap to be generic With this mechanism (in combination with the new sidebar) in place adding a new entity to the site becomes very easy, rather than having to add a lot of code to 'map.py', one can simply register with the sitemap modules.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
     1
#!/usr/bin/python2.5
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
     2
#
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     4
#
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     8
#
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    10
#
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    15
# limitations under the License.
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    16
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    17
"""Sidebar
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    18
"""
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    19
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    20
__authors__ = [
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    21
    '"Sverre Rabbelier" <sverre@rabbelier.nl>',
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    22
  ]
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    23
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    24
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    25
SITEMAP = []
493
6976c4d8d0ac Refactor the sidebar to use Django templates
Sverre Rabbelier <srabbelier@gmail.com>
parents: 284
diff changeset
    26
31
8b43c541afa7 First iteration of a "prototype" Melange app, along with an initial Person
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    27
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    28
def addPages(pages):
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    29
  global SITEMAP
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents: 493
diff changeset
    30
  SITEMAP += pages