You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixiv/PixivSearch/templates/index.html

107 lines
4.1 KiB

6 years ago
<html xmlns="http://www.w3.org/1999/html">
<head>
<style>
div {
text-align: center;
}
ol {
list-style-type: demical;
}
ol li {
list-style-position: outside;
}
</style>
{% load staticfiles %}
<script src="{% static "js/jquery-3.2.1.min.js" %}"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script>
function check() {
$("[name=pageSize],[name=order]").each(function () {
if ($(this).val() != '' && $(this).val() <= 0) {
$(this).val('');
alert($(this).parent().text() + '不能小于等于0');
$(this).focus();
}
});
}
</script>
</head>
<body>
<form action="/pixiv/search" method="post" onsubmit="check()">
{% csrf_token %}
<div class="form-inline">
<div class="form-group">
<label for="word">关键字</label>
<input type="text" class="form-control" id="word" name="word" value="{{ word }}" placeholder="R-18">
</div>
<div class="form-group">
<label for="word">页数</label>
<input type="number" class="form-control" id="pageSize" name="pageSize" value="{{ pageSize }}" placeholder="10">
</div>
<div class="form-group">
<label for="word">统计数</label>
<input type="number" class="form-control" id="order" name="order" value="{{ order }}" placeholder="10">
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="customRadio1" name="type" value="text" class="custom-control-input" {% if type == 'text' or type is None %}checked{% endif %}>
<label class="custom-control-label" for="customRadio1">不显示大图</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="customRadio2" name="type" value="img" class="custom-control-input" {% ifequal type 'img' %}checked{% endifequal %}>
<label class="custom-control-label" for="customRadio2">显示大图</label>
</div>
</div>
<div class="form-inline">
<button class="btn btn-primary offset-md-3" id="button" type="submit">查询</button>
{% if download %}
<a href="{% static "/download/" %}{{ download }}">图包提取(文件大小:{{ size }})</a>
{% endif %}
</div>
</form>
<div>
<h1>{{ msg }}</h1>
</div>
<ol>
{% for imageNode in imageNodes %}
<li>
<div>
<h1>标题:<a href="https://www.pixiv.net/member_illust.php?mode=medium&illust_id={{ imageNode.illustId }}"
target="_blank">{{ imageNode.illustTitle }}</a>,画师:<a
href="https://www.pixiv.net/member.php?id={{ imageNode.userId }}">{{ imageNode.userName }}</a>,收藏数:{{ imageNode.bookmarkCount }}
</h1>
{% if imageNode.localName %}
<img src="{% static "images/" %}{{ imageNode.localName }}">
{% endif %}
</div>
</li>
{% empty %}
<p>{{ tip }}</p>
{% endfor %}
</ol>
</body>
</html>