summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Branca <chewbranca@gmail.com>2013-03-13 10:31:02 -0700
committerRussell Branca <chewbranca@gmail.com>2013-03-13 10:31:02 -0700
commit25881bb138b9341c1b31f573efe094f26ce66de9 (patch)
tree5603945a690d94d92efc7111a73c498a775a2281
parentf0b587c41c7ed777328827d06dc5a91521468c82 (diff)
parent60ff9597ef64ec67e9d2e7f0dda2f23442c0be9d (diff)
downloadcouchdb-25881bb138b9341c1b31f573efe094f26ce66de9.tar.gz
Merge remote-tracking branch 'upstream/fauxton' into fauxton
Conflicts: src/fauxton/app/templates/databases/sidebar.html src/fauxton/app/templates/fauxton/api_bar.html
-rw-r--r--src/fauxton/app/templates/databases/sidebar.html6
-rw-r--r--src/fauxton/app/templates/fauxton/api_bar.html12
-rw-r--r--src/fauxton/app/templates/layouts/with_sidebar.html10
-rw-r--r--src/fauxton/app/templates/layouts/with_tabs_sidebar.html2
-rw-r--r--src/fauxton/readme.md31
-rw-r--r--src/fauxton/tasks/fauxton.js9
-rw-r--r--src/fauxton/tasks/templates/base.js.underscore21
-rw-r--r--src/fauxton/tasks/templates/resources.js.underscore21
-rw-r--r--src/fauxton/tasks/templates/route.js.underscore21
-rw-r--r--src/fauxton/writing_addons.md3
10 files changed, 107 insertions, 29 deletions
diff --git a/src/fauxton/app/templates/databases/sidebar.html b/src/fauxton/app/templates/databases/sidebar.html
index 35cd8609a..87c7fd8d6 100644
--- a/src/fauxton/app/templates/databases/sidebar.html
+++ b/src/fauxton/app/templates/databases/sidebar.html
@@ -12,7 +12,9 @@ License for the specific language governing permissions and limitations under
the License.
-->
-<a class="btn btn-small new span4" id="new" style="width: 93%; margin-left: 0"><i class="icon-plus"></i> New database</a>
+<div class="row-fluid">
+<a class="btn new span4" id="new"><i class="icon-plus"></i> New database</a>
+</div>
<hr>
<ul class="nav nav-list">
<!-- <li class="nav-header">Database types</li> -->
@@ -22,4 +24,4 @@ the License.
<div class="well">
<p>Here be news.</p>
</div>
-<a href="http://couchdb.org" target="_couchdb"><img src="img/couchdblogo.png"/></a> \ No newline at end of file
+<a href="http://couchdb.org" target="_blank"><img src="img/couchdblogo.png"/></a>
diff --git a/src/fauxton/app/templates/fauxton/api_bar.html b/src/fauxton/app/templates/fauxton/api_bar.html
index ff35ee9df..0ca6c69ca 100644
--- a/src/fauxton/app/templates/fauxton/api_bar.html
+++ b/src/fauxton/app/templates/fauxton/api_bar.html
@@ -16,9 +16,15 @@ the License.
<div class="navbar-inner">
<div class="container">
<div class="input-prepend input-append">
- <span class="add-on">API reference <a href="http://docs.couchdb.org/en/latest/" target="_couchdb"><i class="icon-question-sign"></i></a></span><input type="text" class="input-xxlarge" value="<%= endpoint %>"><a href="#" class="btn">Show me</a>
-
+ <span class="add-on">
+ API reference
+ <a href="http://docs.couchdb.org/en/latest/" target="_blank">
+ <i class="icon-question-sign"></i>
+ </a>
+ </span>
+ <input type="text" class="input-xxlarge" value="<%= endpoint %>">
+ <a href="<%= endpoint %>" target="_blank" class="btn">Show me</a>
</div>
</div>
</div>
-</div> \ No newline at end of file
+</div>
diff --git a/src/fauxton/app/templates/layouts/with_sidebar.html b/src/fauxton/app/templates/layouts/with_sidebar.html
index c28dac485..5deb4d13f 100644
--- a/src/fauxton/app/templates/layouts/with_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_sidebar.html
@@ -14,13 +14,13 @@ the License.
<div id="primary-navbar"></div>
-<div id="dashboard" class="container">
- <div class="row">
+<div id="dashboard" class="container-fluid">
+ <div class="row-fluid">
<div id="breadcrumbs" class="span12"></div>
</div>
- <div class="row">
- <div id="sidebar-content" class="sidebar span4"></div>
- <div id="dashboard-content" class="list span8 pull-right"></div>
+ <div class="row-fluid">
+ <div id="sidebar-content" class="sidebar span3"></div>
+ <div id="dashboard-content" class="list span9"></div>
</div>
</div>
diff --git a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
index c486a69b4..f78832fe4 100644
--- a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
@@ -13,7 +13,7 @@ the License.
-->
<div id="primary-navbar"></div>
-<div id="dashboard" class="container">
+<div id="dashboard" class="container-fluid">
<div class="row-fluid">
<div id="breadcrumbs" class="row-fluid"></div>
diff --git a/src/fauxton/readme.md b/src/fauxton/readme.md
index d5da23fdc..09632af4c 100644
--- a/src/fauxton/readme.md
+++ b/src/fauxton/readme.md
@@ -13,17 +13,15 @@ Current items of interest:
* Data popups for additional db info on \_all_dbs page
* CouchDB API compliant urls
-## Setup ##
+## Setup Fauxton ##
-Some recentish version of node.js and npm is required for the local
-development and build tools.
+A recent of [node.js](http://nodejs.org/) and npm is required.
### CouchDB Setup ###
- git clone https://github.com/cloudant-labs/couchdb/ couchdb-fauxton
- cd couchdb-fauxton
+ 1. Clone the Couchdb repo: https://github.com/apache/couchdb.git or http://git-wip-us.apache.org/repos/asf/couchdb.git
+ cd couchdb
git checkout fauxton
- ./bootstrap && ./configure && make dev
### Fauxton Setup ###
@@ -31,7 +29,8 @@ development and build tools.
# Install all dependencies
npm install
-
+
+#### (Optional) To avoid a npm global install
# Add node_modules/.bin to your path
# export PATH=./node_modules/.bin:$PATH
# Or just use the wrappers in ./bin/
@@ -42,15 +41,19 @@ development and build tools.
# Or fully compiled install
# ./bin/bbb couchdb
-### Start CouchDB with Fauxton Installed ###
+### To Deploy Fauxton
+
+ bbb couchapp_deploy - to deploy to your local [Couchdb instance] (http://localhost:5984/fauxton/_design/fauxton/index.html)
- ../../utils/run &
- open http://localhost:5984/_utils/fauxton/index.html
+## Understang Fauxton Code layout
-### Install as a Couchapp
+Each bit of functionality is its own seperate module or addon. All core modules are stored under `app/module` and any addons that are optional are under `app/addons`.
+We use [backbone.js](http://backbonejs.org/) and [Backbone.layoutmanager](https://github.com/tbranyen/backbone.layoutmanager) quite heavily, so best to get an idea how they work.
+Its best at this point to read through a couple of the modules and addons to get an idea of how they work. Two good starting points are `app/addon/config` and `app/modules/databases`.
+Each module must have a `base.js` file, this is read and compile when Fauxton is deployed. A `resource.js` file is usually for your Backbone.Models and Backbone.Collections,
+`view.js` for your Backbone.Views. The `routes.js` is used to register a url path for your view along with what layout, data, breadcrumbs and api point is required for the view.
-Complete the setup process as above and run:
+## Todo items
- ./bin/bbb couchapp_setup couchapp_install
+Checkout [Jira](https://issues.apache.org/jira/browse/COUCHDB/component/12320406) for a list of items to do.
-Install [phantomjs](http://phantomjs.org/) for tests.
diff --git a/src/fauxton/tasks/fauxton.js b/src/fauxton/tasks/fauxton.js
index 78b50f377..ee365a20b 100644
--- a/src/fauxton/tasks/fauxton.js
+++ b/src/fauxton/tasks/fauxton.js
@@ -37,17 +37,17 @@ module.exports = function(grunt) {
{
name: 'base',
filename: 'base.js',
- template: 'define([\n "app",\n "api",\n "addons/<%= module.toLowerCase() %>/routes"\n],\n\nfunction(app, FauxtonAPI, <%= module %>Routes) {\n\tvar <%= module %> = new FauxtonAPI.addon();\n\treturn <%= module %>;\n});\n'
+ template: grunt.file.read('./tasks/templates/base.js.underscore')
},
{
name: 'resources',
filename: 'resources.js',
- template: 'define([\n "app",\n "backbone",\n "modules/fauxton/base"\n],\n\nfunction (app, backbone, FauxtonAPI) {\n\tvar <%= module %> = {};\n\treturn <%= module %>;\n});\n'
+ template: grunt.file.read('./tasks/templates/resources.js.underscore')
},
{
name: 'routes',
filename: 'routes.js',
- template: 'define([\n "app",\n "api",\n "addons/<%= module.toLowerCase() %>/resources"\n],\n\nfunction(app, FauxtonAPI, <%= module %>) {\n\treturn <%= module %>;\n});\n'
+ template: grunt.file.read('./tasks/templates/route.js.underscore')
}
]
@@ -81,6 +81,7 @@ module.exports = function(grunt) {
grunt.file.write(filepath + '/' + file.filename, content);
});
grunt.log.writeln('Created addon ' + result.name + ' in ' + result.path);
+ grunt.log.writeln('\n\nAdd ' + result.name + ' to settings.json for it to be compiled and deployed');
done();
});
function onErr(err) {
@@ -166,4 +167,4 @@ module.exports = function(grunt) {
grunt.file.write(dest, tmpl({deps: deps}));
});
-}; \ No newline at end of file
+};
diff --git a/src/fauxton/tasks/templates/base.js.underscore b/src/fauxton/tasks/templates/base.js.underscore
new file mode 100644
index 000000000..cf7afa7ee
--- /dev/null
+++ b/src/fauxton/tasks/templates/base.js.underscore
@@ -0,0 +1,21 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+ "app",
+ "api",
+ "addons/<%= module.toLowerCase() %>/routes"
+],
+
+function(app, FauxtonAPI, <%= module %>) {
+ return <%= module %>;
+});
diff --git a/src/fauxton/tasks/templates/resources.js.underscore b/src/fauxton/tasks/templates/resources.js.underscore
new file mode 100644
index 000000000..0aa37f8bc
--- /dev/null
+++ b/src/fauxton/tasks/templates/resources.js.underscore
@@ -0,0 +1,21 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+ "app",
+ "api"
+],
+
+function (app, FauxtonAPI) {
+ var <%= module %> = FauxtonAPI.addon();
+ return <%= module %>;
+});
diff --git a/src/fauxton/tasks/templates/route.js.underscore b/src/fauxton/tasks/templates/route.js.underscore
new file mode 100644
index 000000000..9256766d3
--- /dev/null
+++ b/src/fauxton/tasks/templates/route.js.underscore
@@ -0,0 +1,21 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+ "app",
+ "api",
+ "addons/<%= module.toLowerCase() %>/resources"
+],
+function(app, FauxtonAPI, <%= module %>) {
+ <%= module %>.Routes = {};
+ return <%= module %>;
+});
diff --git a/src/fauxton/writing_addons.md b/src/fauxton/writing_addons.md
index 6d3f87bc0..ccd09af3c 100644
--- a/src/fauxton/writing_addons.md
+++ b/src/fauxton/writing_addons.md
@@ -32,6 +32,9 @@ an addon:
Done, without errors.
+Once the addon is created add the name to the settings.json file to get it compiled
+and added on the next install.
+
## Routes and hooks
An addon can insert itself into fauxton in two ways; via a route or via a hook.