~cofob/AlfisViewer

44421c3eeb2f53b887e87d98dde6095fa2fe2226 — Vasiliy Petrov 2 years ago d4ad460
Add random domain in search
2 files changed, 21 insertions(+), 1 deletions(-)

M search/views.py
M templates/search.html
M search/views.py => search/views.py +20 -0
@@ 3,6 3,7 @@ from domain.models import Domain
from alfis_connector import Blocks
from binascii import unhexlify
from domain.utils import get_domain_hash
from random import choice


def index(request):


@@ 46,5 47,24 @@ def index(request):
            "domain_fullmatch": domain_fullmatch,
            "key": key,
            "query": query,
            "random": choice(
                [
                    "cofob.ygg",
                    "index.ygg",
                    "git.srv",
                    "cr.srv",
                    "site.srv",
                    "rutracker.ygg",
                    "linux.ygg",
                    "gosuslugi.ygg",
                    "yandex.ygg",
                    "ru.ygg",
                    "home.ygg",
                    "lewd.ygg",
                    "naturism.ygg",
                    "forum.ygg",
                    "meduza.ygg",
                ]
            ),
        },
    )

M templates/search.html => templates/search.html +1 -1
@@ 1,5 1,5 @@
{% load i18n %}
<form action="{% url 'search' %}" method="get">
    <input class="input" style="height: 25px; width: 200px; margin-right: 5px;" name="query" type="text" required placeholder="{% trans "Example" %}: cofob.ygg" value="{{ query }}">
    <input class="input" style="height: 25px; width: 200px; margin-right: 5px;" name="query" type="text" required placeholder="{% trans "Example" %}: {{ random }}" value="{{ query }}">
    <button type="submit" style="height: 25px;" class="button">{% trans "Search" %}</button>
</form>
\ No newline at end of file