optimacms 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/optimacms/admin/templates_controller.rb +2 -1
- data/app/inputs/fake_input.rb +6 -0
- data/app/views/optimacms/admin/templates/_form.html.haml +17 -1
- data/app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml +0 -1
- data/config/locales/simple_form.en.yml +2 -1
- data/config/locales/simple_form.ru.yml +2 -1
- data/lib/optimacms/simple_form_extensions/button_components.rb +25 -0
- data/lib/optimacms/version.rb +1 -1
- data/spec/dummy/log/development.log +2834 -0
- data/spec/dummy/tmp/pids/server.pid +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9114c48f0dfd82c25b0880f4776a0e3c4c981d38
|
4
|
+
data.tar.gz: 82a92a7e9b7aeba9cc3fe132e306f532bf4021ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 515bd0a4c299478540e73272822535b3b948a175521925e76d2ba9cdb4481e1aae48f70c1103462d833fb0874906a89f04b7f27d2f6e2ca6d101c0df31e35a5b
|
7
|
+
data.tar.gz: 38b448846a0c87b39017afc88a7f7108cd0129d8b34224a722bc7e4fab71d5110b92850621afe94d8240d5842e6db6501f6bdb225f2b42742e33d79486160e42
|
@@ -119,7 +119,8 @@ module Optimacms
|
|
119
119
|
#@res = false
|
120
120
|
|
121
121
|
if @res
|
122
|
-
|
122
|
+
u = params[:continue]=="1" ? edit_template_path(@item) : url_list
|
123
|
+
redirect_to u, success: 'Successfully updated'
|
123
124
|
else
|
124
125
|
render :edit
|
125
126
|
end
|
@@ -5,6 +5,8 @@ File: #{@item.path}
|
|
5
5
|
= horizontal_simple_form_for @item, {:html => { :class => "form-horizontal", :role => "form" }}.merge((@modal==1 ? {remote: true}: {})) do |f|
|
6
6
|
= render 'optimacms/admin/shared/form_errors', :object=>@item
|
7
7
|
|
8
|
+
= f.input :continue, as: :fake, input_html: {value: "0"}
|
9
|
+
|
8
10
|
= f.input :parent_id, as: :hidden
|
9
11
|
|
10
12
|
= f.input :title, label: "Title"
|
@@ -24,4 +26,18 @@ File: #{@item.path}
|
|
24
26
|
|
25
27
|
|
26
28
|
|
27
|
-
|
29
|
+
-#= f.button :submit_cancel, 'Save', :cancel=>@url_back
|
30
|
+
= f.button :save_continue_cancel, 'Save', :cancel=>@url_back
|
31
|
+
|
32
|
+
|
33
|
+
:javascript
|
34
|
+
|
35
|
+
$( document ).ready(function() {
|
36
|
+
$('#mainform a.btn-save-continue').click(function(e){
|
37
|
+
e.preventDefault();
|
38
|
+
console.log("click");
|
39
|
+
var f = $(this).closest("form");
|
40
|
+
f.find("input[name='continue']").val("1");
|
41
|
+
f.submit();
|
42
|
+
});
|
43
|
+
});
|
@@ -24,6 +24,31 @@ module Optimacms
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
def save_continue_cancel(*args, &block)
|
28
|
+
template.content_tag :div, :class => "form-group" do
|
29
|
+
template.content_tag :div, :class => "col-sm-offset-1 col-sm-6" do
|
30
|
+
options = args.extract_options!
|
31
|
+
|
32
|
+
# class
|
33
|
+
options[:class] = [options[:class], 'btn', 'btn-primary', 'btn-lg'].compact
|
34
|
+
|
35
|
+
#
|
36
|
+
args << options
|
37
|
+
|
38
|
+
buttons = submit(*args, &block) + ' '.html_safe+
|
39
|
+
template.link_to(I18n.t('simple_form.buttons.save_continue'), '#', {class: options[:class]+['btn-save-continue']})
|
40
|
+
|
41
|
+
# with cancel link
|
42
|
+
if cancel = options.delete(:cancel)
|
43
|
+
(buttons+' '.html_safe + template.link_to(I18n.t('simple_form.buttons.cancel'), cancel)).html_safe
|
44
|
+
else
|
45
|
+
buttons.html_safe
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
27
52
|
end
|
28
53
|
|
29
54
|
SimpleForm::FormBuilder.send :include, ButtonComponents
|
data/lib/optimacms/version.rb
CHANGED