leilukin-tumbleblog/admin/pages/feathers.twig

69 lines
2.4 KiB
Twig

{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block title %}{{ "Feathers" | translate }}{% endblock %}
{% block content %}
<h2>{{ "Feathers" | translate }}</h2>
{% if enabled_feathers is not empty %}
<h3>{{ "Enabled" | translate }}</h3>
<ul id="feathers_enabled" class="extend feathers">
{% for safename, feather in enabled_feathers %}
<li class="feather{{ feather.classes is defined ? ' ' ~ feather.classes | join(' ') : '' }}" id="feather_{{ safename }}">
<h4>
{{ feather.name }}{# translation is done in the controller #}
<a class="emblem feather_url" rel="external" href="{{ feather.url }}" target="_blank">
{{ icon_img("info.svg", "info" | translate) }}
</a>
</h4>
<p class="feather_description">
{{ feather.description }}{# translation is done in the controller #}
</p>
<div class="controls">
<form class="feather_disabler" action="{{ url('disable') }}" method="post" accept-charset="UTF-8">
<input type="hidden" name="extension" value="{{ safename }}">
<input type="hidden" name="type" value="feather">
<input type="hidden" name="hash" value="{{ authenticate() }}">
{% if feather.confirm is not empty %}
<button name="confirm" value="1" type="submit" class="boo" data-confirm="{{ feather.confirm | fix(true) }}">
{{ "Uninstall" | translate }}
</button>
{% endif %}
<button type="submit">
{{ "Disable" | translate }}
</button>
</form>
</div>
</li>
{% endfor %}
</ul>
{% endif %}
{% if disabled_feathers is not empty %}
<h3>{{ "Disabled" | translate }}</h3>
<ul id="feathers_disabled" class="extend feathers">
{% for safename, feather in disabled_feathers %}
<li class="feather{{ feather.classes is defined ? ' ' ~ feather.classes | join(' ') : '' }}" id="feather_{{ safename }}">
<h4>
{{ feather.name }}{# translation is done in the controller #}
<a class="emblem feather_url" href="{{ feather.url }}" target="_blank">
{{- icon_img("info.svg", "info" | translate) }}
</a>
</h4>
<p class="feather_description">
{{ feather.description }}{# translation is done in the controller #}
</p>
<div class="controls">
<form class="feather_enabler" action="{{ url('enable') }}" method="post" accept-charset="UTF-8">
<input type="hidden" name="extension" value="{{ safename }}">
<input type="hidden" name="type" value="feather">
<input type="hidden" name="hash" value="{{ authenticate() }}">
<button type="submit">
{{ "Enable" | translate }}
</button>
</form>
</div>
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}