about summary refs log tree commit diff
path: root/tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/addstars.html84
-rw-r--r--tmpl/header.html11
-rw-r--r--tmpl/index.html24
-rw-r--r--tmpl/javascript.html5
-rw-r--r--tmpl/nav.html20
-rw-r--r--tmpl/newtree.html60
-rw-r--r--tmpl/overview.html49
7 files changed, 253 insertions, 0 deletions
diff --git a/tmpl/addstars.html b/tmpl/addstars.html
new file mode 100644
index 0000000..cffc31e
--- /dev/null
+++ b/tmpl/addstars.html
@@ -0,0 +1,84 @@
+{{define "addstars"}}
+    <head>
+        {{template "header"}}
+        <style>
+            .jumbotron{
+                margin: 10px;
+            }
+        </style>
+    </head>
+    <body>
+    {{template "nav"}}
+
+    <div class="container">
+        <div class="tab-content" id="nav-tabContent">
+            <div class="tab-pane fade" id="nav-overview" role="tabpanel" aria-labelledby="nav-overview-tab">There will be an overview here!</div>
+            <div class="tab-pane fade" id="nav-new-tree" role="tabpanel" aria-labelledby="nav-new-tree-tab">add tree</div>
+            <div class="tab-pane fade" id="nav-add-stars" role="tabpanel" aria-labelledby="nav-add-stars-tab">Add some stars!</div>
+            <div class="tab-pane fade" id="nav-draw-tree" role="tabpanel" aria-labelledby="nav-draw-tree-tab">Draw one of the galaxies!</div>
+        </div>
+    </div>
+
+    <div class="container">
+        <div class="jumbotron">
+            <h1 class="display-4">Add Stars</h1>
+            <p class="lead">This is the "Add your star to a tree" page! Fill out the form below for adding one of your stars into one of the trees!</p>
+            <form action="/addstars" method="post">
+
+                <hr class="my-4">
+                <div class="form-group">
+                    <input type="text" class="form-control" id="dbip" placeholder="db-ip" name="dbip">
+                </div>
+                <div class="form-group">
+                    <input type="text" class="form-control" id="tree" placeholder="tree index" name="tree">
+                </div>
+                <hr class="my-4">
+
+                <div class="form-group">
+                    <input type="text" class="form-control" id="x" placeholder="x" name="x">
+                </div>
+                <div class="form-group">
+                    <input type="text" class="form-control" id="y" placeholder="y" name="y">
+                </div>
+                <div class="form-group">
+                    <input type="text" class="form-control" id="vx" placeholder="vx" name="vx">
+                </div>
+                <div class="form-group">
+                    <input type="text" class="form-control" id="vy" placeholder="vy" name="vy">
+                </div>
+                <div class="form-group">
+                    <input type="text" class="form-control" id="m" placeholder="mass" name="mass">
+                </div>
+                <button type="submit" class="btn btn-primary">Submit</button>
+            </form>
+        </div>
+    </div>
+
+    <div class="container">
+        <div class="jumbotron">
+            <p class="lead">Optionally: select a .csv:</p>
+            <div class="input-group">
+                <div class="input-group-prepend">
+                    <span class="input-group-text" id="inputGroupFileAddon01">Upload</span>
+                </div>
+                <div class="custom-file">
+                    <input type="file" class="custom-file-input" id="inputGroupFile01" aria-describedby="inputGroupFileAddon01">
+                    <label class="custom-file-label" for="inputGroupFile01">Choose file</label>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+        <div class="jumbotron">
+            <form enctype="multipart/form-data" action="http://127.0.0.1:9090/upload" method="post">
+                <input type="file" name="uploadfile" />
+                <input type="hidden" name="token" value="{{.}}"/>
+                <input type="submit" value="upload" />
+            </form>
+        </div>
+    </div>
+
+    {{template "javascript"}}
+    </body>
+{{end}}
diff --git a/tmpl/header.html b/tmpl/header.html
new file mode 100644
index 0000000..57e749e
--- /dev/null
+++ b/tmpl/header.html
@@ -0,0 +1,11 @@
+{{define "header"}}
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <title>emile.space</title>
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+    <style>
+        .nav {
+            margin: 10px;
+        }
+    </style>
+{{end}}
diff --git a/tmpl/index.html b/tmpl/index.html
new file mode 100644
index 0000000..1f22908
--- /dev/null
+++ b/tmpl/index.html
@@ -0,0 +1,24 @@
+{{define "index"}}
+    <head>
+        {{template "header"}}
+        <style>
+            .jumbotron{
+                margin: 10px;
+            }
+        </style>
+    </head>
+    <body>
+    {{template "nav"}}
+
+    <div class="container">
+        <div class="tab-content" id="nav-tabContent">
+            <div class="tab-pane fade" id="nav-overview" role="tabpanel" aria-labelledby="nav-overview-tab">There will be an overview here!</div>
+            <div class="tab-pane fade" id="nav-new-tree" role="tabpanel" aria-labelledby="nav-new-tree-tab">add tree</div>
+            <div class="tab-pane fade" id="nav-add-stars" role="tabpanel" aria-labelledby="nav-add-stars-tab">Add some stars!</div>
+            <div class="tab-pane fade" id="nav-draw-tree" role="tabpanel" aria-labelledby="nav-draw-tree-tab">Draw one of the galaxies!</div>
+        </div>
+    </div>
+
+    {{template "javascript"}}
+    </body>
+{{end}}
diff --git a/tmpl/javascript.html b/tmpl/javascript.html
new file mode 100644
index 0000000..54b2810
--- /dev/null
+++ b/tmpl/javascript.html
@@ -0,0 +1,5 @@
+{{define "javascript"}}
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
+{{end}}
diff --git a/tmpl/nav.html b/tmpl/nav.html
new file mode 100644
index 0000000..9c7a94b
--- /dev/null
+++ b/tmpl/nav.html
@@ -0,0 +1,20 @@
+{{define "nav"}}
+<div class="container">
+    <nav>
+        <ul class="nav nav-tabs">
+            <li class="nav-item">
+                <a class="nav-link" href="/">Overview</a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="/newtree">New Tree</a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="/addstars">Add Stars</a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="/drawtree">Draw Tree</a>
+            </li>
+        </ul>
+    </nav>
+</div>
+{{end}}
diff --git a/tmpl/newtree.html b/tmpl/newtree.html
new file mode 100644
index 0000000..974e45c
--- /dev/null
+++ b/tmpl/newtree.html
@@ -0,0 +1,60 @@
+{{define "newtree"}}
+    <head>
+        {{template "header"}}
+        <style>
+            .jumbotron{
+                margin: 10px;
+            }
+        </style>
+    </head>
+    <body>
+    {{template "nav"}}
+
+    <div class="container">
+        <div class="tab-content" id="nav-tabContent">
+            <div class="tab-pane fade" id="nav-overview" role="tabpanel" aria-labelledby="nav-overview-tab">There will be an overview here!</div>
+            <div class="tab-pane fade" id="nav-new-tree" role="tabpanel" aria-labelledby="nav-new-tree-tab">add tree</div>
+            <div class="tab-pane fade" id="nav-add-stars" role="tabpanel" aria-labelledby="nav-add-stars-tab">Add some stars!</div>
+            <div class="tab-pane fade" id="nav-draw-tree" role="tabpanel" aria-labelledby="nav-draw-tree-tab">Draw one of the galaxies!</div>
+        </div>
+    </div>
+
+    <div class="container">
+        <div class="jumbotron">
+            <h1 class="display-4">New Tree</h1>
+            <p class="lead">This is the "Create your own tree" page! Fill out the form below to create a new (quad)tree storing a complete galaxy!</p>
+            <hr class="my-4">
+            <form action="/newtree" method="post">
+                <div class="form-group">
+                    <label for="db-ip">The ip of the database</label>
+                    <input type="text" class="form-control" id="x-pos" placeholder="db-ip" name="db-ip">
+                </div>
+                <div class="form-group">
+                    <label for="x-pos">(Center) X Position</label>
+                    <input type="text" class="form-control" id="x-pos" placeholder="x-pos" name="x">
+                </div>
+                <div class="form-group">
+                    <label for="y-pos">(Center) Y Position</label>
+
+                    <input type="text" class="form-control" id="y-pos" placeholder="y-pos" name="y">
+                </div>
+                <div class="form-group">
+                    <label for="width">Width</label>
+                    <input type="text" class="form-control" id="width" placeholder="width" name="w">
+                </div>
+                <button type="submit" class="btn btn-primary">Submit</button>
+            </form>
+        </div>
+        {{if .NewTree}}
+            <div class="alert alert-success alert-dismissible fade show" role="success">
+                <strong>Successfully created the tree!</strong> (x:{{.X}}, y:{{.Y}}), width: {{.W}}
+                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+        {{end}}
+    </div>
+
+    {{template "javascript"}}
+    </body>
+{{end}}
diff --git a/tmpl/overview.html b/tmpl/overview.html
new file mode 100644
index 0000000..7f20c2c
--- /dev/null
+++ b/tmpl/overview.html
@@ -0,0 +1,49 @@
+{{define "overview"}}
+    <head>
+        {{template "header"}}
+    </head>
+    <body>
+        {{template "nav"}}
+        <div id="wrap">
+            <div class="container">
+                <h3>Existing galaxies</h3>
+                <table cellpadding="0" cellspacing="0" border="0" class="datatable table table-striped table-bordered">
+                    <thead>
+                        <tr>
+                            <th>Index</th>
+                            <th>Boundary</th>
+                            <th>Amounf of stars</th>
+                            <th>Range</th>
+                        </tr>
+                    </thead>
+
+                    <tbody>
+                        <tr class="gradeX">
+                            <td>1</td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                        <tr class="gradeX">
+                            <td>2</td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                        <tr class="gradeX">
+                            <td>3</td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                    </tbody>
+
+                    <tfoot>
+                    </tfoot>
+                </table>
+            </div>
+        </div>
+
+        {{template "javascript"}}
+    </body>
+{{end}}
\ No newline at end of file