ily.li/views/url-shrinker.njk

41 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-07-06 10:49:18 +02:00
{% extends 'layouts/base.njk' %}
{% set title = app.name + ' - URL shrinker' %}
2020-07-06 10:49:18 +02:00
{% block scripts %}
<script src="/js/url-shrinker.js"></script>
2020-07-06 10:49:18 +02:00
{% endblock %}
{% block body %}
<h1>Shrink URLs</h1>
2020-07-06 10:49:18 +02:00
<p>(no phishing allowed)</p>
<div class="container">
<section class="panel">
<h2>Shrink a URL</h2>
2020-07-06 10:49:18 +02:00
<form action="{{ route('shrink-url') }}" method="POST" id="url-shrink-form">
2020-07-06 10:49:18 +02:00
{{ 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://'+default_domain+'/bear', validation_attributes='disabled') }}
2020-07-06 10:49:18 +02:00
{{ macros.field(_locals, 'checkbox', 'autogen_url', '', 'Generate url automatically', null, validation_attributes='checked') }}
2020-11-22 15:19:58 +01:00
{{ macros.csrf(getCsrfToken) }}
2020-07-06 10:49:18 +02:00
<button type="submit"><i data-feather="link"></i> Shrink URL</button>
2020-07-06 10:49:18 +02:00
</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' %}
2020-11-22 15:19:58 +01:00
{% endblock %}