Permalink
Browse files

Merge branch 'master' of github.com:mozilla/FlightDeck

  • Loading branch information...
2 parents 0b98912 + fe55d4d commit a11109fdda94ac7363ac5a8177bb743fa35718d2 @zalun zalun committed Feb 23, 2012
View
@@ -37,12 +37,9 @@ def app_manifest(request):
'url': 'https://builder.addons.mozilla.org/',
},
'installs_allowed_from': [
- 'https://apps-preview-dev.allizom.org',
- 'https://apps-preview.allizom.org',
- 'https://apps-preview.mozilla.org',
- 'https://addons-dev.allizom.org',
- 'https://addons.allizom.org',
- 'https://addons.mozilla.org',
+ 'https://marketplace-dev.allizom.org',
+ 'https://marketplace.allizom.org',
+ 'https://marketplace.mozilla.org',
],
'default_locale': 'en',
}
@@ -56,7 +53,7 @@ def graphite(request, site):
# have to hack together our own. This is temporary until we can replace it
# with jinja code.
- v = {}
+ v = {}
v['ns'] = {"trunk": "builder.preview",
"stage": "builder.next",
"prod": "builder"}[site] # Validated by url regex
@@ -87,11 +84,11 @@ def admin(request):
if action == 'setup_mapping':
msg = 'setup_mapping triggered'
log.info(log_msg % (msg, request.user, request.user.pk))
- threading.Thread(target=setup_mapping).start()
+ threading.Thread(target=setup_mapping).start()
elif action == 'index_all':
msg = 'index_all triggered'
log.info(log_msg % (msg , request.user, request.user.pk))
- threading.Thread(target=index_all).start()
+ threading.Thread(target=index_all).start()
elif action == 'update_package_activity':
msg = 'update_package_activity triggered'
log.info(log_msg % (msg , request.user, request.user.pk))
@@ -205,25 +202,25 @@ def monitor(request):
return HttpResponse(template.render(context), status=status)
-def get_package(request):
- package = get_object_or_404(Package, id_number=request.GET['package_id'])
+def get_package(request):
+ package = get_object_or_404(Package, id_number=request.GET['package_id'])
return render_to_response('admin/_package_result.html', {
'package': package
}, context_instance=RequestContext(request))
@user_passes_test(lambda u: u.is_superuser)
def update_package(request):
- package = get_object_or_404(Package, pk=request.POST['package_id'])
- if 'featured' in request.POST:
+ package = get_object_or_404(Package, pk=request.POST['package_id'])
+ if 'featured' in request.POST:
package.featured = request.POST.get('featured') == 'true'
-
- if 'example' in request.POST:
+
+ if 'example' in request.POST:
package.example = request.POST.get('example') == 'true'
-
- package.save()
+
+ package.save()
return HttpResponse({'status':'ok'}, content_type='text/javascript')
-
-
+
+
def homepage(r):
# one more for the main one
pkgs_limit = settings.HOMEPAGE_PACKAGES_NUMBER
@@ -294,18 +294,22 @@ module.exports = new Class({
instantiate_modules: function() {
// iterate by modules and instantiate Module
- var mainLoaded;
+ var mainLoaded = false,
+ firstModule;
this.options.modules.forEach(function(module) {
module.readonly = this.options.readonly;
var mod = this.newModule(module);
if (module.main) {
mainLoaded = true;
this.editFile(mod);
}
+ if (!firstModule) {
+ firstModule = mod;
+ }
}, this);
- if (!mainLoaded && this.options.modules[0]) {
- this.editFile(this.options.modules[0]);
+ if (!mainLoaded && firstModule) {
+ this.editFile(firstModule);
}
},
@@ -8,10 +8,12 @@ var Class = require('shipyard/class/Class'),
log = require('shipyard/utils/log'),
dom = require('shipyard/dom'),
- tabs = require('../views/Tabs'),
+ tabs = require('../views/Tabs');
- //TODO: this is terrible practice
- fd = dom.window.get('fd');
+//TODO: this is terrible practice
+function fd() {
+ return dom.window.get('fd');
+}
module.exports = new Class({
@@ -42,7 +44,7 @@ module.exports = new Class({
if (file.changed) {
- fd.showQuestion({
+ fd().showQuestion({
title: 'Lose unsaved changes?',
message: 'The tab "'+file.get('shortName')+'" that you are trying to close has unsaved changes.',
buttons: [
@@ -64,9 +66,9 @@ module.exports = new Class({
setTimeout(function() {
file.set('content', file.original_content);
file.setChanged(false);
- fd.item.edited--;
- if(!fd.item.edited) {
- fd.item.emit('reset');
+ fd().item.edited--;
+ if(!fd().item.edited) {
+ fd().item.emit('reset');
}
}, 1);
}
@@ -24,10 +24,10 @@ module.exports = new Class({
uid: property(function uid(pk) {
if (arguments.length === 0) {
// getter
- return this.get('pk');
+ return this.get('id');
} else {
// setter
- return this.set('pk', pk);
+ return this.set('id', pk);
}
}, 'id')

0 comments on commit a11109f

Please sign in to comment.