73 lines
2.6 KiB
HTML
73 lines
2.6 KiB
HTML
{% load static %}
|
|
{% load i18n %}
|
|
{% load admin_url %}
|
|
{% load mastodon %}
|
|
{% load oauth_token %}
|
|
{% load truncate %}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ site_name }} - {{ title }}</title>
|
|
<script src="https://static.neodb.social/cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
|
<link rel="stylesheet" href="{% static 'css/boofilsic.min.css' %}">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="page-wrapper">
|
|
<div id="content-wrapper">
|
|
{% include "partial/_navbar.html" %}
|
|
|
|
<section id="content" class="container">
|
|
<div class="grid">
|
|
<div class="single-section-wrapper" id="main">
|
|
<a href="{% url 'books:scrape' %}" class="single-section-wrapper__link single-section-wrapper__link--secondary">{% trans '>>> 试试一键剽取~ <<<' %}</a>
|
|
<form class="entity-form" action="{{ submit_url }}" method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ form.media }}
|
|
{{ form }}
|
|
<input class="button" type="submit" value="{% trans '提交' %}">
|
|
</form>
|
|
</div>
|
|
|
|
</section>
|
|
</div>
|
|
{% include "partial/_footer.html" %}
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// mark required
|
|
$("#content *[required]").each(function () {
|
|
$(this).prev().prepend("*");
|
|
});
|
|
|
|
// when source site is this site, hide url input box and populate it with fake url
|
|
// the backend would update this field
|
|
if ($("select[name='source_site']").val() == "{{ this_site_enum_value }}") {
|
|
$("input[name='source_url']").hide();
|
|
$("label[for='id_source_url']").hide();
|
|
$("input[name='source_url']").val("https://www.temp.com/" + Date.now() + Math.random());
|
|
}
|
|
$("select[name='source_site']").change(function () {
|
|
let value = $(this).val();
|
|
if (value == "{{ this_site_enum_value }}") {
|
|
$("input[name='source_url']").hide();
|
|
$("label[for='id_source_url']").hide();
|
|
$("input[name='source_url']").val("https://www.temp.com/" + Date.now() + Math.random());
|
|
} else {
|
|
$("input[name='source_url']").show();
|
|
$("label[for='id_source_url']").show();
|
|
$("input[name='source_url']").val("");
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
|
|
|
|
</html>
|