fix doc count calculation

This commit is contained in:
Max Ogden 2011-07-26 12:32:40 -07:00
parent 2d07653c09
commit 3312498a14
2 changed files with 9 additions and 4 deletions

View File

@ -85,9 +85,7 @@
<div id="right-panel">
<div id="tool-panel">
<div id="summary-bar">
<span>
{{doc_count}} documents
</span>
<span id="docCount"></span>
</div>
<div id="download">
</div>

View File

@ -149,10 +149,17 @@ var recline = function() {
if( util.inURL("_rewrite", app.baseURL) ) app.dbInfo.db_name = "api";
util.render('tableContainer', app.container, app.dbInfo);
util.render('tableContainer', app.container);
util.render('title', 'project-title', app.dbInfo);
util.render( 'generating', 'project-actions' );
couch.request({url: app.baseURL + 'api/_all_docs?' + $.param({startkey: '"_design/"', endkey: '"_design0"'})}).then(
function ( data ) {
var ddocCount = data.rows.length;
$('#docCount').text(app.dbInfo.doc_count - ddocCount + " documents");
}
)
couch.session().then(function(session) {
if ( session.userCtx.name ) {
var text = "Sign out";