You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2014/03/11 17:57:38 UTC

couchdb commit: updated refs/heads/BrandingPOC to 87cc407

Repository: couchdb
Updated Branches:
  refs/heads/BrandingPOC [created] 87cc4076a


POC step 1: generate the imports for branding


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/87cc4076
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/87cc4076
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/87cc4076

Branch: refs/heads/BrandingPOC
Commit: 87cc4076a17cbd337cad8652a39b26c52ad923e0
Parents: 5d17c20
Author: suelockwood <de...@apache.org>
Authored: Tue Feb 25 13:07:36 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Tue Mar 11 12:56:59 2014 -0400

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                        |   9 +-
 src/fauxton/assets/less/branding.less           |  12 +++
 .../assets/less/branding.less.underscore        |  12 +++
 src/fauxton/assets/less/fauxton.less            |   7 +-
 src/fauxton/settings.json.default               | 106 ++++++++++---------
 src/fauxton/tasks/fauxton.js                    |  18 ++++
 6 files changed, 110 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/87cc4076/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index c087afa..82dc759 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -56,6 +56,7 @@ module.exports = function(grunt) {
   }();
 
   var assets = function(){
+
     // Base assets
     var theAssets = {
       less:{
@@ -342,7 +343,11 @@ module.exports = function(grunt) {
         src: "settings.json"
       }
     },
-
+    gen_brand_imports: {
+      "default": {
+        src: "settings.json"
+      }
+    },
     gen_load_addons: {
       "default": {
         src: "settings.json"
@@ -430,7 +435,7 @@ module.exports = function(grunt) {
   // lighter weight test task for use inside dev/watch
   grunt.registerTask('test_inline', ['mochaSetup','jst', 'concat:test_config_js','mocha_phantomjs']);
   // Fetch dependencies (from git or local dir), lint them and make load_addons
-  grunt.registerTask('dependencies', ['get_deps', 'gen_load_addons:default']);
+  grunt.registerTask('dependencies', ['get_deps', 'gen_load_addons:default', 'gen_brand_imports:default']);
   // build templates, js and css
   grunt.registerTask('build', ['less', 'concat:index_css', 'jst', 'requirejs', 'concat:requirejs', 'template:release']);
   // minify code and css, ready for release.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87cc4076/src/fauxton/assets/less/branding.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/branding.less b/src/fauxton/assets/less/branding.less
new file mode 100644
index 0000000..967ca9a
--- /dev/null
+++ b/src/fauxton/assets/less/branding.less
@@ -0,0 +1,12 @@
+/*
+ * ::WARNING::
+ * THIS IS A GENERATED FILE. DO NOT EDIT.
+ */
+
+
+
+ 
+@import "../../../app/addons/cloudantbrand/variables.less";
+
+
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87cc4076/src/fauxton/assets/less/branding.less.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/branding.less.underscore b/src/fauxton/assets/less/branding.less.underscore
new file mode 100644
index 0000000..a2cc317
--- /dev/null
+++ b/src/fauxton/assets/less/branding.less.underscore
@@ -0,0 +1,12 @@
+/*
+ * ::WARNING::
+ * THIS IS A GENERATED FILE. DO NOT EDIT.
+ */
+
+<% if (less.variables){ %> 
+@import "<%=less.variables%>";
+<% }%>
+
+<% if (less.branding){ %> 
+@import "<%=less.branding%>";
+<% }%>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87cc4076/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 4ec502a..f115ead 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -17,12 +17,17 @@
  *
  */
 @import "bootstrap/variables.less";
-@import "variables.less";
+// @import "variables.less";
+
+//brand
+@import "branding.less";
+
 @import "bootstrap/bootstrap.less";
 @import "bootstrap/mixins.less";
 @import "prettyprint.less";
 @import "icons.less";
 
+
 /**
  * HTML-wide overrides
  **/

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87cc4076/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 1bc88f6..5ab971e 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -1,61 +1,65 @@
 {
   "deps": [
-  { "name": "fauxton" },
-  { "name": "databases" },
-  { "name": "documents" },
-  { "name": "pouchdb" },
-  { "name": "activetasks" },
-  { "name": "config" },
-  { "name": "logs" },
-  { "name": "stats" },
-  { "name": "replication" },
-  { "name": "plugins" },
-  { "name": "contribute" },
-  { "name": "permissions" },
-  { "name": "compaction" },
-  { "name": "auth" },
-  { "name": "verifyinstall" }
+    { "name": "fauxton" },
+    { "name": "databases" },
+    { "name": "documents" },
+    { "name": "pouchdb" },
+    { "name": "activetasks" },
+    { "name": "config" },
+    { "name": "logs" },
+    { "name": "stats" },
+    { "name": "replication" },
+    { "name": "plugins" },
+    { "name": "contribute" },
+    { "name": "permissions" },
+    { "name": "compaction" },
+    { "name": "auth" },
+    { "name": "verifyinstall" }
   ],
-    "template": {
-      "development": {
-        "src": "assets/index.underscore",
-        "dest": "dist/debug/index.html",
-        "variables": {
-          "requirejs": "/assets/js/libs/require.js",
-          "css": "./css/index.css",
-          "base": null,
-          "cachebuster": ""
-        },
-        "app": {
-          "root": "/",
-          "host": "../..",
-          "version": "1.0.dev"
-        }
+  "branding": {
+    "variables": "assets/less/variables.less",
+    "branding": ""
+  },
+  "template": {
+    "development": {
+      "src": "assets/index.underscore",
+      "dest": "dist/debug/index.html",
+      "variables": {
+        "requirejs": "/assets/js/libs/require.js",
+        "css": "./css/index.css",
+        "base": null,
+        "cachebuster": ""
       },
-      "release": {
-        "src": "assets/index.underscore",
-        "dest": "dist/debug/index.html",
-        "variables": {
-          "requirejs": "./js/require.js",
-          "css": "./css/index.css",
-          "base": null,
-          "cachebuster": "?v1.0"
-        },
-        "app": {
-          "root": "/_utils/fauxton/",
-          "host": "../..",
-          "version": "1.0"
-        }
+      "app": {
+        "root": "/",
+        "host": "../..",
+        "version": "1.0.dev"
       }
     },
+    "release": {
+      "src": "assets/index.underscore",
+      "dest": "dist/debug/index.html",
+      "variables": {
+        "requirejs": "./js/require.js",
+        "css": "./css/index.css",
+        "base": null,
+        "cachebuster": "?v1.0"
+      },
+      "app": {
+        "root": "/_utils/fauxton/",
+        "host": "../..",
+        "version": "1.0"
+      }
+    }
+  },
 
-    "couch_config": {
-      "fauxton": {
-        "db": "http://localhost:5984/fauxton",
-        "app": "./couchapp.js",
-        "options": {
-          "okay_if_missing": true
-        }
+  "couch_config": {
+    "fauxton": {
+      "db": "http://localhost:5984/fauxton",
+      "app": "./couchapp.js",
+      "options": {
+        "okay_if_missing": true
       }
     }
+  }
 }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87cc4076/src/fauxton/tasks/fauxton.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/fauxton.js b/src/fauxton/tasks/fauxton.js
index e54bab8..80581a7 100644
--- a/src/fauxton/tasks/fauxton.js
+++ b/src/fauxton/tasks/fauxton.js
@@ -75,6 +75,24 @@ module.exports = function(grunt) {
 
   });
 
+
+  grunt.registerMultiTask('gen_brand_imports', 'Generate the branding.less file imports for site branding and setting variables', function() {
+    var path = require('path');
+        data = this.data,
+        _ = grunt.util._,
+        settingsFile = path.existsSync(data.src) ? data.src : "settings.json.default",
+        settings = grunt.file.readJSON(settingsFile),
+        template = "assets/less/branding.less.underscore",
+        dest = "assets/less/branding.less",
+        less = settings.branding;
+
+    var tmpl = _.template(grunt.file.read(template));
+    grunt.file.write(dest, tmpl({less: less}));
+  });
+
+
+
+
   grunt.registerMultiTask('gen_load_addons', 'Generate the load_addons.js file', function() {
     var path = require('path');
         data = this.data,