Skip to content

Commit

Permalink
fix some spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Jun 29, 2011
1 parent 0745b1d commit f982fd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 10 additions & 10 deletions lib/Dwimmer.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ our $VERSION = '0.01';


get '/' => sub { get '/' => sub {
my $filename = config->{dwimmer}{json}; my $filename = config->{dwimmer}{json};
my $json = -e $filename ? read_file $filename : '{}'; my $json = -e $filename ? read_file $filename : '{}';
my $data = from_json $json; my $data = from_json $json;
template 'index', {data => $data}; template 'index', {data => $data};
}; };


Expand All @@ -19,16 +19,16 @@ get '/page' => sub {


post '/page' => sub { post '/page' => sub {
my $filename = config->{dwimmer}{json}; my $filename = config->{dwimmer}{json};
my $json = -e $filename ? read_file $filename : '{}'; my $json = -e $filename ? read_file $filename : '{}';
my $data = from_json $json; my $data = from_json $json;
my $now = time; my $now = time;
$data->{$now} = { $data->{$now} = {
title => params->{title}, title => params->{title},
text => params->{text}, text => params->{text},
}; };


write_file $filename, to_json($data); write_file $filename, to_json($data);
redirect '/'; redirect '/';
}; };


true; true;
1 change: 0 additions & 1 deletion views/index.tt
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,5 @@
Hi Hi
<a href="/page">add a new entry</a> <a href="/page">add a new entry</a>
<hr />


<% FOR e IN data.keys.sort %> <% FOR e IN data.keys.sort %>
<hr /> <hr />
Expand Down

0 comments on commit f982fd1

Please sign in to comment.