diff --git a/public/css/players.css b/public/css/players.css index 145c32e..7a512f7 100644 --- a/public/css/players.css +++ b/public/css/players.css @@ -12,37 +12,6 @@ background: #059669; } -/* ── Progress ─────────────────────────────────── */ - -.progress-container { - width: 100%; - background: var(--surface-3); - border-radius: var(--radius-xl); - padding: 3px; - margin: 20px 0; - overflow: hidden; -} - -.progress-bar { - width: 0%; - height: 26px; - background: linear-gradient(135deg, var(--accent), var(--accent-hover)); - border-radius: var(--radius-xl); - text-align: center; - line-height: 26px; - color: white; - font-weight: 600; - font-size: 12px; - transition: width 0.4s ease; -} - -.progress-text { - text-align: center; - margin: 8px 0; - font-size: 13px; - color: var(--text-secondary); -} - /* ── Mobile helpers ───────────────────────────── */ .mobile-only { diff --git a/public/css/shared.css b/public/css/shared.css index 98c4fdf..cfc1e12 100644 --- a/public/css/shared.css +++ b/public/css/shared.css @@ -306,15 +306,6 @@ body { margin: 0 0 24px 0; } -/* ── Loading ──────────────────────────────────── */ - -.loading { - text-align: center; - padding: 40px 20px; - font-size: 15px; - color: var(--text-secondary); -} - /* ── Tables ───────────────────────────────────── */ table { diff --git a/src/routes/players.js b/src/routes/players.js index 59abd72..fddfc0c 100644 --- a/src/routes/players.js +++ b/src/routes/players.js @@ -106,75 +106,6 @@ router.get('/api/ratings/progress', (req, res) => { }); }); -router.post('/api/populate-database', (req, res) => { - res.writeHead(200, { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache', - 'Connection': 'keep-alive', - 'Access-Control-Allow-Origin': '*', - }); - - const progressCallback = (progress) => { - res.write(`data: ${JSON.stringify(progress)}\n\n`); - }; - - logger.info('=== Starting database population from database players ==='); - - refreshAllPlayersInDB(progressCallback).then(ratings => { - logger.info(`=== Database population complete: ${ratings.length} players refreshed ===`); - res.write(`data: ${JSON.stringify({ status: 'complete', ratings, message: `Successfully refreshed ${ratings.length} players` })}\n\n`); - res.end(); - }).catch(error => { - logger.error('Error populating database:', error); - res.write(`data: ${JSON.stringify({ status: 'error', message: error.message })}\n\n`); - res.end(); - }); -}); - -router.get('/api/database-status', async (req, res) => { - try { - const playerCount = await new Promise((resolve, reject) => { - db.get('SELECT COUNT(*) as count FROM players', [], (err, row) => { - if (err) reject(err); - else resolve(row.count); - }); - }); - - res.json({ - playersInDB: playerCount, - needsPopulation: playerCount === 0 - }); - } catch (error) { - res.status(500).json({ error: 'Failed to check database status' }); - } -}); - -router.get('/api/load-all-players', (req, res) => { - res.writeHead(200, { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache', - 'Connection': 'keep-alive', - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Headers': 'Cache-Control' - }); - - const progressCallback = (progress) => { - res.write(`data: ${JSON.stringify(progress)}\n\n`); - }; - - refreshAllPlayersInDB(progressCallback).then(ratings => { - res.write(`data: ${JSON.stringify({ status: 'complete', ratings })}\n\n`); - res.end(); - }).catch(error => { - res.write(`data: ${JSON.stringify({ status: 'error', error: error.message })}\n\n`); - res.end(); - }); - - req.on('close', () => { - res.end(); - }); -}); - router.get('/api/rating-history/:pdgaNumber', async (req, res) => { try { const { pdgaNumber } = req.params; diff --git a/views/pages/courses.ejs b/views/pages/courses.ejs index c994b10..63f3a99 100644 --- a/views/pages/courses.ejs +++ b/views/pages/courses.ejs @@ -19,7 +19,6 @@ -
`; %> diff --git a/views/pages/index.ejs b/views/pages/index.ejs index 193e4c0..0287684 100644 --- a/views/pages/index.ejs +++ b/views/pages/index.ejs @@ -19,13 +19,6 @@
- -
`; %> @@ -57,7 +50,7 @@ title: 'PDGA Ratings', activePage: 'players', cssFiles: ['players.css'], - jsFiles: ['tooltips.js', 'chart.js', 'progress.js', 'players.js'], + jsFiles: ['tooltips.js', 'chart.js', 'players.js'], initScript: 'setupTooltipsAfterSwap();', body: body, modals: modals