~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/subject.py

  • Committer: Matt Giuca
  • Date: 2010-03-05 07:00:41 UTC
  • Revision ID: matt.giuca@gmail.com-20100305070041-l6z1rfojn78bhiqd
subject.py: Minor refactor in displaying SVN urls. No longer pass the svn root to the Genshi template.

Show diffs side-by-side

added added

removed removed

Lines of Context:
735
735
    permission = "view_project_submissions"
736
736
    tab = 'subjects'
737
737
 
738
 
    def build_subversion_url(self, svnroot, submission):
 
738
    def build_subversion_url(self, config, submission):
739
739
        princ = submission.assessed.principal
740
740
 
741
741
        if isinstance(princ, User):
748
748
                    princ.name
749
749
                    )
750
750
        return urlparse.urljoin(
751
 
                    svnroot,
 
751
                    config['urls']['svn_addr'],
752
752
                    os.path.join(path, submission.path[1:] if
753
753
                                       submission.path.startswith(os.sep) else
754
754
                                       submission.path))
763
763
        ctx['format_datetime'] = ivle.date.make_date_nice
764
764
        ctx['format_datetime_short'] = ivle.date.format_datetime_for_paragraph
765
765
        ctx['build_subversion_url'] = self.build_subversion_url
766
 
        ctx['svn_addr'] = req.config['urls']['svn_addr']
767
766
        ctx['project'] = self.context
768
767
        ctx['user'] = req.user
769
768
        ctx['ProjectEdit'] = ProjectEdit