diff --git a/assets/pasted-20260312-161138-4fa78450.png b/assets/pasted-20260312-161138-4fa78450.png new file mode 100644 index 0000000..cd1529c Binary files /dev/null and b/assets/pasted-20260312-161138-4fa78450.png differ diff --git a/core/templates/core/project_detail.html b/core/templates/core/project_detail.html index aa2a48d..958f0fd 100644 --- a/core/templates/core/project_detail.html +++ b/core/templates/core/project_detail.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block content %} -
-
+
+

{{ project.title }}

{{ project.industry }} | Goal: {{ project.goal }}

@@ -11,12 +11,11 @@
-
- -
-
-
-
Interactive Mind Map
+
+
+
+
+
Interactive Mind Map
{% csrf_token %} @@ -25,50 +24,53 @@
-
+ +
{% if not nodes %}

The mind map is empty

Something went wrong during generation, or the map was cleared.

{% csrf_token %} -
{% endif %} +
-
-
-
-
- -
- -
-
-
Node Details
-
-
-

Click on a node or edge in the map to see its details here.

-
-
+ +
+ + +
+
+
Node Details
+
+
+

Click on a node or edge in the map to see its details here.

+
+
+ + +
+
+
Ask AI Assistant
+
+
+
+ Hello! I'm your AI business strategist. Ask me to expand on a node, brainstorm new ideas, or analyze the map. If you ask me to add nodes to the map, I will! +
+
+ + +
+
+
- -
-
-
Ask AI Assistant
-
-
-
- Hello! I'm your AI business strategist. Ask me to expand on a node, brainstorm new ideas, or analyze the map. If you ask me to add nodes to the map, I will! -
-
- -
@@ -83,16 +85,33 @@ @@ -203,9 +222,9 @@ const nodeId = params.nodes[0]; const node = data.nodes.get(nodeId); detailsPanel.innerHTML = ` -

${node.label}

- ${node.category} -

Summary:
${node.summary}

+
${node.label}
+ ${node.category} +

Summary:
${node.summary}

`; } else if (params.edges.length > 0) { // Edge clicked @@ -214,16 +233,17 @@ const fromNode = data.nodes.get(edge.from); const toNode = data.nodes.get(edge.to); detailsPanel.innerHTML = ` -
Connection Details
-

From: ${fromNode.label}

-

To: ${toNode.label}

-
-

How:
${edge.how || 'N/A'}

-

Why:
${edge.why || 'N/A'}

+
Connection Details
+

From: ${fromNode.label}

+

To: ${toNode.label}

+
+

How: ${edge.how || 'N/A'}

+

Why: ${edge.why || 'N/A'}

+
`; } else { // Clicked empty space - detailsPanel.innerHTML = '

Click on a node or edge in the map to see its details here.

'; + detailsPanel.innerHTML = '

Click on a node or edge in the map to see its details here.

'; } }); @@ -236,12 +256,12 @@ const responseDiv = document.getElementById('ai-response'); // Append user message - responseDiv.innerHTML += `
You: ${message}
`; + responseDiv.innerHTML += `
${message}
`; inputField.value = ''; // Show loading state const loadingId = 'loading-' + Date.now(); - responseDiv.innerHTML += `
AI is thinking...
`; + responseDiv.innerHTML += `
Thinking...
`; responseDiv.scrollTop = responseDiv.scrollHeight; fetch("{% url 'ai_chat' project.pk %}", { @@ -258,7 +278,7 @@ // Handle chat response if (apiData.response) { - responseDiv.innerHTML += `
AI: ${apiData.response}
`; + responseDiv.innerHTML += `
${apiData.response}
`; } // Check for new nodes and add them to the map @@ -301,16 +321,24 @@ // Stabilize and adjust view network.stabilize(); setTimeout(fitNetwork, 500); // Fit network smoothly after a slight delay - responseDiv.innerHTML += `
Successfully added new items to the map!
`; + responseDiv.innerHTML += `
New items added to map!
`; } responseDiv.scrollTop = responseDiv.scrollHeight; }) .catch(err => { document.getElementById(loadingId).remove(); - responseDiv.innerHTML += `
Error: Failed to get response from AI.
`; + responseDiv.innerHTML += `
Error: Failed to get response.
`; console.error(err); }); }); + + // Allow submitting AI input with Enter key + document.getElementById('ai-input').addEventListener('keypress', function (e) { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + document.getElementById('ai-submit').click(); + } + }); {% endblock %} \ No newline at end of file