github.com/blystad/deis@v0.11.0/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, Cluster
     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      clusters = Cluster.objects.filter(owner=request.user)
    25      return render(request, 'web/dashboard.html', {
    26          'page': 'dashboard',
    27          'apps': apps,
    28          'clusters': clusters,
    29          'version': __version__,
    30      })
    31  
    32  
    33  @login_required
    34  def clusters(request):
    35      """Return the user's clusters web page."""
    36      clusters = Cluster.objects.filter(owner=request.user)
    37      return render(request, 'web/clusters.html', {
    38          'page': 'clusters',
    39          'clusters': clusters,
    40      })
    41  
    42  
    43  @login_required
    44  def apps(request):
    45      """Return the user's apps web page."""
    46      apps = App.objects.filter(owner=request.user)
    47      return render(request, 'web/apps.html', {
    48          'page': 'apps',
    49          'apps': apps,
    50      })
    51  
    52  
    53  @login_required
    54  def support(request):
    55      """Return the support ticket system home page."""
    56      return render(request, 'web/support.html', {
    57          'page': 'support',
    58      })