mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 09:19:59 +00:00
minor changes
This commit is contained in:
parent
df288bfadd
commit
57a71be7b8
|
@ -35,7 +35,7 @@
|
|||
{% endif %}
|
||||
<div class="markdown-editor" id="{{ field_name }}-markdown-editor" data-field-name="{{ field_name }}">
|
||||
{{ field.label(class='control-label') }}
|
||||
<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" class="small">Markdown supported</a>
|
||||
<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" class="small" target="_blank">Markdown supported</a>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#{{ field_name }}-tab" role="tab" data-toggle="tab">
|
||||
|
|
|
@ -9,19 +9,19 @@
|
|||
{% from "_formhelpers.html" import render_markdown_editor %}
|
||||
|
||||
<h1>Upload Torrent</h1>
|
||||
|
||||
{% if not g.user %}
|
||||
<p>You are not logged in, and are uploading anonymously.</p>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div id="upload-drop-zone"><span>Drop here!</span></div>
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{{ upload_form.csrf_token }}
|
||||
|
||||
{% if config.ENFORCE_MAIN_ANNOUNCE_URL %}<p><strong>Important:</strong> Please include <kbd>{{ config.MAIN_ANNOUNCE_URL }}</kbd> in your trackers</p>{% endif %}
|
||||
{% if config.ENFORCE_MAIN_ANNOUNCE_URL %}<p><strong>Important:</strong> Please include <kbd>{{ config.MAIN_ANNOUNCE_URL }}</kbd> in your trackers.</p>{% endif %}
|
||||
<p><strong>Important:</strong> Make sure you have read <strong><a href="{{ url_for('site.rules') }}">the rules</a></strong> before uploading!</p>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="col-md-12">
|
||||
{{ render_upload(upload_form.torrent_file, accept=".torrent") }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,11 +29,10 @@
|
|||
<div class="col-md-6">
|
||||
{{ render_field(upload_form.display_name, class_='form-control', placeholder='Display name') }}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
{{ render_field(upload_form.category, class_='form-control')}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"></div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-6">
|
||||
{{ render_field(upload_form.information, class_='form-control', placeholder='Your website or IRC channel') }}
|
||||
|
@ -58,7 +57,6 @@
|
|||
</div>
|
||||
<div class="hidden-xl hidden-lg"><br></div>
|
||||
<div class="btn-group" data-toggle="buttons">
|
||||
|
||||
<label class="btn btn-danger" title="This torrent is derived from another release">
|
||||
{{ upload_form.is_remake }}
|
||||
<span class="glyphicon glyphicon-check"></span>
|
||||
|
@ -100,7 +98,6 @@
|
|||
{% endif %}
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<input type="submit" value="Upload" class="btn btn-primary">
|
||||
|
|
|
@ -7,6 +7,7 @@ import flask
|
|||
from flask_paginate import Pagination
|
||||
|
||||
from nyaa import models
|
||||
from nyaa.extensions import db
|
||||
from nyaa.search import (DEFAULT_MAX_SEARCH_RESULT, DEFAULT_PER_PAGE, SERACH_PAGINATE_DISPLAY_MSG,
|
||||
_generate_query_string, search_db, search_elastic)
|
||||
from nyaa.utils import chain_get
|
||||
|
@ -40,6 +41,12 @@ def before_request():
|
|||
flask.session.permanent = True
|
||||
flask.session.modified = True
|
||||
|
||||
ip = ip_address(flask.request.remote_addr)
|
||||
if user.last_login_ip != ip:
|
||||
user.last_login_ip = ip.packed
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
||||
# Check if user is banned on POST
|
||||
if flask.request.method == 'POST':
|
||||
ip = ip_address(flask.request.remote_addr).packed
|
||||
|
|
|
@ -99,7 +99,8 @@ def edit_torrent(torrent_id):
|
|||
flask.abort(403)
|
||||
|
||||
torrent_user_level = torrent.user and torrent.user.level
|
||||
if editor and editor.is_moderator and (torrent_user_level is None or editor.level > torrent_user_level):
|
||||
if editor and editor.is_moderator and \
|
||||
(torrent_user_level is None or editor.level > torrent_user_level):
|
||||
ban_form = forms.BanForm()
|
||||
|
||||
if flask.request.method == 'POST' and form.submit.data and form.validate():
|
||||
|
|
Loading…
Reference in a new issue