app/soc/views/sitemap/build.py
author Sverre Rabbelier <srabbelier@gmail.com>
Sat, 10 Jan 2009 18:18:10 +0000
changeset 802 95c534d02e39
parent 791 30da180c4bca
child 901 d580a057103d
permissions -rw-r--r--
Added Club Admin model, logic, and view Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
499
d22e4fe8e64b Fix missing dots in doc strings and some other doc string corrections.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 494
diff changeset
    17
"""Module that constructs the sitemap.
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
"""
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
    '"Sverre Rabbelier" <sverre@rabbelier.nl>',
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
  ]
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
from django.conf.urls import defaults
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
779
81506d223cb0 Added support for creating clubs.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 768
diff changeset
    27
from soc.views.models import club
791
30da180c4bca Added the club_app view, logic and model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 779
diff changeset
    28
from soc.views.models import club_app
802
95c534d02e39 Added Club Admin model, logic, and view
Sverre Rabbelier <srabbelier@gmail.com>
parents: 791
diff changeset
    29
from soc.views.models import club_admin
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    30
from soc.views.models import document
665
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    31
from soc.views.models import host
726
ba3d399ec9be Added Notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 703
diff changeset
    32
from soc.views.models import notification
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents: 665
diff changeset
    33
from soc.views.models import organization
534
c31cfbf1a20f Replace HomeSettings with Presence Model class. Replace SiteSettings with
Todd Larsen <tlarsen@google.com>
parents: 499
diff changeset
    34
from soc.views.models import presence
665
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    35
from soc.views.models import program
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    36
from soc.views.models import request
665
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    37
from soc.views.models import site
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    38
from soc.views.models import sponsor
768
002d3141ff99 Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 767
diff changeset
    39
from soc.views.models import timeline
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
from soc.views.models import user
590
37735d97b541 Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents: 585
diff changeset
    41
from soc.views.models import user_self
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    42
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    43
from soc.views.sitemap import sidebar
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    44
from soc.views.sitemap import sitemap
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    46
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    47
sidebar.addMenu(user_self.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    48
sidebar.addMenu(presence.view.getSidebarMenus)
779
81506d223cb0 Added support for creating clubs.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 768
diff changeset
    49
sidebar.addMenu(club.view.getSidebarMenus)
802
95c534d02e39 Added Club Admin model, logic, and view
Sverre Rabbelier <srabbelier@gmail.com>
parents: 791
diff changeset
    50
sidebar.addMenu(club_admin.view.getSidebarMenus)
791
30da180c4bca Added the club_app view, logic and model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 779
diff changeset
    51
sidebar.addMenu(club_app.view.getSidebarMenus)
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    52
sidebar.addMenu(site.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    53
sidebar.addMenu(user.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    54
sidebar.addMenu(document.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    55
sidebar.addMenu(sponsor.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    56
sidebar.addMenu(host.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    57
sidebar.addMenu(request.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    58
sidebar.addMenu(program.view.getSidebarMenus)
700
8baf8367340d Dynamically add sidebar items for programs
Sverre Rabbelier <srabbelier@gmail.com>
parents: 682
diff changeset
    59
sidebar.addMenu(program.view.getExtraMenus)
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    60
sidebar.addMenu(organization.view.getSidebarMenus)
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    61
779
81506d223cb0 Added support for creating clubs.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 768
diff changeset
    62
sitemap.addPages(club.view.getDjangoURLPatterns())
802
95c534d02e39 Added Club Admin model, logic, and view
Sverre Rabbelier <srabbelier@gmail.com>
parents: 791
diff changeset
    63
sitemap.addPages(club_admin.view.getDjangoURLPatterns())
791
30da180c4bca Added the club_app view, logic and model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 779
diff changeset
    64
sitemap.addPages(club_app.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    65
sitemap.addPages(document.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    66
sitemap.addPages(host.view.getDjangoURLPatterns())
726
ba3d399ec9be Added Notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 703
diff changeset
    67
sitemap.addPages(notification.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    68
sitemap.addPages(organization.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    69
sitemap.addPages(presence.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    70
sitemap.addPages(program.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    71
sitemap.addPages(request.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    72
sitemap.addPages(site.view.getDjangoURLPatterns())
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    73
sitemap.addPages(sponsor.view.getDjangoURLPatterns())
768
002d3141ff99 Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 767
diff changeset
    74
sitemap.addPages(timeline.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    75
sitemap.addPages(user_self.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    76
sitemap.addPages(user.view.getDjangoURLPatterns())
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    77
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    78
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    79
def getPatterns():
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    80
  return defaults.patterns(None, *sitemap.SITEMAP)