94 lines
3.9 KiB
HTML
94 lines
3.9 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>{% trans 'Nicedb - 主页' %}</title>
|
|
<script src="https://cdn.staticfile.org/jquery/3.5.0/jquery.min.js"></script>
|
|
<script src="{% static 'js/scrape.js' %}"></script>
|
|
<link rel="stylesheet" href="{% static 'css/boofilsic_browse.css' %}">
|
|
<link rel="stylesheet" href="{% static 'lib/css/milligram.css' %}">
|
|
</head>
|
|
|
|
<body>
|
|
<style>
|
|
#scrapeForm label{
|
|
font-size: small !important;
|
|
}
|
|
</style>
|
|
<div id="page-wrapper">
|
|
<div id="content-wrapper">
|
|
<section id="navbar" class="navbar">
|
|
<div class="container">
|
|
<nav class="clearfix">
|
|
<a href="{% url 'common:home' %}">
|
|
<img src="{% static 'img/logo.svg' %}" alt="" class="logo">
|
|
</a>
|
|
<input type="search" class="search-box" name="keywords"
|
|
value="{% if request.GET.keywords %}{{ request.GET.keywords }}{% endif %}" id="searchInput" required="true" placeholder="{% trans '搜索书影音,多个关键字以空格分割' %}">
|
|
<a class="nav-link" id="logoutLink" href="{% url 'users:logout' %}">{% trans '登出' %}</a>
|
|
<a class="nav-link" href="{% url 'common:home' %}">{% trans '主页' %}</a>
|
|
{% if request.user.is_staff %}
|
|
<a class="nav-link" href="{% admin_url %}">{% trans '后台' %}</a>
|
|
{% endif %}
|
|
</nav>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="content" class="container">
|
|
<div class="row">
|
|
<div id="main">
|
|
|
|
<iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="https://search.douban.com/book/subject_search{% if keywords %}?search_text={{ keywords }}{% endif %}" frameborder="0"></iframe>
|
|
<div class="dividing-line"></div>
|
|
<div id="scrapeForm">
|
|
<form action="{% url 'books:create' %}" method="POST" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ form }}
|
|
</form>
|
|
<a href="{% url 'books:scrape' %}" id="submit" class="button add-button">{% trans '剽取!' %}</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="aside">
|
|
<div class="aside-card">
|
|
<div class="add-nav">
|
|
|
|
<div>
|
|
|
|
{% trans '根据豆瓣内容填写下方表格!' %}
|
|
</div>
|
|
<a href="{% url 'books:scrape' %}" id="submit" class="button add-button">{% trans '剽取!' %}</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</section>
|
|
|
|
</div>
|
|
<footer class="container">
|
|
<a href="https://donotban.com/@whitiewhite">去长毛象向作者提意见</a>
|
|
<a href="https://github.com/doubaniux/boofilsic" id="githubLink">Github</a>
|
|
</footer>
|
|
|
|
</div>
|
|
<script>
|
|
$("#searchInput").on('keyup', function (e) {
|
|
if (e.keyCode === 13) {
|
|
let keywords = $(this).val();
|
|
if (keywords)
|
|
location.href = "{% url 'common:search' %}" + "?keywords=" + keywords;
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
|
|
</html>
|