Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

active search from 3 january#90

Open
WebsterQR wants to merge 4 commits intoidlesign:masteridlesign/pythonz:masterfrom
WebsterQR:active_searchWebsterQR/pythonz:active_searchCopy head branch name to clipboard
Open

active search from 3 january#90
WebsterQR wants to merge 4 commits intoidlesign:masteridlesign/pythonz:masterfrom
WebsterQR:active_searchWebsterQR/pythonz:active_searchCopy head branch name to clipboard

Conversation

@WebsterQR
Copy link

No description provided.

Copy link
Owner

@idlesign idlesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Маковские директории .DS_Store нужно будет убрать из этого запроса на слияние. Они не требуются.

<input class="form-control" autofocus type="search" aria-label="Search" name="text" placeholder="Поиск по справочнику" value="{{ search_term }}" required itemprop="query-input">
<label for="tags">
<input
id='tags'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tags здесь точно ни при чем, лучше search.

hx-indicator=".htmx-indicator">
</label>
</div>
<div id="active_search_results" class="mr-2" style="position: absolute;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Стили лучше не зашивать в элементы, а прописать в css-файл. Раз у нас уже используется css-каркас Bootstrap, то можно использовать инструменты оттуда — это чаще проще и красивее, чем изобретение своих. В частности сейчас элемент с результатами выглядит малопривлекательно.

pythonz/apps/templates/static/active_search_results.html Outdated Show resolved Hide resolved
pythonz/apps/views/search.py Outdated Show resolved Hide resolved
pythonz/apps/templates/static/active_search_results.html Outdated Show resolved Hide resolved
def get_results(request):
search_term, results = search_models(
request.POST.get('text', ''), search_in=(
Category,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если будет много результатов, то это будет выглядеть так себе.
Тут нужно ограничить их максимальное число.
Ещё, может быть, поможет, если мы здесь исключим некоторые разделы, например, Персоны.

pythonz/urls.py Outdated Show resolved Hide resolved
@idlesign idlesign added интерф. польз. Пользовательский интерфейс сервер Код для сервера (python) улучшение labels Jan 10, 2022
<input class="form-control" autofocus type="search" aria-label="Search" name="text" placeholder="Поиск по справочнику" value="{{ search_term }}" required itemprop="query-input">
<label for="tags">
<input
id='tags'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В атрибутах используй везде двойные кавычки, чтобы не было разнобоя.

Reference,
App,
))
if len(results) > 5:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сначала выбрать из БД все результаты, а потом их усечь — не очень удачное идея. Лучше вовсе не выбирать из БД лишнее.


from .apps.realms import bootstrap_realms
from .apps.views import page_not_found, permission_denied, server_error, index, search, login, telebot, user_settings
from .apps.views.search import suggest
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот импорт не используется и здесь не нужен.

@@ -0,0 +1,5 @@
{% for item in results %}
<div>
<a href="{{ item.get_absolute_url }}">{{ item.title }}</a>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Название может быть на столько длинное, что раздвинет блок с вариантами за края страницы.

<form class="form-inline" action="/search/" method="post" itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
{% csrf_token %}
<div role="search" class="mr-2">
<div id="search" role="search" class="mr-2">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А для чего тут id? Он где-то используется?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

интерф. польз. Пользовательский интерфейс сервер Код для сервера (python) улучшение

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.