1 <form id="permission-template-form" method="post" action="<%= ApplicationController.root_context -%>/permission_templates/<%= form_action %>">
2 <% if form_action == 'edit' %>
3 <input type="hidden" name="id" value="<%= @permission_template.id -%>">
6 <div class="modal-head">
7 <h2><%= message("permission_template.#{message_title}") -%></h2>
9 <div class="modal-body">
10 <div id="permission-template-error" class="permission-template error errors" style="display:none;" />
11 <div class="modal-field">
12 <label for="name"><%= h message('name') -%> <em class="mandatory">*</em></label>
13 <input id="name" name="name" type="text" size="50" maxlength="256" value="<%= @permission_template ? @permission_template.name : '' -%>" autofocus="autofocus"/>
15 <div class="modal-field">
16 <label for="description"><%= h message('description') -%></label>
17 <input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= @permission_template ? @permission_template.description : '' -%>"/>
20 <div class="modal-foot">
21 <input type="submit" value="<%= h message("permission_template.#{message_submit}") -%>" id="submit-permission-template-<%= form_action %>"/>
22 <a href="#" onclick="return closeModalWindow()" id="cancel-<%= form_action %>-template"><%= h message('cancel') -%></a>
28 $j("#permission-template-form").modalForm({
29 success: function (data) {
30 window.location.reload();
32 error: function (xhr, textStatus, errorThrown) {
33 var htmlClass = 'permission-template';
34 $j('input[id^="submit-permission-template"]').removeAttr('disabled');
35 $j('.' + htmlClass + '.errors').show();
36 $j('.' + htmlClass + '.errors').html(xhr.responseText);