Files
kursy-mirror/kursy/templates/allauth/elements/button.html

37 lines
3.1 KiB
HTML

{% load allauth %}
{% comment %} djlint:off {% endcomment %}
<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %}
{% if attrs.form %}form="{{ attrs.form }}"{% endif %}
{% if attrs.id %}id="{{ attrs.id }}"{% endif %}
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
{% if attrs.type %}type="{{ attrs.type }}"{% endif %}
{% if attrs.value %}value="{{ attrs.value }}"{% endif %}
class="{% block class %}
inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50
{% if "link" in attrs.tags %}bg-transparent p-0 text-blue-600 hover:text-blue-700 hover:underline focus:ring-blue-500
{% else %}
{% if "prominent" in attrs.tags %}px-5 py-3 text-base{% elif "minor" in attrs.tags %}px-2.5 py-1.5 text-sm{% else %}px-4 py-2 text-sm{% endif %}
{% if "outline" in attrs.tags %}
border
{% if "danger" in attrs.tags %}border-red-600 text-red-600 hover:bg-red-50 focus:ring-red-500{% elif "secondary" in attrs.tags %}border-slate-500 text-slate-600 hover:bg-slate-100 focus:ring-slate-500{% elif "warning" in attrs.tags %}border-amber-500 text-amber-700 hover:bg-amber-50 focus:ring-amber-500{% else %}border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500{% endif %}
{% else %}
{% if "danger" in attrs.tags %}bg-red-600 text-white hover:bg-red-700 focus:ring-red-500{% elif "secondary" in attrs.tags %}bg-slate-600 text-white hover:bg-slate-700 focus:ring-slate-500{% elif "warning" in attrs.tags %}bg-amber-500 text-slate-900 hover:bg-amber-600 focus:ring-amber-500{% else %}bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500{% endif %}
{% endif %}
{% endif %}{% endblock %}">
{% if "tool" in attrs.tags %}
{% if "delete" in attrs.tags %}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="h-4 w-4" viewBox="0 0 16 16">
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"/>
<path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"/>
</svg>
{% elif "edit" in attrs.tags %}
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16"><path fill="currentColor" d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793L14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708zm.646 6.061L9.793 2.5L3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.5.5 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11z"/></svg>
{% endif %}
{% endif %}
{% if not "tool" in attrs.tags %}
{% slot %}
{% endslot %}
{% endif %}
</{% if attrs.href %}a{% else %}button{% endif %}>