40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
|
{% extends 'layouts/base.njk' %}
|
||
|
|
||
|
{% set title = app.name + ' - URL shortener' %}
|
||
|
|
||
|
{% block scripts %}
|
||
|
<script src="/js/url-shortener.js"></script>
|
||
|
{% endblock %}
|
||
|
|
||
|
{% block body %}
|
||
|
<h1>Shorten URLs</h1>
|
||
|
<p>(no phishing allowed)</p>
|
||
|
|
||
|
<div class="container">
|
||
|
<section class="panel">
|
||
|
<h2>Shorten a URL</h2>
|
||
|
|
||
|
<form action="{{ route('shorten-url') }}" method="POST" id="url-shortener-form">
|
||
|
{{ macros.field(_locals, 'text', 'target_url', '', 'Target URL', 'Only valid URLs starting with http:// or https://', validation_attributes='required') }}
|
||
|
|
||
|
{{ macros.field(_locals, 'text', 'slug', '', 'Custom url slug', 'Example: bear sets url to https://ily.li/bear', validation_attributes='disabled') }}
|
||
|
{{ macros.field(_locals, 'checkbox', 'autogen_url', '', 'Generate url automatically', null, validation_attributes='checked') }}
|
||
|
|
||
|
{{ macros.csrf(getCSRFToken) }}
|
||
|
|
||
|
<button type="submit"><i data-feather="link"></i> Shorten URL</button>
|
||
|
</form>
|
||
|
|
||
|
{% set url = flash('url') %}
|
||
|
{% if url | length %}
|
||
|
<div class="copyable-text">
|
||
|
<div class="title">URL</div>
|
||
|
<div class="content">{{ url }}</div>
|
||
|
<button class="copy-button"><i data-feather="copy"></i></button>
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
</section>
|
||
|
</div>
|
||
|
|
||
|
{% include 'desktop-utility.njk' %}
|
||
|
{% endblock %}
|