annotate hgscm/apps/www/views.py @ 207:c1c9a4f809ba

integrated quick_start and learn_mercurial into the django project (with links). Only missing parts: A wiki-page for links to learning resources and autodetection of the most current version.
author Arne Babenhauserheide <bab@draketo.de>
date Thu, 02 Jul 2009 15:35:27 +0200
parents 307dd774a9b6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26
b3d9cbb33d54 adding basic django project, just renders the frontpage right now
Jesper Noehr <jesper@noehr.org>
parents:
diff changeset
1 from django.shortcuts import render_to_response
b3d9cbb33d54 adding basic django project, just renders the frontpage right now
Jesper Noehr <jesper@noehr.org>
parents:
diff changeset
2 from django.template import RequestContext
70
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
3 from django.http import HttpResponseRedirect
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
4 from django.utils import simplejson
71
9be94f3dcaa0 downloads: fix import and paths
David Soria Parra <dsp@php.net>
parents: 70
diff changeset
5 from django.conf import settings
9be94f3dcaa0 downloads: fix import and paths
David Soria Parra <dsp@php.net>
parents: 70
diff changeset
6 from hgscm.apps.www.models import get_download, get_latest_version
9be94f3dcaa0 downloads: fix import and paths
David Soria Parra <dsp@php.net>
parents: 70
diff changeset
7 import os
26
b3d9cbb33d54 adding basic django project, just renders the frontpage right now
Jesper Noehr <jesper@noehr.org>
parents:
diff changeset
8
b3d9cbb33d54 adding basic django project, just renders the frontpage right now
Jesper Noehr <jesper@noehr.org>
parents:
diff changeset
9 def frontpage(request):
78
8d25e34c21c2 templatetags: Add DownloadButton tag to display a download button according to operating system
David Soria Parra <dsp@php.net>
parents: 71
diff changeset
10 return render_to_response("frontpage.html", { },
26
b3d9cbb33d54 adding basic django project, just renders the frontpage right now
Jesper Noehr <jesper@noehr.org>
parents:
diff changeset
11 RequestContext(request))
45
7276388fc71b about: integrate about page in django version
David Soria Parra <dsp@php.net>
parents: 26
diff changeset
12 def about(request):
7276388fc71b about: integrate about page in django version
David Soria Parra <dsp@php.net>
parents: 26
diff changeset
13 return render_to_response("about.html", { },
7276388fc71b about: integrate about page in django version
David Soria Parra <dsp@php.net>
parents: 26
diff changeset
14 RequestContext(request))
182
307dd774a9b6 who_uses: Initial commit of the "who uses mercurial" page
David Soria Parra <dsp@php.net>
parents: 162
diff changeset
15 def who_uses(request):
307dd774a9b6 who_uses: Initial commit of the "who uses mercurial" page
David Soria Parra <dsp@php.net>
parents: 162
diff changeset
16 return render_to_response("who_uses.html", { },
307dd774a9b6 who_uses: Initial commit of the "who uses mercurial" page
David Soria Parra <dsp@php.net>
parents: 162
diff changeset
17 RequestContext(request))
162
d4b03ef491f2 FIX: workflow_guide was missing a view.
Arne Babenhauserheide <bab@draketo.de>
parents: 78
diff changeset
18 def workflow_guide(request):
d4b03ef491f2 FIX: workflow_guide was missing a view.
Arne Babenhauserheide <bab@draketo.de>
parents: 78
diff changeset
19 return render_to_response("workflow_guide.html", { },
d4b03ef491f2 FIX: workflow_guide was missing a view.
Arne Babenhauserheide <bab@draketo.de>
parents: 78
diff changeset
20 RequestContext(request))
207
c1c9a4f809ba integrated quick_start and learn_mercurial into the django project (with links).
Arne Babenhauserheide <bab@draketo.de>
parents: 182
diff changeset
21 def quick_start(request):
c1c9a4f809ba integrated quick_start and learn_mercurial into the django project (with links).
Arne Babenhauserheide <bab@draketo.de>
parents: 182
diff changeset
22 return render_to_response("quick_start.html", { },
c1c9a4f809ba integrated quick_start and learn_mercurial into the django project (with links).
Arne Babenhauserheide <bab@draketo.de>
parents: 182
diff changeset
23 RequestContext(request))
c1c9a4f809ba integrated quick_start and learn_mercurial into the django project (with links).
Arne Babenhauserheide <bab@draketo.de>
parents: 182
diff changeset
24 def learn_mercurial(request):
c1c9a4f809ba integrated quick_start and learn_mercurial into the django project (with links).
Arne Babenhauserheide <bab@draketo.de>
parents: 182
diff changeset
25 return render_to_response("learn_mercurial.html", { },
c1c9a4f809ba integrated quick_start and learn_mercurial into the django project (with links).
Arne Babenhauserheide <bab@draketo.de>
parents: 182
diff changeset
26 RequestContext(request))
65
57ece5687f92 Add 'about this page' site
David Soria Parra <dsp@php.net>
parents: 45
diff changeset
27 def thepage(request):
57ece5687f92 Add 'about this page' site
David Soria Parra <dsp@php.net>
parents: 45
diff changeset
28 return render_to_response("thepage.html", { },
57ece5687f92 Add 'about this page' site
David Soria Parra <dsp@php.net>
parents: 45
diff changeset
29 RequestContext(request))
70
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
30 def download(request, platform, version):
78
8d25e34c21c2 templatetags: Add DownloadButton tag to display a download button according to operating system
David Soria Parra <dsp@php.net>
parents: 71
diff changeset
31 return HttpResponseRedirect(get_download(platform, version)['url'])
70
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
32 def downloads(request):
71
9be94f3dcaa0 downloads: fix import and paths
David Soria Parra <dsp@php.net>
parents: 70
diff changeset
33 f = open(os.path.join(settings.MEDIA_ROOT, "downloads.json"))
70
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
34 list = simplejson.load(f)
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
35 f.close()
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
36 return render_to_response("downloads.html", {'downloads': list},
bef09338eceb downloads: add initial handling for downloads
David Soria Parra <dsp@php.net>
parents: 65
diff changeset
37 RequestContext(request))