Skip to content

Commit

Permalink
form class="core"
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Sep 4, 2024
1 parent e391e7b commit 66bcb88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datasette_search_all/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block description_source_license %}
{% if searchable_tables %}
<form action="{{ urls.path("/-/search") }}" method="get">
<form class="core" action="{{ urls.path("/-/search") }}" method="get">
<p>
<input type="search" name="q" value="{{ q }}" placeholder="Search for records across {{ searchable_tables|length }} table{% if searchable_tables|length > 1 %}s{% endif %}" id="search-all-q">
<input type="submit" value="Search">
Expand Down
2 changes: 1 addition & 1 deletion datasette_search_all/templates/search_all.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Search all tables</h1>
{% if not searchable_tables %}
<p>There are no tables that have been configured for search.</p>
{% else %}
<form action="{{ urls.path("/-/search") }}" method="get">
<form class="core" action="{{ urls.path("/-/search") }}" method="get">
<p>
<input type="search" name="q" value="{{ q }}" id="search-all-q">
<input type="submit" value="Search">
Expand Down
6 changes: 3 additions & 3 deletions tests/test_search_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async def test_no_form_on_index_if_not_searchable(db_path):
datasette = Datasette([db_path])
response = await datasette.client.get("/")
assert response.status_code == 200
assert '<form action="/-/search" method="get">' not in response.text
assert '<form class="core" action="/-/search" method="get">' not in response.text


@pytest.mark.asyncio
Expand All @@ -27,7 +27,7 @@ async def test_shows_form_on_index_if_searchable(db_path):
datasette = Datasette([db_path])
response = await datasette.client.get("/")
assert response.status_code == 200
assert '<form action="/-/search" method="get">' in response.text
assert '<form class="core" action="/-/search" method="get">' in response.text


@pytest.mark.asyncio
Expand All @@ -47,7 +47,7 @@ async def test_search_page(db_path):
response = await datasette.client.get("/-/search?q=dog")
assert response.status_code == 200
content = response.text
assert '<form action="/-/search" method="get">' in content
assert '<form class="core" action="/-/search" method="get">' in content
assert "<title>Search: dog</title>" in content
assert (
'<li data-searchable-url="/data/creatures">'
Expand Down

1 comment on commit 66bcb88

@simonw
Copy link
Owner Author

@simonw simonw commented on 66bcb88 Sep 4, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.