app/soc/views/sitemap/build.py
author Lennard de Rijk <ljvderijk@gmail.com>
Mon, 16 Mar 2009 21:17:04 +0000
changeset 1897 634617545037
parent 1617 9fdf1bf1e6a6
child 1936 ea886e0aedc4
permissions -rw-r--r--
Added a new template tag to serve up background color for StudentProposals Reviews. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
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
#
1308
35b75ffcbb37 Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1307
diff changeset
     3
# Copyright 2008 the Melange authors.
494
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
1617
9fdf1bf1e6a6 Remove unused imports from soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1428
diff changeset
    27
#from soc.views.models import club
9fdf1bf1e6a6 Remove unused imports from soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1428
diff changeset
    28
#from soc.views.models import club_app
9fdf1bf1e6a6 Remove unused imports from soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1428
diff changeset
    29
#from soc.views.models import club_admin
9fdf1bf1e6a6 Remove unused imports from soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1428
diff changeset
    30
#from soc.views.models import club_member
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    31
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
    32
from soc.views.models import host
1130
9bdbb18d622e Added view and templates for mentors.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    33
from soc.views.models import mentor
726
ba3d399ec9be Added Notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 703
diff changeset
    34
from soc.views.models import notification
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents: 665
diff changeset
    35
from soc.views.models import organization
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1002
diff changeset
    36
from soc.views.models import org_admin
1151
3116b927f4b9 Added org_app view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1130
diff changeset
    37
from soc.views.models import org_app
665
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 program
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
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
    40
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
    41
from soc.views.models import sponsor
1380
e4235440897c Added students to sidebar.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1346
diff changeset
    42
from soc.views.models import student
1428
36a0ebe0c868 Added student_proposals to the sitemap.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1413
diff changeset
    43
from soc.views.models import student_proposal
768
002d3141ff99 Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 767
diff changeset
    44
from soc.views.models import timeline
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
from soc.views.models import user
590
37735d97b541 Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents: 585
diff changeset
    46
from soc.views.models import user_self
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    47
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    48
from soc.views.sitemap import sidebar
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    49
from soc.views.sitemap import sitemap
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    50
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    51
1346
b3bbc6fa18ef Keep a global list of all known Roles
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    52
# TODO: instead of commenting out club stuff, make it depend on a setting
b3bbc6fa18ef Keep a global list of all known Roles
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    53
b3bbc6fa18ef Keep a global list of all known Roles
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1317
diff changeset
    54
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    55
sidebar.addMenu(user_self.view.getSidebarMenus)
1280
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    56
#sidebar.addMenu(club.view.getSidebarMenus)
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    57
#sidebar.addMenu(club.view.getExtraMenus)
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    58
#sidebar.addMenu(club_admin.view.getSidebarMenus)
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    59
#sidebar.addMenu(club_member.view.getSidebarMenus)
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    60
#sidebar.addMenu(club_app.view.getSidebarMenus)
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    61
sidebar.addMenu(site.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    62
sidebar.addMenu(user.view.getSidebarMenus)
1317
fad74cf4e5da Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    63
#sidebar.addMenu(document.view.getSidebarMenus)
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    64
sidebar.addMenu(sponsor.view.getSidebarMenus)
1002
11a2aff6c3ad Added sidebar support for group instances.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 980
diff changeset
    65
sidebar.addMenu(sponsor.view.getExtraMenus)
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    66
sidebar.addMenu(host.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    67
sidebar.addMenu(request.view.getSidebarMenus)
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    68
sidebar.addMenu(program.view.getSidebarMenus)
700
8baf8367340d Dynamically add sidebar items for programs
Sverre Rabbelier <srabbelier@gmail.com>
parents: 682
diff changeset
    69
sidebar.addMenu(program.view.getExtraMenus)
1380
e4235440897c Added students to sidebar.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1346
diff changeset
    70
sidebar.addMenu(student.view.getSidebarMenus)
1428
36a0ebe0c868 Added student_proposals to the sitemap.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1413
diff changeset
    71
sidebar.addMenu(student_proposal.view.getSidebarMenus)
703
c4f3997becd9 Rename getSidebarLinks to getSidebarMenus
Sverre Rabbelier <srabbelier@gmail.com>
parents: 700
diff changeset
    72
sidebar.addMenu(organization.view.getSidebarMenus)
1264
4d46b09f3751 Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1151
diff changeset
    73
sidebar.addMenu(organization.view.getExtraMenus)
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1002
diff changeset
    74
sidebar.addMenu(org_admin.view.getSidebarMenus)
1130
9bdbb18d622e Added view and templates for mentors.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    75
sidebar.addMenu(mentor.view.getSidebarMenus)
1151
3116b927f4b9 Added org_app view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1130
diff changeset
    76
sidebar.addMenu(org_app.view.getSidebarMenus)
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    77
1280
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    78
#sitemap.addPages(club.view.getDjangoURLPatterns())
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    79
#sitemap.addPages(club_admin.view.getDjangoURLPatterns())
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    80
#sitemap.addPages(club_app.view.getDjangoURLPatterns())
9a510b94cf22 Disable clubs for now
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1264
diff changeset
    81
#sitemap.addPages(club_member.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    82
sitemap.addPages(document.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    83
sitemap.addPages(host.view.getDjangoURLPatterns())
1130
9bdbb18d622e Added view and templates for mentors.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1126
diff changeset
    84
sitemap.addPages(mentor.view.getDjangoURLPatterns())
726
ba3d399ec9be Added Notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 703
diff changeset
    85
sitemap.addPages(notification.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    86
sitemap.addPages(organization.view.getDjangoURLPatterns())
1126
4fc86db70a76 Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1002
diff changeset
    87
sitemap.addPages(org_admin.view.getDjangoURLPatterns())
1151
3116b927f4b9 Added org_app view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1130
diff changeset
    88
sitemap.addPages(org_app.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    89
sitemap.addPages(program.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    90
sitemap.addPages(request.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    91
sitemap.addPages(site.view.getDjangoURLPatterns())
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    92
sitemap.addPages(sponsor.view.getDjangoURLPatterns())
1380
e4235440897c Added students to sidebar.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1346
diff changeset
    93
sitemap.addPages(student.view.getDjangoURLPatterns())
1428
36a0ebe0c868 Added student_proposals to the sitemap.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1413
diff changeset
    94
sitemap.addPages(student_proposal.view.getDjangoURLPatterns())
768
002d3141ff99 Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 767
diff changeset
    95
sitemap.addPages(timeline.view.getDjangoURLPatterns())
767
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    96
sitemap.addPages(user_self.view.getDjangoURLPatterns())
ebd938bbd3d4 Sorted build.py's sitemap.addPages lines
Sverre Rabbelier <srabbelier@gmail.com>
parents: 726
diff changeset
    97
sitemap.addPages(user.view.getDjangoURLPatterns())
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    98
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    99
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   100
def getPatterns():
1617
9fdf1bf1e6a6 Remove unused imports from soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1428
diff changeset
   101
  """Retrieves all the url patterns of this site.
9fdf1bf1e6a6 Remove unused imports from soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1428
diff changeset
   102
  """
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
   103
  return defaults.patterns(None, *sitemap.SITEMAP)