diff options
author | suelockwood <deathbearbrown@gmail.com> | 2013-09-11 16:23:30 -0400 |
---|---|---|
committer | suelockwood <deathbearbrown@gmail.com> | 2013-09-12 13:53:51 -0400 |
commit | b865a1dc27fbbbdf158b0dec68d68144c58a9a5e (patch) | |
tree | 8002c12876020afa8c2d79c085d0f5fbd93db2d6 | |
parent | d3d19660cd6e0ce662192c036da9b3771e8794b5 (diff) | |
download | couchdb-b865a1dc27fbbbdf158b0dec68d68144c58a9a5e.tar.gz |
Views weren't saving & there was a console error from CodeMirror.
-rw-r--r-- | src/fauxton/app/addons/replication/templates/form.html | 2 | ||||
-rw-r--r-- | src/fauxton/app/modules/documents/views.js | 2 | ||||
-rw-r--r-- | src/fauxton/app/templates/documents/view_editor.html | 77 |
3 files changed, 37 insertions, 44 deletions
diff --git a/src/fauxton/app/addons/replication/templates/form.html b/src/fauxton/app/addons/replication/templates/form.html index 2c09b767d..ad8c9b24c 100644 --- a/src/fauxton/app/addons/replication/templates/form.html +++ b/src/fauxton/app/addons/replication/templates/form.html @@ -63,7 +63,7 @@ the License. <label for="createTarget"> <input type="checkbox" name="create_target" value="true" id="createTarget"> - Create Target <i class="icon-question-sign " rel="tooltip" title="Create the target database"></i> + Create Target <a href="http://docs.couchdb.org/en/latest/json-structure.html?highlight=replication#replication-settings"><i class="icon-question-sign" rel="tooltip" title="Create the target database"></i></a> </label> </div> diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index 14fa54696..148dc769a 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -1059,7 +1059,7 @@ function(app, FauxtonAPI, Paginate, Documents, pouchdb, Codemirror, JSHint, resi var json, notification, that = this; - event.preventDefault(); + if (event) { event.preventDefault();} if (this.hasValidCode()) { var mapVal = this.mapEditor.getValue(), diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html index 13b92b17a..e04caa486 100644 --- a/src/fauxton/app/templates/documents/view_editor.html +++ b/src/fauxton/app/templates/documents/view_editor.html @@ -22,54 +22,49 @@ the License. <div class="tab-pane active" id="index"> <div id="define-view" class="ddoc-alert well"> <div class="errors-container"></div> - <form class="form-horizontal"> - <h3>Define your index</h3> + <form class="form-horizontal view-query-save"> + <div class="control-group"> - <div class="row" style="margin-left:10px"> - <div class="span3"> - <label class="control-label" for="ddoc">Design document <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#design-docs"><i class="icon-question-sign"></i></a></label> - <div class="controls"> - <select id="ddoc"> - <optgroup label="Select a document"> - <option id="new-doc">New document</option> - <% ddocs.each(function(ddoc) { %> - <% if (ddoc.id === ddocName) { %> - <option selected="selected"><%= ddoc.id %></option> - <% } else { %> - <option><%= ddoc.id %></option> - <% } %> - <% }); %> - </optgroup> - </select> - </div> - </div> - <div id="new-ddoc-section" class="span5 offset1" style="display:none"> - <label class="control-label" for="new-ddoc"> _design/ </label> - <div class="controls"> - <input type="text" id="new-ddoc" placeholder="newDesignDoc"> - </div> + <label for="ddoc">Design document <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#design-docs"><i class="icon-question-sign"></i></a></label> + <select id="ddoc"> + <optgroup label="Select a document"> + <option id="new-doc">New document</option> + <% ddocs.each(function(ddoc) { %> + <% if (ddoc.id === ddocName) { %> + <option selected="selected"><%= ddoc.id %></option> + <% } else { %> + <option><%= ddoc.id %></option> + <% } %> + <% }); %> + </optgroup> + </select> + <div id="new-ddoc-section" class="span5 offset1" style="display:none"> + <label class="control-label" for="new-ddoc"> _design/ </label> + <div class="controls"> + <input type="text" id="new-ddoc" placeholder="newDesignDoc"> </div> </div> </div> + <div class="control-group"> - <label class="control-label" for="index-name">Index name <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#view-functions"><i class="icon-question-sign"></i></a></label> - <div class="controls"> - <input type="text" id="index-name" value="<%= viewName %>" placeholder="Index name" /> - </div> + <label for="index-name">Index name <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#view-functions"><i class="icon-question-sign"></i></a></label> + <input type="text" id="index-name" value="<%= viewName %>" placeholder="Index name" /> </div> + + <div class="control-group"> - <label class="control-label" for="map-function">Map function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#map-functions"><i class="icon-question-sign"></i></a></label> - <div class="controls"> + <label for="map-function">Map function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#map-functions"><i class="icon-question-sign"></i></a></label> <% if (newView) { %> <textarea class="js-editor" id="map-function"><%= langTemplates.map %></textarea> <% } else { %> <textarea class="js-editor" id="map-function"><%= ddoc.get('views')[viewName].map %></textarea> <% } %> - </div> </div> + + <div class="control-group"> - <label class="control-label" for="reduce-function-selector">Reduce function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions"><i class="icon-question-sign"></i></a></label> - <div class="controls"> + <label for="reduce-function-selector">Reduce function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions"><i class="icon-question-sign"></i></a></label> + <select id="reduce-function-selector"> <option value="" <%= !reduceFunStr ? 'selected="selected"' : '' %>>None</option> <% _.each(["_sum", "_count", "_stats"], function(reduce) { %> @@ -78,25 +73,23 @@ the License. <option value="CUSTOM" <% if (isCustomReduce) { %>selected<% } %>>Custom reduce</option> </select> <span class="help-block">Reduce functions are optional.</span> - </div> </div> + + <div class="control-group reduce-function"> - <label class="control-label" for="reduce-function">Custom Reduce</label> - <div class="controls"> + <label for="reduce-function">Custom Reduce</label> <% if (newView) { %> <textarea class="js-editor" id="reduce-function"><%= langTemplates.reduce %></textarea> <% } else { %> <textarea class="js-editor" id="reduce-function"><%= ddoc.get('views')[viewName].reduce %></textarea> <% } %> - </div> </div> + <div class="control-group"> - <div class="controls"> - <button class="btn btn-success btn-large save">Save</button> + <button class="button green save fonticon-circle-check">Save</button> <% if (!this.newView) { %> - <button class="btn btn-danger btn-large delete">Delete</button> + <button class="button cancel-button outlineGray fonticon-circle-x">Delete</button> <% } %> - </div> </div> <div class="clearfix"></div> </form> |