madmin 0.1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +50 -63
  4. data/Rakefile +5 -6
  5. data/app/assets/config/manifest.js +2 -0
  6. data/app/assets/stylesheets/actiontext.scss +36 -0
  7. data/app/assets/stylesheets/{madmin/application.css → application.css} +2 -9
  8. data/app/controllers/madmin/base_controller.rb +5 -9
  9. data/app/controllers/madmin/dashboard_controller.rb +1 -3
  10. data/app/controllers/madmin/resource_controller.rb +81 -0
  11. data/app/helpers/madmin/application_helper.rb +10 -8
  12. data/app/views/layouts/madmin/application.html.erb +23 -25
  13. data/app/views/madmin/application/_form.html.erb +25 -0
  14. data/app/views/madmin/application/_javascript.html.erb +24 -0
  15. data/app/views/madmin/application/_navigation.html.erb +6 -0
  16. data/app/views/madmin/application/edit.html.erb +3 -0
  17. data/app/views/madmin/application/index.html.erb +47 -0
  18. data/app/views/madmin/application/new.html.erb +3 -0
  19. data/app/views/madmin/application/show.html.erb +24 -0
  20. data/app/views/madmin/dashboard/show.html.erb +1 -0
  21. data/app/views/madmin/fields/attachment/_form.html.erb +2 -0
  22. data/app/views/madmin/fields/attachment/_index.html.erb +3 -0
  23. data/app/views/madmin/fields/attachment/_show.html.erb +3 -0
  24. data/app/views/madmin/fields/attachments/_form.html.erb +2 -0
  25. data/app/views/madmin/fields/attachments/_index.html.erb +1 -0
  26. data/app/views/madmin/fields/attachments/_show.html.erb +7 -0
  27. data/app/views/madmin/fields/belongs_to/_form.html.erb +2 -14
  28. data/app/views/madmin/fields/belongs_to/_index.html.erb +3 -7
  29. data/app/views/madmin/fields/belongs_to/_show.html.erb +3 -8
  30. data/app/views/madmin/fields/boolean/_form.html.erb +2 -0
  31. data/app/views/madmin/fields/boolean/_index.html.erb +1 -0
  32. data/app/views/madmin/fields/boolean/_show.html.erb +1 -0
  33. data/app/views/madmin/fields/date/_form.html.erb +2 -0
  34. data/app/views/madmin/fields/date/_index.html.erb +1 -0
  35. data/app/views/madmin/fields/date/_show.html.erb +1 -0
  36. data/app/views/madmin/fields/date_time/_form.html.erb +2 -0
  37. data/app/views/madmin/fields/date_time/_index.html.erb +1 -0
  38. data/app/views/madmin/fields/date_time/_show.html.erb +1 -0
  39. data/app/views/madmin/fields/decimal/_form.html.erb +2 -0
  40. data/app/views/madmin/fields/decimal/_index.html.erb +1 -0
  41. data/app/views/madmin/fields/decimal/_show.html.erb +1 -0
  42. data/app/views/madmin/fields/enum/_form.html.erb +2 -0
  43. data/app/views/madmin/fields/enum/_index.html.erb +1 -0
  44. data/app/views/madmin/fields/enum/_show.html.erb +1 -0
  45. data/app/views/madmin/fields/float/_form.html.erb +2 -0
  46. data/app/views/madmin/fields/float/_index.html.erb +1 -0
  47. data/app/views/madmin/fields/float/_show.html.erb +1 -0
  48. data/app/views/madmin/fields/has_many/_form.html.erb +2 -0
  49. data/app/views/madmin/fields/has_many/_index.html.erb +1 -0
  50. data/app/views/madmin/fields/has_many/_show.html.erb +4 -14
  51. data/app/views/madmin/fields/has_one/_form.html.erb +3 -0
  52. data/app/views/madmin/fields/has_one/_index.html.erb +3 -0
  53. data/app/views/madmin/fields/has_one/_show.html.erb +3 -12
  54. data/app/views/madmin/fields/integer/_form.html.erb +2 -0
  55. data/app/views/madmin/fields/integer/_index.html.erb +1 -0
  56. data/app/views/madmin/fields/integer/_show.html.erb +1 -0
  57. data/app/views/madmin/fields/json/_form.html.erb +2 -0
  58. data/app/views/madmin/fields/json/_index.html.erb +1 -0
  59. data/app/views/madmin/fields/json/_show.html.erb +1 -0
  60. data/app/views/madmin/fields/polymorphic/_form.html.erb +5 -32
  61. data/app/views/madmin/fields/polymorphic/_index.html.erb +3 -1
  62. data/app/views/madmin/fields/polymorphic/_show.html.erb +3 -14
  63. data/app/views/madmin/fields/rich_text/_form.html.erb +4 -0
  64. data/app/views/madmin/fields/rich_text/_index.html.erb +1 -0
  65. data/app/views/madmin/fields/rich_text/_show.html.erb +3 -0
  66. data/app/views/madmin/fields/string/_form.html.erb +2 -0
  67. data/app/views/madmin/fields/string/_index.html.erb +1 -0
  68. data/app/views/madmin/fields/string/_show.html.erb +1 -0
  69. data/app/views/madmin/fields/text/_form.html.erb +2 -4
  70. data/app/views/madmin/fields/text/_index.html.erb +1 -1
  71. data/app/views/madmin/fields/text/_show.html.erb +1 -8
  72. data/app/views/madmin/fields/time/_form.html.erb +2 -0
  73. data/app/views/madmin/fields/time/_index.html.erb +1 -0
  74. data/app/views/madmin/fields/time/_show.html.erb +1 -0
  75. data/lib/generators/madmin/install/install_generator.rb +31 -12
  76. data/lib/generators/madmin/install/templates/controller.rb.tt +22 -0
  77. data/lib/generators/madmin/resource/resource_generator.rb +83 -47
  78. data/lib/generators/madmin/resource/templates/controller.rb.tt +4 -0
  79. data/lib/generators/madmin/resource/templates/resource.rb.tt +11 -0
  80. data/lib/generators/madmin/views/edit_generator.rb +16 -0
  81. data/lib/generators/madmin/views/form_generator.rb +15 -0
  82. data/lib/generators/madmin/views/index_generator.rb +15 -0
  83. data/lib/generators/madmin/views/layout_generator.rb +21 -0
  84. data/lib/generators/madmin/views/navigation_generator.rb +15 -0
  85. data/lib/generators/madmin/views/new_generator.rb +16 -0
  86. data/lib/generators/madmin/views/show_generator.rb +15 -0
  87. data/lib/generators/madmin/views/views_generator.rb +8 -8
  88. data/lib/madmin.rb +34 -23
  89. data/lib/madmin/engine.rb +5 -2
  90. data/lib/madmin/field.rb +22 -46
  91. data/lib/madmin/fields/attachment.rb +6 -0
  92. data/lib/madmin/fields/attachments.rb +9 -0
  93. data/lib/madmin/fields/belongs_to.rb +18 -0
  94. data/lib/madmin/fields/boolean.rb +6 -0
  95. data/lib/madmin/fields/date.rb +6 -0
  96. data/lib/madmin/fields/date_time.rb +6 -0
  97. data/lib/madmin/fields/decimal.rb +6 -0
  98. data/lib/madmin/fields/enum.rb +9 -0
  99. data/lib/madmin/fields/float.rb +6 -0
  100. data/lib/madmin/fields/has_many.rb +18 -0
  101. data/lib/madmin/fields/has_one.rb +6 -0
  102. data/lib/madmin/fields/integer.rb +6 -0
  103. data/lib/madmin/fields/json.rb +6 -0
  104. data/lib/madmin/fields/polymorphic.rb +17 -0
  105. data/lib/madmin/fields/rich_text.rb +6 -0
  106. data/lib/madmin/fields/string.rb +6 -0
  107. data/lib/madmin/fields/text.rb +6 -0
  108. data/lib/madmin/fields/time.rb +6 -0
  109. data/lib/madmin/generator_helpers.rb +24 -0
  110. data/lib/madmin/namespace.rb +35 -0
  111. data/lib/madmin/resource.rb +176 -0
  112. data/lib/madmin/version.rb +1 -1
  113. data/lib/madmin/view_generator.rb +42 -0
  114. data/lib/tasks/madmin_tasks.rake +7 -0
  115. metadata +106 -111
  116. data/app/assets/config/madmin_manifest.js +0 -2
  117. data/app/assets/javascripts/madmin/application.js +0 -15
  118. data/app/assets/javascripts/madmin/dashboard.js +0 -2
  119. data/app/assets/javascripts/madmin/resources.js +0 -36
  120. data/app/assets/stylesheets/madmin/dashboard.css +0 -4
  121. data/app/assets/stylesheets/madmin/resources.css +0 -4
  122. data/app/controllers/madmin/application_controller.rb +0 -16
  123. data/app/controllers/madmin/resources_controller.rb +0 -97
  124. data/app/decorators/madmin/resource_decorator.rb +0 -16
  125. data/app/helpers/madmin/fields/polymorphic_helper.rb +0 -25
  126. data/app/jobs/madmin/application_job.rb +0 -4
  127. data/app/mailers/madmin/application_mailer.rb +0 -6
  128. data/app/models/madmin/application_record.rb +0 -5
  129. data/app/views/application/_navigation.html.erb +0 -17
  130. data/app/views/madmin/dashboard/index.html.erb +0 -6
  131. data/app/views/madmin/fields/check_box/_form.html.erb +0 -4
  132. data/app/views/madmin/fields/check_box/_index.html.erb +0 -1
  133. data/app/views/madmin/fields/check_box/_show.html.erb +0 -8
  134. data/app/views/madmin/fields/email/_form.html.erb +0 -4
  135. data/app/views/madmin/fields/email/_index.html.erb +0 -1
  136. data/app/views/madmin/fields/email/_show.html.erb +0 -8
  137. data/app/views/madmin/fields/number/_form.html.erb +0 -4
  138. data/app/views/madmin/fields/number/_index.html.erb +0 -1
  139. data/app/views/madmin/fields/number/_show.html.erb +0 -8
  140. data/app/views/madmin/fields/password/_form.html.erb +0 -4
  141. data/app/views/madmin/fields/password/_index.html.erb +0 -1
  142. data/app/views/madmin/fields/password/_show.html.erb +0 -8
  143. data/app/views/madmin/fields/select/_form.html.erb +0 -4
  144. data/app/views/madmin/fields/select/_index.html.erb +0 -1
  145. data/app/views/madmin/fields/select/_show.html.erb +0 -8
  146. data/app/views/madmin/fields/text_area/_form.html.erb +0 -4
  147. data/app/views/madmin/fields/text_area/_index.html.erb +0 -1
  148. data/app/views/madmin/fields/text_area/_show.html.erb +0 -8
  149. data/app/views/madmin/resources/_form.html.erb +0 -15
  150. data/app/views/madmin/resources/_scopes.html.erb +0 -10
  151. data/app/views/madmin/resources/edit.html.erb +0 -2
  152. data/app/views/madmin/resources/index.html.erb +0 -13
  153. data/app/views/madmin/resources/index/_content.html.erb +0 -33
  154. data/app/views/madmin/resources/new.html.erb +0 -2
  155. data/app/views/madmin/resources/show.html.erb +0 -10
  156. data/config/routes.rb +0 -11
  157. data/lib/generators/madmin/controller/USAGE +0 -8
  158. data/lib/generators/madmin/controller/controller_generator.rb +0 -10
  159. data/lib/generators/madmin/page/USAGE +0 -8
  160. data/lib/generators/madmin/page/page_generator.rb +0 -20
  161. data/lib/generators/madmin/page/templates/template.html.erb +0 -2
  162. data/lib/generators/madmin/page/templates/template.rb.erb +0 -10
  163. data/lib/generators/madmin/resource/templates/resource.rb.erb +0 -11
  164. data/lib/madmin/field/associatable.rb +0 -58
  165. data/lib/madmin/field/belongs_to.rb +0 -9
  166. data/lib/madmin/field/check_box.rb +0 -8
  167. data/lib/madmin/field/date_time.rb +0 -8
  168. data/lib/madmin/field/email.rb +0 -8
  169. data/lib/madmin/field/has_many.rb +0 -9
  170. data/lib/madmin/field/has_one.rb +0 -9
  171. data/lib/madmin/field/number.rb +0 -8
  172. data/lib/madmin/field/password.rb +0 -8
  173. data/lib/madmin/field/polymorphic.rb +0 -57
  174. data/lib/madmin/field/select.rb +0 -13
  175. data/lib/madmin/field/text.rb +0 -8
  176. data/lib/madmin/field/text_area.rb +0 -8
  177. data/lib/madmin/resourceable.rb +0 -72
  178. data/lib/madmin/resourceable/class_methods.rb +0 -152
  179. data/lib/madmin/resources.rb +0 -13
@@ -1,3 +1,3 @@
1
1
  module Madmin
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -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
@@ -2,3 +2,10 @@
2
2
  # task :madmin do
3
3
  # # Task goes here
4
4
  # end
5
+
6
+ namespace :madmin do
7
+ desc "Installs madmin into your app"
8
+ task :install do
9
+ system("#{RbConfig.ruby} ./bin/rails generate madmin:install")
10
+ end
11
+ end
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.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
- - Jason Charnes
8
7
  - Chris Oliver
9
- - Andrew Fomera
10
- autorequire:
8
+ - Andrea Fomera
9
+ autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2019-10-18 00:00:00.000000000 Z
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: '5.2'
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: '5.2'
27
+ version: 6.0.3
29
28
  - !ruby/object:Gem::Dependency
30
- name: pry-rails
29
+ name: pagy
31
30
  requirement: !ruby/object:Gem::Requirement
32
31
  requirements:
33
32
  - - ">="
34
33
  - !ruby/object:Gem::Version
35
- version: '0'
36
- type: :development
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
- - !ruby/object:Gem::Dependency
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: '0'
64
- type: :development
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: Administration for Rails
47
+ version: '4.0'
48
+ description: It's an admin, obviously.
72
49
  email:
73
- - jason@thecharnes.com
74
50
  - excid3@gmail.com
75
- - andrew@zerlex.net
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/madmin_manifest.js
84
- - app/assets/javascripts/madmin/application.js
85
- - app/assets/javascripts/madmin/dashboard.js
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/resources_controller.rb
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/dashboard/index.html.erb
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/check_box/_form.html.erb
107
- - app/views/madmin/fields/check_box/_index.html.erb
108
- - app/views/madmin/fields/check_box/_show.html.erb
109
- - app/views/madmin/fields/email/_form.html.erb
110
- - app/views/madmin/fields/email/_index.html.erb
111
- - app/views/madmin/fields/email/_show.html.erb
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/number/_form.html.erb
117
- - app/views/madmin/fields/number/_index.html.erb
118
- - app/views/madmin/fields/number/_show.html.erb
119
- - app/views/madmin/fields/password/_form.html.erb
120
- - app/views/madmin/fields/password/_index.html.erb
121
- - app/views/madmin/fields/password/_show.html.erb
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/select/_form.html.erb
126
- - app/views/madmin/fields/select/_index.html.erb
127
- - app/views/madmin/fields/select/_show.html.erb
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/text_area/_form.html.erb
132
- - app/views/madmin/fields/text_area/_index.html.erb
133
- - app/views/madmin/fields/text_area/_show.html.erb
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/page/USAGE
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/resource.rb.erb
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/field/associatable.rb
156
- - lib/madmin/field/belongs_to.rb
157
- - lib/madmin/field/check_box.rb
158
- - lib/madmin/field/date_time.rb
159
- - lib/madmin/field/email.rb
160
- - lib/madmin/field/has_many.rb
161
- - lib/madmin/field/has_one.rb
162
- - lib/madmin/field/number.rb
163
- - lib/madmin/field/password.rb
164
- - lib/madmin/field/polymorphic.rb
165
- - lib/madmin/field/select.rb
166
- - lib/madmin/field/text.rb
167
- - lib/madmin/field/text_area.rb
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/resourceable.rb
170
- - lib/madmin/resourceable/class_methods.rb
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://madmin.jasoncharnes.com
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: '0'
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.0.6
194
- signing_key:
188
+ rubygems_version: 3.2.3
189
+ signing_key:
195
190
  specification_version: 4
196
- summary: Administration for Rails
191
+ summary: A modern admin for Ruby on Rails apps
197
192
  test_files: []
@@ -1,2 +0,0 @@
1
- //= link_directory ../javascripts/madmin .js
2
- //= link_directory ../stylesheets/madmin .css
@@ -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,2 +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.
@@ -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,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -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