hobo/hobo/applications/templates/hobo/applications/manifest.html

114 lines
4.8 KiB
HTML

{% extends "hobo/applications/home.html" %}
{% load i18n thumbnail %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'application-manifest' app_slug=app.slug %}">{{ app.name }}</a>
{% endblock %}
{% block appbar %}
<h2 class="application-title">
{% if app.icon %}
{% thumbnail app.icon '64x64' crop='center' format='PNG' as im %}
<img src="{{ im.url }}" alt="" />
{% endthumbnail %}
{% endif %}
{{ app.name }}
</h2>
<span class="actions">
<a class="extra-actions-menu-opener"></a>
{% if app.editable %}
<a rel="popup" href="{% url 'application-metadata' app_slug=app.slug %}">{% trans 'Metadata' %}</a>
{% else %}
<a rel="popup" href="{% url 'application-update' app_slug=app.slug %}">{% trans 'Update' %}</a>
{% endif %}
<ul class="extra-actions-menu">
<li><a href="{% url 'application-versions' app_slug=app.slug %}">{% trans 'See all versions' %}</a></li>
<li><a rel="popup" href="{% url 'application-delete' slug=app.slug %}">{% trans 'Delete' %}</a></li>
</ul>
</span>
{% endblock %}
{% block content %}
<ul class="objects-list single-links application-content">
{% for relation in relations %}
<li {% if relation.auto_dependency %}class="auto-dependency"{% endif %}>
<a {% if relation.element.get_redirect_url %}href="{{ relation.element.get_redirect_url }}"{% endif %}>
{% if relation.error %}<span class="tag tag-error">{{ relation.get_error_status_display }}</span>{% endif %}
{{ relation.element.name }} <span class="extra-info">- {{ relation.element.type_label }}</span>
</a>
{% if app.editable and not relation.auto_dependency %}<a rel="popup" class="delete" href="{% url 'application-delete-element' app_slug=app.slug pk=relation.id %}">{% trans "remove" %}</a>{% endif %}
</li>
{% endfor %}
</ul>
{% if relations %}
<div class="buttons">
{% if app.editable %}
<a class="pk-button" href="{% url 'application-scandeps' app_slug=app.slug %}">{% trans "Scan dependencies" %}</a>
&nbsp; &nbsp;
<a class="pk-button" rel="popup" href="{% url 'application-generate' app_slug=app.slug %}">{% trans "Generate application bundle" %}</a>
{% endif %}
{% if last_version %}
{% if app.editable %}&nbsp; &nbsp;{% endif %}
<a class="pk-button" download href="{% url 'application-download' app_slug=app.slug %}">{% blocktrans with number=last_version.number %}Download latest version ({{ number }}){% endblocktrans %}</a>
{% endif %}
</div>
{% else %}
<div id="application-empty">
<div class="infonotice">
<p>{% trans "You should now assemble the different parts of your application." %}</p>
</div>
</div>
{% endif %}
{% endblock %}
{% block sidebar %}
<aside id="sidebar">
{% if app.editable %}
<h3>{% trans "Add" %}</h3>
{% for service, types in types_by_service.items %}
<h4>{{ service }}</h4>
{% for type in types %}
<a class="button button-paragraph" rel="popup" href="{% url 'application-add-element' app_slug=app.slug type=type.id %}">{{ type.text }}</a>
{% endfor %}
{% endfor %}
{% endif %}
{% with has_parameters=app.parameter_set.exists parameters_qs=app.parameter_set.all %}
{% if app.editable or has_parameters %}
<div class="app-parameters--section">
<h3>{% trans "Parameters" %}
{% if app.editable %}
<a rel="popup" href="{% url 'application-add-parameter' app_slug=app.slug %}">({% trans "add" %})</a>
{% endif %}
</h3>
{% if app.editable and has_parameters %}
<ul class="objects-list single-links app-parameters--list">
{% for parameter in parameters_qs %}
<li><a rel="popup" href="{% url 'application-edit-parameter' app_slug=app.slug pk=parameter.id %}">{{ parameter.label }}</a>
<a rel="popup" class="delete" href="{% url 'application-delete-parameter' app_slug=app.slug pk=parameter.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% elif app.editable %}
<p>{% trans "No parameters defined." %}</p>
{% endif %}
{% if has_parameters %}
<div class="app-parameters--values">
{% for parameter in parameters_qs %}
<p>
<label>{{ parameter.label }}</label>
{{ parameter.variable.value|default:"-" }}
(<a rel="popup" href="{% url 'application-change-parameter-value' app_slug=app.slug name=parameter.variable.name %}">{% trans 'change' %}</a>)
</p>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{% endwith %}
</aside>
{% endblock %}