diff options
author | suelockwood <deathbear@apache.org> | 2013-12-26 11:17:49 -0500 |
---|---|---|
committer | suelockwood <deathbear@apache.org> | 2013-12-26 11:17:49 -0500 |
commit | bc378807a944f37d3ba45f293f3b4c1f87728a5b (patch) | |
tree | f5cb1346ea75df06707638aa66604cf7c4231e83 | |
parent | c18c2f116298efd0b0642c7c63599c2e0a45844c (diff) | |
download | couchdb-bc378807a944f37d3ba45f293f3b4c1f87728a5b.tar.gz |
Add messaging while waiting for DB to delete.
Remove buttons from the bottom of the editor
-rw-r--r-- | src/fauxton/app/modules/documents/views.js | 106 | ||||
-rw-r--r-- | src/fauxton/app/templates/documents/doc.html | 17 |
2 files changed, 64 insertions, 59 deletions
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index 96314addf..a0775a18c 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -31,52 +31,55 @@ define([ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColumns) { var Views = {}; - Views.Tabs = FauxtonAPI.View.extend({ - template: "templates/documents/tabs", - initialize: function(options){ - this.collection = options.collection; - this.database = options.database; - this.active_id = options.active_id; - }, - - events: { - "click #delete-database": "delete_database" - }, - - serialize: function () { - return { - // TODO make this not hard coded here - changes_url: '#' + this.database.url('changes'), - db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit, - }; - }, - - beforeRender: function(manage) { - this.insertView("#search", new Views.SearchBox({ - collection: this.collection, - database: this.database.id - })); - }, - - afterRender: function () { - if (this.active_id) { - this.$('.active').removeClass('active'); - this.$('#'+this.active_id).addClass('active'); - } - }, - - delete_database: function (event) { - event.preventDefault(); - - var result = confirm("Are you sure you want to delete this database?"); - - if (!result) { return; } - - return this.database.destroy().done(function () { - app.router.navigate('#/_all_dbs', {trigger: true}); - }); - } - }); + // Views.Tabs = FauxtonAPI.View.extend({ + // template: "templates/documents/tabs", + // initialize: function(options){ + // this.collection = options.collection; + // this.database = options.database; + // this.active_id = options.active_id; + // }, + + // events: { + // "click #delete-database": "delete_database" + // }, + + // serialize: function () { + // return { + // // TODO make this not hard coded here + // changes_url: '#' + this.database.url('changes'), + // db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit, + // }; + // }, + + // beforeRender: function(manage) { + // this.insertView("#search", new Views.SearchBox({ + // collection: this.collection, + // database: this.database.id + // })); + // }, + + // afterRender: function () { + // if (this.active_id) { + // this.$('.active').removeClass('active'); + // this.$('#'+this.active_id).addClass('active'); + // } + // }, + + // delete_database: function (event) { + // event.preventDefault(); + + // var result = confirm("Are you sure you want to delete this database?"); + + // if (!result) { return; } + // FauxtonAPI.addNotification({ + // msg: "Deleting your database...", + // type: "error" + // }); + // return this.database.destroy().done(function () { + // app.router.navigate('#/_all_dbs', {trigger: true}); + // }); + // } + // }); Views.SearchBox = FauxtonAPI.View.extend({ template: "templates/documents/search", @@ -1661,16 +1664,23 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum if (!result) { return; } var databaseName = this.database.id; + FauxtonAPI.addNotification({ + msg: "Deleting your database...", + type: "error", + clear: true + }); this.database.destroy().then(function () { FauxtonAPI.navigate('#/_all_dbs'); FauxtonAPI.addNotification({ - msg: 'The database ' + databaseName + ' has been deleted.' + msg: 'The database ' + databaseName + ' has been deleted.', + clear: true }); }).fail(function (rsp, error, msg) { FauxtonAPI.addNotification({ msg: 'Could not delete the database, reason ' + msg + '.', - type: 'error' + type: 'error', + clear: true }); }); }, diff --git a/src/fauxton/app/templates/documents/doc.html b/src/fauxton/app/templates/documents/doc.html index 82f2733d5..10bbf8b88 100644 --- a/src/fauxton/app/templates/documents/doc.html +++ b/src/fauxton/app/templates/documents/doc.html @@ -17,14 +17,14 @@ the License. <div class="row doc-editor-buttons"> <div class="span3"> - <button class="save-doc button green btn-large save fonticon-circle-check" type="button">Save</button> - <button class="button cancel-button gray btn-large">Back to _all_docs</button> + <button class="save-doc button green btn-medium save fonticon-circle-check" type="button">Save</button> + <button class="button cancel-button gray btn-medium">Back to _all_docs</button> </div> <div class="span7"> <% if (attachments) { %> <div class="btn-group"> - <a class="button gray btn-large dropdown-toggle btn" data-bypass="true" data-toggle="dropdown" href="#"> + <a class="button gray btn-medium dropdown-toggle btn" data-bypass="true" data-toggle="dropdown" href="#"> View Attachments <span class="caret"></span> </a> @@ -39,11 +39,11 @@ the License. </ul> </div> <% } %> - <button class="button gray btn-large upload"><i class="icon-circle-arrow-up"></i> Upload Attachment</button> - <button class="button gray btn-large duplicate"><i class="icon-repeat"></i> Duplicate document</button> + <button class="button gray btn-medium upload"><i class="icon-circle-arrow-up"></i> Upload Attachment</button> + <button class="button gray btn-medium duplicate"><i class="icon-repeat"></i> Duplicate document</button> </div> - <button class="button red btn-large delete"><i class="icon-trash"></i></button> + <button class="button red btn-medium delete"><i class="icon-trash"></i></button> </ul> <div id="upload-modal"> </div> @@ -51,10 +51,5 @@ the License. </div> <div id="editor-container" class="doc-code"><%- JSON.stringify(doc.attributes, null, " ") %></div> - <br /> - <p> - <button class="save-doc button green btn-large save fonticon-circle-check" type="button">Save</button> - <button class="button gray btn-large cancel-button outlineGray fonticon-circle-x" type="button">Cancel</button> - </p> </div> |