github.com/mgood/deis@v1.0.2-0.20141120022609-9a185b756e7d/controller/web/views.py (about)

     1  """
     2  View classes for presenting Deis web pages.
     3  """
     4  
     5  from django.contrib.auth.decorators import login_required
     6  from django.shortcuts import render
     7  
     8  from api.models import App
     9  from deis import __version__
    10  
    11  
    12  @login_required
    13  def account(request):
    14      """Return the user's account web page."""
    15      return render(request, 'web/account.html', {
    16          'page': 'account',
    17      })
    18  
    19  
    20  @login_required
    21  def dashboard(request):
    22      """Return the user's dashboard web page."""
    23      apps = App.objects.filter(owner=request.user)
    24      return render(request, 'web/dashboard.html', {
    25          'page': 'dashboard',
    26          'apps': apps,
    27          'version': __version__,
    28      })
    29  
    30  
    31  @login_required
    32  def apps(request):
    33      """Return the user's apps web page."""
    34      apps = App.objects.filter(owner=request.user)
    35      return render(request, 'web/apps.html', {
    36          'page': 'apps',
    37          'apps': apps,
    38      })
    39  
    40  
    41  @login_required
    42  def support(request):
    43      """Return the support ticket system home page."""
    44      return render(request, 'web/support.html', {
    45          'page': 'support',
    46      })