disguise 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +26 -24
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/app/models/domain_theme.rb +1 -1
- data/app/models/theme.rb +4 -4
- data/app/views/admin/themes/_theme.html.erb +3 -3
- data/app/views/admin/themes/edit.html.erb +9 -2
- data/config/locales/ar.yml +20 -0
- data/config/locales/bg.yml +20 -0
- data/config/locales/ca.yml +20 -0
- data/config/locales/cs.yml +20 -0
- data/{locales → config/locales}/da.yml +8 -8
- data/config/locales/de.yml +20 -0
- data/config/locales/el.yml +20 -0
- data/{locales → config/locales}/en.yml +0 -0
- data/config/locales/es.yml +20 -0
- data/config/locales/et.yml +20 -0
- data/config/locales/fa.yml +20 -0
- data/config/locales/fi.yml +20 -0
- data/{locales → config/locales}/fr.yml +8 -8
- data/config/locales/gl.yml +20 -0
- data/config/locales/hi.yml +20 -0
- data/config/locales/hr.yml +20 -0
- data/config/locales/hu.yml +20 -0
- data/config/locales/id.yml +20 -0
- data/config/locales/it.yml +20 -0
- data/config/locales/iw.yml +20 -0
- data/config/locales/ja.yml +20 -0
- data/config/locales/ko.yml +20 -0
- data/config/locales/lt.yml +20 -0
- data/config/locales/lv.yml +20 -0
- data/config/locales/mt.yml +20 -0
- data/config/locales/nl.yml +20 -0
- data/config/locales/no.yml +21 -0
- data/config/locales/pl.yml +20 -0
- data/config/locales/pt-PT.yml +20 -0
- data/{locales → config/locales}/pt.yml +0 -0
- data/config/locales/ro.yml +20 -0
- data/config/locales/ru.yml +20 -0
- data/config/locales/sk.yml +20 -0
- data/config/locales/sl.yml +20 -0
- data/{locales → config/locales}/sq.yml +7 -7
- data/config/locales/sr.yml +20 -0
- data/config/locales/sv.yml +20 -0
- data/config/locales/th.yml +20 -0
- data/config/locales/tl.yml +20 -0
- data/config/locales/tr.yml +20 -0
- data/config/locales/uk.yml +20 -0
- data/config/locales/vi.yml +20 -0
- data/config/locales/zh-CN.yml +20 -0
- data/config/locales/zh-TW.yml +20 -0
- data/config/locales/zh.yml +20 -0
- data/config/routes.rb +6 -0
- data/disguise.gemspec +157 -181
- data/lib/disguise.rb +2 -10
- data/lib/disguise/config.rb +22 -9
- data/lib/disguise/controllers/disguise_application.rb +58 -0
- data/lib/disguise/engine.rb +14 -0
- data/lib/tasks/diguise.rake +9 -0
- data/test/{rails_root → rails_test}/.gitignore +0 -0
- data/test/{rails_root → rails_test}/.rake_tasks +0 -0
- data/test/rails_test/Gemfile +18 -0
- data/test/rails_test/Gemfile.lock +114 -0
- data/test/{rails_root → rails_test}/Rakefile +2 -4
- data/test/{rails_root → rails_test}/app/controllers/admin/domain_themes_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/controllers/admin/themes_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/controllers/application_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/controllers/default_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/models/.keep +0 -0
- data/test/rails_test/app/models/user.rb +3 -0
- data/test/{rails_root → rails_test}/app/views/default/index.html.erb +0 -0
- data/test/{rails_root → rails_test}/app/views/layouts/default.html.erb +0 -0
- data/test/rails_test/config.ru +4 -0
- data/test/rails_test/config/application.rb +42 -0
- data/test/rails_test/config/boot.rb +13 -0
- data/test/rails_test/config/database.yml +14 -0
- data/test/rails_test/config/environment.rb +5 -0
- data/test/rails_test/config/environments/development.rb +26 -0
- data/test/rails_test/config/environments/production.rb +49 -0
- data/test/rails_test/config/environments/test.rb +35 -0
- data/test/rails_test/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_test/config/initializers/disguise.rb +5 -0
- data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
- data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
- data/test/rails_test/config/initializers/secret_token.rb +7 -0
- data/test/rails_test/config/initializers/session_store.rb +8 -0
- data/test/rails_test/config/routes.rb +3 -0
- data/test/{rails_root → rails_test}/db/.keep +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090530170040_create_themes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090602041838_create_users.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090606153236_create_domain_themes.rb +0 -0
- data/test/{rails_root → rails_test}/features/step_definitions/webrat_steps.rb +0 -0
- data/test/{rails_root → rails_test}/features/support/env.rb +0 -0
- data/test/{rails_root → rails_test}/public/.htaccess +0 -0
- data/test/rails_test/public/404.html +26 -0
- data/test/rails_test/public/422.html +26 -0
- data/test/rails_test/public/500.html +26 -0
- data/test/{rails_root → rails_test}/public/dispatch.rb +1 -1
- data/test/{rails_root → rails_test}/public/favicon.ico +0 -0
- data/test/{rails_root → rails_test}/public/images/blue/preview.gif +0 -0
- data/test/rails_test/public/images/rails.png +0 -0
- data/test/{rails_root → rails_test}/public/javascripts/application.js +0 -0
- data/test/{rails_root → rails_test}/public/javascripts/controls.js +75 -73
- data/test/{rails_root → rails_test}/public/javascripts/dragdrop.js +171 -169
- data/test/{rails_root → rails_test}/public/javascripts/effects.js +180 -177
- data/test/rails_test/public/javascripts/prototype.js +6001 -0
- data/test/rails_test/public/javascripts/rails.js +175 -0
- data/test/rails_test/public/robots.txt +5 -0
- data/test/{rails_root/public/stylesheets/.keep → rails_test/public/stylesheets/.gitkeep} +0 -0
- data/test/{rails_root/test/functional/.keep → rails_test/public/stylesheets/application.css} +0 -0
- data/test/rails_test/script/rails +6 -0
- data/test/{rails_root → rails_test}/test/factories.rb +0 -0
- data/test/{rails_root/test/integration → rails_test/test/functional}/.keep +0 -0
- data/test/{rails_root → rails_test}/test/functional/admin/domain_themes_controller_test.rb +6 -6
- data/test/{rails_root → rails_test}/test/functional/admin/themes_controller_test.rb +6 -6
- data/test/{rails_root → rails_test}/test/functional/default_controller_test.rb +2 -2
- data/test/{rails_root/test/mocks/development → rails_test/test/integration}/.keep +0 -0
- data/test/{rails_root → rails_test}/test/test_helper.rb +6 -9
- data/test/{rails_root/test/mocks/test → rails_test/test/unit}/.keep +0 -0
- data/test/{rails_root → rails_test}/test/unit/domain_theme_test.rb +2 -1
- data/test/{rails_root → rails_test}/test/unit/theme_test.rb +4 -2
- data/test/{rails_root → rails_test}/themes/blue/description.txt +0 -0
- data/test/{rails_root → rails_test}/themes/blue/locales/blue.yml +0 -0
- data/test/{rails_root → rails_test}/themes/blue/locales/en.yml +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/default/index.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/default.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/global/_footer.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/global/_head.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/global/_header.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/description.txt +0 -0
- data/test/{rails_root → rails_test}/themes/red/locales/en.yml +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/default.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/global/_footer.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/global/_head.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/global/_header.html.erb +0 -0
- metadata +159 -183
- data/config/disguise_routes.rb +0 -7
- data/lib/action_controller/disguise_application.rb +0 -61
- data/lib/disguise/initialize_routes.rb +0 -8
- data/lib/disguise/tasks.rb +0 -34
- data/locales/ar.yml +0 -20
- data/locales/bg.yml +0 -20
- data/locales/ca.yml +0 -20
- data/locales/cs.yml +0 -20
- data/locales/de.yml +0 -20
- data/locales/el.yml +0 -20
- data/locales/es.yml +0 -20
- data/locales/et.yml +0 -20
- data/locales/fa.yml +0 -20
- data/locales/fi.yml +0 -20
- data/locales/gl.yml +0 -20
- data/locales/hi.yml +0 -20
- data/locales/hr.yml +0 -20
- data/locales/hu.yml +0 -20
- data/locales/id.yml +0 -20
- data/locales/it.yml +0 -20
- data/locales/iw.yml +0 -20
- data/locales/ja.yml +0 -20
- data/locales/ko.yml +0 -20
- data/locales/lt.yml +0 -20
- data/locales/lv.yml +0 -20
- data/locales/mt.yml +0 -20
- data/locales/nl.yml +0 -20
- data/locales/no.yml +0 -21
- data/locales/pl.yml +0 -20
- data/locales/pt-PT.yml +0 -20
- data/locales/ro.yml +0 -20
- data/locales/ru.yml +0 -20
- data/locales/sk.yml +0 -20
- data/locales/sl.yml +0 -20
- data/locales/sr.yml +0 -20
- data/locales/sv.yml +0 -20
- data/locales/th.yml +0 -20
- data/locales/tl.yml +0 -20
- data/locales/tr.yml +0 -20
- data/locales/uk.yml +0 -20
- data/locales/vi.yml +0 -20
- data/locales/zh-CN.yml +0 -20
- data/locales/zh-TW.yml +0 -20
- data/locales/zh.yml +0 -20
- data/rails/init.rb +0 -2
- data/tasks/rails.rake +0 -2
- data/test/rails_root/Capfile +0 -3
- data/test/rails_root/app/models/user.rb +0 -9
- data/test/rails_root/config/amazon_s3.yml +0 -14
- data/test/rails_root/config/boot.rb +0 -109
- data/test/rails_root/config/database.yml +0 -14
- data/test/rails_root/config/environment.rb +0 -21
- data/test/rails_root/config/environments/development.rb +0 -19
- data/test/rails_root/config/environments/production.rb +0 -1
- data/test/rails_root/config/environments/test.rb +0 -33
- data/test/rails_root/config/global_config.yml +0 -18
- data/test/rails_root/config/initializers/disguise.rb +0 -2
- data/test/rails_root/config/initializers/requires.rb +0 -13
- data/test/rails_root/config/initializers/s3_credentials.rb +0 -9
- data/test/rails_root/config/initializers/session_store.rb +0 -8
- data/test/rails_root/config/routes.rb +0 -7
- data/test/rails_root/public/404.html +0 -30
- data/test/rails_root/public/422.html +0 -30
- data/test/rails_root/public/500.html +0 -30
- data/test/rails_root/public/images/rails.png +0 -0
- data/test/rails_root/public/images/red/preview.gif +0 -0
- data/test/rails_root/public/javascripts/builder.js +0 -136
- data/test/rails_root/public/javascripts/prototype.js +0 -4225
- data/test/rails_root/public/javascripts/scriptaculous.js +0 -58
- data/test/rails_root/public/javascripts/slider.js +0 -277
- data/test/rails_root/public/javascripts/sound.js +0 -60
- data/test/rails_root/public/robots.txt +0 -1
- data/test/rails_root/public/stylesheets/themes/blue/styles.css +0 -1
- data/test/rails_root/public/stylesheets/themes/red/styles.css +0 -1
- data/test/rails_root/script/about +0 -3
- data/test/rails_root/script/breakpointer +0 -3
- data/test/rails_root/script/console +0 -3
- data/test/rails_root/script/create_project.rb +0 -52
- data/test/rails_root/script/cucumber +0 -7
- data/test/rails_root/script/dbconsole +0 -3
- data/test/rails_root/script/destroy +0 -3
- data/test/rails_root/script/generate +0 -3
- data/test/rails_root/script/performance/benchmarker +0 -3
- data/test/rails_root/script/performance/profiler +0 -3
- data/test/rails_root/script/performance/request +0 -3
- data/test/rails_root/script/plugin +0 -3
- data/test/rails_root/script/process/inspector +0 -3
- data/test/rails_root/script/process/reaper +0 -3
- data/test/rails_root/script/process/spawner +0 -3
- data/test/rails_root/script/runner +0 -3
- data/test/rails_root/script/server +0 -3
- data/test/rails_root/test/unit/.keep +0 -0
@@ -0,0 +1,175 @@
|
|
1
|
+
(function() {
|
2
|
+
// Technique from Juriy Zaytsev
|
3
|
+
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
|
4
|
+
function isEventSupported(eventName) {
|
5
|
+
var el = document.createElement('div');
|
6
|
+
eventName = 'on' + eventName;
|
7
|
+
var isSupported = (eventName in el);
|
8
|
+
if (!isSupported) {
|
9
|
+
el.setAttribute(eventName, 'return;');
|
10
|
+
isSupported = typeof el[eventName] == 'function';
|
11
|
+
}
|
12
|
+
el = null;
|
13
|
+
return isSupported;
|
14
|
+
}
|
15
|
+
|
16
|
+
function isForm(element) {
|
17
|
+
return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
|
18
|
+
}
|
19
|
+
|
20
|
+
function isInput(element) {
|
21
|
+
if (Object.isElement(element)) {
|
22
|
+
var name = element.nodeName.toUpperCase()
|
23
|
+
return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
|
24
|
+
}
|
25
|
+
else return false
|
26
|
+
}
|
27
|
+
|
28
|
+
var submitBubbles = isEventSupported('submit'),
|
29
|
+
changeBubbles = isEventSupported('change')
|
30
|
+
|
31
|
+
if (!submitBubbles || !changeBubbles) {
|
32
|
+
// augment the Event.Handler class to observe custom events when needed
|
33
|
+
Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
|
34
|
+
function(init, element, eventName, selector, callback) {
|
35
|
+
init(element, eventName, selector, callback)
|
36
|
+
// is the handler being attached to an element that doesn't support this event?
|
37
|
+
if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
|
38
|
+
(!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
|
39
|
+
// "submit" => "emulated:submit"
|
40
|
+
this.eventName = 'emulated:' + this.eventName
|
41
|
+
}
|
42
|
+
}
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!submitBubbles) {
|
47
|
+
// discover forms on the page by observing focus events which always bubble
|
48
|
+
document.on('focusin', 'form', function(focusEvent, form) {
|
49
|
+
// special handler for the real "submit" event (one-time operation)
|
50
|
+
if (!form.retrieve('emulated:submit')) {
|
51
|
+
form.on('submit', function(submitEvent) {
|
52
|
+
var emulated = form.fire('emulated:submit', submitEvent, true)
|
53
|
+
// if custom event received preventDefault, cancel the real one too
|
54
|
+
if (emulated.returnValue === false) submitEvent.preventDefault()
|
55
|
+
})
|
56
|
+
form.store('emulated:submit', true)
|
57
|
+
}
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
if (!changeBubbles) {
|
62
|
+
// discover form inputs on the page
|
63
|
+
document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
|
64
|
+
// special handler for real "change" events
|
65
|
+
if (!input.retrieve('emulated:change')) {
|
66
|
+
input.on('change', function(changeEvent) {
|
67
|
+
input.fire('emulated:change', changeEvent, true)
|
68
|
+
})
|
69
|
+
input.store('emulated:change', true)
|
70
|
+
}
|
71
|
+
})
|
72
|
+
}
|
73
|
+
|
74
|
+
function handleRemote(element) {
|
75
|
+
var method, url, params;
|
76
|
+
|
77
|
+
var event = element.fire("ajax:before");
|
78
|
+
if (event.stopped) return false;
|
79
|
+
|
80
|
+
if (element.tagName.toLowerCase() === 'form') {
|
81
|
+
method = element.readAttribute('method') || 'post';
|
82
|
+
url = element.readAttribute('action');
|
83
|
+
params = element.serialize();
|
84
|
+
} else {
|
85
|
+
method = element.readAttribute('data-method') || 'get';
|
86
|
+
url = element.readAttribute('href');
|
87
|
+
params = {};
|
88
|
+
}
|
89
|
+
|
90
|
+
new Ajax.Request(url, {
|
91
|
+
method: method,
|
92
|
+
parameters: params,
|
93
|
+
evalScripts: true,
|
94
|
+
|
95
|
+
onComplete: function(request) { element.fire("ajax:complete", request); },
|
96
|
+
onSuccess: function(request) { element.fire("ajax:success", request); },
|
97
|
+
onFailure: function(request) { element.fire("ajax:failure", request); }
|
98
|
+
});
|
99
|
+
|
100
|
+
element.fire("ajax:after");
|
101
|
+
}
|
102
|
+
|
103
|
+
function handleMethod(element) {
|
104
|
+
var method = element.readAttribute('data-method'),
|
105
|
+
url = element.readAttribute('href'),
|
106
|
+
csrf_param = $$('meta[name=csrf-param]')[0],
|
107
|
+
csrf_token = $$('meta[name=csrf-token]')[0];
|
108
|
+
|
109
|
+
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
110
|
+
element.parentNode.insert(form);
|
111
|
+
|
112
|
+
if (method !== 'post') {
|
113
|
+
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
114
|
+
form.insert(field);
|
115
|
+
}
|
116
|
+
|
117
|
+
if (csrf_param) {
|
118
|
+
var param = csrf_param.readAttribute('content'),
|
119
|
+
token = csrf_token.readAttribute('content'),
|
120
|
+
field = new Element('input', { type: 'hidden', name: param, value: token });
|
121
|
+
form.insert(field);
|
122
|
+
}
|
123
|
+
|
124
|
+
form.submit();
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
document.on("click", "*[data-confirm]", function(event, element) {
|
129
|
+
var message = element.readAttribute('data-confirm');
|
130
|
+
if (!confirm(message)) event.stop();
|
131
|
+
});
|
132
|
+
|
133
|
+
document.on("click", "a[data-remote]", function(event, element) {
|
134
|
+
if (event.stopped) return;
|
135
|
+
handleRemote(element);
|
136
|
+
event.stop();
|
137
|
+
});
|
138
|
+
|
139
|
+
document.on("click", "a[data-method]", function(event, element) {
|
140
|
+
if (event.stopped) return;
|
141
|
+
handleMethod(element);
|
142
|
+
event.stop();
|
143
|
+
});
|
144
|
+
|
145
|
+
document.on("submit", function(event) {
|
146
|
+
var element = event.findElement(),
|
147
|
+
message = element.readAttribute('data-confirm');
|
148
|
+
if (message && !confirm(message)) {
|
149
|
+
event.stop();
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
|
153
|
+
var inputs = element.select("input[type=submit][data-disable-with]");
|
154
|
+
inputs.each(function(input) {
|
155
|
+
input.disabled = true;
|
156
|
+
input.writeAttribute('data-original-value', input.value);
|
157
|
+
input.value = input.readAttribute('data-disable-with');
|
158
|
+
});
|
159
|
+
|
160
|
+
var element = event.findElement("form[data-remote]");
|
161
|
+
if (element) {
|
162
|
+
handleRemote(element);
|
163
|
+
event.stop();
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
document.on("ajax:after", "form", function(event, element) {
|
168
|
+
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
169
|
+
inputs.each(function(input) {
|
170
|
+
input.value = input.readAttribute('data-original-value');
|
171
|
+
input.removeAttribute('data-original-value');
|
172
|
+
input.disabled = false;
|
173
|
+
});
|
174
|
+
});
|
175
|
+
})();
|
File without changes
|
data/test/{rails_root/test/functional/.keep → rails_test/public/stylesheets/application.css}
RENAMED
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
File without changes
|
File without changes
|
@@ -12,8 +12,8 @@ class Admin::DomainThemesControllerTest < ActionController::TestCase
|
|
12
12
|
setup do
|
13
13
|
post :create, :domain_theme => { :name => 'red', :uri => @new_uri }
|
14
14
|
end
|
15
|
-
|
16
|
-
|
15
|
+
should set_the_flash.to(I18n.t("disguise.theme_updated"))
|
16
|
+
should redirect_to("edit theme") { edit_admin_theme_path }
|
17
17
|
should "create a new domain theme" do
|
18
18
|
assert_difference 'DomainTheme.count' do
|
19
19
|
post :create, :domain_theme => { :name => 'red_too', :uri => 'red_too_unique.example.com' }
|
@@ -30,8 +30,8 @@ class Admin::DomainThemesControllerTest < ActionController::TestCase
|
|
30
30
|
should "change the domain theme uri" do
|
31
31
|
assert_equal @domain_theme.uri, @new_uri
|
32
32
|
end
|
33
|
-
|
34
|
-
|
33
|
+
should set_the_flash.to(I18n.t("disguise.theme_updated"))
|
34
|
+
should redirect_to("edit theme") { edit_admin_theme_path }
|
35
35
|
end
|
36
36
|
|
37
37
|
context "DELETE to destroy" do
|
@@ -39,8 +39,8 @@ class Admin::DomainThemesControllerTest < ActionController::TestCase
|
|
39
39
|
@domain_theme = Factory(:domain_theme)
|
40
40
|
delete :destroy, :id => @domain_theme.to_param
|
41
41
|
end
|
42
|
-
|
43
|
-
|
42
|
+
should set_the_flash.to(I18n.t('disguise.uri_deleted'))
|
43
|
+
should redirect_to("admin edit theme") { edit_admin_theme_path }
|
44
44
|
end
|
45
45
|
|
46
46
|
|
@@ -16,16 +16,16 @@ class Admin::ThemesControllerTest < ActionController::TestCase
|
|
16
16
|
Theme.stubs(:available_themes).returns([@current_theme, @themes])
|
17
17
|
get :edit
|
18
18
|
end
|
19
|
-
|
20
|
-
|
19
|
+
should respond_with :success
|
20
|
+
should render_template 'admin/themes/no_themes'
|
21
21
|
end
|
22
22
|
|
23
23
|
context "get edit page" do
|
24
24
|
setup do
|
25
25
|
get :edit
|
26
26
|
end
|
27
|
-
|
28
|
-
|
27
|
+
should respond_with :success
|
28
|
+
should render_template 'admin/themes/edit'
|
29
29
|
end
|
30
30
|
|
31
31
|
context "update the current theme" do
|
@@ -36,7 +36,7 @@ class Admin::ThemesControllerTest < ActionController::TestCase
|
|
36
36
|
should "change the current theme" do
|
37
37
|
assert_equal Theme.first.name, 'red'
|
38
38
|
end
|
39
|
-
|
40
|
-
|
39
|
+
should set_the_flash.to(I18n.t("disguise.theme_updated"))
|
40
|
+
should redirect_to("edit theme") { edit_admin_theme_path }
|
41
41
|
end
|
42
42
|
end
|
@@ -12,8 +12,8 @@ class DefaultControllerTest < ActionController::TestCase
|
|
12
12
|
setup do
|
13
13
|
get :index
|
14
14
|
end
|
15
|
-
|
16
|
-
|
15
|
+
should respond_with :success
|
16
|
+
should render_template :index # rendering the default home page
|
17
17
|
end
|
18
18
|
|
19
19
|
context "requests" do
|
File without changes
|
@@ -1,14 +1,11 @@
|
|
1
1
|
$:.reject! { |e| e.include? 'TextMate' }
|
2
2
|
ENV["RAILS_ENV"] = "test"
|
3
|
-
require File.expand_path(
|
3
|
+
require File.expand_path('../../config/environment', __FILE__)
|
4
|
+
|
5
|
+
require 'rails/test_help'
|
4
6
|
|
5
|
-
require 'test_help'
|
6
|
-
gem 'thoughtbot-factory_girl' # from github
|
7
|
-
require 'factory_girl'
|
8
|
-
require 'ruby-debug'
|
9
|
-
require 'mocha'
|
10
|
-
require 'redgreen' rescue LoadError
|
11
7
|
require File.expand_path(File.dirname(__FILE__) + '/factories')
|
8
|
+
|
12
9
|
class ActiveSupport::TestCase
|
13
10
|
|
14
11
|
self.use_transactional_fixtures = true
|
@@ -25,11 +22,11 @@ class ActiveSupport::TestCase
|
|
25
22
|
end
|
26
23
|
|
27
24
|
def clean_theme_view_path(controller)
|
28
|
-
controller.view_paths.delete_if {|view_path| view_path.
|
25
|
+
controller.view_paths.delete_if {|view_path| view_path.to_path.index(Disguise.configuration.theme_full_base_path) == 0}
|
29
26
|
end
|
30
27
|
|
31
28
|
def clean_theme_locale
|
32
|
-
I18n.load_path.delete_if {|localization_path| localization_path.index(Disguise
|
29
|
+
I18n.load_path.delete_if {|localization_path| localization_path.index(Disguise.configuration.theme_full_base_path) == 0}
|
33
30
|
end
|
34
31
|
|
35
32
|
end
|
File without changes
|
@@ -6,7 +6,7 @@ class ThemeTest < ActiveSupport::TestCase
|
|
6
6
|
setup do
|
7
7
|
@theme = Theme.first || Theme.create
|
8
8
|
@theme.name = 'blue'
|
9
|
-
@blue_theme_hash = {:name=>"blue", :description=>"Put information about your theme here", :preview_image=>"/images/blue/preview.gif"}
|
9
|
+
@blue_theme_hash = {:name => "blue", :description => "Put information about your theme here", :preview_image => "/images/blue/preview.gif"}
|
10
10
|
end
|
11
11
|
context "locales" do
|
12
12
|
should "get the locales for the current theme" do
|
@@ -17,7 +17,9 @@ class ThemeTest < ActiveSupport::TestCase
|
|
17
17
|
should "find 2 themes" do
|
18
18
|
current_theme, themes = Theme.available_themes(@theme)
|
19
19
|
assert themes.length == 2
|
20
|
-
assert_equal
|
20
|
+
assert_equal @blue_theme_hash[:name], current_theme[:name]
|
21
|
+
assert_equal @blue_theme_hash[:description], current_theme[:description]
|
22
|
+
assert_equal @blue_theme_hash[:preview_image], current_theme[:preview_image]
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disguise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
version:
|
10
|
+
version: 3.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ball
|
@@ -42,7 +42,52 @@ files:
|
|
42
42
|
- app/views/admin/themes/_theme.html.erb
|
43
43
|
- app/views/admin/themes/edit.html.erb
|
44
44
|
- app/views/admin/themes/no_themes.html.erb
|
45
|
-
- config/
|
45
|
+
- config/locales/ar.yml
|
46
|
+
- config/locales/bg.yml
|
47
|
+
- config/locales/ca.yml
|
48
|
+
- config/locales/cs.yml
|
49
|
+
- config/locales/da.yml
|
50
|
+
- config/locales/de.yml
|
51
|
+
- config/locales/el.yml
|
52
|
+
- config/locales/en.yml
|
53
|
+
- config/locales/es.yml
|
54
|
+
- config/locales/et.yml
|
55
|
+
- config/locales/fa.yml
|
56
|
+
- config/locales/fi.yml
|
57
|
+
- config/locales/fr.yml
|
58
|
+
- config/locales/gl.yml
|
59
|
+
- config/locales/hi.yml
|
60
|
+
- config/locales/hr.yml
|
61
|
+
- config/locales/hu.yml
|
62
|
+
- config/locales/id.yml
|
63
|
+
- config/locales/it.yml
|
64
|
+
- config/locales/iw.yml
|
65
|
+
- config/locales/ja.yml
|
66
|
+
- config/locales/ko.yml
|
67
|
+
- config/locales/lt.yml
|
68
|
+
- config/locales/lv.yml
|
69
|
+
- config/locales/mt.yml
|
70
|
+
- config/locales/nl.yml
|
71
|
+
- config/locales/no.yml
|
72
|
+
- config/locales/pl.yml
|
73
|
+
- config/locales/pt-PT.yml
|
74
|
+
- config/locales/pt.yml
|
75
|
+
- config/locales/ro.yml
|
76
|
+
- config/locales/ru.yml
|
77
|
+
- config/locales/sk.yml
|
78
|
+
- config/locales/sl.yml
|
79
|
+
- config/locales/sq.yml
|
80
|
+
- config/locales/sr.yml
|
81
|
+
- config/locales/sv.yml
|
82
|
+
- config/locales/th.yml
|
83
|
+
- config/locales/tl.yml
|
84
|
+
- config/locales/tr.yml
|
85
|
+
- config/locales/uk.yml
|
86
|
+
- config/locales/vi.yml
|
87
|
+
- config/locales/zh-CN.yml
|
88
|
+
- config/locales/zh-TW.yml
|
89
|
+
- config/locales/zh.yml
|
90
|
+
- config/routes.rb
|
46
91
|
- db/migrate/20090530170040_create_themes.rb
|
47
92
|
- db/migrate/20090606153236_create_domain_themes.rb
|
48
93
|
- disguise.gemspec
|
@@ -57,156 +102,87 @@ files:
|
|
57
102
|
- generators/theme/templates/views/_header.html.erb
|
58
103
|
- generators/theme/templates/views/default.html.erb
|
59
104
|
- generators/theme/theme_generator.rb
|
60
|
-
- lib/action_controller/disguise_application.rb
|
61
105
|
- lib/disguise.rb
|
62
106
|
- lib/disguise/config.rb
|
63
|
-
- lib/disguise/
|
64
|
-
- lib/disguise/
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
90
|
-
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-
|
111
|
-
-
|
112
|
-
- test/
|
113
|
-
- test/
|
114
|
-
- test/
|
115
|
-
- test/
|
116
|
-
- test/
|
117
|
-
- test/
|
118
|
-
- test/
|
119
|
-
- test/
|
120
|
-
- test/
|
121
|
-
- test/
|
122
|
-
- test/
|
123
|
-
- test/
|
124
|
-
- test/
|
125
|
-
- test/
|
126
|
-
- test/
|
127
|
-
- test/
|
128
|
-
- test/
|
129
|
-
- test/
|
130
|
-
- test/
|
131
|
-
- test/
|
132
|
-
- test/
|
133
|
-
- test/
|
134
|
-
- test/
|
135
|
-
- test/
|
136
|
-
- test/
|
137
|
-
- test/
|
138
|
-
- test/
|
139
|
-
- test/
|
140
|
-
- test/
|
141
|
-
- test/
|
142
|
-
- test/rails_root/db/migrate/20090606153236_create_domain_themes.rb
|
143
|
-
- test/rails_root/features/step_definitions/webrat_steps.rb
|
144
|
-
- test/rails_root/features/support/env.rb
|
145
|
-
- test/rails_root/public/.htaccess
|
146
|
-
- test/rails_root/public/404.html
|
147
|
-
- test/rails_root/public/422.html
|
148
|
-
- test/rails_root/public/500.html
|
149
|
-
- test/rails_root/public/dispatch.rb
|
150
|
-
- test/rails_root/public/favicon.ico
|
151
|
-
- test/rails_root/public/images/blue/preview.gif
|
152
|
-
- test/rails_root/public/images/rails.png
|
153
|
-
- test/rails_root/public/images/red/preview.gif
|
154
|
-
- test/rails_root/public/javascripts/application.js
|
155
|
-
- test/rails_root/public/javascripts/builder.js
|
156
|
-
- test/rails_root/public/javascripts/controls.js
|
157
|
-
- test/rails_root/public/javascripts/dragdrop.js
|
158
|
-
- test/rails_root/public/javascripts/effects.js
|
159
|
-
- test/rails_root/public/javascripts/prototype.js
|
160
|
-
- test/rails_root/public/javascripts/scriptaculous.js
|
161
|
-
- test/rails_root/public/javascripts/slider.js
|
162
|
-
- test/rails_root/public/javascripts/sound.js
|
163
|
-
- test/rails_root/public/robots.txt
|
164
|
-
- test/rails_root/public/stylesheets/.keep
|
165
|
-
- test/rails_root/public/stylesheets/themes/blue/styles.css
|
166
|
-
- test/rails_root/public/stylesheets/themes/red/styles.css
|
167
|
-
- test/rails_root/script/about
|
168
|
-
- test/rails_root/script/breakpointer
|
169
|
-
- test/rails_root/script/console
|
170
|
-
- test/rails_root/script/create_project.rb
|
171
|
-
- test/rails_root/script/cucumber
|
172
|
-
- test/rails_root/script/dbconsole
|
173
|
-
- test/rails_root/script/destroy
|
174
|
-
- test/rails_root/script/generate
|
175
|
-
- test/rails_root/script/performance/benchmarker
|
176
|
-
- test/rails_root/script/performance/profiler
|
177
|
-
- test/rails_root/script/performance/request
|
178
|
-
- test/rails_root/script/plugin
|
179
|
-
- test/rails_root/script/process/inspector
|
180
|
-
- test/rails_root/script/process/reaper
|
181
|
-
- test/rails_root/script/process/spawner
|
182
|
-
- test/rails_root/script/runner
|
183
|
-
- test/rails_root/script/server
|
184
|
-
- test/rails_root/test/factories.rb
|
185
|
-
- test/rails_root/test/functional/.keep
|
186
|
-
- test/rails_root/test/functional/admin/domain_themes_controller_test.rb
|
187
|
-
- test/rails_root/test/functional/admin/themes_controller_test.rb
|
188
|
-
- test/rails_root/test/functional/default_controller_test.rb
|
189
|
-
- test/rails_root/test/integration/.keep
|
190
|
-
- test/rails_root/test/mocks/development/.keep
|
191
|
-
- test/rails_root/test/mocks/test/.keep
|
192
|
-
- test/rails_root/test/test_helper.rb
|
193
|
-
- test/rails_root/test/unit/.keep
|
194
|
-
- test/rails_root/test/unit/domain_theme_test.rb
|
195
|
-
- test/rails_root/test/unit/theme_test.rb
|
196
|
-
- test/rails_root/themes/blue/description.txt
|
197
|
-
- test/rails_root/themes/blue/locales/blue.yml
|
198
|
-
- test/rails_root/themes/blue/locales/en.yml
|
199
|
-
- test/rails_root/themes/blue/views/default/index.html.erb
|
200
|
-
- test/rails_root/themes/blue/views/layouts/default.html.erb
|
201
|
-
- test/rails_root/themes/blue/views/layouts/global/_footer.html.erb
|
202
|
-
- test/rails_root/themes/blue/views/layouts/global/_head.html.erb
|
203
|
-
- test/rails_root/themes/blue/views/layouts/global/_header.html.erb
|
204
|
-
- test/rails_root/themes/red/description.txt
|
205
|
-
- test/rails_root/themes/red/locales/en.yml
|
206
|
-
- test/rails_root/themes/red/views/layouts/default.html.erb
|
207
|
-
- test/rails_root/themes/red/views/layouts/global/_footer.html.erb
|
208
|
-
- test/rails_root/themes/red/views/layouts/global/_head.html.erb
|
209
|
-
- test/rails_root/themes/red/views/layouts/global/_header.html.erb
|
107
|
+
- lib/disguise/controllers/disguise_application.rb
|
108
|
+
- lib/disguise/engine.rb
|
109
|
+
- lib/tasks/diguise.rake
|
110
|
+
- test/rails_test/.gitignore
|
111
|
+
- test/rails_test/.rake_tasks
|
112
|
+
- test/rails_test/Gemfile
|
113
|
+
- test/rails_test/Gemfile.lock
|
114
|
+
- test/rails_test/Rakefile
|
115
|
+
- test/rails_test/app/controllers/admin/domain_themes_controller.rb
|
116
|
+
- test/rails_test/app/controllers/admin/themes_controller.rb
|
117
|
+
- test/rails_test/app/controllers/application_controller.rb
|
118
|
+
- test/rails_test/app/controllers/default_controller.rb
|
119
|
+
- test/rails_test/app/models/.keep
|
120
|
+
- test/rails_test/app/models/user.rb
|
121
|
+
- test/rails_test/app/views/default/index.html.erb
|
122
|
+
- test/rails_test/app/views/layouts/default.html.erb
|
123
|
+
- test/rails_test/config.ru
|
124
|
+
- test/rails_test/config/application.rb
|
125
|
+
- test/rails_test/config/boot.rb
|
126
|
+
- test/rails_test/config/database.yml
|
127
|
+
- test/rails_test/config/environment.rb
|
128
|
+
- test/rails_test/config/environments/development.rb
|
129
|
+
- test/rails_test/config/environments/production.rb
|
130
|
+
- test/rails_test/config/environments/test.rb
|
131
|
+
- test/rails_test/config/initializers/backtrace_silencers.rb
|
132
|
+
- test/rails_test/config/initializers/disguise.rb
|
133
|
+
- test/rails_test/config/initializers/inflections.rb
|
134
|
+
- test/rails_test/config/initializers/mime_types.rb
|
135
|
+
- test/rails_test/config/initializers/secret_token.rb
|
136
|
+
- test/rails_test/config/initializers/session_store.rb
|
137
|
+
- test/rails_test/config/routes.rb
|
138
|
+
- test/rails_test/db/.keep
|
139
|
+
- test/rails_test/db/migrate/20090530170040_create_themes.rb
|
140
|
+
- test/rails_test/db/migrate/20090602041838_create_users.rb
|
141
|
+
- test/rails_test/db/migrate/20090606153236_create_domain_themes.rb
|
142
|
+
- test/rails_test/features/step_definitions/webrat_steps.rb
|
143
|
+
- test/rails_test/features/support/env.rb
|
144
|
+
- test/rails_test/public/.htaccess
|
145
|
+
- test/rails_test/public/404.html
|
146
|
+
- test/rails_test/public/422.html
|
147
|
+
- test/rails_test/public/500.html
|
148
|
+
- test/rails_test/public/dispatch.rb
|
149
|
+
- test/rails_test/public/favicon.ico
|
150
|
+
- test/rails_test/public/images/blue/preview.gif
|
151
|
+
- test/rails_test/public/images/rails.png
|
152
|
+
- test/rails_test/public/javascripts/application.js
|
153
|
+
- test/rails_test/public/javascripts/controls.js
|
154
|
+
- test/rails_test/public/javascripts/dragdrop.js
|
155
|
+
- test/rails_test/public/javascripts/effects.js
|
156
|
+
- test/rails_test/public/javascripts/prototype.js
|
157
|
+
- test/rails_test/public/javascripts/rails.js
|
158
|
+
- test/rails_test/public/robots.txt
|
159
|
+
- test/rails_test/public/stylesheets/.gitkeep
|
160
|
+
- test/rails_test/public/stylesheets/application.css
|
161
|
+
- test/rails_test/script/rails
|
162
|
+
- test/rails_test/test/factories.rb
|
163
|
+
- test/rails_test/test/functional/.keep
|
164
|
+
- test/rails_test/test/functional/admin/domain_themes_controller_test.rb
|
165
|
+
- test/rails_test/test/functional/admin/themes_controller_test.rb
|
166
|
+
- test/rails_test/test/functional/default_controller_test.rb
|
167
|
+
- test/rails_test/test/integration/.keep
|
168
|
+
- test/rails_test/test/test_helper.rb
|
169
|
+
- test/rails_test/test/unit/.keep
|
170
|
+
- test/rails_test/test/unit/domain_theme_test.rb
|
171
|
+
- test/rails_test/test/unit/theme_test.rb
|
172
|
+
- test/rails_test/themes/blue/description.txt
|
173
|
+
- test/rails_test/themes/blue/locales/blue.yml
|
174
|
+
- test/rails_test/themes/blue/locales/en.yml
|
175
|
+
- test/rails_test/themes/blue/views/default/index.html.erb
|
176
|
+
- test/rails_test/themes/blue/views/layouts/default.html.erb
|
177
|
+
- test/rails_test/themes/blue/views/layouts/global/_footer.html.erb
|
178
|
+
- test/rails_test/themes/blue/views/layouts/global/_head.html.erb
|
179
|
+
- test/rails_test/themes/blue/views/layouts/global/_header.html.erb
|
180
|
+
- test/rails_test/themes/red/description.txt
|
181
|
+
- test/rails_test/themes/red/locales/en.yml
|
182
|
+
- test/rails_test/themes/red/views/layouts/default.html.erb
|
183
|
+
- test/rails_test/themes/red/views/layouts/global/_footer.html.erb
|
184
|
+
- test/rails_test/themes/red/views/layouts/global/_head.html.erb
|
185
|
+
- test/rails_test/themes/red/views/layouts/global/_header.html.erb
|
210
186
|
has_rdoc: true
|
211
187
|
homepage: http://github.com/jbasdf/disguise
|
212
188
|
licenses: []
|
@@ -242,34 +218,34 @@ signing_key:
|
|
242
218
|
specification_version: 3
|
243
219
|
summary: Easy to use view theme system for Rails
|
244
220
|
test_files:
|
245
|
-
- test/
|
246
|
-
- test/
|
247
|
-
- test/
|
248
|
-
- test/
|
249
|
-
- test/
|
250
|
-
- test/
|
251
|
-
- test/
|
252
|
-
- test/
|
253
|
-
- test/
|
254
|
-
- test/
|
255
|
-
- test/
|
256
|
-
- test/
|
257
|
-
- test/
|
258
|
-
- test/
|
259
|
-
- test/
|
260
|
-
- test/
|
261
|
-
- test/
|
262
|
-
- test/
|
263
|
-
- test/
|
264
|
-
- test/
|
265
|
-
- test/
|
266
|
-
- test/
|
267
|
-
- test/
|
268
|
-
- test/
|
269
|
-
- test/
|
270
|
-
- test/
|
271
|
-
- test/
|
272
|
-
- test/
|
273
|
-
- test/
|
274
|
-
- test/
|
275
|
-
- test/
|
221
|
+
- test/rails_test/app/controllers/admin/domain_themes_controller.rb
|
222
|
+
- test/rails_test/app/controllers/admin/themes_controller.rb
|
223
|
+
- test/rails_test/app/controllers/application_controller.rb
|
224
|
+
- test/rails_test/app/controllers/default_controller.rb
|
225
|
+
- test/rails_test/app/models/user.rb
|
226
|
+
- test/rails_test/config/application.rb
|
227
|
+
- test/rails_test/config/boot.rb
|
228
|
+
- test/rails_test/config/environment.rb
|
229
|
+
- test/rails_test/config/environments/development.rb
|
230
|
+
- test/rails_test/config/environments/production.rb
|
231
|
+
- test/rails_test/config/environments/test.rb
|
232
|
+
- test/rails_test/config/initializers/backtrace_silencers.rb
|
233
|
+
- test/rails_test/config/initializers/disguise.rb
|
234
|
+
- test/rails_test/config/initializers/inflections.rb
|
235
|
+
- test/rails_test/config/initializers/mime_types.rb
|
236
|
+
- test/rails_test/config/initializers/secret_token.rb
|
237
|
+
- test/rails_test/config/initializers/session_store.rb
|
238
|
+
- test/rails_test/config/routes.rb
|
239
|
+
- test/rails_test/db/migrate/20090530170040_create_themes.rb
|
240
|
+
- test/rails_test/db/migrate/20090602041838_create_users.rb
|
241
|
+
- test/rails_test/db/migrate/20090606153236_create_domain_themes.rb
|
242
|
+
- test/rails_test/features/step_definitions/webrat_steps.rb
|
243
|
+
- test/rails_test/features/support/env.rb
|
244
|
+
- test/rails_test/public/dispatch.rb
|
245
|
+
- test/rails_test/test/factories.rb
|
246
|
+
- test/rails_test/test/functional/admin/domain_themes_controller_test.rb
|
247
|
+
- test/rails_test/test/functional/admin/themes_controller_test.rb
|
248
|
+
- test/rails_test/test/functional/default_controller_test.rb
|
249
|
+
- test/rails_test/test/test_helper.rb
|
250
|
+
- test/rails_test/test/unit/domain_theme_test.rb
|
251
|
+
- test/rails_test/test/unit/theme_test.rb
|