aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-04-23 12:14:39 -0400
committerbnewbold <bnewbold@robocracy.org>2012-04-23 12:14:39 -0400
commiteb04c544afee65ca91cb07dbf62f670401a7f244 (patch)
tree99a299dadc12cadbdcf5c0110b392b25081ced73 /templates
parent7b6696714142de8deeb5ef4f144ac3ecf8116e3e (diff)
downloadbommom-eb04c544afee65ca91cb07dbf62f670401a7f244.tar.gz
bommom-eb04c544afee65ca91cb07dbf62f670401a7f244.zip
basic view-only http interface
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html2
-rw-r--r--templates/bom_view.html37
-rw-r--r--templates/home.html9
-rw-r--r--templates/user.html11
4 files changed, 57 insertions, 2 deletions
diff --git a/templates/base.html b/templates/base.html
index 538d7db..c455815 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,6 +1,6 @@
{{ define "HEADER" }}<html>
<head>
-<title>bombom</title>
+<title>bommom</title>
<link rel="stylesheet" type="text/css" href="/static/default.css"></link>
</head>
<body>{{ end }}
diff --git a/templates/bom_view.html b/templates/bom_view.html
new file mode 100644
index 0000000..2606217
--- /dev/null
+++ b/templates/bom_view.html
@@ -0,0 +1,37 @@
+{{ template "HEADER" }}
+<h1>{{ .BomMeta.Name }} is a bom.</h1>
+<b>Owner: </b>{{ .BomMeta.Owner }}<br>
+{{ if .BomMeta.Homepage }}<b>Homepage: </b>{{ .BomMeta.Homepage }}<br>{{ end }}
+{{ if .BomMeta.Description }}<b>Description: </b>{{ .BomMeta.Description }}<br>{{ end }}
+<b>Version: </b>{{ .BomMeta.HeadVersion }} (at head)<br>
+<b>Created: </b>{{ .Bom.Created }}<br>
+{{ if .Bom.Progeny}}<b>Source: </b>{{ .Bom.Progeny }}<br>{{ end }}
+<table>
+<tr>
+ <th>qty
+ <th>elements
+ <th>manufacturer
+ <th>mpn
+ <th>function
+ <th>form_factor
+ <th>specs
+ <th>category
+ <th>tag
+ <th>comment
+</tr>
+{{ range .Bom.LineItems }}
+<tr>
+ <td>{{ len .Elements }}
+ <td>{{ range .Elements }}{{ if . }}{{ . }} {{ end }}{{ end }}
+ <td>{{ .Manufacturer }}
+ <td>{{ .Mpn }}
+ <td>{{ .Function }}
+ <td>{{ .FormFactor }}
+ <td>{{ .Specs }}
+ <td>{{ .Category }}
+ <td>{{ .Tag }}
+ <td>{{ .Comment }}
+</tr>
+{{ end }}
+</table>
+{{ template "FOOTER" }}
diff --git a/templates/home.html b/templates/home.html
index 1298241..1b328c3 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -1,3 +1,10 @@
{{ template "HEADER" }}
-<h1>Home Page</h1>
+<h1>this is bomom.</h1>
+<ul>
+{{ range .BomList }}
+<li><a href="/{{ .Owner }}/">{{ .Owner }}</a>/<a href="/{{ .Owner }}/{{ .Name }}/">{{ .Name }}</a>
+{{ else }}
+No Boms found!
+{{ end }}
+</ul>
{{ template "FOOTER" }}
diff --git a/templates/user.html b/templates/user.html
new file mode 100644
index 0000000..f5c8983
--- /dev/null
+++ b/templates/user.html
@@ -0,0 +1,11 @@
+{{ template "HEADER" }}
+<h1>{{ .User }} is a bommom user.</h1>
+<b>Email:</b> <a href="mailto:{{ .Email }}">{{ .Email }}</a>
+<ul>
+{{ range .BomList }}
+<li><a href="/{{ .Owner }}/{{ .Name }}/">{{ .Name }}</a>
+{{ else }}
+No Boms found!
+{{ end }}
+</ul>
+{{ template "FOOTER" }}