diff --git a/kanso.json b/kanso.json index 7e27ac9..183ed34 100644 --- a/kanso.json +++ b/kanso.json @@ -19,6 +19,27 @@ "static/img/promo/screenshot1.png", "static/img/promo/screenshot2.png" ], + "settings_schema" : { + "description": "Market Settings", + "type": "object", + "properties": { + "use_garden_market_logo" : { + "type": "boolean" + }, + "market_name": { + "type": "string" + }, + "use_google_analytics" : { + "type": "boolean" + }, + "google_analytics_code": { + "type": "string" + }, + "admin_review_apps": { + "type": "boolean" + } + } + }, "modules": ["lib", "views"], "load": "lib/app", "less": { diff --git a/lib/app.js b/lib/app.js index 1768f81..fda8468 100644 --- a/lib/app.js +++ b/lib/app.js @@ -1,4 +1,5 @@ module.exports = { + app_settings: require('./app_settings'), rewrites: require('./rewrites'), lists: require('./lists'), shows: require('./shows'), diff --git a/lib/app_settings.js b/lib/app_settings.js new file mode 100644 index 0000000..443ff07 --- /dev/null +++ b/lib/app_settings.js @@ -0,0 +1,7 @@ +module.exports = { + use_garden_market_logo : true, + market_name: "App Garden", + use_google_analytics : true, + google_analytics_code : "UA-31457059-1", + admin_review_apps: false +}; \ No newline at end of file diff --git a/lib/lists.js b/lib/lists.js index 3b41487..ba1aa1d 100644 --- a/lib/lists.js +++ b/lib/lists.js @@ -32,9 +32,11 @@ exports.home = function (head, req) { utils.show( { title: 'App Garden', + app_settings : this.app_settings, baseURL : '', db_name : req.info.db_name, content: templates['home.html']({ + app_settings : this.app_settings, rows: rows, baseURL : '' }) @@ -59,8 +61,10 @@ exports.category_page = function (head, req) { utils.show({ title: req.query.category, baseURL : '../', + app_settings : this.app_settings, content: templates['category_page.html']({ rows: rows, + app_settings : this.app_settings, title: utils.toSentenceCase(req.query.category), category: req.query.category, baseURL : '../' @@ -117,9 +121,11 @@ exports.app_details = function (head, req) { utils.show ({ title: 'App: ' + title, baseURL : '../', + app_settings : this.app_settings, onload : onload, content: templates['app_details.html']({ baseURL : '../', + app_settings : this.app_settings, meta: meta, id: id, title: title, @@ -157,9 +163,11 @@ exports.app_details_install = function (head, req) { utils.show ({ title: 'App: ' + title, baseURL : '../../', + app_settings : this.app_settings, onload : 'ui.showInstallChoices();', content: templates['app_details_install.html']({ baseURL : '../../', + app_settings : this.app_settings, meta: meta, id: id, title: title, @@ -192,10 +200,12 @@ exports.app_details_install_couch = function (head, req) { utils.show({ title: 'App: ' + title, + app_settings : this.app_settings, baseURL : '../../', onload: 'ui.couch_install_page()', content: templates['app_details_manual_install.html']({ meta: meta, + app_settings : this.app_settings, id: id, title: title, baseURL : '../../', @@ -222,9 +232,11 @@ exports.user_page = function (head, req) { } utils.show({ title: req.query.user, + app_settings : this.app_settings, baseURL : '../', content: templates['user_page.html']({ rows: rows, + app_settings : this.app_settings, title: utils.toSentenceCase(req.query.user), user: req.query.user, baseURL : '../' diff --git a/lib/shows.js b/lib/shows.js index e451929..6bab579 100644 --- a/lib/shows.js +++ b/lib/shows.js @@ -13,6 +13,7 @@ var templates = require('handlebars').templates, exports.not_found = function (doc, req) { return utils.base_template({ code: 404, + app_settings : this.app_settings, title: 'Not found', content: templates['404.html']({}) }); @@ -21,9 +22,11 @@ exports.not_found = function (doc, req) { exports.install_script = function (doc, req) { return utils.base_template({ code: 200, + app_settings : this.app_settings, headers: {'Content-Type': 'text/plain'}, body: templates['install.sh']({ app: req.query.name, + app_settings : this.app_settings, app_url: utils.app_url(req, req.query.name), open_path: utils.open_path(doc) }) @@ -35,10 +38,12 @@ exports.upload_app = function (doc, req) { return utils.base_template({ code: 200, baseURL : './', + app_settings : this.app_settings, title: 'Upload your app', onload : 'ui.upload_page()', content: templates['upload_app.html']({ upload_url: utils.upload_url(req), + app_settings : this.app_settings, baseURL : './' }) }); @@ -48,10 +53,12 @@ exports.search = function(doc, req) { return utils.base_template({ code: 200, baseURL : './', + app_settings : this.app_settings, title: 'Search Results', onload : 'ui.perform_search("'+ req.query.q +'")', content: templates['search.html']({ baseURL : './', + app_settings : this.app_settings, terms : req.query.q }) }); diff --git a/static/css/garden.less b/static/css/garden.less index bdf5ac4..7e0facc 100644 --- a/static/css/garden.less +++ b/static/css/garden.less @@ -37,6 +37,12 @@ body { padding-top: @baseline; } +h2.name_logo { + line-height: 36px; + padding: 4px; + font-size: 30px; +} + form.search input { margin-top: 3px; padding: 8px 3px; diff --git a/templates/404.html b/templates/404.html index d50c116..664daf4 100644 --- a/templates/404.html +++ b/templates/404.html @@ -3,7 +3,13 @@
diff --git a/templates/app_details.html b/templates/app_details.html index 5360f9c..1fe9a2b 100644 --- a/templates/app_details.html +++ b/templates/app_details.html @@ -3,7 +3,13 @@
diff --git a/templates/app_details_install.html b/templates/app_details_install.html index 6ec3fee..be1146c 100644 --- a/templates/app_details_install.html +++ b/templates/app_details_install.html @@ -3,7 +3,13 @@
diff --git a/templates/app_details_manual_install.html b/templates/app_details_manual_install.html index 4d94460..2d96c9e 100644 --- a/templates/app_details_manual_install.html +++ b/templates/app_details_manual_install.html @@ -3,7 +3,13 @@
diff --git a/templates/base.html b/templates/base.html index b0f6241..1c890e9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -33,9 +33,10 @@ var ui = require('lib/ui'); ui.init(); {{{onload}}} + {{#if app_settings.use_google_analytics}} var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-31457059-1']); + _gaq.push(['_setAccount', '{{app_settings.google_analytics_code}}']); _gaq.push(['_trackPageview']); (function() { @@ -43,7 +44,7 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); - + {{/if}} diff --git a/templates/category_page.html b/templates/category_page.html index bbfccb5..2244acd 100644 --- a/templates/category_page.html +++ b/templates/category_page.html @@ -3,7 +3,13 @@
diff --git a/templates/home.html b/templates/home.html index ffbb6ce..722fdb4 100644 --- a/templates/home.html +++ b/templates/home.html @@ -3,7 +3,13 @@
diff --git a/templates/search.html b/templates/search.html index 3ce5294..dc62d83 100644 --- a/templates/search.html +++ b/templates/search.html @@ -3,7 +3,13 @@
diff --git a/templates/upload_app.html b/templates/upload_app.html index 7dcf58f..71748c5 100644 --- a/templates/upload_app.html +++ b/templates/upload_app.html @@ -3,7 +3,13 @@
diff --git a/templates/user_page.html b/templates/user_page.html index f134be4..dd0b837 100644 --- a/templates/user_page.html +++ b/templates/user_page.html @@ -3,7 +3,13 @@