post_reorder 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/plugins/post_reorder/noty/jquery.noty.js +502 -0
- data/app/assets/javascripts/plugins/post_reorder/noty/layouts/topCenter.js +41 -0
- data/app/assets/javascripts/plugins/post_reorder/noty/layouts/topLeft.js +43 -0
- data/app/assets/javascripts/plugins/post_reorder/noty/layouts/topRight.js +43 -0
- data/app/assets/javascripts/plugins/post_reorder/noty/themes/default.js +155 -0
- data/app/assets/javascripts/plugins/post_reorder/post_reorder.js +69 -0
- data/app/assets/javascripts/plugins/post_reorder/reorder.js +5 -0
- data/app/assets/stylesheets/plugins/post_reorder/reorder.css +6 -0
- data/app/controllers/plugins/post_reorder/admin_controller.rb +35 -0
- data/app/controllers/plugins/post_reorder/front_controller.rb +14 -0
- data/app/helpers/plugins/post_reorder/main_helper.rb +22 -0
- data/app/helpers/plugins/post_reorder/post_reorder_helper.rb +57 -0
- data/app/models/plugins/post_reorder/post_reorder.rb +12 -0
- data/app/views/plugins/post_reorder/admin/settings.html.erb +37 -0
- data/app/views/plugins/post_reorder/front/index.html.erb +1 -0
- data/app/views/plugins/post_reorder/layouts/readme.txt +2 -0
- data/config/camaleon_plugin.json +30 -0
- data/config/locales/translation.yml +16 -0
- data/config/routes.rb +12 -0
- data/lib/post_reorder.rb +4 -0
- data/lib/post_reorder/engine.rb +4 -0
- data/lib/post_reorder/version.rb +3 -0
- data/lib/tasks/post_reorder_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/integration/navigation_test.rb +8 -0
- data/test/post_reorder_test.rb +7 -0
- data/test/test_helper.rb +20 -0
- metadata +171 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
(function($) {
|
2
|
+
|
3
|
+
$.noty.layouts.topCenter = {
|
4
|
+
name : 'topCenter',
|
5
|
+
options : { // overrides options
|
6
|
+
|
7
|
+
},
|
8
|
+
container: {
|
9
|
+
object : '<ul id="noty_topCenter_layout_container" />',
|
10
|
+
selector: 'ul#noty_topCenter_layout_container',
|
11
|
+
style : function() {
|
12
|
+
$(this).css({
|
13
|
+
top : 20,
|
14
|
+
left : 0,
|
15
|
+
position : 'fixed',
|
16
|
+
width : '310px',
|
17
|
+
height : 'auto',
|
18
|
+
margin : 0,
|
19
|
+
padding : 0,
|
20
|
+
listStyleType: 'none',
|
21
|
+
zIndex : 10000000
|
22
|
+
});
|
23
|
+
|
24
|
+
$(this).css({
|
25
|
+
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
|
26
|
+
});
|
27
|
+
}
|
28
|
+
},
|
29
|
+
parent : {
|
30
|
+
object : '<li />',
|
31
|
+
selector: 'li',
|
32
|
+
css : {}
|
33
|
+
},
|
34
|
+
css : {
|
35
|
+
display: 'none',
|
36
|
+
width : '310px'
|
37
|
+
},
|
38
|
+
addClass : ''
|
39
|
+
};
|
40
|
+
|
41
|
+
})(jQuery);
|
@@ -0,0 +1,43 @@
|
|
1
|
+
(function($) {
|
2
|
+
|
3
|
+
$.noty.layouts.topLeft = {
|
4
|
+
name : 'topLeft',
|
5
|
+
options : { // overrides options
|
6
|
+
|
7
|
+
},
|
8
|
+
container: {
|
9
|
+
object : '<ul id="noty_topLeft_layout_container" />',
|
10
|
+
selector: 'ul#noty_topLeft_layout_container',
|
11
|
+
style : function() {
|
12
|
+
$(this).css({
|
13
|
+
top : 20,
|
14
|
+
left : 20,
|
15
|
+
position : 'fixed',
|
16
|
+
width : '310px',
|
17
|
+
height : 'auto',
|
18
|
+
margin : 0,
|
19
|
+
padding : 0,
|
20
|
+
listStyleType: 'none',
|
21
|
+
zIndex : 10000000
|
22
|
+
});
|
23
|
+
|
24
|
+
if(window.innerWidth < 600) {
|
25
|
+
$(this).css({
|
26
|
+
left: 5
|
27
|
+
});
|
28
|
+
}
|
29
|
+
}
|
30
|
+
},
|
31
|
+
parent : {
|
32
|
+
object : '<li />',
|
33
|
+
selector: 'li',
|
34
|
+
css : {}
|
35
|
+
},
|
36
|
+
css : {
|
37
|
+
display: 'none',
|
38
|
+
width : '310px'
|
39
|
+
},
|
40
|
+
addClass : ''
|
41
|
+
};
|
42
|
+
|
43
|
+
})(jQuery);
|
@@ -0,0 +1,43 @@
|
|
1
|
+
(function($) {
|
2
|
+
|
3
|
+
$.noty.layouts.topRight = {
|
4
|
+
name : 'topRight',
|
5
|
+
options : { // overrides options
|
6
|
+
|
7
|
+
},
|
8
|
+
container: {
|
9
|
+
object : '<ul id="noty_topRight_layout_container" />',
|
10
|
+
selector: 'ul#noty_topRight_layout_container',
|
11
|
+
style : function() {
|
12
|
+
$(this).css({
|
13
|
+
top : 20,
|
14
|
+
right : 20,
|
15
|
+
position : 'fixed',
|
16
|
+
width : '310px',
|
17
|
+
height : 'auto',
|
18
|
+
margin : 0,
|
19
|
+
padding : 0,
|
20
|
+
listStyleType: 'none',
|
21
|
+
zIndex : 10000000
|
22
|
+
});
|
23
|
+
|
24
|
+
if(window.innerWidth < 600) {
|
25
|
+
$(this).css({
|
26
|
+
right: 5
|
27
|
+
});
|
28
|
+
}
|
29
|
+
}
|
30
|
+
},
|
31
|
+
parent : {
|
32
|
+
object : '<li />',
|
33
|
+
selector: 'li',
|
34
|
+
css : {}
|
35
|
+
},
|
36
|
+
css : {
|
37
|
+
display: 'none',
|
38
|
+
width : '310px'
|
39
|
+
},
|
40
|
+
addClass : ''
|
41
|
+
};
|
42
|
+
|
43
|
+
})(jQuery);
|
@@ -0,0 +1,155 @@
|
|
1
|
+
;(function($) {
|
2
|
+
|
3
|
+
$.noty.themes.defaultTheme = {
|
4
|
+
name: 'defaultTheme',
|
5
|
+
helpers: {
|
6
|
+
borderFix: function() {
|
7
|
+
if (this.options.dismissQueue) {
|
8
|
+
var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
|
9
|
+
switch (this.options.layout.name) {
|
10
|
+
case 'top':
|
11
|
+
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
12
|
+
$(selector).last().css({borderRadius: '0px 0px 3px 3px'}); break;
|
13
|
+
case 'topCenter': case 'topLeft': case 'topRight':
|
14
|
+
case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
|
15
|
+
case 'center': case 'centerLeft': case 'centerRight': case 'inline':
|
16
|
+
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
17
|
+
$(selector).first().css({'border-top-left-radius': '3px', 'border-top-right-radius': '3px'});
|
18
|
+
$(selector).last().css({'border-bottom-left-radius': '3px', 'border-bottom-right-radius': '3px'}); break;
|
19
|
+
case 'bottom':
|
20
|
+
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
21
|
+
$(selector).first().css({borderRadius: '3px 3px 0px 0px'}); break;
|
22
|
+
default: break;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
},
|
27
|
+
modal: {
|
28
|
+
css: {
|
29
|
+
position: 'fixed',
|
30
|
+
width: '100%',
|
31
|
+
height: '100%',
|
32
|
+
backgroundColor: '#000',
|
33
|
+
zIndex: 10000,
|
34
|
+
opacity: 0.6,
|
35
|
+
display: 'none',
|
36
|
+
left: 0,
|
37
|
+
top: 0
|
38
|
+
}
|
39
|
+
},
|
40
|
+
style: function() {
|
41
|
+
|
42
|
+
this.$bar.css({
|
43
|
+
overflow: 'hidden',
|
44
|
+
background: "#000000"
|
45
|
+
});
|
46
|
+
|
47
|
+
this.$message.css({
|
48
|
+
fontSize: '11px',
|
49
|
+
lineHeight: '14px',
|
50
|
+
textAlign: 'center',
|
51
|
+
padding: '8px 10px 9px',
|
52
|
+
width: 'auto',
|
53
|
+
position: 'relative'
|
54
|
+
});
|
55
|
+
|
56
|
+
this.$closeButton.css({
|
57
|
+
position: 'absolute',
|
58
|
+
top: 4, right: 4,
|
59
|
+
width: 10, height: 10,
|
60
|
+
background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMBy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bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAATpJREFUeNoszrFqVFEUheG19zlz7sQ7ijMQBAvfYBqbpJCoZSAQbOwEE1IHGytbLQUJ8SUktW8gCCFJMSGSNxCmFBJO7j5rpXD6n5/P5vM53H3b3T9LOiB5AQDuDjM7BnA7DMPHDGBH0nuSzwHsRcRVRNRSysuU0i6AOwA/02w2+9Fae00SEbEh6SGAR5K+k3zWWptKepCm0+kpyRoRGyRBcpPkDsn1iEBr7drdP2VJZyQXERGSPpiZAViTBACXKaV9kqd5uVzCzO5KKb/d/UZSDwD/eyxqree1VqSu6zKAF2Z2RPJJaw0rAkjOJT0m+SuT/AbgDcmnkmBmfwAsJL1dXQ8lWY6IGwB1ZbrOOb8zs8thGP4COFwx/mE8Ho9Go9ErMzvJOW/1fY/JZIJSypqZfXX3L13X9fcDAKJct1sx3OiuAAAAAElFTkSuQmCC)",
|
61
|
+
display: 'none',
|
62
|
+
cursor: 'pointer'
|
63
|
+
});
|
64
|
+
|
65
|
+
this.$buttons.css({
|
66
|
+
padding: 5,
|
67
|
+
textAlign: 'right',
|
68
|
+
borderTop: '0px',
|
69
|
+
backgroundColor: '#333333'
|
70
|
+
});
|
71
|
+
|
72
|
+
this.$buttons.find('button').css({
|
73
|
+
marginLeft: 5
|
74
|
+
});
|
75
|
+
|
76
|
+
this.$buttons.find('button:first').css({
|
77
|
+
marginLeft: 0
|
78
|
+
});
|
79
|
+
|
80
|
+
this.$bar.bind({
|
81
|
+
mouseenter: function() { $(this).find('.noty_close').stop().fadeTo('normal',1); },
|
82
|
+
mouseleave: function() { $(this).find('.noty_close').stop().fadeTo('normal',0); }
|
83
|
+
});
|
84
|
+
|
85
|
+
switch (this.options.layout.name) {
|
86
|
+
case 'top':
|
87
|
+
this.$bar.css({
|
88
|
+
borderRadius: '0px 0px 3px 3px',
|
89
|
+
borderBottom: '2px solid #eee',
|
90
|
+
borderLeft: '2px solid #eee',
|
91
|
+
borderRight: '2px solid #eee',
|
92
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.2)"
|
93
|
+
});
|
94
|
+
break;
|
95
|
+
case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
|
96
|
+
this.$bar.css({
|
97
|
+
borderRadius: '3px',
|
98
|
+
border: '1px solid #eee',
|
99
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.2)"
|
100
|
+
});
|
101
|
+
this.$message.css({fontSize: '11px', textAlign: 'center'});
|
102
|
+
break;
|
103
|
+
case 'topLeft': case 'topRight':
|
104
|
+
case 'bottomLeft': case 'bottomRight':
|
105
|
+
case 'centerLeft': case 'centerRight':
|
106
|
+
this.$bar.css({
|
107
|
+
borderRadius: '3px',
|
108
|
+
border: '1px solid #eee',
|
109
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.2)"
|
110
|
+
});
|
111
|
+
this.$message.css({fontSize: '11px', textAlign: 'left'});
|
112
|
+
break;
|
113
|
+
case 'bottom':
|
114
|
+
this.$bar.css({
|
115
|
+
borderRadius: '3px 3px 0px 0px',
|
116
|
+
borderTop: '2px solid #eee',
|
117
|
+
borderLeft: '2px solid #eee',
|
118
|
+
borderRight: '2px solid #eee',
|
119
|
+
boxShadow: "0 -1px 2px rgba(0, 0, 0, 0.2)"
|
120
|
+
});
|
121
|
+
break;
|
122
|
+
default:
|
123
|
+
this.$bar.css({
|
124
|
+
border: '2px solid #eee',
|
125
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.2)"
|
126
|
+
});
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
|
130
|
+
switch (this.options.type) {
|
131
|
+
case 'alert': case 'notification':
|
132
|
+
this.$bar.css({backgroundColor: '#333', borderColor: '#333', color: '#FFF', opacity: 1}); break;
|
133
|
+
case 'warning':
|
134
|
+
this.$bar.css({backgroundColor: '#FEA223', borderColor: '#FEA223', color: '#FFF', opacity: 1});
|
135
|
+
this.$buttons.css({borderTop: '1px solid #FEA223'}); break;
|
136
|
+
case 'error':
|
137
|
+
this.$bar.css({backgroundColor: '#B64645', borderColor: '#B64645', color: '#FFF', opacity: 1});
|
138
|
+
this.$buttons.css({borderTop: '1px solid #B64645'}); break;
|
139
|
+
case 'information':
|
140
|
+
this.$bar.css({backgroundColor: '#3FBAE4', borderColor: '#3FBAE4', color: '#FFF', opacity: 1});
|
141
|
+
this.$buttons.css({borderTop: '1px solid #3FBAE4'}); break;
|
142
|
+
case 'success':
|
143
|
+
this.$bar.css({backgroundColor: '#95B75D', borderColor: '#95B75D', color: '#FFF', opacity: 1});
|
144
|
+
this.$buttons.css({borderTop: '1px solid #95B75D'});break;
|
145
|
+
default:
|
146
|
+
this.$bar.css({backgroundColor: '#333', borderColor: '#333', color: '#FFF', opacity: 1}); break;
|
147
|
+
}
|
148
|
+
},
|
149
|
+
callback: {
|
150
|
+
onShow: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); },
|
151
|
+
onClose: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); }
|
152
|
+
}
|
153
|
+
};
|
154
|
+
|
155
|
+
})(jQuery);
|
@@ -0,0 +1,69 @@
|
|
1
|
+
(function($){
|
2
|
+
$.fn.reorder = function (options){
|
3
|
+
var default_options = {url: "", table: ".table"};
|
4
|
+
options = $.extend(default_options, options || {});
|
5
|
+
|
6
|
+
var th_data = false;
|
7
|
+
|
8
|
+
$(options.table+' thead tr').each(function(i, el) {
|
9
|
+
|
10
|
+
th = $(this).find('th').attr('data-sortable');
|
11
|
+
|
12
|
+
if(typeof th === "undefined"){
|
13
|
+
th_data = true
|
14
|
+
}else{
|
15
|
+
th_data = false
|
16
|
+
}
|
17
|
+
|
18
|
+
});
|
19
|
+
|
20
|
+
if(th_data){
|
21
|
+
th_new = '<th class="center" data-sortable="0"></th>';
|
22
|
+
$(options.table+' thead tr').prepend(th_new);
|
23
|
+
|
24
|
+
$(options.table+' tbody tr').each(function(i, el) {
|
25
|
+
id = $(this).attr('data-id');
|
26
|
+
|
27
|
+
td_new = '<td>'
|
28
|
+
+'<div class="moved" style="cursor: all-scroll">'
|
29
|
+
+'<i class="fa fa-arrows"></i>'
|
30
|
+
+'<input type="hidden" name="values[]" value="'+id+'" />'
|
31
|
+
+'</div>'
|
32
|
+
'</td>';
|
33
|
+
|
34
|
+
$(this).prepend(td_new);
|
35
|
+
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
$( options.table+" tbody" ).sortable({
|
41
|
+
axis: "y",
|
42
|
+
placeholder: "ui-state-highlight",
|
43
|
+
handle: ".moved",
|
44
|
+
//items: "tr:not(.sortable)",
|
45
|
+
items: "tr.sortable",
|
46
|
+
start: function(event, ui) {
|
47
|
+
ui.item.startPos = ui.item.index();
|
48
|
+
|
49
|
+
},
|
50
|
+
stop: function( event, ui ) {
|
51
|
+
$.post(options.url, $(options.table+" input" ).serialize(), function(){
|
52
|
+
if(ui.item.startPos != ui.item.index()){
|
53
|
+
var $not = noty({text: 'Sorted successfully!', layout: 'topRight', type: 'success'});
|
54
|
+
setTimeout(function(){
|
55
|
+
$not.close();
|
56
|
+
},2000);
|
57
|
+
}
|
58
|
+
});
|
59
|
+
},
|
60
|
+
change: function(event, ui) {
|
61
|
+
console.log("New position: " + ui.placeholder.index());
|
62
|
+
|
63
|
+
}
|
64
|
+
});
|
65
|
+
|
66
|
+
$( options.table+" tbody" ).disableSelection();
|
67
|
+
};
|
68
|
+
|
69
|
+
})(jQuery);
|
@@ -0,0 +1,35 @@
|
|
1
|
+
=begin
|
2
|
+
Camaleon CMS is a content management system
|
3
|
+
Copyright (C) 2015 by Owen Peredo Diaz
|
4
|
+
Email: owenperedo@gmail.com
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
6
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
7
|
+
See the GNU Affero General Public License (GPLv3) for more details.
|
8
|
+
=end
|
9
|
+
class Plugins::PostReorder::AdminController < Apps::PluginsAdminController
|
10
|
+
|
11
|
+
# This updates the position of the elements in the database.
|
12
|
+
def reorder_posts
|
13
|
+
if params[:values].present?
|
14
|
+
params[:values].each_with_index do |value,index |
|
15
|
+
post = current_site.posts.find(value)
|
16
|
+
post.update_column("post_order", index)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
render inline: "correct"
|
20
|
+
end
|
21
|
+
|
22
|
+
# show plugin settings.
|
23
|
+
def settings
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
# This saves the settings plugin.
|
28
|
+
def save_settings
|
29
|
+
@plugin = current_site.plugins.find_by_slug("post_reorder")
|
30
|
+
@plugin.set_meta("_reorder_objects", params[:object] || {})
|
31
|
+
flash[:notice] = "#{t('plugin.post_reorder.updated_changes')}"
|
32
|
+
|
33
|
+
redirect_to admin_plugins_path
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
=begin
|
2
|
+
Camaleon CMS is a content management system
|
3
|
+
Copyright (C) 2015 by Owen Peredo Diaz
|
4
|
+
Email: owenperedo@gmail.com
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
6
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
7
|
+
See the GNU Affero General Public License (GPLv3) for more details.
|
8
|
+
=end
|
9
|
+
class Plugins::PostReorder::FrontController < Apps::PluginsFrontController
|
10
|
+
|
11
|
+
def index
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Plugins::PostReorder::MainHelper
|
2
|
+
def self.included(klass)
|
3
|
+
# klass.helper_method [:my_helper_method] rescue "" # here your methods accessible from views
|
4
|
+
end
|
5
|
+
|
6
|
+
# here all actions on going to active
|
7
|
+
# you can run sql commands like this:
|
8
|
+
# results = ActiveRecord::Base.connection.execute(query);
|
9
|
+
# plugin: plugin model
|
10
|
+
def post_reorder_on_active(plugin)
|
11
|
+
end
|
12
|
+
|
13
|
+
# here all actions on going to inactive
|
14
|
+
# plugin: plugin model
|
15
|
+
def post_reorder_on_inactive(plugin)
|
16
|
+
end
|
17
|
+
|
18
|
+
# here all actions to upgrade for a new version
|
19
|
+
# plugin: plugin model
|
20
|
+
def post_reorder_on_upgrade(plugin)
|
21
|
+
end
|
22
|
+
end
|