we really need separate on_path for apply
[MojoFacets.git] / templates / changes / index.html.ep
index 612e4b4..63deb8b 100644 (file)
@@ -1,14 +1,12 @@
 % layout 'ui';
 
-
 % my $dump = param('dump');
-% my $apply_on_path = param('apply_on_path');
 
 <form method=post>
-<input type=submit value="Apply"> on
-<select name=apply_on_path>
+<input name=apply type=submit value="Apply"> on
+<select name=on_path>
 % foreach my $p ( @$loaded ) {
-<option<%= $p eq $apply_on_path ? ' selected' : '' %>><%= $p %></option>
+<option<%= $p eq $on_path ? ' selected' : '' %>><%= $p %></option>
 % }
 </select>
 
@@ -16,7 +14,7 @@
 
 <label><input type=checkbox name=dump <%= $dump ? 'checked' : '' %>>dump</label>
 
-% if ( $apply_on_path ) {
+% if ( $on_path ) {
 <ul id=status>
 %  foreach my $status ( keys %$stats ) {
 <li><label>
 %  }
 </ul>
 
-%  if ( ! param('commit') ) {
+%  if ( ! param('commit') && param('apply') ) {
 <input type=submit name=commit value="Commit changes">
-%  } else {
+%  } elsif ( param('commit') ) {
 <b>
-Changes commited to <a href="<%= url_for( controller => 'data', action => 'load' )->query( path => $apply_on_path ) %>"><%= $apply_on_path %></a>
+Changes commited to <a href="<%= url_for( controller => 'data', action => 'items' )->query( path => $on_path ) %>"><%= $on_path %></a>
 </b>
+<pre><%= dumper stash('commit_changed') %></pre>
 %  }
 
 % }