about summary refs log tree commit diff
path: root/templates
diff options
context:
space:
mode:
authorPjotr Prins2026-04-06 04:58:31 -0500
committerPjotr Prins2026-04-06 04:58:31 -0500
commitddac775a9c58f84026f51cfcaa688bb51e70f00c (patch)
treef8862e2d10b4ab58b138905cffb6d8211adda997 /templates
parentd99396ddac97bdea89c4326e5d3a6ba70c894313 (diff)
parent0ede8df7f295604b09a574dcfa587a31483f1583 (diff)
downloadgenecup-ddac775a9c58f84026f51cfcaa688bb51e70f00c.tar.gz
Merge branch 'master' of /home/git/public/genecup
Diffstat (limited to 'templates')
-rw-r--r--templates/create-ontology.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/templates/create-ontology.html b/templates/create-ontology.html
new file mode 100644
index 0000000..537c246
--- /dev/null
+++ b/templates/create-ontology.html
@@ -0,0 +1,48 @@
+{% extends "layout.html" %}
+{% block content %}
+
+<div class="container mt-4">
+  <h3>Create Ontology with Gemini AI</h3>
+
+  <form method="POST" action="/create-ontology">
+    <input type="hidden" name="action" value="generate">
+    <div class="form-group">
+      <label for="prompt">Prompt:</label>
+      <textarea class="form-control" id="prompt" name="prompt" rows="6">{{ prompt }}</textarea>
+    </div>
+    <button type="submit" class="btn btn-primary" onclick="this.style.backgroundColor='#87CEEB'; this.style.borderColor='#87CEEB';">Create Ontology</button>
+  </form>
+
+  {% if result %}
+  <div class="form-group mt-4">
+    <label for="result">Result ({{ count }} terms):</label>
+    <textarea class="form-control" id="result" name="result" rows="20" form="search-form">{{ result }}</textarea>
+  </div>
+
+  <form id="search-form" method="POST" action="/create-ontology" class="mt-3">
+    <input type="hidden" name="action" value="search">
+    <div class="form-group">
+      <label for="query">Gene symbols (space or comma separated):</label>
+      <textarea class="form-control" id="query" name="query" rows="2"></textarea>
+    </div>
+    <div id="check_selection_onto"></div>
+    <button type="submit" class="btn btn-primary" onclick="if(!document.getElementById('query').value.trim()){alert('Please enter at least one gene symbol');return false;}">Search</button>
+  </form>
+
+  <script>
+    var lines = document.getElementById('result').value.split('\n');
+    var checkbox = '';
+    for (var i = 0; i < lines.length; i++) {
+      var term = lines[i].trim();
+      if (term) {
+        var label = term.split(',')[0].trim();
+        checkbox += '<strong><input type="checkbox" name="type" value="' + label + '" checked form="search-form"> ' + label + '&nbsp;&nbsp;</strong>';
+      }
+    }
+    checkbox += '<br><strong><input type="checkbox" onClick="var c=document.querySelectorAll(\'input[name=type]\');for(var i=0;i<c.length;i++)c[i].checked=this.checked;"/> (Un)select all</strong>';
+    document.getElementById('check_selection_onto').innerHTML = checkbox;
+  </script>
+  {% endif %}
+</div>
+
+{% endblock %}