adminsite 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +209 -0
- data/MIT-LICENSE +20 -0
- data/README.markdown +122 -0
- data/Rakefile +14 -0
- data/USAGE +18 -0
- data/VERSION +1 -0
- data/app/admin_configs/adminsite/adminsite_admin_user_admin_config.rb +43 -0
- data/app/admin_configs/adminsite/adminsite_file_asset_admin_config.rb +32 -0
- data/app/admin_configs/adminsite/adminsite_page_admin_config.rb +46 -0
- data/app/admin_configs/adminsite/adminsite_page_layout_admin_config.rb +31 -0
- data/app/assets/images/adminsite/admin/accept.png +0 -0
- data/app/assets/images/adminsite/admin/add.png +0 -0
- data/app/assets/images/adminsite/admin/arrow_left.png +0 -0
- data/app/assets/images/adminsite/admin/arrow_refresh.png +0 -0
- data/app/assets/images/adminsite/admin/arrow_up.png +0 -0
- data/app/assets/images/adminsite/admin/cross.png +0 -0
- data/app/assets/images/adminsite/admin/logo.gif +0 -0
- data/app/assets/images/adminsite/admin/logo.png +0 -0
- data/app/assets/images/adminsite/admin/magnifier.png +0 -0
- data/app/assets/images/adminsite/admin/newspaper_add.png +0 -0
- data/app/assets/images/adminsite/admin/newspaper_delete.png +0 -0
- data/app/assets/images/adminsite/admin/openid-icon-small.gif +0 -0
- data/app/assets/images/adminsite/admin/page_white_magnify.png +0 -0
- data/app/assets/images/adminsite/admin/pencil.png +0 -0
- data/app/assets/images/adminsite/admin/rails.png +0 -0
- data/app/assets/images/adminsite/admin/reorder.gif +0 -0
- data/app/assets/images/adminsite/admin/spinner.gif +0 -0
- data/app/assets/javascripts/adminsite/admin.js +13 -0
- data/app/assets/javascripts/adminsite/admin/code_editor.js.coffee +40 -0
- data/app/assets/javascripts/adminsite/admin/hide_and_show.js +26 -0
- data/app/assets/stylesheets/adminsite/admin.scss +16 -0
- data/app/assets/stylesheets/adminsite/admin/base.scss +521 -0
- data/app/assets/stylesheets/adminsite/admin/code_editor.scss +29 -0
- data/app/assets/stylesheets/adminsite/admin/pagination.scss +28 -0
- data/app/controllers/adminsite/admin/adminsite_admin_users_controller.rb +21 -0
- data/app/controllers/adminsite/admin/adminsite_file_assets_controller.rb +57 -0
- data/app/controllers/adminsite/admin/adminsite_page_layouts_controller.rb +41 -0
- data/app/controllers/adminsite/admin/adminsite_pages_controller.rb +40 -0
- data/app/controllers/adminsite/admin/base_controller.rb +16 -0
- data/app/controllers/adminsite/admin/crud_controller.rb +27 -0
- data/app/controllers/adminsite/admin/iframe_controller.rb +28 -0
- data/app/controllers/adminsite/admin/resources_controller.rb +148 -0
- data/app/controllers/adminsite/admin_application_controller.rb +9 -0
- data/app/controllers/adminsite/admin_user_sessions_controller.rb +5 -0
- data/app/controllers/adminsite/contents_controller.rb +88 -0
- data/app/helpers/admin/adminsite_application_helper.rb +174 -0
- data/app/helpers/admin_application_helper.rb +3 -0
- data/app/models/adminsite/admin_config/base.rb +100 -0
- data/app/models/adminsite/admin_user.rb +10 -0
- data/app/models/adminsite/file_asset.rb +22 -0
- data/app/models/adminsite/page.rb +59 -0
- data/app/models/adminsite/page_layout.rb +9 -0
- data/app/views/adminsite/admin/adminsite_file_assets/index.html.haml +39 -0
- data/app/views/adminsite/admin/adminsite_page_layouts/edit.html.haml +5 -0
- data/app/views/adminsite/admin/adminsite_page_layouts/index.html.haml +9 -0
- data/app/views/adminsite/admin/adminsite_page_layouts/new.html.haml +5 -0
- data/app/views/adminsite/admin/adminsite_pages/edit.html.haml +5 -0
- data/app/views/adminsite/admin/adminsite_pages/index.html.haml +16 -0
- data/app/views/adminsite/admin/adminsite_pages/new.html.haml +5 -0
- data/app/views/adminsite/admin/crud/index.html.haml +4 -0
- data/app/views/adminsite/admin/crud/show.html.haml +15 -0
- data/app/views/adminsite/admin/iframe/index.haml +14 -0
- data/app/views/adminsite/admin/resources/_form.haml +6 -0
- data/app/views/adminsite/admin/resources/_list.haml +18 -0
- data/app/views/adminsite/admin/resources/_search_form.html.haml +41 -0
- data/app/views/adminsite/admin/resources/edit.haml +13 -0
- data/app/views/adminsite/admin/resources/index.haml +13 -0
- data/app/views/adminsite/admin/resources/new.haml +14 -0
- data/app/views/adminsite/admin/resources/show.haml +15 -0
- data/app/views/adminsite/admin/shared/_admin_menu.html.haml +6 -0
- data/app/views/adminsite/admin/shared/_content_menu.html.haml +4 -0
- data/app/views/adminsite/admin/shared/_page_assets_list.html.haml +6 -0
- data/app/views/adminsite/admin/shared/_syntax_help.html.haml +24 -0
- data/app/views/adminsite/admin_user_sessions/new.html.haml +14 -0
- data/app/views/layouts/adminsite/admin.html.haml +31 -0
- data/config/initializers/adminsite_constants.rb +2 -0
- data/config/initializers/assets.rb +7 -0
- data/config/initializers/devise.rb +265 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/paperclip.rb +15 -0
- data/config/initializers/time_formats.rb +1 -0
- data/config/locales/da.devise.yaml +57 -0
- data/config/locales/da.yaml +199 -0
- data/config/locales/en.devise.yaml +60 -0
- data/config/locales/en.yaml +205 -0
- data/config/routes.rb +17 -0
- data/db/migrate/20101007000000_create_admin.rb +59 -0
- data/db/migrate/20101007000001_create_cms_tables.rb +39 -0
- data/lib/adminsite.rb +28 -0
- data/lib/adminsite/configuration.rb +15 -0
- data/lib/adminsite/engine.rb +30 -0
- data/lib/adminsite/liquid/tags/asset.rb +70 -0
- data/lib/adminsite/version.rb +3 -0
- data/lib/generators/adminsite/add_dashboard/add_dashboard_generator.rb +34 -0
- data/lib/generators/adminsite/add_dashboard/templates/controllers/admin_dashboard_controller.rb +13 -0
- data/lib/generators/adminsite/add_dashboard/templates/views/index.html.haml +6 -0
- data/lib/generators/adminsite/add_iframe/add_iframe_generator.rb +42 -0
- data/lib/generators/adminsite/add_iframe/templates/controllers/admin_iframe_controller.rb +16 -0
- data/lib/generators/adminsite/add_resource/USAGE +0 -0
- data/lib/generators/adminsite/add_resource/add_resource_generator.rb +40 -0
- data/lib/generators/adminsite/add_resource/templates/admin_configs/resource_admin_config.rb +47 -0
- data/lib/generators/adminsite/add_resource/templates/controllers/admin_resource_controller.rb +19 -0
- data/lib/generators/adminsite/install/USAGE +13 -0
- data/lib/generators/adminsite/install/install_generator.rb +51 -0
- data/lib/generators/adminsite/install/templates/assets/adminsite.js +17 -0
- data/lib/generators/adminsite/install/templates/assets/adminsite.scss +14 -0
- data/lib/generators/adminsite/install/templates/config/locales/adminsite.da.yml +4 -0
- data/lib/generators/adminsite/install/templates/config/locales/adminsite.en.yml +6 -0
- data/lib/generators/adminsite/install/templates/recipes/application.rb +18 -0
- data/lib/generators/adminsite/install/templates/views/_admin_menu.html.haml +8 -0
- data/lib/recipes/adminsite.rb +82 -0
- data/lib/tasks/adminsite.rake +147 -0
- metadata +384 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 0250463289f2a9b816252c45b77c6f236f9f5823
|
|
4
|
+
data.tar.gz: 1fea1b5a47867e8808ff8debe66793cf31f20b6b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 06cffdb3e7e9a9ed39d2d312200713d37dc127f7e3ffc2614ec4b5c9caa128fc26c7aa5852ceb6f2753d8451ddaa15b4618ee40230eaaaf7752a583a92afaa11
|
|
7
|
+
data.tar.gz: 5a55222e035c30c3a348721f99afc1dc1d8437c5a319805f713a4238d5b568b00b78e329ca42e4c0a945e236122e2d3e021988e4eae185c1fa09cd3816a6d391
|
data/Gemfile
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
|
|
3
|
+
gemspec
|
|
4
|
+
|
|
5
|
+
# Add dependencies to develop your gem here.
|
|
6
|
+
# Include everything needed to run rake, tests, features, etc.
|
|
7
|
+
group :development do
|
|
8
|
+
gem "shoulda", ">= 0"
|
|
9
|
+
gem "simplecov", ">= 0.10.0"
|
|
10
|
+
gem "rdoc"
|
|
11
|
+
gem "rspec"
|
|
12
|
+
end
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
adminsite (2.0.0)
|
|
5
|
+
actionpack-page_caching
|
|
6
|
+
codemirror-rails (>= 4.8)
|
|
7
|
+
devise (~> 3.4)
|
|
8
|
+
domainatrix
|
|
9
|
+
formtastic (>= 3.1.3)
|
|
10
|
+
haml
|
|
11
|
+
jquery-rails
|
|
12
|
+
kaminari (>= 0.15.0)
|
|
13
|
+
liquid
|
|
14
|
+
paperclip
|
|
15
|
+
rails (~> 4.2)
|
|
16
|
+
ransack (>= 1.3)
|
|
17
|
+
sass-rails
|
|
18
|
+
|
|
19
|
+
GEM
|
|
20
|
+
remote: https://rubygems.org/
|
|
21
|
+
specs:
|
|
22
|
+
actionmailer (4.2.3)
|
|
23
|
+
actionpack (= 4.2.3)
|
|
24
|
+
actionview (= 4.2.3)
|
|
25
|
+
activejob (= 4.2.3)
|
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
28
|
+
actionpack (4.2.3)
|
|
29
|
+
actionview (= 4.2.3)
|
|
30
|
+
activesupport (= 4.2.3)
|
|
31
|
+
rack (~> 1.6)
|
|
32
|
+
rack-test (~> 0.6.2)
|
|
33
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
35
|
+
actionpack-page_caching (1.0.2)
|
|
36
|
+
actionpack (>= 4.0.0, < 5)
|
|
37
|
+
actionview (4.2.3)
|
|
38
|
+
activesupport (= 4.2.3)
|
|
39
|
+
builder (~> 3.1)
|
|
40
|
+
erubis (~> 2.7.0)
|
|
41
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
42
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
43
|
+
activejob (4.2.3)
|
|
44
|
+
activesupport (= 4.2.3)
|
|
45
|
+
globalid (>= 0.3.0)
|
|
46
|
+
activemodel (4.2.3)
|
|
47
|
+
activesupport (= 4.2.3)
|
|
48
|
+
builder (~> 3.1)
|
|
49
|
+
activerecord (4.2.3)
|
|
50
|
+
activemodel (= 4.2.3)
|
|
51
|
+
activesupport (= 4.2.3)
|
|
52
|
+
arel (~> 6.0)
|
|
53
|
+
activesupport (4.2.3)
|
|
54
|
+
i18n (~> 0.7)
|
|
55
|
+
json (~> 1.7, >= 1.7.7)
|
|
56
|
+
minitest (~> 5.1)
|
|
57
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
58
|
+
tzinfo (~> 1.1)
|
|
59
|
+
addressable (2.3.8)
|
|
60
|
+
arel (6.0.3)
|
|
61
|
+
bcrypt (3.1.10)
|
|
62
|
+
builder (3.2.2)
|
|
63
|
+
climate_control (0.0.3)
|
|
64
|
+
activesupport (>= 3.0)
|
|
65
|
+
cocaine (0.5.7)
|
|
66
|
+
climate_control (>= 0.0.3, < 1.0)
|
|
67
|
+
codemirror-rails (5.6)
|
|
68
|
+
railties (>= 3.0, < 5)
|
|
69
|
+
devise (3.5.2)
|
|
70
|
+
bcrypt (~> 3.0)
|
|
71
|
+
orm_adapter (~> 0.1)
|
|
72
|
+
railties (>= 3.2.6, < 5)
|
|
73
|
+
responders
|
|
74
|
+
thread_safe (~> 0.1)
|
|
75
|
+
warden (~> 1.2.3)
|
|
76
|
+
diff-lcs (1.2.5)
|
|
77
|
+
docile (1.1.5)
|
|
78
|
+
domainatrix (0.0.11)
|
|
79
|
+
addressable
|
|
80
|
+
erubis (2.7.0)
|
|
81
|
+
formtastic (3.1.3)
|
|
82
|
+
actionpack (>= 3.2.13)
|
|
83
|
+
globalid (0.3.6)
|
|
84
|
+
activesupport (>= 4.1.0)
|
|
85
|
+
haml (4.0.7)
|
|
86
|
+
tilt
|
|
87
|
+
i18n (0.7.0)
|
|
88
|
+
jquery-rails (4.0.5)
|
|
89
|
+
rails-dom-testing (~> 1.0)
|
|
90
|
+
railties (>= 4.2.0)
|
|
91
|
+
thor (>= 0.14, < 2.0)
|
|
92
|
+
json (1.8.3)
|
|
93
|
+
kaminari (0.16.3)
|
|
94
|
+
actionpack (>= 3.0.0)
|
|
95
|
+
activesupport (>= 3.0.0)
|
|
96
|
+
liquid (3.0.6)
|
|
97
|
+
loofah (2.0.3)
|
|
98
|
+
nokogiri (>= 1.5.9)
|
|
99
|
+
mail (2.6.3)
|
|
100
|
+
mime-types (>= 1.16, < 3)
|
|
101
|
+
mime-types (2.6.1)
|
|
102
|
+
mimemagic (0.3.0)
|
|
103
|
+
mini_portile (0.6.2)
|
|
104
|
+
minitest (5.7.0)
|
|
105
|
+
nokogiri (1.6.6.2)
|
|
106
|
+
mini_portile (~> 0.6.0)
|
|
107
|
+
orm_adapter (0.5.0)
|
|
108
|
+
paperclip (4.3.0)
|
|
109
|
+
activemodel (>= 3.2.0)
|
|
110
|
+
activesupport (>= 3.2.0)
|
|
111
|
+
cocaine (~> 0.5.5)
|
|
112
|
+
mime-types
|
|
113
|
+
mimemagic (= 0.3.0)
|
|
114
|
+
polyamorous (1.2.0)
|
|
115
|
+
activerecord (>= 3.0)
|
|
116
|
+
rack (1.6.4)
|
|
117
|
+
rack-test (0.6.3)
|
|
118
|
+
rack (>= 1.0)
|
|
119
|
+
rails (4.2.3)
|
|
120
|
+
actionmailer (= 4.2.3)
|
|
121
|
+
actionpack (= 4.2.3)
|
|
122
|
+
actionview (= 4.2.3)
|
|
123
|
+
activejob (= 4.2.3)
|
|
124
|
+
activemodel (= 4.2.3)
|
|
125
|
+
activerecord (= 4.2.3)
|
|
126
|
+
activesupport (= 4.2.3)
|
|
127
|
+
bundler (>= 1.3.0, < 2.0)
|
|
128
|
+
railties (= 4.2.3)
|
|
129
|
+
sprockets-rails
|
|
130
|
+
rails-deprecated_sanitizer (1.0.3)
|
|
131
|
+
activesupport (>= 4.2.0.alpha)
|
|
132
|
+
rails-dom-testing (1.0.7)
|
|
133
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
|
134
|
+
nokogiri (~> 1.6.0)
|
|
135
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
|
136
|
+
rails-html-sanitizer (1.0.2)
|
|
137
|
+
loofah (~> 2.0)
|
|
138
|
+
railties (4.2.3)
|
|
139
|
+
actionpack (= 4.2.3)
|
|
140
|
+
activesupport (= 4.2.3)
|
|
141
|
+
rake (>= 0.8.7)
|
|
142
|
+
thor (>= 0.18.1, < 2.0)
|
|
143
|
+
rake (10.4.2)
|
|
144
|
+
ransack (1.7.0)
|
|
145
|
+
actionpack (>= 3.0)
|
|
146
|
+
activerecord (>= 3.0)
|
|
147
|
+
activesupport (>= 3.0)
|
|
148
|
+
i18n
|
|
149
|
+
polyamorous (~> 1.2)
|
|
150
|
+
rdoc (4.2.0)
|
|
151
|
+
json (~> 1.4)
|
|
152
|
+
responders (2.1.0)
|
|
153
|
+
railties (>= 4.2.0, < 5)
|
|
154
|
+
rspec (3.3.0)
|
|
155
|
+
rspec-core (~> 3.3.0)
|
|
156
|
+
rspec-expectations (~> 3.3.0)
|
|
157
|
+
rspec-mocks (~> 3.3.0)
|
|
158
|
+
rspec-core (3.3.2)
|
|
159
|
+
rspec-support (~> 3.3.0)
|
|
160
|
+
rspec-expectations (3.3.1)
|
|
161
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
162
|
+
rspec-support (~> 3.3.0)
|
|
163
|
+
rspec-mocks (3.3.2)
|
|
164
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
165
|
+
rspec-support (~> 3.3.0)
|
|
166
|
+
rspec-support (3.3.0)
|
|
167
|
+
sass (3.4.18)
|
|
168
|
+
sass-rails (5.0.4)
|
|
169
|
+
railties (>= 4.0.0, < 5.0)
|
|
170
|
+
sass (~> 3.1)
|
|
171
|
+
sprockets (>= 2.8, < 4.0)
|
|
172
|
+
sprockets-rails (>= 2.0, < 4.0)
|
|
173
|
+
tilt (>= 1.1, < 3)
|
|
174
|
+
shoulda (3.5.0)
|
|
175
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
|
176
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
|
177
|
+
shoulda-context (1.2.1)
|
|
178
|
+
shoulda-matchers (2.8.0)
|
|
179
|
+
activesupport (>= 3.0.0)
|
|
180
|
+
simplecov (0.10.0)
|
|
181
|
+
docile (~> 1.1.0)
|
|
182
|
+
json (~> 1.8)
|
|
183
|
+
simplecov-html (~> 0.10.0)
|
|
184
|
+
simplecov-html (0.10.0)
|
|
185
|
+
sprockets (3.3.4)
|
|
186
|
+
rack (~> 1.0)
|
|
187
|
+
sprockets-rails (2.3.2)
|
|
188
|
+
actionpack (>= 3.0)
|
|
189
|
+
activesupport (>= 3.0)
|
|
190
|
+
sprockets (>= 2.8, < 4.0)
|
|
191
|
+
thor (0.19.1)
|
|
192
|
+
thread_safe (0.3.5)
|
|
193
|
+
tilt (2.0.1)
|
|
194
|
+
tzinfo (1.2.2)
|
|
195
|
+
thread_safe (~> 0.1)
|
|
196
|
+
warden (1.2.3)
|
|
197
|
+
rack (>= 1.0)
|
|
198
|
+
|
|
199
|
+
PLATFORMS
|
|
200
|
+
ruby
|
|
201
|
+
|
|
202
|
+
DEPENDENCIES
|
|
203
|
+
adminsite!
|
|
204
|
+
bundler (>= 1.5)
|
|
205
|
+
rake
|
|
206
|
+
rdoc
|
|
207
|
+
rspec
|
|
208
|
+
shoulda
|
|
209
|
+
simplecov (>= 0.10.0)
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2010 [name of plugin creator]
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Adminsite
|
|
2
|
+
=========
|
|
3
|
+
This is a basic Circle Admin Backend interface.
|
|
4
|
+
|
|
5
|
+
This support a series of namespaced (`yoursite.com/admin/`) backend with these
|
|
6
|
+
features:
|
|
7
|
+
|
|
8
|
+
- Login for admin
|
|
9
|
+
- Simple cms for pages (handle html xml files)
|
|
10
|
+
- Simple cms for file assets (handles images and swf files)
|
|
11
|
+
- Page caching
|
|
12
|
+
- Protected pages (agnostic, you need to implement your `current_user` methods)
|
|
13
|
+
- Mosso Cloud Files support
|
|
14
|
+
- Liquid template language
|
|
15
|
+
|
|
16
|
+
3 steps install
|
|
17
|
+
===============
|
|
18
|
+
1. Add this in your Gemfile:
|
|
19
|
+
|
|
20
|
+
gem 'adminsite'
|
|
21
|
+
|
|
22
|
+
2. Run
|
|
23
|
+
|
|
24
|
+
rails generate adminsite
|
|
25
|
+
|
|
26
|
+
3. There is no 3
|
|
27
|
+
You are ready to go!
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
How does it work.
|
|
31
|
+
================
|
|
32
|
+
1. Start your web server (ex: `./script/server`)
|
|
33
|
+
2. Log in at `http://localhost:3000/admin` with admin / password
|
|
34
|
+
3. Create a new page with:
|
|
35
|
+
- name: index page
|
|
36
|
+
- url: index.html
|
|
37
|
+
- body: "hello world"
|
|
38
|
+
4. open `http://localhost:3000/`
|
|
39
|
+
|
|
40
|
+
Adminsite Exporter Generators
|
|
41
|
+
=============================
|
|
42
|
+
You can generate an exporter based on a model. The generator takes care of all
|
|
43
|
+
the process including adding a new tab in the menu and needed routes.
|
|
44
|
+
|
|
45
|
+
You might want to adjust what the exports should contains,
|
|
46
|
+
you can define multiple style, look in the generated controllers and classes.
|
|
47
|
+
|
|
48
|
+
1. Run
|
|
49
|
+
|
|
50
|
+
`./script/generate admisite_exporter Customer`
|
|
51
|
+
|
|
52
|
+
2. Add the proper menu item in you view/admin/shared/_menu.html.haml file
|
|
53
|
+
|
|
54
|
+
`=menu\_item("Customer Exports", admin\_customer\_exports\_path)`
|
|
55
|
+
|
|
56
|
+
3. Based on you app setup you might need to add to environments.rb
|
|
57
|
+
|
|
58
|
+
`config.gem 'simple\_xlsx\_writer', :lib => 'simple\_xlsx'`
|
|
59
|
+
|
|
60
|
+
Where Customer is only an example.
|
|
61
|
+
|
|
62
|
+
Mosso Cloud Files
|
|
63
|
+
=================
|
|
64
|
+
If you want to use Mosso Cloud Files support you should add a
|
|
65
|
+
`config/mosso_cloudfiles.yml` that should look like this:
|
|
66
|
+
|
|
67
|
+
development:
|
|
68
|
+
username: circlerd
|
|
69
|
+
api_key: SECRET_API
|
|
70
|
+
test:
|
|
71
|
+
username: katherine
|
|
72
|
+
api_key: test
|
|
73
|
+
production:
|
|
74
|
+
username: circlerd
|
|
75
|
+
api_key: SECRET_API
|
|
76
|
+
|
|
77
|
+
`SECRET_API` is defined into the Mosso control panel and in all the projects we
|
|
78
|
+
have with Mosso integration (copy it from one of them).
|
|
79
|
+
|
|
80
|
+
Add this into your `config/environments/production.rb`:
|
|
81
|
+
|
|
82
|
+
PAPERCLIP_CONTAINER = "my_project_container"
|
|
83
|
+
|
|
84
|
+
Be sure that `my_project_container` exists for your account.
|
|
85
|
+
|
|
86
|
+
Add this line into your `config/environment.rb`:
|
|
87
|
+
|
|
88
|
+
gem.require 'cloudfiles'
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
Protected pages
|
|
92
|
+
===============
|
|
93
|
+
If you want protected pages you need to add in `ApplicationController` a
|
|
94
|
+
`authenticate_content_user` method:
|
|
95
|
+
|
|
96
|
+
This method should return `false` if no user is logged in or `true` if there is
|
|
97
|
+
a user logged in
|
|
98
|
+
|
|
99
|
+
ex. using Authlogic:
|
|
100
|
+
|
|
101
|
+
def authenticate_content_user
|
|
102
|
+
unless current_user
|
|
103
|
+
flash[:notice] = "You must be logged in to access this page"
|
|
104
|
+
redirect_to "/"
|
|
105
|
+
return false
|
|
106
|
+
end
|
|
107
|
+
return true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def current_user
|
|
111
|
+
# Place you authentication code here
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
Rake Tasks
|
|
116
|
+
==========
|
|
117
|
+
The gem adds these task:
|
|
118
|
+
|
|
119
|
+
rake db:migrate
|
|
120
|
+
rake adminsite:create_admin
|
|
121
|
+
|
|
122
|
+
These tasks are all executed for you by `rails g | grep adminsite`
|
data/Rakefile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
#!/usr/bin/env rake
|
|
4
|
+
begin
|
|
5
|
+
require 'bundler/setup'
|
|
6
|
+
require 'bundler/gem_tasks'
|
|
7
|
+
rescue LoadError
|
|
8
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
require 'rake'
|
|
12
|
+
|
|
13
|
+
# APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
14
|
+
# load 'rails/tasks/engine.rake'
|
data/USAGE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
************************************************************
|
|
2
|
+
|
|
3
|
+
Thank you for installing Circle Adminsite
|
|
4
|
+
|
|
5
|
+
Once you have installed this gem
|
|
6
|
+
include it into your app Gemfile with:
|
|
7
|
+
gem 'adminsite'
|
|
8
|
+
|
|
9
|
+
Then from your app root type:
|
|
10
|
+
rails generate adminsite
|
|
11
|
+
|
|
12
|
+
For Mosso Cloud Files integration and Protected pages
|
|
13
|
+
please refer to the README file in this gem root folder
|
|
14
|
+
|
|
15
|
+
Export generator is also available:
|
|
16
|
+
rails generate adminsite_exporter Product
|
|
17
|
+
|
|
18
|
+
************************************************************
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.3.1
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Adminsite
|
|
2
|
+
class AdminsiteAdminUserAdminConfig < Adminsite::AdminConfig::Base
|
|
3
|
+
|
|
4
|
+
def attributes_index
|
|
5
|
+
[ :name,
|
|
6
|
+
:email,
|
|
7
|
+
:updated_at
|
|
8
|
+
]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def attributes_edit
|
|
12
|
+
[ :name,
|
|
13
|
+
:email,
|
|
14
|
+
:password,
|
|
15
|
+
:password_confirmation
|
|
16
|
+
]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def attributes_show
|
|
20
|
+
[ :name,
|
|
21
|
+
:email,
|
|
22
|
+
:updated_at
|
|
23
|
+
]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def attributes_search
|
|
27
|
+
attributes_index
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def actions_index
|
|
31
|
+
[ :new ]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def default_member_actions
|
|
35
|
+
[ :edit,
|
|
36
|
+
:destroy]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def label_attribute
|
|
40
|
+
:email
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|