Fioddor Superconcentrado 4b2162f3fd
setup: Show and remove conflicts before installation
Warn of installed conflicting packages before installing apps.

[sunil: Rename 'advice' to 'action']
[sunil: Action will be string constant, for better API and i18n]
[sunil: Don't show conflict warning if action is 'ignore']
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-10-10 19:22:19 -07:00

116 lines
4.0 KiB
HTML

{% extends "base.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block content %}
{% include "app-header.html" with setup=True %}
{% include "toolbar.html" %}
{% if setup_state == 'up-to-date' %}
{% trans "Application installed." %}
{% elif not setup_current_operation %}
<p>
{% if setup_state == 'needs-setup' %}
{% blocktrans trimmed %}
Install this application?
{% endblocktrans %}
{% elif setup_state == 'needs-update' %}
{% blocktrans trimmed %}
This application needs an update. Update now?
{% endblocktrans %}
{% endif %}
</p>
<form class="form-install" action="" method="post">
{% csrf_token %}
{% if package_manager_is_busy %}
<div class="alert alert-warning" role="alert">
{% blocktrans trimmed %}
Another installation or upgrade is already running.
Please wait for a few moments before trying again.
{% endblocktrans %}
</div>
{% elif setup_helper.has_unavailable_packages %}
<div class="alert alert-warning" role="alert">
{% blocktrans trimmed %}
This application is currently not available in your distribution.
{% endblocktrans %}
<button type="submit" class="btn btn-default btn-sm" name="refresh-packages">
<span class="fa fa-refresh"></span> {% trans "Check again" %}
</button>
</div>
{% elif package_conflicts and package_conflicts_action != 'ignore' %}
<div class="alert alert-warning" role="alert">
{% blocktrans trimmed %}
<strong>Conflicting Packages:</strong> Some packages installed on
the system conflict with the installation of this app. The following
packages will be removed if you proceed:
{% endblocktrans %}
{% for package in package_conflicts %}
{{ package }}
{% endfor %}
</div>
{% endif %}
<input type="submit" class="btn btn-md btn-primary" name="install"
{% if package_manager_is_busy or setup_helper.has_unavailable_packages %}
disabled="disabled"
{% endif %}
{% if setup_state == 'needs-setup' %}
value="{% trans "Install" %}"
{% elif setup_state == 'needs-update' %}
value="{% trans "Update" %}"
{% endif %} />
</form>
{% else %}
{% if setup_current_operation.step == 'pre' %}
<div class="installing install-state-pre">
<span class="fa fa-refresh fa-spin processing"></span>
{% trans "Performing pre-install operation" %}
</div>
{% elif setup_current_operation.step == 'post' %}
<div class="installing install-state-post">
<span class="fa fa-refresh fa-spin processing"></span>
{% trans "Performing post-install operation" %}
</div>
{% elif setup_current_operation.step == 'install' %}
{% with transaction=setup_current_operation.transaction %}
<div class="installing install-state-installing">
<span class="fa fa-refresh fa-spin processing"></span>
{% blocktrans trimmed with package_names=transaction.package_names|join:", " status=transaction.status_string %}
Installing {{ package_names }}: {{ status }}
{% endblocktrans %}
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped active
w-{{ transaction.percentage }}"
role="progressbar" aria-valuemin="0" aria-valuemax="100"
aria-valuenow="{{ transaction.percentage }}">
<span class="sr-only">
{% blocktrans trimmed with percentage=transaction.percentage %}
{{ percentage }}% complete
{% endblocktrans %}
</span>
</div>
</div>
{% endwith %}
{% endif %}
{% endif %}
{% endblock %}