my_admin 0.0.12 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/README.md +13 -13
- data/app/assets/javascripts/my_admin/application.js +1 -1
- data/app/controllers/my_admin/configurations_controller.rb +1 -1
- data/app/controllers/my_admin/dashboards_controller.rb +1 -1
- data/app/controllers/my_admin/first_users_controller.rb +1 -1
- data/app/controllers/my_admin/models_controller.rb +8 -4
- data/app/controllers/my_admin/password_controller.rb +2 -2
- data/app/controllers/my_admin/recovers_controller.rb +2 -2
- data/app/controllers/my_admin/sessions_controller.rb +4 -4
- data/app/helpers/my_admin_field_helper.rb +30 -30
- data/app/helpers/my_admin_model_helper.rb +2 -2
- data/app/views/layouts/my_admin.html.erb +10 -1
- data/app/views/layouts/my_admin_off.html.erb +1 -1
- data/app/views/my_admin/_header.html.erb +2 -2
- data/app/views/my_admin/_header.html.erb.old +1 -1
- data/app/views/my_admin/fields/edit/type/date_between.html.erb +14 -0
- data/app/views/my_admin/fields/filter/type/boolean.html.erb +3 -3
- data/app/views/my_admin/fields/filter/type/integer_between.html.erb +14 -0
- data/app/views/my_admin/models/_actions.html.erb +15 -0
- data/app/views/my_admin/models/_actions_header.html.erb +3 -0
- data/app/views/my_admin/models/index.html.erb +2 -18
- data/app/views/my_admin/password/edit.html.erb +1 -1
- data/config/locales/pt.yml +1 -1
- data/config/routes.rb +2 -1
- data/{lib/generators/my_admin/install/templates/migrations/ckeditor_assets.rb → db/migrate/20151128132449_create_ckeditor_assets.rb} +2 -6
- data/{lib/generators/my_admin/install/templates/migrations/configurations.rb → db/migrate/20151128142449_create_my_admin_configurations.rb} +1 -7
- data/{lib/generators/my_admin/install/templates/migrations/group_permissions.rb → db/migrate/20151128152449_create_my_admin_group_permissions.rb} +2 -7
- data/{lib/generators/my_admin/install/templates/migrations/groups.rb → db/migrate/20151128162449_create_my_admin_groups.rb} +1 -5
- data/{lib/generators/my_admin/install/templates/migrations/locales.rb → db/migrate/20151128172449_create_my_admin_locales.rb} +2 -6
- data/{lib/generators/my_admin/install/templates/migrations/logs.rb → db/migrate/20151128182449_create_my_admin_logs.rb} +1 -5
- data/{lib/generators/my_admin/install/templates/migrations/permissions.rb → db/migrate/20151128192449_create_my_admin_permissions.rb} +1 -5
- data/{lib/generators/my_admin/install/templates/migrations/user_groups.rb → db/migrate/20151128202449_create_my_admin_user_groups.rb} +2 -7
- data/{lib/generators/my_admin/install/templates/migrations/users.rb → db/migrate/20151128212449_create_my_admin_users.rb} +1 -7
- data/lib/generators/my_admin/install/install_generator.rb +0 -38
- data/lib/my_admin/active_record.rb +28 -0
- data/lib/my_admin/engine.rb +12 -0
- data/lib/my_admin/version.rb +1 -1
- metadata +135 -110
- data/lib/my_admin/paperclip_processors/cropper.rb +0 -20
- data/lib/my_admin/paperclip_processors/rotator.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a4310aa37b7f6e047efd13b3d9002c99802b3f7d
|
4
|
+
data.tar.gz: c43f564825f78b5841c53c2d0467ea232da7a319
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7d71e2087d021a09fe50d2efa07746aef8e9fbaa9559b893ed097f0811e9a2ffa8b96dc491a717f909090fce0e9c8088eaea82103940f2b9d3de5fc73b42bf06
|
7
|
+
data.tar.gz: b47f76b8a7ae70178a080e09b20a201dc1ca1308f592bc090cc8f316bef05b387c2b4db2133d65e678cbf7cc565768d8777ddfffcd0ebf1fba8f55d7b0c144e8
|
data/README.md
CHANGED
@@ -376,27 +376,27 @@ No caso acima você alterará todos os campos que tiverem o nome ‘phone’ de
|
|
376
376
|
|
377
377
|
Porém se você desejar alterar os campos somente de uma grupo, siga a estrutura abaixo, com exemplo de que o grupo se chama “contatos”.
|
378
378
|
|
379
|
-
* /app/views/my_admin/contatos/fields/edit/phone.html.erb
|
380
|
-
* /app/views/my_admin/contatos/fields/phone.html.erb
|
381
|
-
* /app/views/my_admin/contatos/fields/filter/phone.html.erb
|
379
|
+
* /app/views/my_admin/applications/contatos/fields/edit/phone.html.erb
|
380
|
+
* /app/views/my_admin/applications/contatos/fields/phone.html.erb
|
381
|
+
* /app/views/my_admin/applications/contatos/fields/filter/phone.html.erb
|
382
382
|
|
383
383
|
O mesmo serve para criar ou editar um tipo de campo para um grupo.
|
384
384
|
|
385
|
-
* /app/views/my_admin/contatos/fields/edit/type/unidade.html
|
386
|
-
* /app/views/my_admin/contatos/fields/type/unidade.html
|
387
|
-
* /app/views/my_admin/contatos/fields/filter/type/unidade.html
|
385
|
+
* /app/views/my_admin/applications/contatos/fields/edit/type/unidade.html
|
386
|
+
* /app/views/my_admin/applications/contatos/fields/type/unidade.html
|
387
|
+
* /app/views/my_admin/applications/contatos/fields/filter/type/unidade.html
|
388
388
|
|
389
|
-
Ainda existe a possibilidade de customizar um campo de um modelo especifico. Veja o exemplo abaixo do modelo “User
|
389
|
+
Ainda existe a possibilidade de customizar um campo de um modelo especifico. Veja o exemplo abaixo do modelo “User“.
|
390
390
|
|
391
|
-
* /app/views/my_admin/
|
392
|
-
* /app/views/my_admin/
|
393
|
-
* /app/views/my_admin/
|
391
|
+
* /app/views/my_admin/models/users/fields/edit/phone.html.erb
|
392
|
+
* /app/views/my_admin/models/users/fields/phone.html.erb
|
393
|
+
* /app/views/my_admin/models/users/fields/filter/phone.html.erb
|
394
394
|
|
395
395
|
O mesmo para tipo de campo.
|
396
396
|
|
397
|
-
* /app/views/my_admin/
|
398
|
-
* /app/views/my_admin/
|
399
|
-
* /app/views/my_admin/
|
397
|
+
* /app/views/my_admin/models/users/fields/edit/type/unidade.html
|
398
|
+
* /app/views/my_admin/models/users/fields/type/unidade.html
|
399
|
+
* /app/views/my_admin/models/users/fields/filter/type/unidade.html
|
400
400
|
|
401
401
|
Obs.: A pasta do modelo deve ser o mesmo nome da tabela do modelo.
|
402
402
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
//
|
13
13
|
//= require jquery
|
14
14
|
//= require jquery_ujs
|
15
|
-
|
15
|
+
// require turbolinks
|
16
16
|
//= require ckeditor/init
|
17
17
|
//= require my_admin/plugins/nicescroll/jquery.nicescroll.min
|
18
18
|
//= require my_admin/plugins/validation/jquery.validate.min
|
@@ -11,7 +11,7 @@ class MyAdmin::FirstUsersController < MyAdmin::MyAdminController
|
|
11
11
|
if @user.save
|
12
12
|
my_admin_sign_in @user
|
13
13
|
flash[:notice] = I18n.t("my_admin.messages.user.created")
|
14
|
-
redirect_to send("#{admin_prefix}
|
14
|
+
redirect_to send("#{admin_prefix}_root_path")
|
15
15
|
else
|
16
16
|
render :new
|
17
17
|
end
|
@@ -20,6 +20,8 @@ class MyAdmin::ModelsController < MyAdmin::MyAdminController
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
@objects = @objects.my_admin_default_scope if @objects.respond_to? :my_admin_default_scope
|
24
|
+
|
23
25
|
headers = []
|
24
26
|
only = @model.my_admin.export_display
|
25
27
|
|
@@ -54,6 +56,7 @@ class MyAdmin::ModelsController < MyAdmin::MyAdminController
|
|
54
56
|
per_page = params[:per_page] || @model.my_admin.per_page
|
55
57
|
per_page = @model.my_admin.per_page if params[:per_page].to_i <= 0 rescue @model.my_admin.per_page
|
56
58
|
|
59
|
+
@objects = @objects.my_admin_default_scope if @objects.respond_to? :my_admin_default_scope
|
57
60
|
@objects = @objects.paginate(:per_page => per_page, :page => params[:page])
|
58
61
|
|
59
62
|
cache_my_admin_params
|
@@ -188,18 +191,19 @@ class MyAdmin::ModelsController < MyAdmin::MyAdminController
|
|
188
191
|
end
|
189
192
|
|
190
193
|
def get_model
|
191
|
-
|
192
|
-
@
|
194
|
+
position = admin_prefix.blank? ? 1 : 2
|
195
|
+
@application = MyAdmin::Application.find_by_url(request.url.split("?")[0].split(request.host_with_port).last.split("/")[position]) #(params[:application])
|
196
|
+
@model = @application.find_model_by_url(request.url.split("?")[0].split(request.host_with_port).last.split("/")[position + 1]) #(params[:model])
|
193
197
|
end
|
194
198
|
|
195
199
|
def add_breadcrumbs
|
196
|
-
breadcrumbs.add('my_admin_home', send("#{admin_prefix}
|
200
|
+
breadcrumbs.add('my_admin_home', send("#{admin_prefix}_root_path"))
|
197
201
|
breadcrumbs.add(@model.title_plural, (params[:action] == 'index') ? nil : model_link(@application, @model))
|
198
202
|
end
|
199
203
|
|
200
204
|
def verify_permission (permission)
|
201
205
|
unless @model.my_admin.can?(permission, my_admin_user)
|
202
|
-
redirect_to send("#{admin_prefix}
|
206
|
+
redirect_to send("#{admin_prefix}_root_path")
|
203
207
|
false
|
204
208
|
else
|
205
209
|
true
|
@@ -9,7 +9,7 @@ class MyAdmin::PasswordController < MyAdmin::MyAdminController
|
|
9
9
|
def update
|
10
10
|
@user = MyAdmin::User.find(my_admin_user.id)
|
11
11
|
if (@user.update_attributes(password_params))
|
12
|
-
redirect_to send("#{admin_prefix}
|
12
|
+
redirect_to send("#{admin_prefix}_root_path"), :flash => { :notice => I18n.t("my_admin.messages.user.password_changed") }
|
13
13
|
else
|
14
14
|
render :edit
|
15
15
|
end
|
@@ -18,7 +18,7 @@ class MyAdmin::PasswordController < MyAdmin::MyAdminController
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def add_breadcrumbs
|
21
|
-
breadcrumbs.add('my_admin_home', send("#{admin_prefix}
|
21
|
+
breadcrumbs.add('my_admin_home', send("#{admin_prefix}_root_path"))
|
22
22
|
breadcrumbs.add('change_password')
|
23
23
|
end
|
24
24
|
|
@@ -31,7 +31,7 @@ class MyAdmin::RecoversController < MyAdmin::MyAdminController
|
|
31
31
|
if (@user.update_attributes(recovers_params))
|
32
32
|
@user.update_attribute(:encrypted_recover, nil)
|
33
33
|
my_admin_sign_in @user
|
34
|
-
redirect_to send("#{admin_prefix}
|
34
|
+
redirect_to send("#{admin_prefix}_root_path"), :flash => { :notice => I18n.t("my_admin.messages.user.password_changed") }
|
35
35
|
else
|
36
36
|
render :show
|
37
37
|
end
|
@@ -50,7 +50,7 @@ class MyAdmin::RecoversController < MyAdmin::MyAdminController
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def verify_login
|
53
|
-
redirect_to send("#{admin_prefix}
|
53
|
+
redirect_to send("#{admin_prefix}_root_path") if my_admin_signed_in?
|
54
54
|
redirect_to send("unlock_#{admin_prefix}_sessions_path") if my_admin_locked?
|
55
55
|
end
|
56
56
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class MyAdmin::SessionsController < MyAdmin::MyAdminController
|
2
2
|
|
3
3
|
def new
|
4
|
-
redirect_to send("#{admin_prefix}
|
4
|
+
redirect_to send("#{admin_prefix}_root_path") if my_admin_signed_in?
|
5
5
|
redirect_to send("unlock_#{admin_prefix}_sessions_path") if my_admin_locked?
|
6
6
|
end
|
7
7
|
|
@@ -13,7 +13,7 @@ class MyAdmin::SessionsController < MyAdmin::MyAdminController
|
|
13
13
|
else
|
14
14
|
if user.is_active?
|
15
15
|
my_admin_sign_in user
|
16
|
-
redirect_to send("#{admin_prefix}
|
16
|
+
redirect_to send("#{admin_prefix}_root_path")
|
17
17
|
else
|
18
18
|
flash.now[:error] = I18n.t("activerecord.errors.my_admin.user.inactive_user")
|
19
19
|
render :new
|
@@ -32,7 +32,7 @@ class MyAdmin::SessionsController < MyAdmin::MyAdminController
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def unlock
|
35
|
-
redirect_to send("#{admin_prefix}
|
35
|
+
redirect_to send("#{admin_prefix}_root_path") if my_admin_signed_in?
|
36
36
|
redirect_to send("new_#{admin_prefix}_sessions_path") if !my_admin_locked?
|
37
37
|
end
|
38
38
|
|
@@ -44,7 +44,7 @@ class MyAdmin::SessionsController < MyAdmin::MyAdminController
|
|
44
44
|
else
|
45
45
|
if user.is_active?
|
46
46
|
my_admin_sign_in user
|
47
|
-
redirect_to send("#{admin_prefix}
|
47
|
+
redirect_to send("#{admin_prefix}_root_path")
|
48
48
|
else
|
49
49
|
flash.now[:error] = I18n.t("activerecord.errors.my_admin.user.inactive_user")
|
50
50
|
my_admin_sign_out
|
@@ -64,90 +64,90 @@ module MyAdminFieldHelper
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def edit_field_struct(application, model, field, object, form, show_label=true)
|
67
|
-
template = "my_admin/#{
|
68
|
-
template = "my_admin/#{application.key}/fields/edit/#{field}_struct" unless lookup_context.exists? template
|
67
|
+
template = "my_admin/models/#{model.model_tableize}/fields/edit/#{field}_struct"
|
68
|
+
template = "my_admin/applications/#{application.key}/fields/edit/#{field}_struct" unless lookup_context.exists? template
|
69
69
|
template = "my_admin/fields/edit/#{field}_struct" unless lookup_context.exists? template
|
70
70
|
|
71
71
|
object_type = field_type(application, model, field, object)
|
72
72
|
|
73
|
-
template = "my_admin/#{
|
74
|
-
template = "my_admin/#{application.key}/fields/edit/type/#{object_type}_struct" unless lookup_context.exists? template
|
73
|
+
template = "my_admin/models/#{model.model_tableize}/fields/edit/type/#{object_type}_struct" unless lookup_context.exists? template
|
74
|
+
template = "my_admin/applications/#{application.key}/fields/edit/type/#{object_type}_struct" unless lookup_context.exists? template
|
75
75
|
template = "my_admin/fields/edit/type/#{object_type}_struct" unless lookup_context.exists? template
|
76
76
|
|
77
|
-
template = "my_admin/#{
|
78
|
-
template = "my_admin/#{application.key}/fields/edit/type/default_struct" unless lookup_context.exists? template
|
77
|
+
template = "my_admin/models/#{model.model_tableize}/fields/edit/type/default_struct" unless lookup_context.exists? template
|
78
|
+
template = "my_admin/applications/#{application.key}/fields/edit/type/default_struct" unless lookup_context.exists? template
|
79
79
|
template = "my_admin/fields/edit/type/default_struct" unless lookup_context.exists? template
|
80
80
|
|
81
81
|
render :template => template, :locals => {:show_label => show_label, :application => application, :model => model, :field => field, :object => object, :form => form }
|
82
82
|
end
|
83
83
|
|
84
84
|
def field_content(application, model, field, object)
|
85
|
-
template = "my_admin/#{
|
86
|
-
template = "my_admin/#{application.key}/fields/#{field}" unless lookup_context.exists? template
|
85
|
+
template = "my_admin/models/#{model.model_tableize}/fields/#{field}"
|
86
|
+
template = "my_admin/applications/#{application.key}/fields/#{field}" unless lookup_context.exists? template
|
87
87
|
template = "my_admin/fields/#{field}" unless lookup_context.exists? template
|
88
88
|
|
89
89
|
object_type = field_type(application, model, field, object)
|
90
90
|
|
91
|
-
template = "my_admin/#{
|
92
|
-
template = "my_admin/#{application.key}/fields/type/#{object_type}" unless lookup_context.exists? template
|
91
|
+
template = "my_admin/models/#{model.model_tableize}/fields/type/#{object_type}" unless lookup_context.exists? template
|
92
|
+
template = "my_admin/applications/#{application.key}/fields/type/#{object_type}" unless lookup_context.exists? template
|
93
93
|
template = "my_admin/fields/type/#{object_type}" unless lookup_context.exists? template
|
94
94
|
|
95
|
-
template = "my_admin/#{
|
96
|
-
template = "my_admin/#{application.key}/fields/type/default" unless lookup_context.exists? template
|
95
|
+
template = "my_admin/models/#{model.model_tableize}/fields/type/default" unless lookup_context.exists? template
|
96
|
+
template = "my_admin/applications/#{application.key}/fields/type/default" unless lookup_context.exists? template
|
97
97
|
template = "my_admin/fields/type/default" unless lookup_context.exists? template
|
98
98
|
|
99
99
|
render :template => template, :locals => {:application => application, :model => model, :field => field, :object => object }
|
100
100
|
end
|
101
101
|
|
102
102
|
def edit_field_content(application, model, field, object, form)
|
103
|
-
template = "my_admin/#{
|
104
|
-
template = "my_admin/#{application.key}/fields/edit/#{field}" unless lookup_context.exists? template
|
103
|
+
template = "my_admin/models/#{model.model_tableize}/fields/edit/#{field}"
|
104
|
+
template = "my_admin/applications/#{application.key}/fields/edit/#{field}" unless lookup_context.exists? template
|
105
105
|
template = "my_admin/fields/edit/#{field}" unless lookup_context.exists? template
|
106
106
|
|
107
107
|
object_type = field_type(application, model, field, object)
|
108
108
|
|
109
|
-
template = "my_admin/#{
|
110
|
-
template = "my_admin/#{application.key}/fields/edit/type/#{object_type}" unless lookup_context.exists? template
|
109
|
+
template = "my_admin/models/#{model.model_tableize}/fields/edit/type/#{object_type}" unless lookup_context.exists? template
|
110
|
+
template = "my_admin/applications/#{application.key}/fields/edit/type/#{object_type}" unless lookup_context.exists? template
|
111
111
|
template = "my_admin/fields/edit/type/#{object_type}" unless lookup_context.exists? template
|
112
112
|
|
113
|
-
template = "my_admin/#{
|
114
|
-
template = "my_admin/#{application.key}/fields/edit/type/default" unless lookup_context.exists? template
|
113
|
+
template = "my_admin/models/#{model.model_tableize}/fields/edit/type/default" unless lookup_context.exists? template
|
114
|
+
template = "my_admin/applications/#{application.key}/fields/edit/type/default" unless lookup_context.exists? template
|
115
115
|
template = "my_admin/fields/edit/type/default" unless lookup_context.exists? template
|
116
116
|
|
117
117
|
render :template => template, :locals => {:application => application, :model => model, :field => field, :object => object, :form => form }
|
118
118
|
end
|
119
119
|
|
120
120
|
def filter_field_struct(application, model, field, object, show_label=true)
|
121
|
-
template = "my_admin/#{
|
122
|
-
template = "my_admin/#{application.key}/fields/filter/#{field}_struct" unless lookup_context.exists? template
|
121
|
+
template = "my_admin/models/#{model.model_tableize}/fields/filter/#{field}_struct"
|
122
|
+
template = "my_admin/applications/#{application.key}/fields/filter/#{field}_struct" unless lookup_context.exists? template
|
123
123
|
template = "my_admin/fields/filter/#{field}_struct" unless lookup_context.exists? template
|
124
124
|
|
125
125
|
object_type = filter_field_type(application, model, field, object)
|
126
126
|
|
127
|
-
template = "my_admin/#{
|
128
|
-
template = "my_admin/#{application.key}/fields/filter/type/#{object_type}_struct" unless lookup_context.exists? template
|
127
|
+
template = "my_admin/models/#{model.model_tableize}/fields/filter/type/#{object_type}_struct" unless lookup_context.exists? template
|
128
|
+
template = "my_admin/applications/#{application.key}/fields/filter/type/#{object_type}_struct" unless lookup_context.exists? template
|
129
129
|
template = "my_admin/fields/filter/type/#{object_type}_struct" unless lookup_context.exists? template
|
130
130
|
|
131
|
-
template = "my_admin/#{
|
132
|
-
template = "my_admin/#{application.key}/fields/filter/type/default_struct" unless lookup_context.exists? template
|
131
|
+
template = "my_admin/models/#{model.model_tableize}/fields/filter/type/default_struct" unless lookup_context.exists? template
|
132
|
+
template = "my_admin/applications/#{application.key}/fields/filter/type/default_struct" unless lookup_context.exists? template
|
133
133
|
template = "my_admin/fields/filter/type/default_struct" unless lookup_context.exists? template
|
134
134
|
|
135
135
|
render :template => template, :locals => {:show_label => show_label, :application => application, :model => model, :field => field, :object => object }
|
136
136
|
end
|
137
137
|
|
138
138
|
def filter_field_content(application, model, field, object)
|
139
|
-
template = "my_admin/#{
|
140
|
-
template = "my_admin/#{application.key}/fields/filter/#{field}" unless lookup_context.exists? template
|
139
|
+
template = "my_admin/models/#{model.model_tableize}/fields/filter/#{field}"
|
140
|
+
template = "my_admin/applications/#{application.key}/fields/filter/#{field}" unless lookup_context.exists? template
|
141
141
|
template = "my_admin/fields/filter/#{field}" unless lookup_context.exists? template
|
142
142
|
|
143
143
|
object_type = filter_field_type(application, model, field, object)
|
144
144
|
|
145
|
-
template = "my_admin/#{
|
146
|
-
template = "my_admin/#{application.key}/fields/filter/type/#{object_type}" unless lookup_context.exists? template
|
145
|
+
template = "my_admin/models/#{model.model_tableize}/fields/filter/type/#{object_type}" unless lookup_context.exists? template
|
146
|
+
template = "my_admin/applications/#{application.key}/fields/filter/type/#{object_type}" unless lookup_context.exists? template
|
147
147
|
template = "my_admin/fields/filter/type/#{object_type}" unless lookup_context.exists? template
|
148
148
|
|
149
|
-
template = "my_admin/#{
|
150
|
-
template = "my_admin/#{application.key}/fields/filter/type/default" unless lookup_context.exists? template
|
149
|
+
template = "my_admin/models/#{model.model_tableize}/fields/filter/type/default" unless lookup_context.exists? template
|
150
|
+
template = "my_admin/applications/#{application.key}/fields/filter/type/default" unless lookup_context.exists? template
|
151
151
|
template = "my_admin/fields/filter/type/default" unless lookup_context.exists? template
|
152
152
|
|
153
153
|
render :template => template, :locals => {:application => application, :model => model, :field => field, :object => object }
|
@@ -25,8 +25,8 @@ module MyAdminModelHelper
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def model_template(application, model, action)
|
28
|
-
template = "my_admin/#{
|
29
|
-
template = "my_admin/#{application.key}/models/#{action}" if !lookup_context.exists? template, [], true and !lookup_context.exists? template, [], false
|
28
|
+
template = "my_admin/models/#{model.model_tableize}/#{action}"
|
29
|
+
template = "my_admin/applications/#{application.key}/models/#{action}" if !lookup_context.exists? template, [], true and !lookup_context.exists? template, [], false
|
30
30
|
template = "my_admin/models/#{action}" if !lookup_context.exists? template, [], true and !lookup_context.exists? template, [], false
|
31
31
|
template
|
32
32
|
end
|
@@ -47,10 +47,19 @@
|
|
47
47
|
<%= render "my_admin/left" %>
|
48
48
|
<div id="main">
|
49
49
|
<div class="container-fluid">
|
50
|
-
|
50
|
+
<<div class="page-header">
|
51
51
|
<div class="pull-left">
|
52
52
|
<h1><%= yield(:title) %></h1>
|
53
53
|
</div>
|
54
|
+
<div class="pull-right">
|
55
|
+
<ul class="minitiles">
|
56
|
+
<%= yield(:minitiles) %>
|
57
|
+
</ul>
|
58
|
+
<ul class="stats">
|
59
|
+
<%= yield(:stats) %>
|
60
|
+
</ul>
|
61
|
+
</div>
|
62
|
+
|
54
63
|
</div>
|
55
64
|
|
56
65
|
<% if flash[:success] %>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<body class="<%= yield(:body_class) %> theme-darkblue" data-theme="theme-darkblue">
|
41
41
|
<div class="wrapper">
|
42
42
|
<h1>
|
43
|
-
<%= link_to send("#{admin_prefix}
|
43
|
+
<%= link_to send("#{admin_prefix}_root_path") do %>
|
44
44
|
<img src="<%= asset_path 'my_admin/logo-big.png' %>" alt="" class='retina-ready' width="59" height="49"><%= MyAdmin.title %>
|
45
45
|
<% end %>
|
46
46
|
</h1>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<div id="navigation">
|
2
2
|
<div class="container-fluid">
|
3
|
-
<%= link_to MyAdmin.title, send("#{admin_prefix}
|
3
|
+
<%= link_to MyAdmin.title, send("#{admin_prefix}_root_path"), :id => "brand" %>
|
4
4
|
|
5
5
|
<a href="#" class="toggle-nav" rel="tooltip" data-placement="bottom" title="Toggle navigation"><i class="icon-reorder"></i></a>
|
6
6
|
<ul class='main-nav'>
|
7
7
|
<!-- <li class='active'> -->
|
8
8
|
<li>
|
9
|
-
<%= link_to content_tag(:span, "Dashboard"), send("#{admin_prefix}
|
9
|
+
<%= link_to content_tag(:span, "Dashboard"), send("#{admin_prefix}_root_path") %>
|
10
10
|
</li>
|
11
11
|
<% @applications.each do |application| %>
|
12
12
|
<% if application.can?(my_admin_user) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% field_name_from = "#{field}_from" %>
|
2
|
+
<% field_name_to = "#{field}_to" %>
|
3
|
+
|
4
|
+
<% val = nil %>
|
5
|
+
<% val = params[model.underscore][field_name_from] if params[model.underscore].present? and params[model.underscore][field_name_from].present? %>
|
6
|
+
|
7
|
+
<%= text_field_tag "#{model.underscore}[#{field_name_from}]", val, :class => "datepick" %>
|
8
|
+
até
|
9
|
+
|
10
|
+
|
11
|
+
<% val = nil %>
|
12
|
+
<% val = params[model.underscore][field_name_to] if params[model.underscore].present? and params[model.underscore][field_name_to].present? %>
|
13
|
+
|
14
|
+
<%= text_field_tag "#{model.underscore}[#{field_name_to}]", val, :class => "datepick" %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%
|
2
|
-
|
3
|
-
|
2
|
+
collection = [['Todos', nil],['Não', false],['Sim', true]]
|
3
|
+
selected = params[model.underscore][field] if params[model.underscore].present? and params[model.underscore][field].present?
|
4
4
|
%>
|
5
|
-
<%= select_tag "#{model.underscore}[#{field.to_s}]", options_for_select(
|
5
|
+
<%= select_tag "#{model.underscore}[#{field.to_s}]", options_for_select(collection, selected) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% field_name_from = "#{field}_from" %>
|
2
|
+
<% field_name_to = "#{field}_to" %>
|
3
|
+
|
4
|
+
<% val = nil %>
|
5
|
+
<% val = params[model.underscore][field_name_from] if params[model.underscore].present? and params[model.underscore][field_name_from].present? %>
|
6
|
+
|
7
|
+
<%= text_field_tag "#{model.underscore}[#{field_name_from}]", val, :class => "integer" %>
|
8
|
+
até
|
9
|
+
|
10
|
+
|
11
|
+
<% val = nil %>
|
12
|
+
<% val = params[model.underscore][field_name_to] if params[model.underscore].present? and params[model.underscore][field_name_to].present? %>
|
13
|
+
|
14
|
+
<%= text_field_tag "#{model.underscore}[#{field_name_to}]", val, :class => "integer" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if @model.my_admin.can?(:destroy, my_admin_user) or @model.my_admin.can?(:update, my_admin_user) %>
|
2
|
+
<td>
|
3
|
+
<%= link_to(edit_model_link(@application, @model, object), :class => "btn btn-mini btn-inverse") do %>
|
4
|
+
<i class="icon-edit"></i>
|
5
|
+
<%= I18n.t('my_admin.labels.models.edit') %>
|
6
|
+
<% end if @model.my_admin.can?(:update, my_admin_user) %>
|
7
|
+
|
8
|
+
<%= link_to(show_model_link(@application, @model, object), :method => :delete, :class => "btn btn-mini btn-danger", data: { confirm: I18n.t('my_admin.messages.models.confirm_remove', :model => @model.title)}) do %>
|
9
|
+
<i class="icon-trash"></i>
|
10
|
+
<%= I18n.t('my_admin.labels.models.remove') %>
|
11
|
+
|
12
|
+
<% end if @model.my_admin.can?(:destroy, my_admin_user) %>
|
13
|
+
|
14
|
+
</td>
|
15
|
+
<% end %>
|
@@ -63,10 +63,8 @@
|
|
63
63
|
<% end %>
|
64
64
|
</th>
|
65
65
|
<% end %>
|
66
|
+
<%= render model_template(@application, @model, 'actions_header') %>
|
66
67
|
|
67
|
-
<% if @model.my_admin.can?(:destroy, my_admin_user) or @model.my_admin.can?(:update, my_admin_user) %>
|
68
|
-
<th></th>
|
69
|
-
<% end %>
|
70
68
|
</tr>
|
71
69
|
</thead>
|
72
70
|
<% unless @objects.blank? %>
|
@@ -85,21 +83,7 @@
|
|
85
83
|
</td>
|
86
84
|
<% end %>
|
87
85
|
|
88
|
-
|
89
|
-
<td>
|
90
|
-
<%= link_to(edit_model_link(@application, @model, object), :class => "btn btn-mini btn-inverse") do %>
|
91
|
-
<i class="icon-edit"></i>
|
92
|
-
<%= I18n.t('my_admin.labels.models.edit') %>
|
93
|
-
<% end if @model.my_admin.can?(:update, my_admin_user) %>
|
94
|
-
|
95
|
-
<%= link_to(show_model_link(@application, @model, object), :method => :delete, :class => "btn btn-mini btn-danger", data: { confirm: I18n.t('my_admin.messages.models.confirm_remove', :model => @model.title)}) do %>
|
96
|
-
<i class="icon-trash"></i>
|
97
|
-
<%= I18n.t('my_admin.labels.models.remove') %>
|
98
|
-
|
99
|
-
<% end if @model.my_admin.can?(:destroy, my_admin_user) %>
|
100
|
-
|
101
|
-
</td>
|
102
|
-
<% end %>
|
86
|
+
<%= render model_template(@application, @model, 'actions'), object: object %>
|
103
87
|
</tr>
|
104
88
|
</tbody>
|
105
89
|
<% end %>
|
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
<div class="form-actions">
|
50
50
|
<%= f.submit I18n.t('my_admin.labels.models.edit'), :class => "btn btn-success" %>
|
51
|
-
<%= link_to("Cancelar", send("#{admin_prefix}
|
51
|
+
<%= link_to("Cancelar", send("#{admin_prefix}_root_path"), :class => "btn") %>
|
52
52
|
</div>
|
53
53
|
|
54
54
|
</div>
|
data/config/locales/pt.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -3,7 +3,8 @@ Rails.application.routes.draw do
|
|
3
3
|
mount Ckeditor::Engine => '/ckeditor'
|
4
4
|
|
5
5
|
namespace MyAdmin.url_prefix, :module => "my_admin" do
|
6
|
-
|
6
|
+
|
7
|
+
root :to => "dashboards#index", :as => "root"
|
7
8
|
|
8
9
|
resource :configuration, :only => [:update, :show]
|
9
10
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateCkeditorAssets < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :ckeditor_assets do |t|
|
4
4
|
t.string :data_file_name, :null => false
|
5
5
|
t.string :data_content_type
|
@@ -9,7 +9,7 @@ class CreateCkeditorAssets < ActiveRecord::Migration
|
|
9
9
|
t.string :assetable_type, :limit => 30
|
10
10
|
t.string :type, :limit => 30
|
11
11
|
|
12
|
-
# Uncomment
|
12
|
+
# Uncomment it to save images dimensions, if your need it
|
13
13
|
t.integer :width
|
14
14
|
t.integer :height
|
15
15
|
|
@@ -19,8 +19,4 @@ class CreateCkeditorAssets < ActiveRecord::Migration
|
|
19
19
|
add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type"
|
20
20
|
add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable"
|
21
21
|
end
|
22
|
-
|
23
|
-
def self.down
|
24
|
-
drop_table :ckeditor_assets
|
25
|
-
end
|
26
22
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class CreateMyAdminConfigurations < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
2
|
+
def change
|
4
3
|
create_table :my_admin_configurations do |t|
|
5
4
|
|
6
5
|
t.string :key
|
@@ -14,9 +13,4 @@ class CreateMyAdminConfigurations < ActiveRecord::Migration
|
|
14
13
|
|
15
14
|
end
|
16
15
|
end
|
17
|
-
|
18
|
-
def self.down
|
19
|
-
drop_table :my_admin_configurations
|
20
|
-
end
|
21
|
-
|
22
16
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateMyAdminGroupPermissions < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :my_admin_group_permissions do |t|
|
4
4
|
t.integer :permission_id
|
5
5
|
t.integer :group_id
|
@@ -8,9 +8,4 @@ class CreateMyAdminGroupPermissions < ActiveRecord::Migration
|
|
8
8
|
add_index :my_admin_group_permissions, [:permission_id, :group_id], :unique => true, :name => 'my_admin_group_permissions_index'
|
9
9
|
|
10
10
|
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
remove_index :my_admin_group_permissions, "my_admin_group_permissions_index"
|
14
|
-
drop_table :my_admin_group_permissions
|
15
|
-
end
|
16
|
-
end
|
11
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateMyAdminGroups < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :my_admin_groups do |t|
|
4
4
|
t.string :name, :limit => 30, :null => false
|
5
5
|
t.text :description
|
@@ -9,8 +9,4 @@ class CreateMyAdminGroups < ActiveRecord::Migration
|
|
9
9
|
|
10
10
|
add_index :my_admin_groups, :name, :unique => true
|
11
11
|
end
|
12
|
-
|
13
|
-
def self.down
|
14
|
-
drop_table :my_admin_groups
|
15
|
-
end
|
16
12
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateMyAdminLocales < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :my_admin_locales do |t|
|
4
4
|
t.string :name
|
5
5
|
t.string :acronym
|
@@ -8,8 +8,4 @@ class CreateMyAdminLocales < ActiveRecord::Migration
|
|
8
8
|
add_index :my_admin_locales, :name, :unique => true
|
9
9
|
add_index :my_admin_locales, :acronym, :unique => true
|
10
10
|
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
drop_table :my_admin_locales
|
14
|
-
end
|
15
|
-
end
|
11
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateMyAdminLogs < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :my_admin_logs do |t|
|
4
4
|
t.integer :user_id, :null => false
|
5
5
|
t.string :object, :null => false
|
@@ -12,8 +12,4 @@ class CreateMyAdminLogs < ActiveRecord::Migration
|
|
12
12
|
|
13
13
|
add_index :my_admin_logs, :user_id
|
14
14
|
end
|
15
|
-
|
16
|
-
def self.down
|
17
|
-
drop_table :my_admin_logs
|
18
|
-
end
|
19
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateMyAdminPermissions < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :my_admin_permissions do |t|
|
4
4
|
t.string :model, :limit => 75, :null => false
|
5
5
|
t.string :name, :limit => 75, :null => false
|
@@ -8,8 +8,4 @@ class CreateMyAdminPermissions < ActiveRecord::Migration
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
drop_table :my_admin_permissions
|
14
|
-
end
|
15
11
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateMyAdminUserGroups < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :my_admin_user_groups do |t|
|
4
4
|
t.integer :user_id
|
5
5
|
t.integer :group_id
|
@@ -8,9 +8,4 @@ class CreateMyAdminUserGroups < ActiveRecord::Migration
|
|
8
8
|
add_index :my_admin_user_groups, [:user_id, :group_id], :unique => true, :name => 'my_admin_user_groups_index'
|
9
9
|
|
10
10
|
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
remove_index :my_admin_user_groups, "my_admin_user_groups_index"
|
14
|
-
drop_table :my_admin_user_groups
|
15
|
-
end
|
16
|
-
end
|
11
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class CreateMyAdminUsers < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
2
|
+
def change
|
4
3
|
create_table :my_admin_users do |t|
|
5
4
|
t.string :first_name, :default => "", :null => false
|
6
5
|
t.string :last_name, :default => "", :null => false
|
@@ -20,9 +19,4 @@ class CreateMyAdminUsers < ActiveRecord::Migration
|
|
20
19
|
t.timestamps
|
21
20
|
end
|
22
21
|
end
|
23
|
-
|
24
|
-
def self.down
|
25
|
-
drop_table :my_admin_users
|
26
|
-
end
|
27
|
-
|
28
22
|
end
|
@@ -20,45 +20,7 @@ module MyAdmin
|
|
20
20
|
directory = File.expand_path('../templates', __FILE__)
|
21
21
|
|
22
22
|
template "config/initializers/my_admin.rb", "config/initializers/my_admin.rb"
|
23
|
-
# template "public/plugins/ckeditor/ckupload.php", "public/my_admin/plugins/ckeditor/ckupload.php"
|
24
|
-
|
25
|
-
#-- "Add Migrations"
|
26
|
-
|
27
|
-
user_class_name = "MyAdminUser"
|
28
|
-
migration_template "migrations/users.rb", "db/migrate/create_#{user_class_name.tableize}.rb"
|
29
|
-
|
30
|
-
sleep 1
|
31
|
-
class_name = "MyAdminGroup"
|
32
|
-
migration_template "migrations/groups.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
33
|
-
|
34
|
-
sleep 1
|
35
|
-
class_name = "MyAdminUserGroups"
|
36
|
-
migration_template "migrations/user_groups.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
37
|
-
|
38
|
-
sleep 1
|
39
|
-
class_name = "MyAdminPermissions"
|
40
|
-
migration_template "migrations/permissions.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
41
23
|
|
42
|
-
sleep 1
|
43
|
-
class_name = "MyAdminLogs"
|
44
|
-
migration_template "migrations/logs.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
45
|
-
|
46
|
-
sleep 1
|
47
|
-
class_name = "MyAdminGroupPermissions"
|
48
|
-
migration_template "migrations/group_permissions.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
49
|
-
|
50
|
-
sleep 1
|
51
|
-
class_name = "MyAdminLocales"
|
52
|
-
migration_template "migrations/locales.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
53
|
-
|
54
|
-
sleep 1
|
55
|
-
class_name = "MyAdminConfigurations"
|
56
|
-
migration_template "migrations/configurations.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
57
|
-
|
58
|
-
sleep 1
|
59
|
-
class_name = "CkeditorAssets"
|
60
|
-
migration_template "migrations/ckeditor_assets.rb", "db/migrate/create_#{class_name.tableize}.rb"
|
61
|
-
|
62
24
|
end
|
63
25
|
|
64
26
|
end
|
@@ -27,6 +27,14 @@ module MyAdmin
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def self.my_admin_filter_type_integer(model, field, params)
|
31
|
+
if params[field].present? and !params[field].blank?
|
32
|
+
where("#{model.table_name}.#{field} = ?", params[field])
|
33
|
+
else
|
34
|
+
where("")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
30
38
|
def self.my_admin_filter_type_belongs_to(model, field, params)
|
31
39
|
if params["#{field.to_s.singularize}_id"].present? and params["#{field.to_s.singularize}_id"].to_i > 0
|
32
40
|
where("#{model.table_name}.#{field.to_s.singularize}_id" => params["#{field.to_s.singularize}_id"].to_i)
|
@@ -68,6 +76,26 @@ module MyAdmin
|
|
68
76
|
:date_to => ( params[field_name_to].to_datetime.end_of_day rescue nil ) })
|
69
77
|
end
|
70
78
|
|
79
|
+
|
80
|
+
def self.my_admin_filter_type_integer_between(model, field, params)
|
81
|
+
field_name_from = "#{field}_from"
|
82
|
+
field_name_to = "#{field}_to"
|
83
|
+
|
84
|
+
field_value_from = params[field_name_from].to_i unless params[field_name_from].blank?
|
85
|
+
field_value_to = params[field_name_to].to_i unless params[field_name_to].blank?
|
86
|
+
|
87
|
+
condition = ""
|
88
|
+
unless field_value_from.nil?
|
89
|
+
condition += "#{model.table_name}.#{field} >= :integer_from"
|
90
|
+
end
|
91
|
+
|
92
|
+
unless field_value_to.nil?
|
93
|
+
condition += " and " unless condition.blank?
|
94
|
+
condition += "#{model.table_name}.#{field} <= :integer_to"
|
95
|
+
end
|
96
|
+
|
97
|
+
where(condition, { :integer_from => field_value_from, :integer_to => field_value_to })
|
98
|
+
|
71
99
|
end
|
72
100
|
end
|
73
101
|
|
data/lib/my_admin/engine.rb
CHANGED
@@ -7,7 +7,11 @@ class Engine < Rails::Engine
|
|
7
7
|
config.assets.precompile += %w( ckeditor/* )
|
8
8
|
config.assets.precompile += %w( my_admin/application.css, my_admin/application_locked.css, my_admin/application_off.css )
|
9
9
|
config.assets.precompile += %w( my_admin/application.js, my_admin/application_locked.js, my_admin/application_off.js )
|
10
|
+
config.assets.precompile += %w( my_admin_application.css, my_admin_application_locked.css, my_admin_application_off.css )
|
10
11
|
config.assets.precompile += %w( my_admin_application.js, my_admin_application_locked.js, my_admin_application_off.js )
|
12
|
+
config.assets.precompile += %w( my_admin/*.ico )
|
13
|
+
config.assets.precompile += %w( my_admin/*.png )
|
14
|
+
config.assets.precompile += %w( my_admin/*.gif )
|
11
15
|
|
12
16
|
config.to_prepare do
|
13
17
|
ActionView::Base.send :include, MyAdminHelper
|
@@ -21,5 +25,13 @@ class Engine < Rails::Engine
|
|
21
25
|
|
22
26
|
Mime::Type.register "application/vnd.ms-excel", :xls
|
23
27
|
end
|
28
|
+
|
29
|
+
initializer :append_migrations do |app|
|
30
|
+
unless app.root.to_s.match root.to_s
|
31
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
32
|
+
app.config.paths["db/migrate"] << expanded_path
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
24
36
|
|
25
37
|
end
|
data/lib/my_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,107 +1,135 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_admin
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Marcos Vinicius von Gal dos Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Version
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
21
19
|
version: 4.2.1
|
22
20
|
type: :runtime
|
23
|
-
version_requirements: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: breadcrumbs
|
26
21
|
prerelease: false
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: breadcrumbs
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
32
34
|
type: :runtime
|
33
|
-
version_requirements: *id002
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: dynamic_form
|
36
35
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
39
|
-
- - ~>
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dynamic_form
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.1'
|
42
48
|
type: :runtime
|
43
|
-
version_requirements: *id003
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: paperclip
|
46
49
|
prerelease: false
|
47
|
-
|
48
|
-
requirements:
|
49
|
-
- - ~>
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: paperclip
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.2'
|
52
62
|
type: :runtime
|
53
|
-
version_requirements: *id004
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: will_paginate
|
56
63
|
prerelease: false
|
57
|
-
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: will_paginate
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
62
76
|
type: :runtime
|
63
|
-
version_requirements: *id005
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: spreadsheet
|
66
77
|
prerelease: false
|
67
|
-
|
68
|
-
requirements:
|
69
|
-
- - ~>
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: spreadsheet
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
72
90
|
type: :runtime
|
73
|
-
version_requirements: *id006
|
74
|
-
- !ruby/object:Gem::Dependency
|
75
|
-
name: htmlentities
|
76
91
|
prerelease: false
|
77
|
-
|
78
|
-
requirements:
|
79
|
-
- - ~>
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version:
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: htmlentities
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '4.3'
|
82
104
|
type: :runtime
|
83
|
-
version_requirements: *id007
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: ckeditor
|
86
105
|
prerelease: false
|
87
|
-
|
88
|
-
requirements:
|
89
|
-
- - ~>
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version:
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '4.3'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: ckeditor
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '4.1'
|
92
118
|
type: :runtime
|
93
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '4.1'
|
94
125
|
description: Content Manager for RoR
|
95
|
-
email:
|
126
|
+
email:
|
96
127
|
- marcosvgs@gmail.com
|
97
128
|
executables: []
|
98
|
-
|
99
129
|
extensions: []
|
100
|
-
|
101
130
|
extra_rdoc_files: []
|
102
|
-
|
103
|
-
|
104
|
-
- .gitignore
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
105
133
|
- Gemfile
|
106
134
|
- MIT-LICENSE
|
107
135
|
- README.md
|
@@ -581,14 +609,14 @@ files:
|
|
581
609
|
- app/assets/javascripts/my_admin/plugins/elfinder/files/.tmb/l1_c2NvdHR3aWxsc19hdXR1bW4zLmpwZw1221239274.png
|
582
610
|
- app/assets/javascripts/my_admin/plugins/elfinder/files/.tmb/l1_c2NvdHR3aWxsc19idWZmYWxvLmpwZw1221239094.png
|
583
611
|
- app/assets/javascripts/my_admin/plugins/elfinder/files/.tmb/l1_c2NvdHR3aWxsc19idXR0ZXJmbHkuanBn1221239286.png
|
584
|
-
-
|
585
|
-
-
|
586
|
-
-
|
587
|
-
-
|
588
|
-
-
|
589
|
-
-
|
590
|
-
-
|
591
|
-
-
|
612
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #1/Another_file.txt'
|
613
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #1/file.txt'
|
614
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #1/scottwills_underwater2.jpg'
|
615
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #1/scottwills_underwater5.jpg'
|
616
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #2/scottwills_cat.jpg'
|
617
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #2/scottwills_fish.jpg'
|
618
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #2/scottwills_gardens.jpg'
|
619
|
+
- 'app/assets/javascripts/my_admin/plugins/elfinder/files/Folder #2/scottwills_horse.jpg'
|
592
620
|
- app/assets/javascripts/my_admin/plugins/elfinder/files/Main-file.txt
|
593
621
|
- app/assets/javascripts/my_admin/plugins/elfinder/files/madness_beach.jpg
|
594
622
|
- app/assets/javascripts/my_admin/plugins/elfinder/files/madness_boat.jpg
|
@@ -829,6 +857,7 @@ files:
|
|
829
857
|
- app/views/my_admin/fields/edit/type/clear_text.html.erb
|
830
858
|
- app/views/my_admin/fields/edit/type/color.html.erb
|
831
859
|
- app/views/my_admin/fields/edit/type/date.html.erb
|
860
|
+
- app/views/my_admin/fields/edit/type/date_between.html.erb
|
832
861
|
- app/views/my_admin/fields/edit/type/datetime.html.erb
|
833
862
|
- app/views/my_admin/fields/edit/type/decimal.html.erb
|
834
863
|
- app/views/my_admin/fields/edit/type/default.html.erb
|
@@ -858,6 +887,7 @@ files:
|
|
858
887
|
- app/views/my_admin/fields/filter/type/default.html.erb
|
859
888
|
- app/views/my_admin/fields/filter/type/default_struct.html.erb
|
860
889
|
- app/views/my_admin/fields/filter/type/email.html.erb
|
890
|
+
- app/views/my_admin/fields/filter/type/integer_between.html.erb
|
861
891
|
- app/views/my_admin/fields/filter/type/list.html.erb
|
862
892
|
- app/views/my_admin/fields/filter/type/list_string.html.erb
|
863
893
|
- app/views/my_admin/fields/type/big_decimal.html.erb
|
@@ -872,6 +902,8 @@ files:
|
|
872
902
|
- app/views/my_admin/fields/type/has_many_edit.html.erb
|
873
903
|
- app/views/my_admin/fields/type/paperclip/attachment.html.erb
|
874
904
|
- app/views/my_admin/first_users/new.html.erb
|
905
|
+
- app/views/my_admin/models/_actions.html.erb
|
906
|
+
- app/views/my_admin/models/_actions_header.html.erb
|
875
907
|
- app/views/my_admin/models/_field.html.erb
|
876
908
|
- app/views/my_admin/models/_filters.html.erb
|
877
909
|
- app/views/my_admin/models/_form.html.erb
|
@@ -891,18 +923,18 @@ files:
|
|
891
923
|
- config/locales/es.yml
|
892
924
|
- config/locales/pt.yml
|
893
925
|
- config/routes.rb
|
926
|
+
- db/migrate/20151128132449_create_ckeditor_assets.rb
|
927
|
+
- db/migrate/20151128142449_create_my_admin_configurations.rb
|
928
|
+
- db/migrate/20151128152449_create_my_admin_group_permissions.rb
|
929
|
+
- db/migrate/20151128162449_create_my_admin_groups.rb
|
930
|
+
- db/migrate/20151128172449_create_my_admin_locales.rb
|
931
|
+
- db/migrate/20151128182449_create_my_admin_logs.rb
|
932
|
+
- db/migrate/20151128192449_create_my_admin_permissions.rb
|
933
|
+
- db/migrate/20151128202449_create_my_admin_user_groups.rb
|
934
|
+
- db/migrate/20151128212449_create_my_admin_users.rb
|
894
935
|
- lib/generators/my_admin/install/USAGE
|
895
936
|
- lib/generators/my_admin/install/install_generator.rb
|
896
937
|
- lib/generators/my_admin/install/templates/config/initializers/my_admin.rb
|
897
|
-
- lib/generators/my_admin/install/templates/migrations/ckeditor_assets.rb
|
898
|
-
- lib/generators/my_admin/install/templates/migrations/configurations.rb
|
899
|
-
- lib/generators/my_admin/install/templates/migrations/group_permissions.rb
|
900
|
-
- lib/generators/my_admin/install/templates/migrations/groups.rb
|
901
|
-
- lib/generators/my_admin/install/templates/migrations/locales.rb
|
902
|
-
- lib/generators/my_admin/install/templates/migrations/logs.rb
|
903
|
-
- lib/generators/my_admin/install/templates/migrations/permissions.rb
|
904
|
-
- lib/generators/my_admin/install/templates/migrations/user_groups.rb
|
905
|
-
- lib/generators/my_admin/install/templates/migrations/users.rb
|
906
938
|
- lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
|
907
939
|
- lib/generators/my_admin/model/model_generator.rb
|
908
940
|
- lib/generators/my_admin/model/templates/controllers/controller.rb
|
@@ -917,40 +949,33 @@ files:
|
|
917
949
|
- lib/my_admin/locales.rb
|
918
950
|
- lib/my_admin/model_configuration.rb
|
919
951
|
- lib/my_admin/paperclip.rb
|
920
|
-
- lib/my_admin/paperclip_processors/cropper.rb
|
921
|
-
- lib/my_admin/paperclip_processors/rotator.rb
|
922
952
|
- lib/my_admin/string.rb
|
923
953
|
- lib/my_admin/to_xls.rb
|
924
954
|
- lib/my_admin/version.rb
|
925
955
|
- lib/my_admin/will_paginate/bootstrap_link_renderer.rb
|
926
956
|
- lib/my_admin/yml_manage.rb
|
927
957
|
- my_admin.gemspec
|
928
|
-
homepage:
|
958
|
+
homepage: ''
|
929
959
|
licenses: []
|
930
|
-
|
931
960
|
metadata: {}
|
932
|
-
|
933
961
|
post_install_message:
|
934
962
|
rdoc_options: []
|
935
|
-
|
936
|
-
require_paths:
|
963
|
+
require_paths:
|
937
964
|
- lib
|
938
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
939
|
-
requirements:
|
965
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
966
|
+
requirements:
|
940
967
|
- - ">="
|
941
|
-
- !ruby/object:Gem::Version
|
968
|
+
- !ruby/object:Gem::Version
|
942
969
|
version: 1.9.3
|
943
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
944
|
-
requirements:
|
970
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
971
|
+
requirements:
|
945
972
|
- - ">="
|
946
|
-
- !ruby/object:Gem::Version
|
947
|
-
version:
|
973
|
+
- !ruby/object:Gem::Version
|
974
|
+
version: '0'
|
948
975
|
requirements: []
|
949
|
-
|
950
976
|
rubyforge_project: my_admin
|
951
|
-
rubygems_version: 2.
|
977
|
+
rubygems_version: 2.2.2
|
952
978
|
signing_key:
|
953
979
|
specification_version: 4
|
954
980
|
summary: MyAdmin
|
955
981
|
test_files: []
|
956
|
-
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Paperclip
|
2
|
-
class Cropper < Thumbnail
|
3
|
-
|
4
|
-
def transformation_command
|
5
|
-
if crop_command
|
6
|
-
crop_command + super.join(" ").gsub(/ -crop \S+/, '')
|
7
|
-
else
|
8
|
-
super
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def crop_command
|
13
|
-
target = @attachment.instance
|
14
|
-
if target.cropping?
|
15
|
-
" -crop '#{target.crop_w}x#{target.crop_h}+#{target.crop_x}+#{target.crop_y}' "
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Paperclip
|
2
|
-
class Rotator < Thumbnail
|
3
|
-
|
4
|
-
attr_accessor :rotate
|
5
|
-
|
6
|
-
def initialize file, options = {}, attachment = nil
|
7
|
-
super
|
8
|
-
@rotate = options[:rotate]
|
9
|
-
end
|
10
|
-
|
11
|
-
def transformation_command
|
12
|
-
if rotate_command
|
13
|
-
super.join(" ") + rotate_command
|
14
|
-
else
|
15
|
-
super
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def rotate_command
|
20
|
-
unless @rotate.blank?
|
21
|
-
" -background None -rotate #{@rotate} "
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|