Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the spawn page when there is no environment #26

Open
jtpio opened this issue Jun 10, 2020 · 1 comment
Open

Improve the spawn page when there is no environment #26

jtpio opened this issue Jun 10, 2020 · 1 comment
Labels
good first issue Good for newcomers

Comments

@jtpio
Copy link
Member

jtpio commented Jun 10, 2020

On a fresh install, the spawn page displays the following:

image

When there is no user environment, the Start button is not needed.

We could extend the spawn.html base template and modify it to show a message.

The template will be added to: https://github.com/plasmabio/tljh-repo2docker/tree/master/tljh_repo2docker/templates

The custom template will override the base JupyterHub template: https://github.com/jupyterhub/jupyterhub/blob/77edffd695bbef3b132fb3e9f1c6f080a84977e2/share/jupyterhub/templates/spawn.html

@jtpio
Copy link
Member Author

jtpio commented Jun 11, 2020

Maybe the simplest for now would be to define a custom spawn.yml in tljh_repo2docker/templates with a content similar to the following:

{% extends "templates/spawn.html" %}

{% block main %}
<div class="container">
  {% block heading %}
  <div class="row text-center">
    <h1>User Environments</h1>
  </div>
  {% endblock %}
  <div class="row col-sm-offset-2 col-sm-8">
    {% if for_user and user.name != for_user.name -%}
      <p>Spawning server for {{ for_user.name }}</p>
    {% endif -%}
    {% if error_message -%}
      <p class="spawn-error-msg text-danger">
        Error: {{error_message}}
      </p>
    {% endif %}
    {% if 'label' in spawner_options_form -%}
    <form enctype="multipart/form-data" id="spawn_form" action="{{url}}" method="post" role="form">
      {{spawner_options_form | safe}}
      <br>
      <input type="submit" value="Start" class="btn btn-jupyter form-control">
    </form>
    {% else %}
      <p class="text-info">
        No user environment available
      </p>
    {% endif %}
  </div>
</div>
{% endblock %}

@jtpio jtpio added the good first issue Good for newcomers label Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant