Permalink
Browse files

add a full page mode

  • Loading branch information...
1 parent 4169323 commit 1e24dd9f62a69b66ad6091a2f9ec13415ef80e00 @lukec lukec committed Nov 25, 2012
Showing with 13 additions and 5 deletions.
  1. +5 −0 vhsapi/lib/VHSAPI.pm
  2. +0 −1 vhsapi/todo
  3. +4 −0 vhsapi/views/data-full.tt
  4. +4 −4 vhsapi/views/layouts/main.tt
View
5 vhsapi/lib/VHSAPI.pm
@@ -53,6 +53,11 @@ get '/s/:spacename/data/:dataname.js' => sub {
}, {layout => undef };
};
+get '/s/:spacename/data/:dataname/fullpage' => sub {
+ my $space = vars->{space} or redirect '/';
+ template 'data-full', { datapoint => $space->datapoint(params->{dataname}) };
+};
+
get '/s/:spacename/data/:dataname' => sub {
my $space = vars->{space} or redirect '/';
template 'data', { datapoint => $space->datapoint(params->{dataname}) };
View
1 vhsapi/todo
@@ -1,7 +1,6 @@
* JSON history for a datapoint
* VHS what datapoints do you have?
-* website embed
* phone system
* Simple docs on how to put new values
* API key checking
View
4 vhsapi/views/data-full.tt
@@ -0,0 +1,4 @@
+<div class="row">
+ <h1>The [% space.title %] [% datapoint.name %] is [% datapoint.value %].</h1>
+ Last updated: <abbr class="timeago" title="[% datapoint.datetime.iso8601 %]">[% datapoint.datetime %]</abbr>
+</div>
View
8 vhsapi/views/layouts/main.tt
@@ -4,15 +4,15 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=[% settings.charset %]" />
<title>VHSAPI</title>
-<link rel="stylesheet" href="/css/bootstrap.css" />
-<link rel="stylesheet" href="/css/style.css" />
+<link rel="stylesheet" href="http://api.hackspace.ca/css/bootstrap.css" />
+<link rel="stylesheet" href="http://api.hackspace.ca/css/style.css" />
<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
- !window.jQuery && document.write('<script type="text/javascript" src="[% request.uri_base %]/javascripts/jquery.js"><\/script>')
+ !window.jQuery && document.write('<script type="text/javascript" src="http://api.hackspace.ca/javascripts/jquery.js"><\/script>')
/* ]]> */</script>
-<script src="/javascripts/jquery.timeago.js" type="text/javascript"></script>
+<script src="http://api.hackspace.ca/javascripts/jquery.timeago.js" type="text/javascript"></script>
</head>
<body>

0 comments on commit 1e24dd9

Please sign in to comment.