mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +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.
|
||||
*/
|
||||
import store from './store';
|
||||
|
||||
/**
|
||||
* @typedef {object} Result
|
||||
|
@ -126,6 +127,8 @@ export class LocalAutocompleter {
|
|||
* @param {{[key: string]: Result}} results
|
||||
*/
|
||||
scanResults(getResult, compare, results) {
|
||||
const unfilter = store.get('unfilter_tag_suggestions');
|
||||
|
||||
let min = 0;
|
||||
let max = this.numTags;
|
||||
|
||||
|
@ -154,8 +157,8 @@ export class LocalAutocompleter {
|
|||
break;
|
||||
}
|
||||
|
||||
// Add if no associations are filtered
|
||||
if (hiddenTags.findIndex(ht => result.associations.includes(ht)) === -1) {
|
||||
// Add if not filtering or no associations are filtered
|
||||
if (unfilter || hiddenTags.findIndex(ht => result.associations.includes(ht)) === -1) {
|
||||
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_uploader", "hide_uploader")
|
||||
|> set_cookie(user_params, "hide_score", "hide_score")
|
||||
|> set_cookie(user_params, "unfilter_tag_suggestions", "unfilter_tag_suggestions")
|
||||
end
|
||||
|
||||
defp set_cookie(conn, params, param_name, cookie_name) do
|
||||
|
|
|
@ -154,6 +154,10 @@ h1 Content Settings
|
|||
=> label f, :hide_uploader
|
||||
=> checkbox f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true"
|
||||
.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
|
||||
=> label f, :hide_score
|
||||
=> checkbox f, :hide_score, checked: @conn.cookies["hide_score"] == "true"
|
||||
|
|
Loading…
Reference in a new issue