Fix: Clean up map_iframe_single.html, remove debug overlay, ensure clean map rendering.

This commit is contained in:
ske087
2025-07-26 15:19:52 +03:00
parent 187254beca
commit 5ddde4bd9b
23 changed files with 1755 additions and 1658 deletions

25
run.py
View File

@@ -1,6 +1,6 @@
import os
from app import create_app, db
from app.models import User, Post, PostImage, GPXFile, Comment, Like, PageView
from app.models import User, Post, PostImage, GPXFile, Comment, Like, PageView, MapRoute
app = create_app()
@@ -14,7 +14,8 @@ def make_shell_context():
'GPXFile': GPXFile,
'Comment': Comment,
'Like': Like,
'PageView': PageView
'PageView': PageView,
'MapRoute': MapRoute
}
@app.cli.command()
@@ -121,6 +122,26 @@ def process_gpx_files():
db.session.commit()
print(f'Processed {processed}/{len(gpx_files)} GPX files')
@app.cli.command()
def set_cover_images():
"""Set cover images for posts that don't have them."""
posts = Post.query.all()
updated = 0
for post in posts:
# Check if post has a cover image
cover_image = post.images.filter_by(is_cover=True).first()
if not cover_image:
# Set the first image as cover if available
first_image = post.images.first()
if first_image:
first_image.is_cover = True
updated += 1
print(f'Set cover image for post: {post.title}')
db.session.commit()
print(f'Updated {updated} posts with cover images')
@app.cli.command()
def create_admin():
"""Create an admin user."""