+
<table border=1>
<tr>
% foreach my $n ( @$columns ) {
<th>
% if ( session('order') ne $n ) {
-<a href="<%= url_for( action => 'order' )->query( order => $n ) %>"><%= $n %></a>
+<a href="<%= url_for( action => 'order' )->query( order => $n, sort => 'a' ) %>"><%= $n %></a>
% } else {
<a href="<%= url_for( action => 'order' )->query( order => $n, sort => session('sort') eq 'a' ? 'd' : 'a' ) %>"><%= $n %></a>
<%== session('sort') eq 'a' ? '↑' : '↓' %>
</tr>
% foreach my $row ( @$sorted ) {
-<tr>
+<tr title="<%= $row->{_row_id} %>">
% foreach my $col ( @$columns ) {
<td<%= $numeric->{$col} ? ' class=numeric' : '' %>>
% if ( ref $row->{$col} eq 'ARRAY' ) {
% } # sorted
</table>
+
+<form id=eval>
+% my $rows = scalar split(/\n/,$code);
+<textarea name=code rows=<%= $rows + 1 %>>
+<%= $code %>
+</textarea>
+<input name=test type=submit value="Test code">
+<input name=commit type=submit value="Commit changes">
+</form>
+
+<script type="text/javascript" src="/edit_table.js"></script>
+<script type="text/javascript" src="/js/jquery.textarea_grow.js"></script>
+<script type="text/javascript">
+
+$(document).ready( function(){
+ $('form#eval textarea').textarea_grow();
+});
+
+</script>