Skip to content

Commit

Permalink
Tweak toggle label design
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jan 22, 2024
1 parent 57e2f25 commit 4c3413b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 30 deletions.
10 changes: 0 additions & 10 deletions ckanext/embeddings/assets/script.js

This file was deleted.

10 changes: 6 additions & 4 deletions ckanext/embeddings/assets/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
body {
border-radius: 0;
.semantic-search-label {
font-size: 16px;
}

.semantic-search-label:after {
content: '';
}
*/
19 changes: 5 additions & 14 deletions ckanext/embeddings/assets/webassets.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# embedding-js:
# filter: rjsmin
# output: ckanext-embedding/%(version)s-embedding.js
# contents:
# - js/embedding.js
# extra:
# preload:
# - base/main

# embedding-css:
# filter: cssrewrite
# output: ckanext-embedding/%(version)s-embedding.css
# contents:
# - css/embedding.css
css:
filter: cssrewrite
output: ckanext-embeddings/%(version)s-embeddings.css
contents:
- style.css
1 change: 1 addition & 0 deletions ckanext/embeddings/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def update_config(self, config):
self.backend = get_embeddings_backend()

toolkit.add_template_directory(config, "templates")
toolkit.add_resource("assets", "ckanext-embeddings")

# IClick

Expand Down
6 changes: 4 additions & 2 deletions ckanext/embeddings/templates/snippets/search_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

{% block search_title %}
{{ super() }}

{% asset "ckanext-embeddings/css" %}
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" value="" id="ext_vector_search" name="ext_vector_search"
{% if h.get_request_param("ext_vector_search") == "true" %}checked{% endif %}
onclick="document.getElementById('ext_vector_search').value = (document.getElementById('ext_vector_search').checked === true)">
<label class="form-check-label" for="ext_vector_search">
Vector search
<label class="form-check-label semantic-search-label" for="ext_vector_search">
Semantic search
</label>
</div>
{% endblock %}

0 comments on commit 4c3413b

Please sign in to comment.