Fix tag parsing and theme all radio buttons

This commit is contained in:
Mark Veidemanis 2022-08-03 07:20:30 +01:00
parent 52ce55b2e9
commit d858f79f7e
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 22 additions and 15 deletions

View File

@ -223,12 +223,7 @@ def query_results(request, size=None):
message_class = "danger"
return {"message": message, "class": message_class}
sentiment_method = request.POST["sentiment-method"]
range_query_compare = {
"range": {
"sentiment": {
}
}
}
range_query_compare = {"range": {"sentiment": {}}}
range_query_precise = {
"match": {
"sentiment": None,

View File

@ -173,21 +173,29 @@
</p>
</div>
<div class="control">
<label class="radio">
<label class="radio button has-text-link">
<input type="radio" value="below" name="sentiment-method">
Below
<span class="icon" data-tooltip="Below">
<i class="fa-solid fa-face-frown"></i>
</span>
</label>
<label class="radio">
<label class="radio button has-text-link is-hidden">
<input type="radio" value="exact" name="sentiment-method">
Exact
<span class="icon" data-tooltip="Exact">
<i class="fa-solid fa-face-smile"></i>
</span>
</label>
<label class="radio">
<label class="radio button has-text-link">
<input type="radio" value="above" name="sentiment-method">
Above
<span class="icon" data-tooltip="Above">
<i class="fa-solid fa-face-smile"></i>
</span>
</label>
<label class="radio">
<label class="radio button has-text-link">
<input type="radio" value="nonzero" name="sentiment-method">
Nonzero
<span class="icon" data-tooltip="Nonzero">
<i class="fa-solid fa-face-meh-blank"></i>
</span>
</label>
</div>
</div>
@ -257,7 +265,11 @@
var inputTags = document.getElementById('tags');
new BulmaTagsInput(inputTags);
inputTags.BulmaTagsInput().on('before.add', function(item) {
if (item.includes(": ")) {
var spl = item.split(": ");
} else {
var spl = item.split(":");
}
var field = spl[0];
try {
var value = JSON.parse(spl[1]);