|
1 | 1 | <%
|
2 | 2 | unless (hide_submit ||= false)
|
3 | 3 | submit_button_text ||= t('.save')
|
4 |
| - submit_button_id ||= "submit_button" |
| 4 | + submit_button_id ||= 'submit_button' |
5 | 5 | submit_button_title ||= nil
|
| 6 | + submit_button_data ||= { disable_with: false } |
6 | 7 | end
|
7 | 8 |
|
8 | 9 | hide_cancel = from_dialog? unless defined?(hide_cancel).presence
|
|
12 | 13 | unless defined?(cancel_title)
|
13 | 14 | cancel_title = t('.cancel_lose_changes')
|
14 | 15 | end
|
15 |
| - cancel_button_id ||= "cancel_button" |
16 |
| - cancel_url ||= (((back = url_for(:back)).include?('javascript') or action_name =~ /^(create|update)$/) ? refinery.send(Refinery.route_for_model(f.object.class, :plural => true)) : back) |
| 16 | + cancel_button_id ||= 'cancel_button' |
| 17 | + cancel_url ||= (((back = url_for(:back)).include?('javascript') or action_name =~ /^(create|update)$/) ? refinery.send(Refinery.route_for_model(f.object.class, plural: true)) : back) |
17 | 18 | end
|
18 | 19 |
|
19 | 20 | continue_editing = defined?(continue_editing) ? continue_editing : (f.object.present? and f.object.persisted?)
|
|
28 | 29 | delete_button_text ||= t('.delete')
|
29 | 30 | delete_title ||= nil
|
30 | 31 | delete_confirmation ||= nil
|
31 |
| - delete_button_id ||= "delete_button" |
| 32 | + delete_button_id ||= 'delete_button' |
32 | 33 | # we have to use eval rather than refinery.send because this url may not exist for HTTP GET
|
33 | 34 | delete_url ||= eval("refinery.#{Refinery.route_for_model(f.object.class)}(#{f.object.id})")
|
34 | 35 | end
|
|
38 | 39 | <input type='hidden' name='dialog' value='true' />
|
39 | 40 | <% end %>
|
40 | 41 |
|
41 |
| -<div class='form-actions<%= ' form-actions-dialog' if from_dialog? %>'> |
42 |
| - <div class='form-actions-left'> |
| 42 | +<%= content_tag :div, class: "form-actions#{' form-actions-dialog' if from_dialog?}" do %> |
| 43 | + <%= content_tag :div, class: 'form-actions-left' do %> |
43 | 44 | <%= submit_tag submit_button_text,
|
44 |
| - :id => submit_button_id, |
45 |
| - :name => nil, |
46 |
| - :class => "wymupdate button", |
47 |
| - :tooltip => submit_button_title unless hide_submit %> |
| 45 | + id: submit_button_id, |
| 46 | + name: nil, |
| 47 | + class: 'wymupdate button', |
| 48 | + data: submit_button_data, |
| 49 | + tooltip: submit_button_title unless hide_submit %> |
48 | 50 |
|
49 |
| - <%= render '/refinery/admin/continue_editing', :f => f if continue_editing -%> |
| 51 | + <%= render '/refinery/admin/continue_editing', f: f if continue_editing -%> |
50 | 52 | <%= hidden_field_tag :continue_editing, false if continue_editing %>
|
51 | 53 |
|
52 | 54 | <%= local_assigns[:before_cancel_button] -%>
|
53 | 55 |
|
54 |
| - <%= link_to(cancel_button_text, cancel_url, |
55 |
| - :title => cancel_title, |
56 |
| - :id => cancel_button_id, |
57 |
| - :class => "close_dialog button") unless hide_cancel %> |
| 56 | + <%= link_to cancel_button_text, cancel_url, |
| 57 | + title: cancel_title, |
| 58 | + id: cancel_button_id, |
| 59 | + class: 'close_dialog button' unless hide_cancel %> |
58 | 60 |
|
59 | 61 | <%= local_assigns[:after_cancel_button] -%>
|
60 |
| - <i id='spinner' class='loading_icon hidden_icon'></i> |
61 |
| - </div> |
62 |
| - <div class='form-actions-right'> |
| 62 | + |
| 63 | + <%= content_tag :i, nil, id: 'spinner', class: 'loading_icon hidden_icon' %> |
| 64 | + <% end %> |
| 65 | + |
| 66 | + <%= content_tag :div, class: 'form-actions-right' do %> |
63 | 67 | <%= local_assigns[:before_delete_button] -%>
|
64 |
| - <%= link_to(delete_button_text, delete_url, |
65 |
| - :title => delete_title, |
66 |
| - :id => delete_button_id, |
67 |
| - :method => :delete, |
68 |
| - :data => { |
69 |
| - :confirm => delete_confirmation |
| 68 | + |
| 69 | + <%= link_to delete_button_text, delete_url, |
| 70 | + title: delete_title, |
| 71 | + id: delete_button_id, |
| 72 | + method: :delete, |
| 73 | + data: { |
| 74 | + confirm: delete_confirmation |
70 | 75 | },
|
71 |
| - :class => "button confirm-delete") unless hide_delete %> |
| 76 | + class: 'button confirm-delete' unless hide_delete %> |
| 77 | + |
72 | 78 | <%= local_assigns[:after_delete_button] -%>
|
73 |
| - </div> |
74 |
| -</div> |
| 79 | + <% end %> |
| 80 | +<% end %> |
0 commit comments