admin_interface 1.4.3 → 2.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/.rvmrc +1 -0
  2. data/Gemfile +8 -0
  3. data/README.rdoc +8 -37
  4. data/Rakefile +30 -0
  5. data/admin_interface.gemspec +319 -17
  6. data/app/helpers/admin/base_helper.rb +6 -0
  7. data/app/inputs/country_code_input.rb +10 -0
  8. data/config/locales/en.yml +3 -0
  9. data/lib/admin_interface/engine.rb +11 -1
  10. data/lib/admin_interface/version.rb +11 -0
  11. data/lib/generators/{admin_scaffold/USAGE → admin_interface/SCAFFOLD_USAGE} +0 -0
  12. data/lib/generators/admin_interface/scaffold_generator.rb +154 -0
  13. data/lib/generators/admin_interface/setup_generator.rb +59 -0
  14. data/lib/generators/admin_interface/templates/scaffold/INSTALL +12 -0
  15. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/controller.rb +0 -0
  16. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/functional_test.rb +0 -0
  17. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/helper.rb +0 -0
  18. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/helper_test.rb +0 -0
  19. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/layout.html.erb +0 -0
  20. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/style.css +0 -0
  21. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_edit.html.erb +3 -3
  22. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_form_partial.html.erb +4 -0
  23. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_index.html.erb +3 -3
  24. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_list_partial.html.erb +0 -0
  25. data/lib/generators/admin_interface/templates/scaffold/view_new.html.erb +10 -0
  26. data/lib/generators/{admin_scaffold/templates → admin_interface/templates/scaffold}/view_show.html.erb +1 -1
  27. data/lib/generators/admin_interface/templates/setup/INSTALL +2 -0
  28. data/lib/generators/admin_interface/templates/{controllers → setup/controllers}/base_controller.rb +2 -2
  29. data/lib/generators/admin_interface/templates/{controllers → setup/controllers}/resource_controller.rb +0 -0
  30. data/lib/generators/admin_interface/templates/{views → setup/views}/index.html.erb +0 -0
  31. data/lib/generators/admin_interface/templates/{views → setup/views}/layout.html.erb +0 -0
  32. data/vendor/assets/images/admin/map.png +0 -0
  33. data/vendor/assets/images/admin/slide_show.png +0 -0
  34. data/vendor/assets/images/admin/view.png +0 -0
  35. data/vendor/assets/images/admin/world.png +0 -0
  36. data/vendor/assets/images/admin/zoom_in.png +0 -0
  37. data/vendor/assets/images/admin/zoom_in.png.old +0 -0
  38. data/vendor/assets/stylesheets/admin_interface.css.scss +17 -2
  39. metadata +398 -64
  40. data/lib/generators/admin_interface/admin_interface_generator.rb +0 -50
  41. data/lib/generators/admin_interface/templates/INSTALL +0 -1
  42. data/lib/generators/admin_scaffold/admin_scaffold_generator.rb +0 -144
  43. data/lib/generators/admin_scaffold/templates/INSTALL +0 -1
  44. data/lib/generators/admin_scaffold/templates/view_new.html.erb +0 -10
  45. data/vendor/assets/images/admin/22x22/.svn/all-wcprops +0 -89
  46. data/vendor/assets/images/admin/22x22/.svn/entries +0 -210
  47. data/vendor/assets/images/admin/22x22/.svn/format +0 -1
  48. data/vendor/assets/images/admin/22x22/.svn/prop-base/authent.png.svn-base +0 -5
  49. data/vendor/assets/images/admin/22x22/.svn/prop-base/comment.png.svn-base +0 -5
  50. data/vendor/assets/images/admin/22x22/.svn/prop-base/file.png.svn-base +0 -5
  51. data/vendor/assets/images/admin/22x22/.svn/prop-base/info.png.svn-base +0 -5
  52. data/vendor/assets/images/admin/22x22/.svn/prop-base/notifications.png.svn-base +0 -5
  53. data/vendor/assets/images/admin/22x22/.svn/prop-base/options.png.svn-base +0 -5
  54. data/vendor/assets/images/admin/22x22/.svn/prop-base/package.png.svn-base +0 -5
  55. data/vendor/assets/images/admin/22x22/.svn/prop-base/plugin.png.svn-base +0 -5
  56. data/vendor/assets/images/admin/22x22/.svn/prop-base/projects.png.svn-base +0 -5
  57. data/vendor/assets/images/admin/22x22/.svn/prop-base/role.png.svn-base +0 -5
  58. data/vendor/assets/images/admin/22x22/.svn/prop-base/settings.png.svn-base +0 -5
  59. data/vendor/assets/images/admin/22x22/.svn/prop-base/tracker.png.svn-base +0 -5
  60. data/vendor/assets/images/admin/22x22/.svn/prop-base/users.png.svn-base +0 -5
  61. data/vendor/assets/images/admin/22x22/.svn/prop-base/workflow.png.svn-base +0 -5
  62. data/vendor/assets/images/admin/22x22/.svn/text-base/authent.png.svn-base +0 -0
  63. data/vendor/assets/images/admin/22x22/.svn/text-base/comment.png.svn-base +0 -0
  64. data/vendor/assets/images/admin/22x22/.svn/text-base/file.png.svn-base +0 -0
  65. data/vendor/assets/images/admin/22x22/.svn/text-base/info.png.svn-base +0 -0
  66. data/vendor/assets/images/admin/22x22/.svn/text-base/notifications.png.svn-base +0 -0
  67. data/vendor/assets/images/admin/22x22/.svn/text-base/options.png.svn-base +0 -0
  68. data/vendor/assets/images/admin/22x22/.svn/text-base/package.png.svn-base +0 -0
  69. data/vendor/assets/images/admin/22x22/.svn/text-base/plugin.png.svn-base +0 -0
  70. data/vendor/assets/images/admin/22x22/.svn/text-base/projects.png.svn-base +0 -0
  71. data/vendor/assets/images/admin/22x22/.svn/text-base/role.png.svn-base +0 -0
  72. data/vendor/assets/images/admin/22x22/.svn/text-base/settings.png.svn-base +0 -0
  73. data/vendor/assets/images/admin/22x22/.svn/text-base/tracker.png.svn-base +0 -0
  74. data/vendor/assets/images/admin/22x22/.svn/text-base/users.png.svn-base +0 -0
  75. data/vendor/assets/images/admin/22x22/.svn/text-base/workflow.png.svn-base +0 -0
@@ -1,50 +0,0 @@
1
- class AdminInterfaceGenerator < Rails::Generators::Base
2
-
3
- source_root File.expand_path("../templates", __FILE__)
4
-
5
- # def copy_image_files
6
- # # Images
7
- # # Copy all images to public/images/admin
8
- # admin_image_dir = File.join('public', 'images', 'admin')
9
- # directory('images', admin_image_dir)
10
- # end
11
-
12
- def copy_controller_files
13
- copy_file("controllers/base_controller.rb", "app/controllers/admin/base_controller.rb")
14
- copy_file("controllers/resource_controller.rb", "app/controllers/admin/resource_controller.rb")
15
- end
16
-
17
- def copy_view_files
18
- copy_file("views/layout.html.erb", "app/views/layouts/admin.html.erb")
19
- copy_file("views/index.html.erb", "app/views/admin/base/index.html.erb")
20
- end
21
-
22
- # def copy_javascript_files
23
- # copy_file("javascripts/jquery.admin.js", "public/javascripts/jquery.admin.js")
24
- # end
25
- #
26
- # def copy_stylesheet_files
27
- # copy_file("views/admin.css", "public/stylesheets/admin.css")
28
- # end
29
-
30
- # Helper files are kept in the Engine Gem.
31
- # def copy_helper_files
32
- # copy_file("helpers/admin/base_helper.rb", "app/helpers/admin/base_helper.rb")
33
- # end
34
-
35
- def add_admin_route
36
- route <<ROUTE
37
- namespace :admin do
38
- root :to => 'base#index'
39
- # resources :some_model do
40
- # delete 'destroy_all', :on => :collection
41
- # end
42
- end
43
- ROUTE
44
- end
45
-
46
- def show_readme
47
- readme("INSTALL")
48
- end
49
-
50
- end
@@ -1 +0,0 @@
1
- See the README file on what to add to your routes.rb file!
@@ -1,144 +0,0 @@
1
- require 'rails/generators/resource_helpers'
2
- class AdminScaffoldGenerator < Rails::Generators::NamedBase
3
-
4
- # See: http://railsapi.com/doc/rails-v3.0.7/classes/Rails/Generators/ResourceHelpers.html
5
- include Rails::Generators::ResourceHelpers
6
- argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
7
-
8
- source_root File.expand_path("../templates", __FILE__)
9
-
10
- CONTROLLER_PATH = 'app/controllers/admin'
11
- # MODEL_PATH = 'app/models/admin'
12
- VIEW_PATH = 'app/views/admin'
13
-
14
- # default_options :skip_timestamps => false, :skip_migration => false, :force_plural => false
15
-
16
- def controller_plural_name
17
- @name.pluralize.downcase
18
- end
19
-
20
- alias_method :controller_file_name, :controller_file_name
21
- alias_method :controller_table_name, :controller_plural_name
22
-
23
- def check_class_collisions # TODO
24
- # Check for class naming collisions.
25
- # class_collisions class_path, "Admin::#{class_name}Controller"
26
- end
27
-
28
- def copy_controller_files
29
- template 'controller.rb', File.join(CONTROLLER_PATH, class_path, "#{controller_file_name}_controller.rb")
30
- end
31
-
32
- def create_admin_scaffold
33
- @name = file_name
34
-
35
- if @name == @name.pluralize && !options[:force_plural]
36
- puts "Plural version of the model detected, using singularized version. Override with --force-plural."
37
- @name = @name.singularize
38
- end
39
-
40
- for action in scaffold_views
41
- template(
42
- "view_#{action}.html.erb",
43
- File.join(VIEW_PATH, controller_class_path, controller_file_name, "#{action}.html.erb")
44
- )
45
- end
46
- template 'view_form_partial.html.erb', File.join(VIEW_PATH, controller_class_path, controller_file_name, "_form.html.erb")
47
-
48
- readme 'INSTALL'
49
- end
50
-
51
- private
52
-
53
- def scaffold_views
54
- %w[ index show new edit ]
55
- end
56
-
57
- # def create_admin_scaffold
58
- # @name = file_name
59
- #
60
- # if @name == @name.pluralize && !options[:force_plural]
61
- # logger.warning "Plural version of the model detected, using singularized version. Override with --force-plural."
62
- # @name = @name.singularize
63
- # end
64
- #
65
- # @controller_name = @name.pluralize
66
- #
67
- # base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
68
- # @controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
69
- # @controller_singular_name=base_name.singularize
70
- # if @controller_class_nesting.empty?
71
- # @controller_class_name = @controller_class_name_without_nesting
72
- # else
73
- # @controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
74
- # end
75
- # end
76
- #
77
- # def manifest
78
- # # Check for class naming collisions.
79
- # # m.class_collisions("Admin::#{controller_class_name}Controller")
80
- # # m.class_collisions(class_name)
81
- #
82
- # # Controller, helper, views, test and stylesheets directories.
83
- # # m.directory(File.join('app/models', class_path))
84
- # directory(File.join(CONTROLLER_PATH, controller_class_path))
85
- # # m.directory(File.join('app/helpers', controller_class_path))
86
- # directory(File.join(VIEW_PATH, controller_class_path, controller_file_name))
87
- # # m.directory(File.join('app/views/layouts', controller_class_path))
88
- # # m.directory(File.join('test/functional', controller_class_path))
89
- # # m.directory(File.join('test/unit', class_path))
90
- # # m.directory(File.join('test/unit/helpers', class_path))
91
- # # m.directory(File.join('public/stylesheets', class_path))
92
- #
93
- # for action in scaffold_views
94
- # template(
95
- # "view_#{action}.html.erb",
96
- # File.join(VIEW_PATH, controller_class_path, controller_file_name, "#{action}.html.erb")
97
- # )
98
- # end
99
- # template 'view_form_partial.html.erb', File.join(VIEW_PATH, controller_class_path, controller_file_name, "_form.html.erb")
100
- #
101
- # # Layout and stylesheet.
102
- # # m.template('layout.html.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.erb"))
103
- # # m.template('style.css', 'public/stylesheets/scaffold.css')
104
- #
105
- # template(
106
- # 'controller.rb', File.join(CONTROLLER_PATH, controller_class_path, "#{controller_file_name}_controller.rb")
107
- # )
108
- #
109
- # # m.template('functional_test.rb', File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
110
- # # m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
111
- # # m.template('helper_test.rb', File.join('test/unit/helpers', controller_class_path, "#{controller_file_name}_helper_test.rb"))
112
- #
113
- # # m.route_resources controller_file_name
114
- #
115
- # # m.dependency 'model', [name] + @args, :collision => :skip
116
- #
117
- # readme 'INSTALL'
118
- # end
119
- #
120
- # protected
121
- # # Override with your own usage banner.
122
- # def banner
123
- # "Usage: #{$0} scaffold ModelName [field:type, field:type]"
124
- # end
125
- #
126
- # def add_options!(opt)
127
- # opt.separator ''
128
- # opt.separator 'Options:'
129
- # opt.on("--skip-timestamps",
130
- # "Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
131
- # opt.on("--skip-migration",
132
- # "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
133
- # opt.on("--force-plural",
134
- # "Forces the generation of a plural ModelName") { |v| options[:force_plural] = v }
135
- # end
136
- #
137
- # def scaffold_views
138
- # %w[ index show new edit ]
139
- # end
140
- #
141
- # def model_name
142
- # class_name.demodulize
143
- # end
144
- end
@@ -1 +0,0 @@
1
- See the README file on what to add to your routes.rb file!
@@ -1,10 +0,0 @@
1
- <h2>New <%= singular_name %></h2>
2
-
3
- <%%= form_for(@<%= singular_name %>, :url => [:admin, @<%= singular_name %>], :html => {:class => 'tabular'}) do |form| %>
4
- <%%= form.error_messages %>
5
-
6
- <%%= render :partial => form %>
7
-
8
- <%%= form.submit 'Create' %>
9
- <%%= link_to 'Back', admin_<%= plural_name %>_path %>
10
- <%% end %>
@@ -1,89 +0,0 @@
1
- K 25
2
- svn:wc:ra_dav:version-url
3
- V 43
4
- /svn/!svn/ver/752/trunk/public/images/22x22
5
- END
6
- plugin.png
7
- K 25
8
- svn:wc:ra_dav:version-url
9
- V 54
10
- /svn/!svn/ver/752/trunk/public/images/22x22/plugin.png
11
- END
12
- file.png
13
- K 25
14
- svn:wc:ra_dav:version-url
15
- V 52
16
- /svn/!svn/ver/157/trunk/public/images/22x22/file.png
17
- END
18
- settings.png
19
- K 25
20
- svn:wc:ra_dav:version-url
21
- V 56
22
- /svn/!svn/ver/167/trunk/public/images/22x22/settings.png
23
- END
24
- role.png
25
- K 25
26
- svn:wc:ra_dav:version-url
27
- V 52
28
- /svn/!svn/ver/157/trunk/public/images/22x22/role.png
29
- END
30
- users.png
31
- K 25
32
- svn:wc:ra_dav:version-url
33
- V 53
34
- /svn/!svn/ver/157/trunk/public/images/22x22/users.png
35
- END
36
- comment.png
37
- K 25
38
- svn:wc:ra_dav:version-url
39
- V 55
40
- /svn/!svn/ver/529/trunk/public/images/22x22/comment.png
41
- END
42
- authent.png
43
- K 25
44
- svn:wc:ra_dav:version-url
45
- V 55
46
- /svn/!svn/ver/157/trunk/public/images/22x22/authent.png
47
- END
48
- notifications.png
49
- K 25
50
- svn:wc:ra_dav:version-url
51
- V 61
52
- /svn/!svn/ver/157/trunk/public/images/22x22/notifications.png
53
- END
54
- projects.png
55
- K 25
56
- svn:wc:ra_dav:version-url
57
- V 56
58
- /svn/!svn/ver/157/trunk/public/images/22x22/projects.png
59
- END
60
- workflow.png
61
- K 25
62
- svn:wc:ra_dav:version-url
63
- V 56
64
- /svn/!svn/ver/157/trunk/public/images/22x22/workflow.png
65
- END
66
- info.png
67
- K 25
68
- svn:wc:ra_dav:version-url
69
- V 52
70
- /svn/!svn/ver/157/trunk/public/images/22x22/info.png
71
- END
72
- options.png
73
- K 25
74
- svn:wc:ra_dav:version-url
75
- V 55
76
- /svn/!svn/ver/157/trunk/public/images/22x22/options.png
77
- END
78
- package.png
79
- K 25
80
- svn:wc:ra_dav:version-url
81
- V 55
82
- /svn/!svn/ver/164/trunk/public/images/22x22/package.png
83
- END
84
- tracker.png
85
- K 25
86
- svn:wc:ra_dav:version-url
87
- V 55
88
- /svn/!svn/ver/157/trunk/public/images/22x22/tracker.png
89
- END
@@ -1,210 +0,0 @@
1
- 8
2
-
3
- dir
4
- 2744
5
- http://redmine.rubyforge.org/svn/trunk/public/images/22x22
6
- http://redmine.rubyforge.org/svn
7
-
8
-
9
-
10
- 2007-09-23T17:19:27.414302Z
11
- 752
12
- jplang
13
-
14
-
15
- svn:special svn:externals svn:needs-lock
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
- e93f8b46-1217-0410-a6f0-8f06a7374b81
28
-
29
- plugin.png
30
- file
31
-
32
-
33
-
34
-
35
- 2009-05-16T12:05:29.000000Z
36
- 32ae7e9669b540005c55e2fd631ae82f
37
- 2007-09-23T17:19:27.414302Z
38
- 752
39
- jplang
40
- has-props
41
-
42
- file.png
43
- file
44
-
45
-
46
-
47
-
48
- 2009-05-16T12:05:29.000000Z
49
- 77b52b5eaca4d4d49c2e45e7bb4517ac
50
- 2007-01-08T19:21:59.140156Z
51
- 157
52
- jplang
53
- has-props
54
-
55
- settings.png
56
- file
57
-
58
-
59
-
60
-
61
- 2009-05-16T12:05:29.000000Z
62
- be61e0c45535750b21d00fdc958384cf
63
- 2007-01-21T11:50:22.864544Z
64
- 167
65
- jplang
66
- has-props
67
-
68
- role.png
69
- file
70
-
71
-
72
-
73
-
74
- 2009-05-16T12:05:29.000000Z
75
- 8f90fc8e800d46206b3535c34909547a
76
- 2007-01-08T19:21:59.140156Z
77
- 157
78
- jplang
79
- has-props
80
-
81
- users.png
82
- file
83
-
84
-
85
-
86
-
87
- 2009-05-16T12:05:29.000000Z
88
- ecd3405a134857f862a7728c1e37bcb0
89
- 2007-01-08T19:21:59.140156Z
90
- 157
91
- jplang
92
- has-props
93
-
94
- comment.png
95
- file
96
-
97
-
98
-
99
-
100
- 2009-05-16T12:05:29.000000Z
101
- 751aecd22b463fe4195dc0ca48b7f346
102
- 2007-05-13T17:09:56.765659Z
103
- 529
104
- jplang
105
- has-props
106
-
107
- authent.png
108
- file
109
-
110
-
111
-
112
-
113
- 2009-05-16T12:05:29.000000Z
114
- 044dc1865020a28ee079d589a56502f9
115
- 2007-01-08T19:21:59.140156Z
116
- 157
117
- jplang
118
- has-props
119
-
120
- notifications.png
121
- file
122
-
123
-
124
-
125
-
126
- 2009-05-16T12:05:29.000000Z
127
- 122667ef626bce599397e1dcc1f71ec7
128
- 2007-01-08T19:21:59.140156Z
129
- 157
130
- jplang
131
- has-props
132
-
133
- projects.png
134
- file
135
-
136
-
137
-
138
-
139
- 2009-05-16T12:05:29.000000Z
140
- 09496465ad3e12b20daf7755facbb76b
141
- 2007-01-08T19:21:59.140156Z
142
- 157
143
- jplang
144
- has-props
145
-
146
- workflow.png
147
- file
148
-
149
-
150
-
151
-
152
- 2009-05-16T12:05:29.000000Z
153
- 0153917416905d5bde62a73eb4c664db
154
- 2007-01-08T19:21:59.140156Z
155
- 157
156
- jplang
157
- has-props
158
-
159
- info.png
160
- file
161
-
162
-
163
-
164
-
165
- 2009-05-16T12:05:29.000000Z
166
- e57082db2c35e65f200e2bc8a59bc58d
167
- 2007-01-08T19:21:59.140156Z
168
- 157
169
- jplang
170
- has-props
171
-
172
- options.png
173
- file
174
-
175
-
176
-
177
-
178
- 2009-05-16T12:05:29.000000Z
179
- 7aa134d4b5879703730cfd508407ddb2
180
- 2007-01-08T19:21:59.140156Z
181
- 157
182
- jplang
183
- has-props
184
-
185
- package.png
186
- file
187
-
188
-
189
-
190
-
191
- 2009-05-16T12:05:29.000000Z
192
- 17099a3ca91a9e1ed7eb96d009258990
193
- 2007-01-15T20:14:06.587659Z
194
- 164
195
- jplang
196
- has-props
197
-
198
- tracker.png
199
- file
200
-
201
-
202
-
203
-
204
- 2009-05-16T12:05:29.000000Z
205
- f7bc5d71c8659e3f1154c6e479e78e10
206
- 2007-01-08T19:21:59.140156Z
207
- 157
208
- jplang
209
- has-props
210
-