Commit 5aa40f22 authored by BAIRE Anthony's avatar BAIRE Anthony

fix the webapp buttons in the webapp list

- remove duplicated code
- remove the "Edit the application properties" button (not useful,
  because it is a very rare operation and also because the sandbox
  panel is no longer accessible from this page)
- reword "Finish the configuration of your app" as "There is an
  active sandbox" (which is much clearer)
- fix the condition for displaying the sandbox button
parent 3a2e7d27
......@@ -14,10 +14,8 @@
<h6 class="card-subtitle text-muted text-center">{{ webapp.contact | email2name }} - Updated {{ webapp.updated_at | naturalday }}</h6>
</div>
<div class="card-body">
{% if user.is_authenticated %}
<nav class="navbar">
<ul class="nav nav-bar mx-auto">
{% if webapp.sandbox_version_id %}
<li class="nav-item">
<a
class="nav-link"
......@@ -33,59 +31,18 @@
title="Start a Jupyter notebook"
data-toggle="tooltip"
data-placement="bottom"><i class="fas fa-sticky-note" data-fa-transform="shrink-10 up-.5" data-fa-mask="fas fa-circle"></i><span class="text-hide">Run notebook</a></li>
{% endif %}
{% if webapp.user == user %}
{% if webapp.notebook_gitrepo %}
<li class="nav-item">
<a
class="nav-link"
href="/jupyter?repo={{ webapp.notebook_gitrepo }}"
title="Start a Jupyter notebook"
data-toggle="tooltip"
data-placement="bottom"><i class="fas fa-sticky-note" data-fa-transform="shrink-10 up-.5" data-fa-mask="fas fa-circle"></i><span class="text-hide">Run notebook</a></li>
{% endif %}
<li class="nav-item">
<a
class="nav-link"
href="{% url 'main:webapp_update' webapp.docker_name %}"
title="Edit the application properties"
data-toggle="tooltip"
data-placement="bottom"><i class="fas fa-pencil-alt" data-fa-transform="shrink-10 up-.5" data-fa-mask="fas fa-circle"></i><span class="text-hide">Run notebook</a></li>
{% else %}
<li class="nav-item">
<a
class="nav-link app-unfinished"
href="{% url 'main:webapp_sandbox_panel' webapp.docker_name %}"
title="Finish the configuration of your app"
data-toggle="tooltip"
data-placement="bottom"><i class="fas fa-exclamation-circle"></i><span class="text-hide">Finish the app configuration</span></a></li>
{% endif %}
</ul>
</nav>
{% else %}
{% endif %}
{% if webapp.user == user and webapp.sandbox_state != webapp.IDLE %}
<li class="nav-item">
<a
class="nav-link app-unfinished"
href="{% url 'main:webapp_sandbox_panel' webapp.docker_name %}"
title="Finish the configuration of your app"
title="There is an active sandbox"
data-toggle="tooltip"
data-placement="bottom"><i class="fas fa-exclamation-circle"></i><span class="text-hide">Finish the app configuration</span></a></li>
data-placement="bottom"><i class="fas fa-exclamation-circle"></i><span class="text-hide">There is an active sandbox</span></a></li>
{% endif %}
</ul>
</nav>
{% else %}
<nav class="navbar">
<ul class="nav nav-bar mx-auto">
<li class="nav-item">
<a
class="nav-link"
href="{% url 'main:webapp_detail' webapp.docker_name %}"
title="Start a job"
data-toggle="tooltip"
data-placement="bottom" ><i class="fas fa-play" data-fa-transform="shrink-10 up-.5" data-fa-mask="fas fa-circle"></i><span class="text-hide">Run a job</a></li>
</ul>
</nav>
{% endif %}
<p class="card-text">
{% if webapp.description %}
{{ webapp.description|truncatechars:200 }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment