1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
- js = "$('#cancel_#{model.id}').cancelEdit({id: '#{model.id}', mode: 'show'});\n "
- js += "$('#save_#{model.id}').saveModel({id: '#{model.id}', mode: 'show'});\n "
:javascript
$(function() {
#{js}
});
%form{:name => "form", :action => url_for("/model/#{model.id}"), :method => "post", :enctype => "multipart/form-data" }
%input{:type => 'text', :name => 'name', :id => "model_#{model.id}_name", :class => 'input_model_name', :size => '40', :value => model.name}
%input{:type => 'hidden', :name => 'id', :id => 'id', :value => model.id}
%input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
%input{:type => "submit", :value => "Save", :id => "save_#{model.id}", :class => "edit_button_h2"}
%span{:class => "edit_button_h2"}
%a{:href => "#", :id => "cancel_#{model.id}"} Cancel
%div{:id => "model_#{model.id}_policy_edit"}
- if is_authorized(model.web_uri, "PUT")
- js = "$('#edit_#{model.id}').editPolicy({id: '#{model.id}', mode: 'edit'});\n "
:javascript
$(function() {
#{js}
});
%span{:class => "manage_button"}
[
%a{:href => url_for("/model/#{model.id}/name?mode=manage"), :id => "edit_#{model.id}"} protect data
]
|