1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-29 12:55:21 +01:00

no sites message for vault and current tab pages

This commit is contained in:
Kyle Spearrin 2016-09-16 00:16:31 -04:00
parent a5e05b6f3d
commit 2552d027b9
3 changed files with 56 additions and 34 deletions

View File

@ -5,21 +5,26 @@
<div class="title">Current Tab Sites</div>
</div>
<div class="content content-tabs">
<div class="list">
<div class="list-grouped">
<div ng-click="fillSite(site)" class="list-grouped-item condensed" style="cursor: pointer;"
ng-repeat="site in theSites = (sites | orderBy: ['name', 'username'])">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Password" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Password')" data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}">
<i class="fa fa-lg fa-key"></i>
</a>
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Username')" data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<i class="fa fa-lg fa-user"></i>
</a>
<span class="text">{{site.name}}</span>
<span class="detail">{{site.username}}</span>
<div ng-if="sites.length">
<div class="list">
<div class="list-grouped">
<div ng-click="fillSite(site)" class="list-grouped-item condensed" style="cursor: pointer;"
ng-repeat="site in theSites = (sites | orderBy: ['name', 'username'])">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Password" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Password')" data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}">
<i class="fa fa-lg fa-key"></i>
</a>
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Username')" data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<i class="fa fa-lg fa-user"></i>
</a>
<span class="text">{{site.name}}</span>
<span class="detail">{{site.username}}</span>
</div>
</div>
</div>
</div>
<div ng-if="!sites.length">
<p>No sites available for tab. <a href="" ng-click="addSite()">Add one</a></p>
</div>
</div>

View File

@ -64,9 +64,19 @@
return item.name.toLowerCase();
};
$scope.setFolderFilter = function (folder) {
$scope.folderFilter = {};
$scope.folderFilter.folderId = folder.id;
$scope.filterByFolder = function (folder) {
};
$scope.searchSites = function () {
if (!$scope.searchText) {
return;
}
return function (site) {
return (site.name && site.name.indexOf($scope.searchText) !== -1) ||
(site.username && site.username.indexOf($scope.searchText) !== -1);
};
};
$scope.addSite = function () {

View File

@ -8,24 +8,31 @@
</div>
</div>
<div class="content content-tabs">
<div class="list">
<div class="list-grouped" ng-repeat="folder in vaultFolders | orderBy: folderSort" ng-show="vaultFolders.length">
<div class="list-grouped-header">
<i class="fa fa-folder-open"></i> {{folder.name}}
</div>
<div ng-click="viewSite(site)" class="list-grouped-item condensed" style="cursor: pointer;"
ng-repeat="site in folderSites = (vaultSites | filter: { folderId: folder.id } | filter: (searchText || '') | orderBy: ['name', 'username'])">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Password" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Password')" data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}">
<i class="fa fa-lg fa-key"></i>
</a>
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Username')" data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<i class="fa fa-lg fa-user"></i>
</a>
<span class="text">{{site.name}}</span>
<span class="detail">{{site.username}}</span>
<div ng-if="vaultSites.length">
<div class="list">
<div class="list-grouped" ng-repeat="folder in vaultFolders | orderBy: folderSort" ng-show="vaultFolders.length">
<div ng-if="(vaultSites | filter: { folderId: folder.id } | filter: searchSites()).length">
<div class="list-grouped-header">
<i class="fa fa-folder-open"></i> {{folder.name}}
</div>
<div ng-click="viewSite(site)" class="list-grouped-item condensed" style="cursor: pointer;"
ng-repeat="site in folderSites = (vaultSites | filter: { folderId: folder.id } | filter: searchSites() | orderBy: ['name', 'username'])">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Password" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Password')" data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}">
<i class="fa fa-lg fa-key"></i>
</a>
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Username')" data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<i class="fa fa-lg fa-user"></i>
</a>
<span class="text">{{site.name}}</span>
<span class="detail">{{site.username}}</span>
</div>
</div>
</div>
</div>
</div>
<div ng-if="!sites.length">
<p>No sites to list. <a href="" ng-click="addSite()">Add one</a></p>
</div>
</div>