Skip to content

Commit

Permalink
Updating templates for the new DisplayService release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojtek Oledzki committed Jan 16, 2012
1 parent c6c60e4 commit 62f9e7c
Show file tree
Hide file tree
Showing 31 changed files with 3,359 additions and 296 deletions.
1 change: 1 addition & 0 deletions htdocs/demo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
$kernel->setPath('data', array(__DIR__ . '/../../data'));
$kernel->setPath('widgets', array(__DIR__ . '/../../vendor/hoborg-widgets', __DIR__ . '/../../widgets'));
$kernel->setDefaultParam('conf', 'demo');

$kernel->handle($_GET);
2 changes: 2 additions & 0 deletions includes/doc/about.intro.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
## Hoborg Dashboard - what is it?

It's FREE and open dashboard system writen by and for developers.
53 changes: 53 additions & 0 deletions includes/doc/dev/how-to.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
### This is how to add dashboard to your website

This blog describes how I added dashboard to hoborglabs.com website.

First I need a folder for 3rd party vendors - easy!!
~~~~
cd hoborglabs.com
mkdir -p vendors/dashboard
cd vendors/dashboard
~~~~

Now I can download dashboard
~~~~
wget http://dashboard.hoborglabs.com/downloads/dashboard.phar
wget http://dashboard.hoborglabs.com/downloads/dashboard-assets.tgz
~~~~

Now ... dashboard.phar does not serves assets. But the default assets set comes
in nice tgz. I will unzip it in vendors folder and symlink it from my public
folder.
~~~~
mkdir assets
tar -xzf dashboard-assets.tgz -C assets/
cd ../../htdocs/
ln -s ../vendors/dashboard/assets/ dashboard-assets
~~~~

Now let's make our dashboard page. (We are still in htdocs/ folder)
~~~~
mkdir dashboard
vim dashboard/index.php
~~~~

And this is what you put inside
~~~~
<?php
define('HD_PUBLIC', '/dashboard-assets');
define('CONFIG_DIR', __DIR__ . '/../../conf/');
include_once __DIR__ . '/../../vendors/dashboard/dashboard.phar';
$kernel = new \Hoborg\Dashboard\Kernel('prod');
$kernel->setPath('data', array(__DIR__ . '/../../data'));
$kernel->setDefaultParam('conf', 'hoborglabs-dashboard');
// and go, go, go...
$kernel->handle($_GET);
~~~~


Now Configuration


And Crontab ...
1 change: 1 addition & 0 deletions includes/doc/dev/intro.intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Dashboard
3 changes: 3 additions & 0 deletions includes/doc/dev/widget.intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## All About Widgets

It's all about widgets here!
46 changes: 46 additions & 0 deletions includes/doc/dev/widget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Widget - What is it?

Widget is simply JSON object which represents it's data. It is then
rendered using {mustache} template. Widget can provide it's own
template or a default one will be used.

By default Dashboard comes with WidgetProvider which allows you
dynamically extend widget's JSON using PHP files or any external CGI
scripts or simply static files.

#### Reserverd Fields

There are few reserved json fields - we try to keep it at minimum.

##### template

This field needs to contain valid mustache template. If it's present
it will be used instead of default template.

##### tick

This field define how often (in seconds) this widget should be
refreshed.



### Life Cycle

It all starts with config file with a list of widgets. Each widget is
loaded and bootstraped (back-end), and added to WidgetManager
(frontend).

WidgetManager starts, renders widgets and from now on it decides when
to refresh each widget.

Each widget is as simple JSON object. Hoborg Widgets comes with some
default fields, but it's totally up to you how will it look. No
constrains! We recommend to always have at least name and body.

~~~
{
"name" : "This is My widget"
"body" : "<span class=\"warn\">I am a widget.</span>",
}
~~~

17 changes: 8 additions & 9 deletions includes/doc/widget-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,22 @@ If CGI address does not begin with https?, SimpleDashboard will assume that you
}
~~~

### php

<h3>php</h3>
<p>
PHP field is used to include given PHP file. Path to PHP files MUST be relative to /widgets folder. Your PHP file needs to return $widget array.
</p>
<pre>

~~~~
{
"body" : "<span class=\"warn\">We had some technical issues - sorry.</span>",
"static" : "error.html",
"php" : "my-widget.php"
}
</pre>
<p>
~~~~

And your PHP script can look like this:
</p>
<pre>

~~~~
&lt;?php
$widget['body'] = 'my body';
return $widget;
</pre>
~~~~
166 changes: 0 additions & 166 deletions site/doc.page

This file was deleted.

53 changes: 53 additions & 0 deletions site/doc/dev.page
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<page name="page">
<component name="google-analytics">
<data>
<enabled>0</enabled>
<account>UA-26727070-1</account>
</data>
</component>
<component name="header">
<data>
<navigation>
<page href="/">Home</page>
<page href="/doc" class="active">Documentation</page>
<page href="/demo">Demo</page>
</navigation>
</data>
</component>

<component name="body">
<data>
<type></type>
</data>
<component name="paragraph">
<data>
<size>side</size>
<markdown file="/var/www/dashboard.local/includes/doc/dev/intro.intro.md" />
</data>
</component>
<component name="paragraph">
<data>
<size>content</size>
<markdown file="/var/www/dashboard.local/includes/doc/dev/intro.md" />
</data>
</component>
</component>

<component name="body">
<data>
<type>highlight</type>
</data>
<component name="paragraph">
<data>
<size>side</size>
<markdown file="/var/www/dashboard.local/includes/doc/dev/widget.intro.md" />
</data>
</component>
<component name="paragraph">
<data>
<size>content</size>
<markdown file="/var/www/dashboard.local/includes/doc/dev/widget.md" />
</data>
</component>
</component>
</page>
Loading

0 comments on commit 62f9e7c

Please sign in to comment.