Add comprehensive edited media management with expandable cards UI
- Optimized delete modal for light/dark modes with modern gradients - Added edit_count tracking to media library with warnings in delete confirmation - Enhanced PlayerEdit model with CASCADE delete on foreign keys - Improved player management page to show latest 3 edited files with image previews - Created new edited_media route and template with full version history - Implemented horizontal expandable cards with two-column layout - Added interactive version selection with thumbnail grid - Included original file in versions list with source badge - Fixed deletion workflow to clean up PlayerEdit records and edited_media folders - Enhanced UI with smooth animations, hover effects, and dark mode support
This commit is contained in:
@@ -334,6 +334,37 @@ def manage_player(player_id: int):
|
||||
status_info=status_info)
|
||||
|
||||
|
||||
@players_bp.route('/<int:player_id>/edited-media')
|
||||
@login_required
|
||||
def edited_media(player_id: int):
|
||||
"""Display all edited media files from this player."""
|
||||
try:
|
||||
player = Player.query.get_or_404(player_id)
|
||||
|
||||
# Get all edited media history from player
|
||||
from app.models.player_edit import PlayerEdit
|
||||
edited_media = PlayerEdit.query.filter_by(player_id=player_id)\
|
||||
.order_by(PlayerEdit.created_at.desc())\
|
||||
.all()
|
||||
|
||||
# Get original content files for each edited media
|
||||
content_files = {}
|
||||
for edit in edited_media:
|
||||
if edit.content_id not in content_files:
|
||||
content = Content.query.get(edit.content_id)
|
||||
if content:
|
||||
content_files[edit.content_id] = content
|
||||
|
||||
return render_template('players/edited_media.html',
|
||||
player=player,
|
||||
edited_media=edited_media,
|
||||
content_files=content_files)
|
||||
except Exception as e:
|
||||
log_action('error', f'Error loading edited media for player {player_id}: {str(e)}')
|
||||
flash('Error loading edited media.', 'danger')
|
||||
return redirect(url_for('players.manage_player', player_id=player_id))
|
||||
|
||||
|
||||
@players_bp.route('/<int:player_id>/fullscreen')
|
||||
def player_fullscreen(player_id: int):
|
||||
"""Display player fullscreen view (no authentication required for players)."""
|
||||
|
||||
Reference in New Issue
Block a user