diff --git a/php/templates/components/container-state.twig b/php/templates/components/container-state.twig new file mode 100644 index 00000000..8bc8c559 --- /dev/null +++ b/php/templates/components/container-state.twig @@ -0,0 +1,27 @@ +{# @var c \App\Containers\Container #} +
  • + + {% if c.GetRunningState().value == 'running' %} + + {{ c.GetDisplayName() }} + (Running) + {% elseif c.GetStartingState().value == 'starting' %} + + {{ c.GetDisplayName() }} + (Starting) + {% else %} + + {{ c.GetDisplayName() }} + (Stopped) + {% endif %} + {% if c.GetDocumentation() != '' %} + (docs) + {% endif %} + + {% if c.GetUiSecret() != '' %} +
    + Show password for {{ c.GetDisplayName() }} + +
    + {% endif %} +
  • \ No newline at end of file diff --git a/php/templates/containers.twig b/php/templates/containers.twig index 1124c51a..96687dac 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -275,39 +275,7 @@ {# @var containers \AIO\Container\Container[] #} {% for container in containers %} {% if container.GetDisplayName() != '' %} -
  • - {% if container.GetStartingState().value == 'starting' %} - - {{ container.GetDisplayName() }} (Starting) - {% if container.GetDocumentation() != '' %} - (docs) - {% endif %} - {% if container.GetUiSecret() != '' %} - (password: {{ container.GetUiSecret() }}) - {% endif %} - - {% elseif container.GetRunningState().value == 'running' %} - - {{ container.GetDisplayName() }} (Running) - {% if container.GetDocumentation() != '' %} - (docs) - {% endif %} - {% if container.GetUiSecret() != '' %} - (password: {{ container.GetUiSecret() }}) - {% endif %} - - {% else %} - - {{ container.GetDisplayName() }} (Stopped) - {% if container.GetDocumentation() != '' %} - (docs) - {% endif %} - {% if container.GetUiSecret() != '' %} - (password: {{ container.GetUiSecret() }}) - {% endif %} - - {% endif %} -
  • + {% include 'components/container-state.twig' with {'c': container} only %} {% endif %} {% endfor %}