<div class="row">
	<div class="col-12">
		<h1 class="h4 mb-3">{{ title }}</h1>
		<form action="{{ admin_dir }}/settings/shortlink/" method="post" class="needs-validation" autocomplete="off" novalidate>
			<div class="row">
				<div class="col">
					<div class="form-group">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" name="opt[disable_shortener_link]" id="disable_shortener_link" value="true" {{ disable_shortener_link ? 'checked' : '' }}>
							<label class="custom-control-label" for="disable_shortener_link">Disable Shortener Link</label>
						</div>
					</div>
					<div class="row">
						<div class="form-group col-12 col-md-6">
							<label for="main_url_shortener">Main URL Shortener (bitly.com)</label>
							<input type="text" name="opt[main_url_shortener]" id="main_url_shortener" class="form-control" placeholder="Enter the access token from bitly.com" value="{{ main_url_shortener }}">
							<small class="form-text text-muted">
								You can find out how to get a bitly.com access token from the following link
								<a rel="noopener" href="https://support.bitly.com/hc/en-us/articles/230647907-How-do-I-find-my-OAuth-access-token-" target="_blank">https://support.bitly.com/hc/en-us/articles/230647907-How-do-I-find-my-OAuth-access-token-</a>
							</small>
						</div>
						<div class="form-group col-12 col-md-6">
							<label for="additional_url_shortener">Select Additional URL Shortener</label>
                            <select name="opt[additional_url_shortener]" id="additional_url_shortener" class="form-control">
                                {% for key, val in shortener_website %}
                                    <option value="{{ key }}" {{ additional_url_shortener == key ? 'selected' : '' }}>{{ val }}</option>
                                {% endfor %}
                            </select>
							<small class="form-text text-muted">Additional URL shorteners are used to earn money online and will be used on the download page.</small>
						</div>
					</div>
					<div class="row">
                        {% for key, val in shortener_website %}
                            {% if key != 'random' %}
                                {% set name = 'additional_url_shortener_' ~ key %}
                                <div class="form-group col-12 col-md-6">
                                    <label for="{{ key }}">
                                        <a rel="noopener" href="http://{{ key }}" target="_blank">{{ val }}</a>
                                        API Key
                                    </label>
                                    <input type="text" name="opt[{{ name }}]" id="{{ name }}" class="form-control" placeholder="Enter {{ key }} API Key" value="{{ attribute(_context, name) }}">
                                </div>
                            {% endif %}
                        {% endfor %}
                    </div>
				</div>
			</div>
			<div class="row">
				<div class="col">
					<button type="submit" class="btn btn-success">
						<em class="fas fa-save mr-2"></em>Update
					</button>
				</div>
			</div>
		</form>
	</div>
</div>
