madmin 0.1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +50 -63
- data/Rakefile +5 -6
- data/app/assets/config/manifest.js +2 -0
- data/app/assets/stylesheets/actiontext.scss +36 -0
- data/app/assets/stylesheets/{madmin/application.css → application.css} +2 -9
- data/app/controllers/madmin/base_controller.rb +5 -9
- data/app/controllers/madmin/dashboard_controller.rb +1 -3
- data/app/controllers/madmin/resource_controller.rb +81 -0
- data/app/helpers/madmin/application_helper.rb +10 -8
- data/app/views/layouts/madmin/application.html.erb +23 -25
- data/app/views/madmin/application/_form.html.erb +25 -0
- data/app/views/madmin/application/_javascript.html.erb +24 -0
- data/app/views/madmin/application/_navigation.html.erb +6 -0
- data/app/views/madmin/application/edit.html.erb +3 -0
- data/app/views/madmin/application/index.html.erb +47 -0
- data/app/views/madmin/application/new.html.erb +3 -0
- data/app/views/madmin/application/show.html.erb +24 -0
- data/app/views/madmin/dashboard/show.html.erb +1 -0
- data/app/views/madmin/fields/attachment/_form.html.erb +2 -0
- data/app/views/madmin/fields/attachment/_index.html.erb +3 -0
- data/app/views/madmin/fields/attachment/_show.html.erb +3 -0
- data/app/views/madmin/fields/attachments/_form.html.erb +2 -0
- data/app/views/madmin/fields/attachments/_index.html.erb +1 -0
- data/app/views/madmin/fields/attachments/_show.html.erb +7 -0
- data/app/views/madmin/fields/belongs_to/_form.html.erb +2 -14
- data/app/views/madmin/fields/belongs_to/_index.html.erb +3 -7
- data/app/views/madmin/fields/belongs_to/_show.html.erb +3 -8
- data/app/views/madmin/fields/boolean/_form.html.erb +2 -0
- data/app/views/madmin/fields/boolean/_index.html.erb +1 -0
- data/app/views/madmin/fields/boolean/_show.html.erb +1 -0
- data/app/views/madmin/fields/date/_form.html.erb +2 -0
- data/app/views/madmin/fields/date/_index.html.erb +1 -0
- data/app/views/madmin/fields/date/_show.html.erb +1 -0
- data/app/views/madmin/fields/date_time/_form.html.erb +2 -0
- data/app/views/madmin/fields/date_time/_index.html.erb +1 -0
- data/app/views/madmin/fields/date_time/_show.html.erb +1 -0
- data/app/views/madmin/fields/decimal/_form.html.erb +2 -0
- data/app/views/madmin/fields/decimal/_index.html.erb +1 -0
- data/app/views/madmin/fields/decimal/_show.html.erb +1 -0
- data/app/views/madmin/fields/enum/_form.html.erb +2 -0
- data/app/views/madmin/fields/enum/_index.html.erb +1 -0
- data/app/views/madmin/fields/enum/_show.html.erb +1 -0
- data/app/views/madmin/fields/float/_form.html.erb +2 -0
- data/app/views/madmin/fields/float/_index.html.erb +1 -0
- data/app/views/madmin/fields/float/_show.html.erb +1 -0
- data/app/views/madmin/fields/has_many/_form.html.erb +2 -0
- data/app/views/madmin/fields/has_many/_index.html.erb +1 -0
- data/app/views/madmin/fields/has_many/_show.html.erb +4 -14
- data/app/views/madmin/fields/has_one/_form.html.erb +3 -0
- data/app/views/madmin/fields/has_one/_index.html.erb +3 -0
- data/app/views/madmin/fields/has_one/_show.html.erb +3 -12
- data/app/views/madmin/fields/integer/_form.html.erb +2 -0
- data/app/views/madmin/fields/integer/_index.html.erb +1 -0
- data/app/views/madmin/fields/integer/_show.html.erb +1 -0
- data/app/views/madmin/fields/json/_form.html.erb +2 -0
- data/app/views/madmin/fields/json/_index.html.erb +1 -0
- data/app/views/madmin/fields/json/_show.html.erb +1 -0
- data/app/views/madmin/fields/polymorphic/_form.html.erb +5 -32
- data/app/views/madmin/fields/polymorphic/_index.html.erb +3 -1
- data/app/views/madmin/fields/polymorphic/_show.html.erb +3 -14
- data/app/views/madmin/fields/rich_text/_form.html.erb +4 -0
- data/app/views/madmin/fields/rich_text/_index.html.erb +1 -0
- data/app/views/madmin/fields/rich_text/_show.html.erb +3 -0
- data/app/views/madmin/fields/string/_form.html.erb +2 -0
- data/app/views/madmin/fields/string/_index.html.erb +1 -0
- data/app/views/madmin/fields/string/_show.html.erb +1 -0
- data/app/views/madmin/fields/text/_form.html.erb +2 -4
- data/app/views/madmin/fields/text/_index.html.erb +1 -1
- data/app/views/madmin/fields/text/_show.html.erb +1 -8
- data/app/views/madmin/fields/time/_form.html.erb +2 -0
- data/app/views/madmin/fields/time/_index.html.erb +1 -0
- data/app/views/madmin/fields/time/_show.html.erb +1 -0
- data/lib/generators/madmin/install/install_generator.rb +31 -12
- data/lib/generators/madmin/install/templates/controller.rb.tt +22 -0
- data/lib/generators/madmin/resource/resource_generator.rb +83 -47
- data/lib/generators/madmin/resource/templates/controller.rb.tt +4 -0
- data/lib/generators/madmin/resource/templates/resource.rb.tt +11 -0
- data/lib/generators/madmin/views/edit_generator.rb +16 -0
- data/lib/generators/madmin/views/form_generator.rb +15 -0
- data/lib/generators/madmin/views/index_generator.rb +15 -0
- data/lib/generators/madmin/views/layout_generator.rb +21 -0
- data/lib/generators/madmin/views/navigation_generator.rb +15 -0
- data/lib/generators/madmin/views/new_generator.rb +16 -0
- data/lib/generators/madmin/views/show_generator.rb +15 -0
- data/lib/generators/madmin/views/views_generator.rb +8 -8
- data/lib/madmin.rb +34 -23
- data/lib/madmin/engine.rb +5 -2
- data/lib/madmin/field.rb +22 -46
- data/lib/madmin/fields/attachment.rb +6 -0
- data/lib/madmin/fields/attachments.rb +9 -0
- data/lib/madmin/fields/belongs_to.rb +18 -0
- data/lib/madmin/fields/boolean.rb +6 -0
- data/lib/madmin/fields/date.rb +6 -0
- data/lib/madmin/fields/date_time.rb +6 -0
- data/lib/madmin/fields/decimal.rb +6 -0
- data/lib/madmin/fields/enum.rb +9 -0
- data/lib/madmin/fields/float.rb +6 -0
- data/lib/madmin/fields/has_many.rb +18 -0
- data/lib/madmin/fields/has_one.rb +6 -0
- data/lib/madmin/fields/integer.rb +6 -0
- data/lib/madmin/fields/json.rb +6 -0
- data/lib/madmin/fields/polymorphic.rb +17 -0
- data/lib/madmin/fields/rich_text.rb +6 -0
- data/lib/madmin/fields/string.rb +6 -0
- data/lib/madmin/fields/text.rb +6 -0
- data/lib/madmin/fields/time.rb +6 -0
- data/lib/madmin/generator_helpers.rb +24 -0
- data/lib/madmin/namespace.rb +35 -0
- data/lib/madmin/resource.rb +176 -0
- data/lib/madmin/version.rb +1 -1
- data/lib/madmin/view_generator.rb +42 -0
- data/lib/tasks/madmin_tasks.rake +7 -0
- metadata +106 -111
- data/app/assets/config/madmin_manifest.js +0 -2
- data/app/assets/javascripts/madmin/application.js +0 -15
- data/app/assets/javascripts/madmin/dashboard.js +0 -2
- data/app/assets/javascripts/madmin/resources.js +0 -36
- data/app/assets/stylesheets/madmin/dashboard.css +0 -4
- data/app/assets/stylesheets/madmin/resources.css +0 -4
- data/app/controllers/madmin/application_controller.rb +0 -16
- data/app/controllers/madmin/resources_controller.rb +0 -97
- data/app/decorators/madmin/resource_decorator.rb +0 -16
- data/app/helpers/madmin/fields/polymorphic_helper.rb +0 -25
- data/app/jobs/madmin/application_job.rb +0 -4
- data/app/mailers/madmin/application_mailer.rb +0 -6
- data/app/models/madmin/application_record.rb +0 -5
- data/app/views/application/_navigation.html.erb +0 -17
- data/app/views/madmin/dashboard/index.html.erb +0 -6
- data/app/views/madmin/fields/check_box/_form.html.erb +0 -4
- data/app/views/madmin/fields/check_box/_index.html.erb +0 -1
- data/app/views/madmin/fields/check_box/_show.html.erb +0 -8
- data/app/views/madmin/fields/email/_form.html.erb +0 -4
- data/app/views/madmin/fields/email/_index.html.erb +0 -1
- data/app/views/madmin/fields/email/_show.html.erb +0 -8
- data/app/views/madmin/fields/number/_form.html.erb +0 -4
- data/app/views/madmin/fields/number/_index.html.erb +0 -1
- data/app/views/madmin/fields/number/_show.html.erb +0 -8
- data/app/views/madmin/fields/password/_form.html.erb +0 -4
- data/app/views/madmin/fields/password/_index.html.erb +0 -1
- data/app/views/madmin/fields/password/_show.html.erb +0 -8
- data/app/views/madmin/fields/select/_form.html.erb +0 -4
- data/app/views/madmin/fields/select/_index.html.erb +0 -1
- data/app/views/madmin/fields/select/_show.html.erb +0 -8
- data/app/views/madmin/fields/text_area/_form.html.erb +0 -4
- data/app/views/madmin/fields/text_area/_index.html.erb +0 -1
- data/app/views/madmin/fields/text_area/_show.html.erb +0 -8
- data/app/views/madmin/resources/_form.html.erb +0 -15
- data/app/views/madmin/resources/_scopes.html.erb +0 -10
- data/app/views/madmin/resources/edit.html.erb +0 -2
- data/app/views/madmin/resources/index.html.erb +0 -13
- data/app/views/madmin/resources/index/_content.html.erb +0 -33
- data/app/views/madmin/resources/new.html.erb +0 -2
- data/app/views/madmin/resources/show.html.erb +0 -10
- data/config/routes.rb +0 -11
- data/lib/generators/madmin/controller/USAGE +0 -8
- data/lib/generators/madmin/controller/controller_generator.rb +0 -10
- data/lib/generators/madmin/page/USAGE +0 -8
- data/lib/generators/madmin/page/page_generator.rb +0 -20
- data/lib/generators/madmin/page/templates/template.html.erb +0 -2
- data/lib/generators/madmin/page/templates/template.rb.erb +0 -10
- data/lib/generators/madmin/resource/templates/resource.rb.erb +0 -11
- data/lib/madmin/field/associatable.rb +0 -58
- data/lib/madmin/field/belongs_to.rb +0 -9
- data/lib/madmin/field/check_box.rb +0 -8
- data/lib/madmin/field/date_time.rb +0 -8
- data/lib/madmin/field/email.rb +0 -8
- data/lib/madmin/field/has_many.rb +0 -9
- data/lib/madmin/field/has_one.rb +0 -9
- data/lib/madmin/field/number.rb +0 -8
- data/lib/madmin/field/password.rb +0 -8
- data/lib/madmin/field/polymorphic.rb +0 -57
- data/lib/madmin/field/select.rb +0 -13
- data/lib/madmin/field/text.rb +0 -8
- data/lib/madmin/field/text_area.rb +0 -8
- data/lib/madmin/resourceable.rb +0 -72
- data/lib/madmin/resourceable/class_methods.rb +0 -152
- data/lib/madmin/resources.rb +0 -13
data/lib/madmin/version.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
require "rails/generators/base"
|
2
|
+
require "madmin/generator_helpers"
|
3
|
+
require "madmin/namespace"
|
4
|
+
|
5
|
+
module Madmin
|
6
|
+
class ViewGenerator < Rails::Generators::Base
|
7
|
+
include Madmin::GeneratorHelpers
|
8
|
+
class_option :namespace, type: :string, default: "madmin"
|
9
|
+
|
10
|
+
def self.template_source_path
|
11
|
+
File.expand_path(
|
12
|
+
"../../../app/views/madmin/application",
|
13
|
+
__FILE__
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def namespace
|
20
|
+
options[:namespace]
|
21
|
+
end
|
22
|
+
|
23
|
+
def copy_resource_template(template_name)
|
24
|
+
template_file = "#{template_name}.html.erb"
|
25
|
+
|
26
|
+
copy_file(
|
27
|
+
template_file,
|
28
|
+
"app/views/#{namespace}/#{resource_path}/#{template_file}"
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def resource_path
|
33
|
+
args.first.try(:underscore).try(:pluralize) || BaseResourcePath.new
|
34
|
+
end
|
35
|
+
|
36
|
+
class BaseResourcePath
|
37
|
+
def to_s
|
38
|
+
"application"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/tasks/madmin_tasks.rake
CHANGED
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: madmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Jason Charnes
|
8
7
|
- Chris Oliver
|
9
|
-
-
|
10
|
-
autorequire:
|
8
|
+
- Andrea Fomera
|
9
|
+
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rails
|
@@ -18,61 +17,38 @@ dependencies:
|
|
18
17
|
requirements:
|
19
18
|
- - ">="
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
20
|
+
version: 6.0.3
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
25
|
- - ">="
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
27
|
+
version: 6.0.3
|
29
28
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
29
|
+
name: pagy
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
32
31
|
requirements:
|
33
32
|
- - ">="
|
34
33
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
36
|
-
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
34
|
+
version: '3.5'
|
35
|
+
- - "<"
|
41
36
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0'
|
43
|
-
|
44
|
-
name: sqlite3
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 1.3.6
|
50
|
-
type: :development
|
37
|
+
version: '4.0'
|
38
|
+
type: :runtime
|
51
39
|
prerelease: false
|
52
40
|
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - "~>"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: 1.3.6
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: standardrb
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
41
|
requirements:
|
61
42
|
- - ">="
|
62
43
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
64
|
-
|
65
|
-
prerelease: false
|
66
|
-
version_requirements: !ruby/object:Gem::Requirement
|
67
|
-
requirements:
|
68
|
-
- - ">="
|
44
|
+
version: '3.5'
|
45
|
+
- - "<"
|
69
46
|
- !ruby/object:Gem::Version
|
70
|
-
version: '0'
|
71
|
-
description:
|
47
|
+
version: '4.0'
|
48
|
+
description: It's an admin, obviously.
|
72
49
|
email:
|
73
|
-
- jason@thecharnes.com
|
74
50
|
- excid3@gmail.com
|
75
|
-
-
|
51
|
+
- afomera@hey.com
|
76
52
|
executables: []
|
77
53
|
extensions: []
|
78
54
|
extra_rdoc_files: []
|
@@ -80,102 +56,121 @@ files:
|
|
80
56
|
- MIT-LICENSE
|
81
57
|
- README.md
|
82
58
|
- Rakefile
|
83
|
-
- app/assets/config/
|
84
|
-
- app/assets/
|
85
|
-
- app/assets/
|
86
|
-
- app/assets/javascripts/madmin/resources.js
|
87
|
-
- app/assets/stylesheets/madmin/application.css
|
88
|
-
- app/assets/stylesheets/madmin/dashboard.css
|
89
|
-
- app/assets/stylesheets/madmin/resources.css
|
90
|
-
- app/controllers/madmin/application_controller.rb
|
59
|
+
- app/assets/config/manifest.js
|
60
|
+
- app/assets/stylesheets/actiontext.scss
|
61
|
+
- app/assets/stylesheets/application.css
|
91
62
|
- app/controllers/madmin/base_controller.rb
|
92
63
|
- app/controllers/madmin/dashboard_controller.rb
|
93
|
-
- app/controllers/madmin/
|
94
|
-
- app/decorators/madmin/resource_decorator.rb
|
64
|
+
- app/controllers/madmin/resource_controller.rb
|
95
65
|
- app/helpers/madmin/application_helper.rb
|
96
|
-
- app/helpers/madmin/fields/polymorphic_helper.rb
|
97
|
-
- app/jobs/madmin/application_job.rb
|
98
|
-
- app/mailers/madmin/application_mailer.rb
|
99
|
-
- app/models/madmin/application_record.rb
|
100
|
-
- app/views/application/_navigation.html.erb
|
101
66
|
- app/views/layouts/madmin/application.html.erb
|
102
|
-
- app/views/madmin/
|
67
|
+
- app/views/madmin/application/_form.html.erb
|
68
|
+
- app/views/madmin/application/_javascript.html.erb
|
69
|
+
- app/views/madmin/application/_navigation.html.erb
|
70
|
+
- app/views/madmin/application/edit.html.erb
|
71
|
+
- app/views/madmin/application/index.html.erb
|
72
|
+
- app/views/madmin/application/new.html.erb
|
73
|
+
- app/views/madmin/application/show.html.erb
|
74
|
+
- app/views/madmin/dashboard/show.html.erb
|
75
|
+
- app/views/madmin/fields/attachment/_form.html.erb
|
76
|
+
- app/views/madmin/fields/attachment/_index.html.erb
|
77
|
+
- app/views/madmin/fields/attachment/_show.html.erb
|
78
|
+
- app/views/madmin/fields/attachments/_form.html.erb
|
79
|
+
- app/views/madmin/fields/attachments/_index.html.erb
|
80
|
+
- app/views/madmin/fields/attachments/_show.html.erb
|
103
81
|
- app/views/madmin/fields/belongs_to/_form.html.erb
|
104
82
|
- app/views/madmin/fields/belongs_to/_index.html.erb
|
105
83
|
- app/views/madmin/fields/belongs_to/_show.html.erb
|
106
|
-
- app/views/madmin/fields/
|
107
|
-
- app/views/madmin/fields/
|
108
|
-
- app/views/madmin/fields/
|
109
|
-
- app/views/madmin/fields/
|
110
|
-
- app/views/madmin/fields/
|
111
|
-
- app/views/madmin/fields/
|
84
|
+
- app/views/madmin/fields/boolean/_form.html.erb
|
85
|
+
- app/views/madmin/fields/boolean/_index.html.erb
|
86
|
+
- app/views/madmin/fields/boolean/_show.html.erb
|
87
|
+
- app/views/madmin/fields/date/_form.html.erb
|
88
|
+
- app/views/madmin/fields/date/_index.html.erb
|
89
|
+
- app/views/madmin/fields/date/_show.html.erb
|
90
|
+
- app/views/madmin/fields/date_time/_form.html.erb
|
91
|
+
- app/views/madmin/fields/date_time/_index.html.erb
|
92
|
+
- app/views/madmin/fields/date_time/_show.html.erb
|
93
|
+
- app/views/madmin/fields/decimal/_form.html.erb
|
94
|
+
- app/views/madmin/fields/decimal/_index.html.erb
|
95
|
+
- app/views/madmin/fields/decimal/_show.html.erb
|
96
|
+
- app/views/madmin/fields/enum/_form.html.erb
|
97
|
+
- app/views/madmin/fields/enum/_index.html.erb
|
98
|
+
- app/views/madmin/fields/enum/_show.html.erb
|
99
|
+
- app/views/madmin/fields/float/_form.html.erb
|
100
|
+
- app/views/madmin/fields/float/_index.html.erb
|
101
|
+
- app/views/madmin/fields/float/_show.html.erb
|
112
102
|
- app/views/madmin/fields/has_many/_form.html.erb
|
103
|
+
- app/views/madmin/fields/has_many/_index.html.erb
|
113
104
|
- app/views/madmin/fields/has_many/_show.html.erb
|
114
105
|
- app/views/madmin/fields/has_one/_form.html.erb
|
106
|
+
- app/views/madmin/fields/has_one/_index.html.erb
|
115
107
|
- app/views/madmin/fields/has_one/_show.html.erb
|
116
|
-
- app/views/madmin/fields/
|
117
|
-
- app/views/madmin/fields/
|
118
|
-
- app/views/madmin/fields/
|
119
|
-
- app/views/madmin/fields/
|
120
|
-
- app/views/madmin/fields/
|
121
|
-
- app/views/madmin/fields/
|
108
|
+
- app/views/madmin/fields/integer/_form.html.erb
|
109
|
+
- app/views/madmin/fields/integer/_index.html.erb
|
110
|
+
- app/views/madmin/fields/integer/_show.html.erb
|
111
|
+
- app/views/madmin/fields/json/_form.html.erb
|
112
|
+
- app/views/madmin/fields/json/_index.html.erb
|
113
|
+
- app/views/madmin/fields/json/_show.html.erb
|
122
114
|
- app/views/madmin/fields/polymorphic/_form.html.erb
|
123
115
|
- app/views/madmin/fields/polymorphic/_index.html.erb
|
124
116
|
- app/views/madmin/fields/polymorphic/_show.html.erb
|
125
|
-
- app/views/madmin/fields/
|
126
|
-
- app/views/madmin/fields/
|
127
|
-
- app/views/madmin/fields/
|
117
|
+
- app/views/madmin/fields/rich_text/_form.html.erb
|
118
|
+
- app/views/madmin/fields/rich_text/_index.html.erb
|
119
|
+
- app/views/madmin/fields/rich_text/_show.html.erb
|
120
|
+
- app/views/madmin/fields/string/_form.html.erb
|
121
|
+
- app/views/madmin/fields/string/_index.html.erb
|
122
|
+
- app/views/madmin/fields/string/_show.html.erb
|
128
123
|
- app/views/madmin/fields/text/_form.html.erb
|
129
124
|
- app/views/madmin/fields/text/_index.html.erb
|
130
125
|
- app/views/madmin/fields/text/_show.html.erb
|
131
|
-
- app/views/madmin/fields/
|
132
|
-
- app/views/madmin/fields/
|
133
|
-
- app/views/madmin/fields/
|
134
|
-
- app/views/madmin/resources/_form.html.erb
|
135
|
-
- app/views/madmin/resources/_scopes.html.erb
|
136
|
-
- app/views/madmin/resources/edit.html.erb
|
137
|
-
- app/views/madmin/resources/index.html.erb
|
138
|
-
- app/views/madmin/resources/index/_content.html.erb
|
139
|
-
- app/views/madmin/resources/new.html.erb
|
140
|
-
- app/views/madmin/resources/show.html.erb
|
141
|
-
- config/routes.rb
|
142
|
-
- lib/generators/madmin/controller/USAGE
|
143
|
-
- lib/generators/madmin/controller/controller_generator.rb
|
126
|
+
- app/views/madmin/fields/time/_form.html.erb
|
127
|
+
- app/views/madmin/fields/time/_index.html.erb
|
128
|
+
- app/views/madmin/fields/time/_show.html.erb
|
144
129
|
- lib/generators/madmin/install/install_generator.rb
|
145
|
-
- lib/generators/madmin/
|
146
|
-
- lib/generators/madmin/page/page_generator.rb
|
147
|
-
- lib/generators/madmin/page/templates/template.html.erb
|
148
|
-
- lib/generators/madmin/page/templates/template.rb.erb
|
130
|
+
- lib/generators/madmin/install/templates/controller.rb.tt
|
149
131
|
- lib/generators/madmin/resource/resource_generator.rb
|
150
|
-
- lib/generators/madmin/resource/templates/
|
132
|
+
- lib/generators/madmin/resource/templates/controller.rb.tt
|
133
|
+
- lib/generators/madmin/resource/templates/resource.rb.tt
|
134
|
+
- lib/generators/madmin/views/edit_generator.rb
|
135
|
+
- lib/generators/madmin/views/form_generator.rb
|
136
|
+
- lib/generators/madmin/views/index_generator.rb
|
137
|
+
- lib/generators/madmin/views/layout_generator.rb
|
138
|
+
- lib/generators/madmin/views/navigation_generator.rb
|
139
|
+
- lib/generators/madmin/views/new_generator.rb
|
140
|
+
- lib/generators/madmin/views/show_generator.rb
|
151
141
|
- lib/generators/madmin/views/views_generator.rb
|
152
142
|
- lib/madmin.rb
|
153
143
|
- lib/madmin/engine.rb
|
154
144
|
- lib/madmin/field.rb
|
155
|
-
- lib/madmin/
|
156
|
-
- lib/madmin/
|
157
|
-
- lib/madmin/
|
158
|
-
- lib/madmin/
|
159
|
-
- lib/madmin/
|
160
|
-
- lib/madmin/
|
161
|
-
- lib/madmin/
|
162
|
-
- lib/madmin/
|
163
|
-
- lib/madmin/
|
164
|
-
- lib/madmin/
|
165
|
-
- lib/madmin/
|
166
|
-
- lib/madmin/
|
167
|
-
- lib/madmin/
|
145
|
+
- lib/madmin/fields/attachment.rb
|
146
|
+
- lib/madmin/fields/attachments.rb
|
147
|
+
- lib/madmin/fields/belongs_to.rb
|
148
|
+
- lib/madmin/fields/boolean.rb
|
149
|
+
- lib/madmin/fields/date.rb
|
150
|
+
- lib/madmin/fields/date_time.rb
|
151
|
+
- lib/madmin/fields/decimal.rb
|
152
|
+
- lib/madmin/fields/enum.rb
|
153
|
+
- lib/madmin/fields/float.rb
|
154
|
+
- lib/madmin/fields/has_many.rb
|
155
|
+
- lib/madmin/fields/has_one.rb
|
156
|
+
- lib/madmin/fields/integer.rb
|
157
|
+
- lib/madmin/fields/json.rb
|
158
|
+
- lib/madmin/fields/polymorphic.rb
|
159
|
+
- lib/madmin/fields/rich_text.rb
|
160
|
+
- lib/madmin/fields/string.rb
|
161
|
+
- lib/madmin/fields/text.rb
|
162
|
+
- lib/madmin/fields/time.rb
|
168
163
|
- lib/madmin/generator_helpers.rb
|
169
|
-
- lib/madmin/
|
170
|
-
- lib/madmin/
|
171
|
-
- lib/madmin/resources.rb
|
164
|
+
- lib/madmin/namespace.rb
|
165
|
+
- lib/madmin/resource.rb
|
172
166
|
- lib/madmin/version.rb
|
167
|
+
- lib/madmin/view_generator.rb
|
173
168
|
- lib/tasks/madmin_tasks.rake
|
174
|
-
homepage: https://
|
169
|
+
homepage: https://github.com/excid3/madmin
|
175
170
|
licenses:
|
176
171
|
- MIT
|
177
172
|
metadata: {}
|
178
|
-
post_install_message:
|
173
|
+
post_install_message:
|
179
174
|
rdoc_options: []
|
180
175
|
require_paths:
|
181
176
|
- lib
|
@@ -183,15 +178,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
178
|
requirements:
|
184
179
|
- - ">="
|
185
180
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
181
|
+
version: 2.5.0
|
187
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
183
|
requirements:
|
189
184
|
- - ">="
|
190
185
|
- !ruby/object:Gem::Version
|
191
186
|
version: '0'
|
192
187
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
194
|
-
signing_key:
|
188
|
+
rubygems_version: 3.2.3
|
189
|
+
signing_key:
|
195
190
|
specification_version: 4
|
196
|
-
summary:
|
191
|
+
summary: A modern admin for Ruby on Rails apps
|
197
192
|
test_files: []
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require rails-ujs
|
14
|
-
//= require activestorage
|
15
|
-
//= require_tree .
|
@@ -1,36 +0,0 @@
|
|
1
|
-
// Place all the behaviors and hooks related to the matching controller here.
|
2
|
-
// All this logic will automatically be available in application.js.
|
3
|
-
|
4
|
-
var updateResourceOptions = function(polymorphicField) {
|
5
|
-
var idField = document.getElementById("commentable_id");
|
6
|
-
var slug =
|
7
|
-
polymorphicField.options[polymorphicField.selectedIndex].dataset.slug;
|
8
|
-
|
9
|
-
idField.options.length = 0;
|
10
|
-
|
11
|
-
if (!slug) {
|
12
|
-
idField.classList.add("d-none");
|
13
|
-
return;
|
14
|
-
}
|
15
|
-
|
16
|
-
axios.get("/madmin/" + slug + ".json").then(function(response) {
|
17
|
-
response.data.forEach(function(resource) {
|
18
|
-
var option = document.createElement("option");
|
19
|
-
option.text = resource.display_value;
|
20
|
-
option.value = resource.id;
|
21
|
-
idField.add(option);
|
22
|
-
});
|
23
|
-
|
24
|
-
idField.classList.remove("d-none");
|
25
|
-
});
|
26
|
-
};
|
27
|
-
|
28
|
-
if (window.polymorphicFields) {
|
29
|
-
window.polymorphicFields.forEach(function(field) {
|
30
|
-
var polymorphicField = document.getElementById(field + "_type");
|
31
|
-
|
32
|
-
polymorphicField.addEventListener("change", function() {
|
33
|
-
updateResourceOptions(polymorphicField);
|
34
|
-
});
|
35
|
-
});
|
36
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Madmin
|
2
|
-
class ApplicationController < BaseController
|
3
|
-
protect_from_forgery with: :exception
|
4
|
-
|
5
|
-
before_action :authenticate!
|
6
|
-
|
7
|
-
private
|
8
|
-
|
9
|
-
def authenticate!
|
10
|
-
# redirect_to x_path unless current_user
|
11
|
-
#
|
12
|
-
# If using Devise, set this method to call:
|
13
|
-
# authenticate_user!
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|