summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
Diffstat (limited to 'themes')
-rw-r--r--themes/okadmin/public/css/main.css103
-rw-r--r--themes/okadmin/templates/index.liquid26
-rw-r--r--themes/okadmin/templates/partials/head.liquid13
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid19
-rw-r--r--themes/okadmin/templates/partials/tail.liquid3
-rw-r--r--themes/okadmin/templates/resource.liquid15
-rw-r--r--themes/okadmin/templates/resource_new.liquid15
7 files changed, 194 insertions, 0 deletions
diff --git a/themes/okadmin/public/css/main.css b/themes/okadmin/public/css/main.css
new file mode 100644
index 0000000..88628e3
--- /dev/null
+++ b/themes/okadmin/public/css/main.css
@@ -0,0 +1,103 @@
+html, body {
+ margin: 0;
+ padding: 0;
+ font-family: "Helvetica", sans-serif;
+ font-size: 16px;
+}
+
+ul {
+ padding: 0;
+ list-style: none;
+}
+
+a {
+ color: #0000ff;
+ text-decoration: none;
+}
+
+a:hover {
+ border-bottom: 3px solid #0000ff;
+}
+
+a:visited {
+ color: #0000ff;
+}
+
+.admin-header {
+ height: 50px;
+ background-color: rgb(233, 233, 233);
+}
+
+.admin-header .breadcrumb {
+ margin-left: 2em;
+ font-size: 2em;
+ color: rgba(0, 0, 0, 0.25);
+ line-height: 50px;
+}
+
+.admin-header .site-link {
+ font-size: 1.5em;
+ float: right;
+ margin-right: 10%;
+ line-height: 50px;
+}
+
+.main.index .resource-category {
+ float: left;
+ min-width: 200px;
+ margin: 1em;
+ padding: 1em;
+ background-color: rgba(0, 0, 0, 0.1);
+}
+
+.main.index .resource-category a.add-new {
+ border-bottom: 3px solid rgba(0, 0, 0, 0);
+ float: right;
+ font-size: 1.5em;
+ color: rgba(0, 0, 0, 0.25);
+}
+
+.main.index .resource-category li {
+ margin: 1em 0;
+}
+
+.main.index .resource-category a.add-new:hover {
+ border-bottom: 3px solid rgba(0, 0, 0, 0.25);
+}
+
+.main.resource > * {
+ margin: 1em 1em;
+}
+
+.main.resource form {
+ background-color: rgba(0, 0, 0, 0.1);
+ max-width: 500px;
+ padding: 1em;
+ font-size: 1.25em;
+}
+
+.main.resource form label {
+ display: block;
+ margin-bottom: 0.25em;
+ color: rgba(0, 0, 0, 0.75);
+}
+
+.main.resource form .property {
+ margin: 1em 0;
+}
+
+.main.resource form input {
+ display: block;
+ font-size: 1.25em;
+ min-height: 2em;
+ padding: 0 0.5em;
+}
+
+.main.resource form button {
+ font-size: 1.25em;
+ float: right;
+}
+
+.clear {
+ clear: both;
+}
diff --git a/themes/okadmin/templates/index.liquid b/themes/okadmin/templates/index.liquid
new file mode 100644
index 0000000..95c64dd
--- /dev/null
+++ b/themes/okadmin/templates/index.liquid
@@ -0,0 +1,26 @@
+{% include 'partials/head' %}
+
+<section class="index main">
+ {% for pair in resources %}
+ {% assign name = pair[0] %}
+ {% assign resource = pair[1] %}
+ {% assign spec = resource.spec %}
+
+ <section class="resource-category {{name}}">
+ <header>
+ <h2>{{name | capitalize}}</h2>
+ </header>
+ <ul class="resource-list">
+ {% for data in resource.data %}
+ <li><a href="{{resource.type}}/{{data.id}}/">{{data.id}}</a></li>
+ {% endfor %}
+ </ul>
+ <footer>
+ <a class="add-new" href="{{resource.type}}/new/">+</a>
+ </footer>
+ </section>
+
+ {% endfor %}
+</section>
+
+{% include 'partials/tail' %}
diff --git a/themes/okadmin/templates/partials/head.liquid b/themes/okadmin/templates/partials/head.liquid
new file mode 100644
index 0000000..86915a4
--- /dev/null
+++ b/themes/okadmin/templates/partials/head.liquid
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>{{meta.title}}</title>
+ <link rel="stylesheet" href="{{meta.static}}/css/main.css">
+ </head>
+ <body>
+ <header class="admin-header">
+ <span class="breadcrumb">Admin</span>
+ <a class="site-link" href="/">View Site</a>
+ </header>
+ <div class="container">
diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid
new file mode 100644
index 0000000..4dd600d
--- /dev/null
+++ b/themes/okadmin/templates/partials/inputs.liquid
@@ -0,0 +1,19 @@
+{% for pair in resource.spec %}
+ {% assign name = pair[0] %}
+ {% assign spec = pair[1] %}
+ {% assign type = spec.type %}
+
+ <div class="property">
+ {% if type == 'string' %}
+ <label for="{{name}}">{{name | capitalize}}</label>
+ <input
+ {% if spec.disabled %}
+ disabled="true"
+ {% endif %}
+ name="{{name}}" type="text" value="{{spec.value}}">
+ {% else %}
+ <p><pre style="color: red">Admin template doesn't support '{{type}}' properties!</pre></p>
+ {% endif %}
+ </div>
+
+{% endfor %}
diff --git a/themes/okadmin/templates/partials/tail.liquid b/themes/okadmin/templates/partials/tail.liquid
new file mode 100644
index 0000000..773c8d4
--- /dev/null
+++ b/themes/okadmin/templates/partials/tail.liquid
@@ -0,0 +1,3 @@
+ </div> {% comment %} closes container tag {% endcomment %}
+ </body>
+</html>
diff --git a/themes/okadmin/templates/resource.liquid b/themes/okadmin/templates/resource.liquid
new file mode 100644
index 0000000..9c1b71c
--- /dev/null
+++ b/themes/okadmin/templates/resource.liquid
@@ -0,0 +1,15 @@
+{% include 'partials/head' %}
+
+<section class="resource main">
+ <nav>
+ <a href="../..">Back</a>
+ </nav>
+ <form action="." method="POST">
+ <input type="hidden" name="_method" value="PUT">
+ {% include 'partials/inputs' %}
+ <button type="submit">Save</button>
+ <div class="clear"></div>
+ </form>
+</section>
+
+{% include 'partials/tail' %}
diff --git a/themes/okadmin/templates/resource_new.liquid b/themes/okadmin/templates/resource_new.liquid
new file mode 100644
index 0000000..1e414be
--- /dev/null
+++ b/themes/okadmin/templates/resource_new.liquid
@@ -0,0 +1,15 @@
+{% include 'partials/head' %}
+
+<section class="main resource resource-new">
+ <nav>
+ <a href="../..">Back</a>
+ </nav>
+ <form action=".." method="POST">
+ <input type="hidden" name="_method" value="POST">
+ {% include 'partials/inputs' %}
+ <button type="submit">Create</button>
+ <div class="clear"></div>
+ </form>
+</section>
+
+{% include 'partials/tail' %}