def _RenderProxyServerFormTemplate(proxy_server):
  """Render the form to add or edit a proxy server."""
  template_values = {
      'proxy_server': proxy_server,
  }
  template = JINJA_ENVIRONMENT.get_template('templates/proxy_server_form.html')
  return template.render(template_values)
def _RenderLandingTemplate():
  """Render the default landing page."""
  template_values = {
      'site_verification_content': DomainVerification.GetOrInsertDefault().content,
  }
  template = JINJA_ENVIRONMENT.get_template('templates/landing.html')
  return template.render(template_values)
def _RenderNotificationsTemplate():
  """Render a list of notifications."""
  notifications = Notification.GetAll()
  template_values = {
      'notifications': notifications
  }
  template = JINJA_ENVIRONMENT.get_template('templates/notifications.html')
  return template.render(template_values)
def _RenderProxyServerFormTemplate(proxy_server):
    """Render the form to add or edit a proxy server."""
    template_values = {
        'proxy_server': proxy_server,
    }
    template = JINJA_ENVIRONMENT.get_template(
        'templates/proxy_server_form.html')
    return template.render(template_values)
def _RenderListProxyServerTemplate():
  """Render a list of proxy servers."""
  proxy_servers = ProxyServer.GetAll()
  template_values = {
      'proxy_servers': proxy_servers
  }
  template = JINJA_ENVIRONMENT.get_template('templates/proxy_server.html')
  return template.render(template_values)
def _RenderAddUsersTemplate(directory_users, error=None):
  """Render a user add page that lets users be added by group key."""
  template_values = {
      'directory_users': directory_users,
  }
  if error is not None:
    template_values['error'] = error
  template = JINJA_ENVIRONMENT.get_template('templates/add_user.html')
  return template.render(template_values)
def _RenderUserListTemplate():
  """Render a list of users."""
  users = User.GetAll()
  user_payloads = _GenerateUserPayload(users)
  template_values = {
      'user_payloads': user_payloads
  }
  template = JINJA_ENVIRONMENT.get_template('templates/user.html')
  return template.render(template_values)
def _RenderChannelsListTemplate():
  """Render a list of notification channels."""
  channels = NotificationChannel.GetAll()
  template_values = {
      'channels': channels
  }
  html_file_name = 'templates/notification_channels.html'
  template = JINJA_ENVIRONMENT.get_template(html_file_name)
  return template.render(template_values)
def _RenderUserDetailsTemplate(user, invite_code=None):
  """Render a user add page that lets users be added by group key."""
  template_values = {
      'user': user,
      'key': user.key.urlsafe(),
  }
  if invite_code is not None:
    template_values['invite_code'] = invite_code
  template = JINJA_ENVIRONMENT.get_template('templates/user_details.html')
  return template.render(template_values)
Beispiel #10
0
def _RenderSetupOAuthClientTemplate():
    """Render a setup page with inputs for client id and secret."""
    entity = OAuth.GetOrInsertDefault()
    domain_verification = DomainVerification.GetOrInsertDefault()
    template_values = {
        'client_id': entity.client_id,
        'client_secret': entity.client_secret,
        'dv_content': domain_verification.content,
    }
    template = JINJA_ENVIRONMENT.get_template('templates/setup_client.html')
    return template.render(template_values)
Beispiel #11
0
def _RenderSetupOAuthClientTemplate():
  """Render a setup page with inputs for client id and secret."""
  entity = OAuth.GetOrInsertDefault()
  domain_verification = DomainVerification.GetOrInsertDefault()
  template_values = {
      'client_id': entity.client_id,
      'client_secret': entity.client_secret,
      'dv_content': domain_verification.content,
  }
  template = JINJA_ENVIRONMENT.get_template('templates/setup_client.html')
  return template.render(template_values)
Beispiel #12
0
 def get(self):
     template = JINJA_ENVIRONMENT.get_template('upload.html')
     self.response.write(template.render())
def _RenderListProxyServerTemplate():
    """Render a list of proxy servers."""
    proxy_servers = ProxyServer.GetAll()
    template_values = {'proxy_servers': proxy_servers}
    template = JINJA_ENVIRONMENT.get_template('templates/proxy_server.html')
    return template.render(template_values)
Beispiel #14
0
    def get(self):
        collection = Script.query().fetch()

        template = JINJA_ENVIRONMENT.get_template('scriptlist.html')
        self.response.write(template.render({'scriptset': collection}))