mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-21 22:09:36 +02:00
Fix issues determined from testing series
This commit is contained in:
parent
c7207ccf52
commit
b32c780266
5 changed files with 28 additions and 17 deletions
|
@ -40,6 +40,8 @@ class AdventureSerializer(serializers.ModelSerializer):
|
||||||
for visit in obj.visits.all():
|
for visit in obj.visits.all():
|
||||||
if visit.start_date and visit.end_date and (visit.start_date <= current_date):
|
if visit.start_date and visit.end_date and (visit.start_date <= current_date):
|
||||||
return True
|
return True
|
||||||
|
elif visit.start_date and not visit.end_date and (visit.start_date <= current_date):
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,8 @@
|
||||||
let imageError: string = '';
|
let imageError: string = '';
|
||||||
let wikiImageError: string = '';
|
let wikiImageError: string = '';
|
||||||
|
|
||||||
|
let old_display_name: string = '';
|
||||||
|
|
||||||
images = adventure.images || [];
|
images = adventure.images || [];
|
||||||
|
|
||||||
if (longitude && latitude) {
|
if (longitude && latitude) {
|
||||||
|
@ -114,9 +116,10 @@
|
||||||
$: {
|
$: {
|
||||||
if (
|
if (
|
||||||
reverseGeocodePlace?.display_name &&
|
reverseGeocodePlace?.display_name &&
|
||||||
adventure.location != reverseGeocodePlace.display_name
|
(old_display_name != reverseGeocodePlace.display_name || !adventure.location)
|
||||||
) {
|
) {
|
||||||
adventure.location = reverseGeocodePlace.display_name;
|
adventure.location = reverseGeocodePlace.display_name;
|
||||||
|
old_display_name = reverseGeocodePlace.display_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -569,14 +572,25 @@
|
||||||
<!-- <div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3"> -->
|
<!-- <div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3"> -->
|
||||||
<div>
|
<div>
|
||||||
<label for="latitude">{$t('adventures.location')}</label><br />
|
<label for="latitude">{$t('adventures.location')}</label><br />
|
||||||
<input
|
<div class="flex items-center">
|
||||||
type="text"
|
<input
|
||||||
id="location"
|
type="text"
|
||||||
name="location"
|
id="location"
|
||||||
bind:value={adventure.location}
|
name="location"
|
||||||
class="input input-bordered w-full"
|
bind:value={adventure.location}
|
||||||
/>
|
class="input input-bordered w-full"
|
||||||
|
/>
|
||||||
|
{#if reverseGeocodePlace && reverseGeocodePlace.display_name && reverseGeocodePlace.display_name != adventure.location}
|
||||||
|
<button
|
||||||
|
class="btn btn-primary ml-2"
|
||||||
|
type="button"
|
||||||
|
on:click={() => (adventure.location = reverseGeocodePlace?.display_name)}
|
||||||
|
>{$t('adventures.set_to_pin')}</button
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form on:submit={geocode} class="mt-2">
|
<form on:submit={geocode} class="mt-2">
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -177,6 +177,7 @@
|
||||||
"adventure_create_error": "Failed to create adventure",
|
"adventure_create_error": "Failed to create adventure",
|
||||||
"adventure_updated": "Adventure updated",
|
"adventure_updated": "Adventure updated",
|
||||||
"adventure_update_error": "Failed to update adventure",
|
"adventure_update_error": "Failed to update adventure",
|
||||||
|
"set_to_pin": "Set to Pin",
|
||||||
"new_adventure": "New Adventure",
|
"new_adventure": "New Adventure",
|
||||||
"basic_information": "Basic Information",
|
"basic_information": "Basic Information",
|
||||||
"adventure_not_found": "There are no adventures to display. Add some using the plus button at the bottom right or try changing filters!",
|
"adventure_not_found": "There are no adventures to display. Add some using the plus button at the bottom right or try changing filters!",
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
|
|
||||||
let count = data.props.count || 0;
|
let count = data.props.count || 0;
|
||||||
|
|
||||||
$: {
|
|
||||||
if (count != adventures.length) {
|
|
||||||
count = adventures.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let totalPages = Math.ceil(count / resultsPerPage);
|
let totalPages = Math.ceil(count / resultsPerPage);
|
||||||
let currentPage: number = 1;
|
let currentPage: number = 1;
|
||||||
|
|
||||||
|
|
|
@ -120,9 +120,9 @@
|
||||||
{#if adventure.latitude && adventure.longitude}
|
{#if adventure.latitude && adventure.longitude}
|
||||||
<Marker
|
<Marker
|
||||||
lngLat={[adventure.longitude, adventure.latitude]}
|
lngLat={[adventure.longitude, adventure.latitude]}
|
||||||
class="grid h-8 w-8 place-items-center rounded-full border border-gray-200 bg-{adventure.is_visited
|
class="grid h-8 w-8 place-items-center rounded-full border border-gray-200 {adventure.is_visited
|
||||||
? 'red'
|
? 'bg-red-300'
|
||||||
: 'blue'}-300 text-black shadow-2xl focus:outline-2 focus:outline-black"
|
: 'bg-blue-300'} text-black shadow-2xl focus:outline-2 focus:outline-black"
|
||||||
on:click={togglePopup}
|
on:click={togglePopup}
|
||||||
>
|
>
|
||||||
<span class="text-xl">
|
<span class="text-xl">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue