added changes controller
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 22 May 2010 12:16:29 +0000 (14:16 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 22 May 2010 12:18:31 +0000 (14:18 +0200)
lib/MojoFacets/Changes.pm [new file with mode: 0644]
public/mojo_facets.css
templates/admin.html.ep
templates/changes/index.html.ep [new file with mode: 0644]

diff --git a/lib/MojoFacets/Changes.pm b/lib/MojoFacets/Changes.pm
new file mode 100644 (file)
index 0000000..8ac0ee9
--- /dev/null
@@ -0,0 +1,15 @@
+package MojoFacets::Changes;
+
+use strict;
+use warnings;
+
+use base 'Mojolicious::Controller';
+
+sub index {
+       my $self = shift;
+
+       # Render template "changes/index.html.ep" with message
+       $self->render(message => 'Latest Changes');
+}
+
+1;
index d067e35..81fb772 100644 (file)
@@ -48,6 +48,10 @@ span.h {
        font-weight: bold;
 }
 
+.admin .changes {
+       float: right;
+}
+
 .debug {
        color: #aaa;
 }
index 0f2affc..2ae6554 100644 (file)
@@ -1,12 +1,15 @@
 <div class=admin>
 
-<a href="<%= url_for( action => 'index' ) %>">load</a>
-<a href="<%= url_for( action => 'columns' ) %>">columns</a>
+<a href="<%= url_for( controller => 'data', action => 'index' ) %>">load</a>
+<a href="<%= url_for( controller => 'data', action => 'columns' ) %>">columns</a>
 items:
 % foreach my $show ( glob 'templates/data/items/*.html.ep' ) {
 %  $show =~ s{^.+/([^/]+)\.html\.ep$}{$1};
 %  my $class = session('show') eq $show ? 'class=active' : '';
-<a href="<%= url_for( action => 'items' )->query( show => $show ) %>" <%= $class %>><%= $show %></a>
+<a href="<%= url_for( controller => 'data', action => 'items' )->query( show => $show ) %>" <%= $class %>><%= $show %></a>
 % }
+
+<a class=changes href="<%= url_for( controller => 'changes', action => 'index' ) %>">changes</a>
+
 </div>
 
diff --git a/templates/changes/index.html.ep b/templates/changes/index.html.ep
new file mode 100644 (file)
index 0000000..84d3113
--- /dev/null
@@ -0,0 +1,2 @@
+% layout 'default';
+<h2><%= $message %></h2>