author | Sverre Rabbelier <srabbelier@gmail.com> |
Sun, 07 Dec 2008 15:29:37 +0000 | |
changeset 703 | c4f3997becd9 |
parent 700 | 8baf8367340d |
child 726 | ba3d399ec9be |
permissions | -rw-r--r-- |
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 |
|
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
27 |
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
|
28 |
from soc.views.models import host |
682
187f4d95fedb
Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
665
diff
changeset
|
29 |
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
|
30 |
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
|
31 |
from soc.views.models import program |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
32 |
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
|
33 |
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
|
34 |
from soc.views.models import sponsor |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
35 |
from soc.views.models import user |
590
37735d97b541
Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents:
585
diff
changeset
|
36 |
from soc.views.models import user_self |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
|
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
from soc.views.sitemap import sidebar |
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
from soc.views.sitemap import sitemap |
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
40 |
|
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
|
703
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
42 |
sidebar.addMenu(user_self.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
43 |
sidebar.addMenu(presence.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
44 |
sidebar.addMenu(site.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
45 |
sidebar.addMenu(user.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
46 |
sidebar.addMenu(document.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
47 |
sidebar.addMenu(sponsor.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
48 |
sidebar.addMenu(host.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
49 |
sidebar.addMenu(request.view.getSidebarMenus) |
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
50 |
sidebar.addMenu(program.view.getSidebarMenus) |
700
8baf8367340d
Dynamically add sidebar items for programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
682
diff
changeset
|
51 |
sidebar.addMenu(program.view.getExtraMenus) |
703
c4f3997becd9
Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents:
700
diff
changeset
|
52 |
sidebar.addMenu(organization.view.getSidebarMenus) |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
53 |
|
585
903890857ed8
Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents:
566
diff
changeset
|
54 |
sitemap.addPages(presence.view.getDjangoURLPatterns()) |
903890857ed8
Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents:
566
diff
changeset
|
55 |
sitemap.addPages(site.view.getDjangoURLPatterns()) |
903890857ed8
Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents:
566
diff
changeset
|
56 |
sitemap.addPages(user.view.getDjangoURLPatterns()) |
590
37735d97b541
Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents:
585
diff
changeset
|
57 |
sitemap.addPages(user_self.view.getDjangoURLPatterns()) |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
58 |
sitemap.addPages(document.view.getDjangoURLPatterns()) |
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
59 |
sitemap.addPages(sponsor.view.getDjangoURLPatterns()) |
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
60 |
sitemap.addPages(host.view.getDjangoURLPatterns()) |
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
61 |
sitemap.addPages(request.view.getDjangoURLPatterns()) |
643 | 62 |
sitemap.addPages(program.view.getDjangoURLPatterns()) |
682
187f4d95fedb
Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents:
665
diff
changeset
|
63 |
sitemap.addPages(organization.view.getDjangoURLPatterns()) |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
64 |
|
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
65 |
|
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
66 |
def getPatterns(): |
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
67 |
return defaults.patterns(None, *sitemap.SITEMAP) |