From d97775d07c939f145579563335729d6f679e21a1 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Wed, 3 Feb 2010 10:26:35 +0000 Subject: [PATCH] GeoView: Change the start page. svn: r14194 --- src/plugins/view/geoview.py | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/plugins/view/geoview.py b/src/plugins/view/geoview.py index 7bf44da96..2e927f57e 100644 --- a/src/plugins/view/geoview.py +++ b/src/plugins/view/geoview.py @@ -2098,3 +2098,44 @@ class GeoView(HtmlView): Builds the new view depending on the filter. """ self._geo_places() + + def _create_start_page(self): + """ + This command creates a default start page, and returns the URL of + this page. + """ + tmpdir = GEOVIEW_SUBPATH + data = """ + + + + + %(title)s + + +

%(title)s

+

%(content)s

+ + + """ % { 'height' : 600, + 'title' : _('Start page for the Geography View'), + 'content': _('You don\'t see a map here for the following ' + 'reasons :
    ' + '
  1. Your database is empty or not yet selected.
  2. ' + '
  3. You don\'t yet select a person.
  4. ' + '
  5. You have no place in your database.
  6. ' + '
  7. The selected places have no coordinates.
  8. ' + '
') + } + filename = os.path.join(tmpdir, 'geography.html') + # Now we have two views : Web and Geography, we need to create the + # startpage only once. + if not os.path.exists(filename): + ufd = file(filename, "w+") + ufd.write(data) + ufd.close() + return urlparse.urlunsplit(('file', '', + URL_SEP.join(filename.split(os.sep)), + '', '')) +