control_center 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.markdown +188 -0
- data/generators/control_center/control_center_generator.rb +26 -0
- data/generators/control_center/templates/control_center.rb +14 -0
- data/lib/control_center.rb +20 -0
- data/lib/control_center/engine.rb +18 -0
- data/lib/control_center/helpers/layout_helper.rb +65 -0
- data/lib/control_center/helpers/tab_builder.rb +14 -0
- data/lib/tasks/control_center_tasks.rake +4 -0
- data/rails/init.rb +7 -0
- data/test/rails/README +2 -0
- data/test/rails/Rakefile +10 -0
- data/test/rails/app/controllers/application.rb +15 -0
- data/test/rails/app/controllers/application_controller.rb +15 -0
- data/test/rails/app/controllers/test_controller.rb +3 -0
- data/test/rails/app/helpers/application_helper.rb +3 -0
- data/test/rails/app/helpers/test_helper.rb +2 -0
- data/test/rails/app/views/layouts/_header_links.html.erb +2 -0
- data/test/rails/app/views/layouts/_tabs.html.erb +3 -0
- data/test/rails/app/views/layouts/control_center.html.erb +64 -0
- data/test/rails/app/views/test/forms.html.erb +106 -0
- data/test/rails/app/views/test/index.html.erb +28 -0
- data/test/rails/app/views/test/no_sidebar.html.erb +17 -0
- data/test/rails/app/views/test/pagination.html.erb +4 -0
- data/test/rails/app/views/test/tab_override.html.erb +12 -0
- data/test/rails/app/views/test/table.html.erb +27 -0
- data/test/rails/config/boot.rb +110 -0
- data/test/rails/config/database.yml +22 -0
- data/test/rails/config/environment.rb +76 -0
- data/test/rails/config/environments/development.rb +17 -0
- data/test/rails/config/environments/production.rb +24 -0
- data/test/rails/config/environments/test.rb +22 -0
- data/test/rails/config/initializers/control_center.rb +14 -0
- data/test/rails/config/initializers/inflections.rb +10 -0
- data/test/rails/config/initializers/mime_types.rb +5 -0
- data/test/rails/config/initializers/new_rails_defaults.rb +17 -0
- data/test/rails/config/locales/en.yml +5 -0
- data/test/rails/config/routes.rb +43 -0
- data/test/rails/db/development.sqlite3 +0 -0
- data/test/rails/db/test.sqlite3 +0 -0
- data/test/rails/doc/README_FOR_APP +5 -0
- data/test/rails/lib/tasks/databaseless.rake +3 -0
- data/test/rails/log/development.log +251 -0
- data/test/rails/log/test.log +280 -0
- data/test/rails/public/404.html +30 -0
- data/test/rails/public/422.html +30 -0
- data/test/rails/public/500.html +33 -0
- data/test/rails/public/dispatch.cgi +10 -0
- data/test/rails/public/dispatch.fcgi +24 -0
- data/test/rails/public/dispatch.rb +10 -0
- data/test/rails/public/favicon.ico +0 -0
- data/test/rails/public/images/rails.png +0 -0
- data/test/rails/public/javascripts/application.js +2 -0
- data/test/rails/public/javascripts/controls.js +963 -0
- data/test/rails/public/javascripts/dragdrop.js +973 -0
- data/test/rails/public/javascripts/effects.js +1128 -0
- data/test/rails/public/javascripts/prototype.js +4320 -0
- data/test/rails/public/robots.txt +5 -0
- data/test/rails/public/stylesheets/control_center.css +289 -0
- data/test/rails/public/stylesheets/custom_css_1.css +0 -0
- data/test/rails/public/stylesheets/custom_css_2.css +0 -0
- data/test/rails/script/about +4 -0
- data/test/rails/script/console +3 -0
- data/test/rails/script/dbconsole +3 -0
- data/test/rails/script/destroy +3 -0
- data/test/rails/script/generate +3 -0
- data/test/rails/script/performance/benchmarker +3 -0
- data/test/rails/script/performance/profiler +3 -0
- data/test/rails/script/performance/request +3 -0
- data/test/rails/script/plugin +3 -0
- data/test/rails/script/process/inspector +3 -0
- data/test/rails/script/process/reaper +3 -0
- data/test/rails/script/process/spawner +3 -0
- data/test/rails/script/runner +3 -0
- data/test/rails/script/server +3 -0
- data/test/rails/test/functional/test_controller_test.rb +49 -0
- data/test/rails/test/performance/browsing_test.rb +9 -0
- data/test/rails/test/test_helper.rb +13 -0
- data/test/rails/update +6 -0
- metadata +145 -0
@@ -0,0 +1,289 @@
|
|
1
|
+
body {
|
2
|
+
background: #ddd;
|
3
|
+
font-family: arial, sans-serif;
|
4
|
+
margin: 0;
|
5
|
+
padding: 0;
|
6
|
+
font-size: 12px;
|
7
|
+
}
|
8
|
+
a img {
|
9
|
+
border: 0;
|
10
|
+
}
|
11
|
+
|
12
|
+
/* header styling */
|
13
|
+
#header {
|
14
|
+
background: #36393d;
|
15
|
+
color: #fff;
|
16
|
+
height: 70px;
|
17
|
+
}
|
18
|
+
#header h1 a {
|
19
|
+
text-decoration: none;
|
20
|
+
}
|
21
|
+
#header h1 {
|
22
|
+
font-size: 30px;
|
23
|
+
line-height: 70px;
|
24
|
+
margin: 0;
|
25
|
+
padding: 0 0 0 20px;
|
26
|
+
}
|
27
|
+
#header #header_links {
|
28
|
+
font-size: small;
|
29
|
+
margin: -65px 15px 0 0;
|
30
|
+
padding: 0;
|
31
|
+
list-style-type: none;
|
32
|
+
text-align: right;
|
33
|
+
float: right;
|
34
|
+
}
|
35
|
+
#header #header_links li {
|
36
|
+
float: left;
|
37
|
+
margin: 0 0 0 5px;
|
38
|
+
}
|
39
|
+
#header #header_links a {
|
40
|
+
color: white;
|
41
|
+
}
|
42
|
+
#header #header_links a:hover {
|
43
|
+
color: #36393d;
|
44
|
+
background: #fff;
|
45
|
+
text-decoration: none;
|
46
|
+
}
|
47
|
+
|
48
|
+
/* primary tabsigation styling */
|
49
|
+
#tabs {
|
50
|
+
clear: both;
|
51
|
+
float: right;
|
52
|
+
margin: -27px 5px 0 0;
|
53
|
+
list-style-type: none;
|
54
|
+
font-weight: bold;
|
55
|
+
font-size: small;
|
56
|
+
}
|
57
|
+
#tabs li {
|
58
|
+
float: left;
|
59
|
+
height: 27px;
|
60
|
+
line-height: 27px;
|
61
|
+
padding: 0 10px;
|
62
|
+
}
|
63
|
+
#tabs li.active {
|
64
|
+
background: #ddd;
|
65
|
+
}
|
66
|
+
#tabs li.active a {
|
67
|
+
color: #000;
|
68
|
+
}
|
69
|
+
#tabs a {
|
70
|
+
text-decoration: none;
|
71
|
+
padding: 3px;
|
72
|
+
color: #fff;
|
73
|
+
}
|
74
|
+
#tabs a:hover {
|
75
|
+
text-decoration: underline;
|
76
|
+
}
|
77
|
+
/* secondary tabsigation styling */
|
78
|
+
#sub_tabs {
|
79
|
+
clear: both;
|
80
|
+
float: left;
|
81
|
+
list-style-type: none;
|
82
|
+
font-weight: bold;
|
83
|
+
font-size: small;
|
84
|
+
margin: 13px 0 0 -15px;
|
85
|
+
}
|
86
|
+
#sub_tabs li {
|
87
|
+
float: left;
|
88
|
+
height: 27px;
|
89
|
+
line-height: 27px;
|
90
|
+
padding: 0 10px;
|
91
|
+
margin-right: 7px;
|
92
|
+
}
|
93
|
+
#sub_tabs li.active {
|
94
|
+
background: #fff;
|
95
|
+
}
|
96
|
+
#sub_tabs li.active a {
|
97
|
+
color: #000;
|
98
|
+
}
|
99
|
+
#sub_tabs a {
|
100
|
+
text-decoration: none;
|
101
|
+
padding: 3px;
|
102
|
+
color: #fff;
|
103
|
+
}
|
104
|
+
#sub_tabs a:hover {
|
105
|
+
text-decoration: underline;
|
106
|
+
}
|
107
|
+
|
108
|
+
/* main content styling */
|
109
|
+
h2 {
|
110
|
+
padding: 5px;
|
111
|
+
}
|
112
|
+
#main {
|
113
|
+
min-width: 800px;
|
114
|
+
}
|
115
|
+
#content {
|
116
|
+
clear: both;
|
117
|
+
}
|
118
|
+
#content_inside {
|
119
|
+
padding: 5px 10px 10px 10px;
|
120
|
+
margin: 0 10px 10px 10px;
|
121
|
+
background: #fff;
|
122
|
+
border-right: 2px solid #ccc;
|
123
|
+
border-bottom: 2px solid #ccc;
|
124
|
+
min-width: 800px;
|
125
|
+
}
|
126
|
+
|
127
|
+
#content.narrow {
|
128
|
+
float: left;
|
129
|
+
width: 70%;
|
130
|
+
}
|
131
|
+
#content.narrow #content_inside {
|
132
|
+
min-width: 560px;
|
133
|
+
}
|
134
|
+
|
135
|
+
#sidebar {
|
136
|
+
float: left;
|
137
|
+
width: 30%;
|
138
|
+
}
|
139
|
+
#sidebar_inside {
|
140
|
+
min-width: 240px;
|
141
|
+
margin: 0 10px 0 0;
|
142
|
+
}
|
143
|
+
.sidebar_box {
|
144
|
+
border-bottom: 2px solid #ccc;
|
145
|
+
}
|
146
|
+
|
147
|
+
/* style for forms */
|
148
|
+
form {
|
149
|
+
margin: 20px 0;
|
150
|
+
width: 100%;
|
151
|
+
}
|
152
|
+
form div {
|
153
|
+
clear: both;
|
154
|
+
float: left;
|
155
|
+
margin-bottom: 6px;
|
156
|
+
}
|
157
|
+
form div div.col2 {
|
158
|
+
width: 200px;
|
159
|
+
float: left;
|
160
|
+
margin: 0 20px 0 0;
|
161
|
+
clear: none;
|
162
|
+
}
|
163
|
+
label {
|
164
|
+
display: block;
|
165
|
+
}
|
166
|
+
fieldset {
|
167
|
+
border: 0;
|
168
|
+
border-top: 1px solid #ddd;
|
169
|
+
clear: both;
|
170
|
+
padding: 0.8em 0 0 0;
|
171
|
+
}
|
172
|
+
fieldset legend {
|
173
|
+
font-weight: bold;
|
174
|
+
margin: 0 0 0 10px;
|
175
|
+
font-size: 1.2em;
|
176
|
+
}
|
177
|
+
input[type="text"], input[type="password"] {
|
178
|
+
width: 200px;
|
179
|
+
}
|
180
|
+
textarea {
|
181
|
+
margin: 0;
|
182
|
+
}
|
183
|
+
input[type="submit"] {
|
184
|
+
margin-top: 20px;
|
185
|
+
}
|
186
|
+
form div.submit {
|
187
|
+
clear: both;
|
188
|
+
float: none;
|
189
|
+
}
|
190
|
+
|
191
|
+
/* styling for errors */
|
192
|
+
.errorExplanation {
|
193
|
+
border: 2px solid #c00;
|
194
|
+
margin-bottom: 8px;
|
195
|
+
width: 100%;
|
196
|
+
}
|
197
|
+
.errorExplanation h2 {
|
198
|
+
float: none;
|
199
|
+
background: #c00;
|
200
|
+
margin: 0;
|
201
|
+
color: #fff;
|
202
|
+
padding: 3px;
|
203
|
+
font-size: large;
|
204
|
+
}
|
205
|
+
.errorExplanation p {
|
206
|
+
padding: 3px;
|
207
|
+
margin: 3px 0;
|
208
|
+
}
|
209
|
+
.fieldWithErrors {
|
210
|
+
display: inline;
|
211
|
+
margin: 0; padding: 0;
|
212
|
+
}
|
213
|
+
.fieldWithErrors input[type="text"], .fieldWithErrors input[type="password"] {
|
214
|
+
border: 2px solid #c00;
|
215
|
+
}
|
216
|
+
.fieldWithErrors label {
|
217
|
+
color: #c00;
|
218
|
+
}
|
219
|
+
|
220
|
+
/* style for tables that are used as reports */
|
221
|
+
table {
|
222
|
+
border-collapse: collapse;
|
223
|
+
margin-bottom: 30px;
|
224
|
+
}
|
225
|
+
table thead tr {
|
226
|
+
border-bottom: 1px solid #000;
|
227
|
+
}
|
228
|
+
table thead th {
|
229
|
+
text-align: center;
|
230
|
+
}
|
231
|
+
table tbody th {
|
232
|
+
text-align: left;
|
233
|
+
vertical-align: top;
|
234
|
+
}
|
235
|
+
table tbody td {
|
236
|
+
padding: 2px 10px;
|
237
|
+
vertical-align: top;
|
238
|
+
}
|
239
|
+
|
240
|
+
/* makes something 100% width */
|
241
|
+
.wide {
|
242
|
+
width: 100%;
|
243
|
+
}
|
244
|
+
|
245
|
+
/* style for pagination */
|
246
|
+
.pagination {
|
247
|
+
padding: 3px;
|
248
|
+
margin: 15px 3px 3px 3px;
|
249
|
+
}
|
250
|
+
.pagination a {
|
251
|
+
padding: 2px 5px 2px 5px;
|
252
|
+
margin: 2px;
|
253
|
+
border: 1px solid #aaaadd;
|
254
|
+
text-decoration: none;
|
255
|
+
color: #36393d;
|
256
|
+
}
|
257
|
+
.pagination a:hover, .pagination a:active {
|
258
|
+
border: 1px solid #36393d;
|
259
|
+
color: #000;
|
260
|
+
}
|
261
|
+
.pagination span.current {
|
262
|
+
padding: 2px 5px 2px 5px;
|
263
|
+
margin: 2px;
|
264
|
+
border: 1px solid #36393d;
|
265
|
+
font-weight: bold;
|
266
|
+
background-color: #36393d;
|
267
|
+
color: #FFF;
|
268
|
+
}
|
269
|
+
.pagination span.disabled {
|
270
|
+
padding: 2px 5px 2px 5px;
|
271
|
+
margin: 2px;
|
272
|
+
border: 1px solid #eee;
|
273
|
+
color: #ddd;
|
274
|
+
}
|
275
|
+
|
276
|
+
/* styles for flashed messages and errors */
|
277
|
+
#message {
|
278
|
+
background: #ff8;
|
279
|
+
font-weight: bold;
|
280
|
+
padding: 5px 20px;
|
281
|
+
margin-top: 10px;
|
282
|
+
}
|
283
|
+
#error {
|
284
|
+
background: #c00;
|
285
|
+
font-weight: bold;
|
286
|
+
color: #fff;
|
287
|
+
padding: 5px 20px;
|
288
|
+
margin-top: 10px;
|
289
|
+
}
|
File without changes
|
File without changes
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestControllerTest < ActionController::TestCase
|
4
|
+
test "that adding custom stylesheets works" do
|
5
|
+
ControlCenter::Config.custom_css = {
|
6
|
+
"custom_css_1" => { :media => :all },
|
7
|
+
"custom_css_2" => { :media => :print }
|
8
|
+
}
|
9
|
+
get :index
|
10
|
+
|
11
|
+
# make sure custom_css_1 is there
|
12
|
+
assert_select "link[href=?]", /\/stylesheets\/custom_css_1.css.*/,
|
13
|
+
:count => 1
|
14
|
+
assert_select "link[media=?]", "all", :count => 1
|
15
|
+
|
16
|
+
# make sure custom_css_2 is there
|
17
|
+
assert_select "link[href=?]", /\/stylesheets\/custom_css_2.css.*/,
|
18
|
+
:count => 1
|
19
|
+
assert_select "link[media=?]", "print", :count => 1
|
20
|
+
end
|
21
|
+
|
22
|
+
test "that viewing a page with no custom stylesheets works" do
|
23
|
+
get :index
|
24
|
+
|
25
|
+
assert_response :success
|
26
|
+
end
|
27
|
+
|
28
|
+
test "that viewing a page with no attributes set to a stylesheet works" do
|
29
|
+
ControlCenter::Config.custom_css = {
|
30
|
+
"custom_css_1" => nil
|
31
|
+
}
|
32
|
+
|
33
|
+
get :index
|
34
|
+
|
35
|
+
assert_select "link[href=?]", /\/stylesheets\/custom_css_1.css.*/,
|
36
|
+
:count => 1
|
37
|
+
end
|
38
|
+
|
39
|
+
test "that adding custom javascripts works" do
|
40
|
+
ControlCenter::Config.include_javascript = %w(application prototype)
|
41
|
+
|
42
|
+
get :index
|
43
|
+
|
44
|
+
assert_select "script[src=?]", /\/javascripts\/application.js.*/,
|
45
|
+
:count => 1
|
46
|
+
assert_select "script[src=?]", /\/javascripts\/prototype.js.*/,
|
47
|
+
:count => 1
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
+
require 'test_help'
|
4
|
+
|
5
|
+
class ActiveSupport::TestCase
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
7
|
+
#
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
+
# -- they do not yet inherit this setting
|
10
|
+
fixtures :all
|
11
|
+
|
12
|
+
# Add more helper methods to be used by all tests here...
|
13
|
+
end
|