Skip to content
Browse files

elements to hold basic information in the dashboard

  • Loading branch information...
1 parent 68d0eae commit 3fd32ab932b25487833c3e59ec7de0d5fb439f7d Gregory Burd committed May 14, 2012
Showing with 34 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 include/records.hrl
  3. +10 −0 src/elements/element_everything.erl
  4. +10 −0 src/elements/element_health.erl
  5. +10 −0 src/elements/element_problems.erl
View
1 .gitignore
@@ -1,2 +1,3 @@
*~
*.beam
+.prototypes
View
3 include/records.hrl
@@ -0,0 +1,3 @@
+-record(everything, {?ELEMENT_BASE(element_everything), attr1, attr2}).
+-record(health, {?ELEMENT_BASE(element_health), attr1, attr2}).
+-record(problems, {?ELEMENT_BASE(element_problems), attr1, attr2}).
View
10 src/elements/element_everything.erl
@@ -0,0 +1,10 @@
+%% -*- mode: nitrogen -*-
+-module (element_everything).
+-compile(export_all).
+-include_lib("nitrogen_core/include/wf.hrl").
+-include("records.hrl").
+
+reflect() -> record_info(fields, everything).
+
+render_element(_Record = #everything{}) ->
+ "<b>Hello from everything</b>".
View
10 src/elements/element_health.erl
@@ -0,0 +1,10 @@
+%% -*- mode: nitrogen -*-
+-module (element_health).
+-compile(export_all).
+-include_lib("nitrogen_core/include/wf.hrl").
+-include("records.hrl").
+
+reflect() -> record_info(fields, health).
+
+render_element(_Record = #health{}) ->
+ "<b>Hello from health</b>".
View
10 src/elements/element_problems.erl
@@ -0,0 +1,10 @@
+%% -*- mode: nitrogen -*-
+-module (element_problems).
+-compile(export_all).
+-include_lib("nitrogen_core/include/wf.hrl").
+-include("records.hrl").
+
+reflect() -> record_info(fields, problems).
+
+render_element(_Record = #problems{}) ->
+ #h2 { text="Problems" }.

0 comments on commit 3fd32ab

Please sign in to comment.
Something went wrong with that request. Please try again.