Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- api/main.py +0 -8
- frontend/court/court.js +6 -25
- frontend/index.html +2 -2
api/main.py
CHANGED
|
@@ -176,14 +176,6 @@ def health():
|
|
| 176 |
}
|
| 177 |
|
| 178 |
|
| 179 |
-
@app.get("/court/ui")
|
| 180 |
-
def serve_moot_court():
|
| 181 |
-
"""Serve the Moot Court UI directly"""
|
| 182 |
-
if os.path.exists("frontend/court/court.html"):
|
| 183 |
-
return FileResponse("frontend/court/court.html", media_type="text/html")
|
| 184 |
-
return {"error": "Moot Court UI not found"}
|
| 185 |
-
|
| 186 |
-
|
| 187 |
@app.post("/query", response_model=QueryResponse)
|
| 188 |
def query(request: QueryRequest, background_tasks: BackgroundTasks):
|
| 189 |
if not request.query.strip():
|
|
|
|
| 176 |
}
|
| 177 |
|
| 178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
@app.post("/query", response_model=QueryResponse)
|
| 180 |
def query(request: QueryRequest, background_tasks: BackgroundTasks):
|
| 181 |
if not request.query.strip():
|
frontend/court/court.js
CHANGED
|
@@ -32,14 +32,10 @@ const state = {
|
|
| 32 |
// ════════════════════════════════════════════════════════════
|
| 33 |
|
| 34 |
document.addEventListener('DOMContentLoaded', () => {
|
| 35 |
-
|
| 36 |
-
try { loadRecentSessions(); } catch (e) { console.warn('Could not load sessions:', e); }
|
| 37 |
updateLobbyTime();
|
| 38 |
setInterval(updateLobbyTime, 1000);
|
| 39 |
-
|
| 40 |
-
if (argInput) {
|
| 41 |
-
argInput.addEventListener('input', updateWordCount);
|
| 42 |
-
}
|
| 43 |
});
|
| 44 |
|
| 45 |
// ════════════════════════════════════════════════════════════
|
|
@@ -47,7 +43,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 47 |
// ════════════════════════════════════════════════════════════
|
| 48 |
|
| 49 |
function showScreen(screenId) {
|
| 50 |
-
console.log(`🔄 Navigating to screen: ${screenId}`);
|
| 51 |
// Hide all screens
|
| 52 |
document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
|
| 53 |
|
|
@@ -56,11 +51,10 @@ function showScreen(screenId) {
|
|
| 56 |
if (targetScreen) {
|
| 57 |
targetScreen.classList.add('active');
|
| 58 |
state.currentScreen = screenId;
|
| 59 |
-
console.log(`✓ Screen active: ${screenId}`);
|
| 60 |
|
| 61 |
// Screen-specific initialization
|
| 62 |
if (screenId === 'lobby') {
|
| 63 |
-
|
| 64 |
} else if (screenId === 'courtroom') {
|
| 65 |
initializeCourtroom();
|
| 66 |
} else if (screenId === 'analysis') {
|
|
@@ -68,8 +62,6 @@ function showScreen(screenId) {
|
|
| 68 |
} else if (screenId === 'sessions') {
|
| 69 |
loadAllSessions();
|
| 70 |
}
|
| 71 |
-
} else {
|
| 72 |
-
console.error(`✗ Screen not found: screen-${screenId}`);
|
| 73 |
}
|
| 74 |
}
|
| 75 |
|
|
@@ -118,22 +110,17 @@ function removeIssue(issue) {
|
|
| 118 |
}
|
| 119 |
|
| 120 |
function goToStep(step) {
|
| 121 |
-
console.log(`→ Moving to setup step ${step}`);
|
| 122 |
-
|
| 123 |
// Validate current step
|
| 124 |
if (state.setupStep === 1 && !state.setupData.side) {
|
| 125 |
alert('Please select your side');
|
| 126 |
-
console.warn('Cannot advance: side not selected');
|
| 127 |
return;
|
| 128 |
}
|
| 129 |
if (state.setupStep === 2) {
|
| 130 |
-
|
| 131 |
-
if (!title) {
|
| 132 |
alert('Please enter case title');
|
| 133 |
-
console.warn('Cannot advance: case title missing');
|
| 134 |
return;
|
| 135 |
}
|
| 136 |
-
state.setupData.title = title;
|
| 137 |
state.setupData.userClient = document.getElementById('user-client').value;
|
| 138 |
state.setupData.opposingParty = document.getElementById('opposing-party').value;
|
| 139 |
state.setupData.facts = document.getElementById('brief-facts').value;
|
|
@@ -143,13 +130,7 @@ function goToStep(step) {
|
|
| 143 |
// Update steps
|
| 144 |
state.setupStep = step;
|
| 145 |
document.querySelectorAll('.setup-step').forEach(s => s.classList.add('hidden'));
|
| 146 |
-
|
| 147 |
-
if (stepEl) {
|
| 148 |
-
stepEl.classList.remove('hidden');
|
| 149 |
-
console.log(`✓ Setup step ${step} displayed`);
|
| 150 |
-
} else {
|
| 151 |
-
console.error(`✗ Setup step ${step} element not found`);
|
| 152 |
-
}
|
| 153 |
|
| 154 |
// Update indicators
|
| 155 |
document.querySelectorAll('.step-indicator').forEach((ind, i) => {
|
|
|
|
| 32 |
// ════════════════════════════════════════════════════════════
|
| 33 |
|
| 34 |
document.addEventListener('DOMContentLoaded', () => {
|
| 35 |
+
loadRecentSessions();
|
|
|
|
| 36 |
updateLobbyTime();
|
| 37 |
setInterval(updateLobbyTime, 1000);
|
| 38 |
+
document.getElementById('argument-input').addEventListener('input', updateWordCount);
|
|
|
|
|
|
|
|
|
|
| 39 |
});
|
| 40 |
|
| 41 |
// ════════════════════════════════════════════════════════════
|
|
|
|
| 43 |
// ════════════════════════════════════════════════════════════
|
| 44 |
|
| 45 |
function showScreen(screenId) {
|
|
|
|
| 46 |
// Hide all screens
|
| 47 |
document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
|
| 48 |
|
|
|
|
| 51 |
if (targetScreen) {
|
| 52 |
targetScreen.classList.add('active');
|
| 53 |
state.currentScreen = screenId;
|
|
|
|
| 54 |
|
| 55 |
// Screen-specific initialization
|
| 56 |
if (screenId === 'lobby') {
|
| 57 |
+
loadRecentSessions();
|
| 58 |
} else if (screenId === 'courtroom') {
|
| 59 |
initializeCourtroom();
|
| 60 |
} else if (screenId === 'analysis') {
|
|
|
|
| 62 |
} else if (screenId === 'sessions') {
|
| 63 |
loadAllSessions();
|
| 64 |
}
|
|
|
|
|
|
|
| 65 |
}
|
| 66 |
}
|
| 67 |
|
|
|
|
| 110 |
}
|
| 111 |
|
| 112 |
function goToStep(step) {
|
|
|
|
|
|
|
| 113 |
// Validate current step
|
| 114 |
if (state.setupStep === 1 && !state.setupData.side) {
|
| 115 |
alert('Please select your side');
|
|
|
|
| 116 |
return;
|
| 117 |
}
|
| 118 |
if (state.setupStep === 2) {
|
| 119 |
+
if (!document.getElementById('case-title').value.trim()) {
|
|
|
|
| 120 |
alert('Please enter case title');
|
|
|
|
| 121 |
return;
|
| 122 |
}
|
| 123 |
+
state.setupData.title = document.getElementById('case-title').value;
|
| 124 |
state.setupData.userClient = document.getElementById('user-client').value;
|
| 125 |
state.setupData.opposingParty = document.getElementById('opposing-party').value;
|
| 126 |
state.setupData.facts = document.getElementById('brief-facts').value;
|
|
|
|
| 130 |
// Update steps
|
| 131 |
state.setupStep = step;
|
| 132 |
document.querySelectorAll('.setup-step').forEach(s => s.classList.add('hidden'));
|
| 133 |
+
document.getElementById(`setup-step-${step}`).classList.remove('hidden');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
// Update indicators
|
| 136 |
document.querySelectorAll('.step-indicator').forEach((ind, i) => {
|
frontend/index.html
CHANGED
|
@@ -32,10 +32,10 @@
|
|
| 32 |
System Analytics
|
| 33 |
</button>
|
| 34 |
|
| 35 |
-
<
|
| 36 |
<span class="analytics-icon">⚖️</span>
|
| 37 |
Moot Court
|
| 38 |
-
</
|
| 39 |
|
| 40 |
<div class="sidebar-section-label">SESSIONS</div>
|
| 41 |
<div id="sessions-list" class="sessions-list">
|
|
|
|
| 32 |
System Analytics
|
| 33 |
</button>
|
| 34 |
|
| 35 |
+
<a href="/static/court/court.html" class="analytics-btn" style="text-decoration: none; color: inherit;">
|
| 36 |
<span class="analytics-icon">⚖️</span>
|
| 37 |
Moot Court
|
| 38 |
+
</a>
|
| 39 |
|
| 40 |
<div class="sidebar-section-label">SESSIONS</div>
|
| 41 |
<div id="sessions-list" class="sessions-list">
|