mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-17 11:04:22 +01:00
Allow disabling of tag suggestion filtering
This commit is contained in:
parent
a9fb361591
commit
ce5405c670
3 changed files with 10 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
/*
|
/*
|
||||||
* Client-side tag completion.
|
* Client-side tag completion.
|
||||||
*/
|
*/
|
||||||
|
import store from './store';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} Result
|
* @typedef {object} Result
|
||||||
|
@ -126,6 +127,8 @@ export class LocalAutocompleter {
|
||||||
* @param {{[key: string]: Result}} results
|
* @param {{[key: string]: Result}} results
|
||||||
*/
|
*/
|
||||||
scanResults(getResult, compare, results) {
|
scanResults(getResult, compare, results) {
|
||||||
|
const unfilter = store.get('unfilter_tag_suggestions');
|
||||||
|
|
||||||
let min = 0;
|
let min = 0;
|
||||||
let max = this.numTags;
|
let max = this.numTags;
|
||||||
|
|
||||||
|
@ -154,8 +157,8 @@ export class LocalAutocompleter {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add if no associations are filtered
|
// Add if not filtering or no associations are filtered
|
||||||
if (hiddenTags.findIndex(ht => result.associations.includes(ht)) === -1) {
|
if (unfilter || hiddenTags.findIndex(ht => result.associations.includes(ht)) === -1) {
|
||||||
results[result.name] = result;
|
results[result.name] = result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ defmodule PhilomenaWeb.SettingController do
|
||||||
|> set_cookie(user_params, "hide_staff_tools", "hide_staff_tools")
|
|> set_cookie(user_params, "hide_staff_tools", "hide_staff_tools")
|
||||||
|> set_cookie(user_params, "hide_uploader", "hide_uploader")
|
|> set_cookie(user_params, "hide_uploader", "hide_uploader")
|
||||||
|> set_cookie(user_params, "hide_score", "hide_score")
|
|> set_cookie(user_params, "hide_score", "hide_score")
|
||||||
|
|> set_cookie(user_params, "unfilter_tag_suggestions", "unfilter_tag_suggestions")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp set_cookie(conn, params, param_name, cookie_name) do
|
defp set_cookie(conn, params, param_name, cookie_name) do
|
||||||
|
|
|
@ -154,6 +154,10 @@ h1 Content Settings
|
||||||
=> label f, :hide_uploader
|
=> label f, :hide_uploader
|
||||||
=> checkbox f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true"
|
=> checkbox f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true"
|
||||||
.fieldlabel: i Hide the uploader and date posted information on image pages.
|
.fieldlabel: i Hide the uploader and date posted information on image pages.
|
||||||
|
.field
|
||||||
|
=> label f, :unfilter_tag_suggestions
|
||||||
|
=> checkbox f, :unfilter_tag_suggestions, checked: @conn.cookies["unfilter_tag_suggestions"] == "true"
|
||||||
|
.fieldlabel: i Don't attempt to filter tag suggestions using your current filter.
|
||||||
.field
|
.field
|
||||||
=> label f, :hide_score
|
=> label f, :hide_score
|
||||||
=> checkbox f, :hide_score, checked: @conn.cookies["hide_score"] == "true"
|
=> checkbox f, :hide_score, checked: @conn.cookies["hide_score"] == "true"
|
||||||
|
|
Loading…
Reference in a new issue