<%args>
$id => undef
$object_type
$mask_field => ""
$mask_val => ""
$list_path
</%args>
<%init>
my $record_class = Jifty->app_class("Model", $object_type);
my $record = $record_class->new();
$record->load($id);
my $update = Jifty->web->new_action(
    class   => "Update".$object_type,
    moniker => "update-" . Jifty->web->serial,
    record  => $record
);
</%init>
<div class="jifty_admin update item inline <%$object_type%>">
<% Jifty->web->form->start %>
<div class="editlink">
  <% Jifty->web->link(
      label   => _('Save'),
      onclick => [
          { submit => $update },
          {   replace_with => $list_path.'view',
              args         => { object_type => $object_type, id => $id, list_path => $list_path }
          }
      ]
      ) %>

  <% Jifty->web->link(
      label     => _('Cancel'),
      onclick   => {
          replace_with => $list_path.'view',
          args         => { object_type => $object_type, id => $id, list_path => $list_path }
        },
      as_button => 1
  ) %>

</div>

% if ($mask_field) {
<% $update->hidden($mask_field, $mask_val) %>
% }
% foreach my $argument ($update->argument_names) {
%  if ( $argument ne $mask_field ) {
<%$update->form_field($argument)%>
%  }
%}

<hr />
<% Jifty->web->form->end %>
</div>

