Hotfixes trail visibility
This commit is contained in:
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
let tagItems: ComboboxItem[] = $state([]);
|
let tagItems: ComboboxItem[] = $state([]);
|
||||||
|
|
||||||
async function update() {
|
async function update() {
|
||||||
onupdate?.(filter);
|
onupdate?.(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,6 +231,23 @@
|
|||||||
clearAfterSelect={false}
|
clearAfterSelect={false}
|
||||||
label={$_("author")}
|
label={$_("author")}
|
||||||
></ActorSearch>
|
></ActorSearch>
|
||||||
|
<hr class="my-4 border-separator" />
|
||||||
|
|
||||||
|
<p class="text-sm font-medium">{$_("visibilty-status")}</p>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2 mb-4">
|
||||||
|
<input
|
||||||
|
id="private-checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
checked={filter.private}
|
||||||
|
class="w-4 h-4 bg-input-background accent-primary border-input-border focus:ring-input-ring focus:ring-2"
|
||||||
|
onchange={setPrivateFilter}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<label for="private-checkbox" class="ms-2 text-sm"
|
||||||
|
>{$_("private")}</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
<div class="flex items-center my-4">
|
<div class="flex items-center my-4">
|
||||||
<input
|
<input
|
||||||
id="public-checkbox"
|
id="public-checkbox"
|
||||||
|
|||||||
@@ -347,7 +347,7 @@
|
|||||||
"use-roads": "Use Roads",
|
"use-roads": "Use Roads",
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
"view": "View",
|
"view": "View",
|
||||||
"visibilty-status": "",
|
"visibilty-status": "Visibility status",
|
||||||
"walking-speed": "",
|
"walking-speed": "",
|
||||||
"waypoints": "{n, plural, =1 {Waypoint} other {Waypoints}}",
|
"waypoints": "{n, plural, =1 {Waypoint} other {Waypoints}}",
|
||||||
"welcome_to": "Welcome to",
|
"welcome_to": "Welcome to",
|
||||||
|
|||||||
@@ -533,21 +533,21 @@ function buildFilterText(user: AuthRecord, filter: TrailFilter, includeGeo: bool
|
|||||||
|
|
||||||
if (showPublic === true) {
|
if (showPublic === true) {
|
||||||
filterText += "(public = TRUE";
|
filterText += "(public = TRUE";
|
||||||
if (showPrivate === true && (!filter.author?.length || filter.author == user?.id)) {
|
if (showPrivate === true && (!filter.author?.length || filter.author == user?.actor)) {
|
||||||
filterText += ` OR author = ${user?.id}`;
|
filterText += ` OR author = ${user?.actor}`;
|
||||||
}
|
}
|
||||||
filterText += ")";
|
filterText += ")";
|
||||||
}
|
}
|
||||||
else if (!filter.author?.length || filter.author == user?.id) {
|
else if (!filter.author?.length || filter.author == user?.actor) {
|
||||||
filterText += "public = FALSE";
|
filterText += "public = FALSE";
|
||||||
filterText += ` AND author = ${user?.id}`;
|
filterText += ` AND author = ${user?.actor}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter.shared !== undefined) {
|
if (filter.shared !== undefined) {
|
||||||
if (filter.shared === true) {
|
if (filter.shared === true) {
|
||||||
filterText += ` OR shares = ${user?.id}`
|
filterText += ` OR shares = ${user?.actor}`
|
||||||
} else {
|
} else {
|
||||||
filterText += ` AND NOT shares = ${user?.id}`
|
filterText += ` AND NOT shares = ${user?.actor}`
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user