Skip to content

Commit eec1266

Browse files
author
Nicholas Thomson
committed
Put company/investors list in small pane
1 parent fb281a1 commit eec1266

File tree

2 files changed

+35
-45
lines changed

2 files changed

+35
-45
lines changed

app/scripts/controllers/crunchinator.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ angular.module('crunchinatorApp.controllers')
102102
$scope.filteredInvestors();
103103
$scope.clearLookingFor();
104104

105+
$scope.updateLookingFor();
106+
105107
$scope.selectedCompanies = _.intersection($scope.selectedCompanies, $scope.filteredCompaniesList);
106108
$scope.selectedCategories = _.intersection($scope.selectedCategories, $scope.filteredCategoriesList);
107109
$scope.selectedInvestors = _.intersection($scope.selectedInvestors, $scope.filteredInvestorsList);
@@ -145,6 +147,7 @@ angular.module('crunchinatorApp.controllers')
145147

146148
$scope.clearLookingFor = function() {
147149
$scope.lookingForList = [];
150+
$scope.updateLookingFor();
148151
};
149152

150153
$scope.$watch('lookingFor', function(){

app/views/main.tpl.html

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,10 @@ <h4 class="pull-left">Environment: {{environment}}</h4>
1616
</div>
1717
<div class="row">
1818

19-
<div class='col-sm-6 spacing-med'>
19+
<div class='col-sm-4 spacing-med'>
2020
<h3 class="pull-left">Categories</h3>
2121
<p class="pull-right count">Count: {{filteredCategoriesList.length}}</p>
2222
<div id="categories" class="textlist clear-both">
23-
<div class="form-group">
24-
<div class="controls">
25-
<div class="input-group">
26-
<span class="input-group-addon"><i class="glyphicon glyphicon-tags"></i></span>
27-
<input ng-model="searchCategories" placeholder="Find Categories" type="text" class="form-control">
28-
</div>
29-
</div>
30-
</div>
3123
<div class="dataset">
3224
<table class="table">
3325
<tbody><tr ng-class="{success: selectedCategories.indexOf(category) &gt; -1}" ng-repeat="category in filteredCategoriesList">
@@ -38,11 +30,40 @@ <h3 class="pull-left">Categories</h3>
3830
</div>
3931
</div>
4032

41-
<div ng-show='lookingFor == "companies"' class='col-sm-6 spacing-med'>
33+
<div class='col-sm-4 spacing-med'>
34+
<div ng-show='!!lookingFor'>
35+
<h3 class='pull-left'>
36+
<span ng-if='lookingFor == "companies"'>Companies</span>
37+
<span ng-if='lookingFor == "investors"'>Investors</span>
38+
</h3>
39+
<p class="pull-right count">
40+
<span ng-show='lookingFor == "companies"'>
41+
{{filteredCompaniesList.length}} of {{all_companies.length}}
42+
</span>
43+
<span ng-show='lookingFor == "investors"'>
44+
{{filteredInvestorsList.length}} of {{all_investors.length}}
45+
</span>
46+
</p>
47+
<div class='textlist clear-both'>
48+
<div class='dataset'>
49+
<table class='table table-striped table-hover' infinite-scroll="updateLookingFor()">
50+
<tbody>
51+
<tr ng-repeat="item in lookingForList">
52+
<td><a href='#'>{{item.name}}</a></td>
53+
<td ng-if='lookingFor == "companies"'>{{item.total_funding | currency}}</td>
54+
</tr>
55+
</tbody>
56+
</table>
57+
</div>
58+
</div>
59+
</div>
60+
</div>
61+
62+
<div ng-show='lookingFor == "companies"' class='col-sm-4 spacing-med'>
4263
<h3 class="pull-left">Investors</h3>
4364
</div>
4465

45-
<div ng-show='lookingFor == "investors"' class='col-sm-6 spacing-med'>
66+
<div ng-show='lookingFor == "investors"' class='col-sm-4 spacing-med'>
4667
<h3 class="pull-left">Companies</h3>
4768
</div>
4869
</div>
@@ -57,39 +78,5 @@ <h3 class="pull-left">Companies</h3>
5778
</div>
5879

5980
</div>
60-
<div ng-show='!!lookingFor' class='row'>
61-
<div class='col-sm-12 spacing-med'>
62-
<div class='panel panel-info'>
63-
<div class='panel-heading'>
64-
<h3 ng-if='lookingFor == "companies"' class='panel-title pull-left'>Companies</h3>
65-
<h3 ng-if='lookingFor == "investors"' class='panel-title pull-left'>Investors</h3>
66-
<div class='pull-right'>
67-
<span ng-show='lookingFor == "companies"'>
68-
{{filteredCompaniesList.length}} of {{all_companies.length}}
69-
</span>
70-
<span ng-show='lookingFor == "investors"'>
71-
{{filteredInvestorsList.length}} of {{all_investors.length}}
72-
</span>
73-
</div>
74-
<div class='clear-both'></div>
75-
</div>
76-
77-
<table class='table table-striped table-hover' infinite-scroll="updateLookingFor()">
78-
<thead>
79-
<tr>
80-
<th>Name</th>
81-
<th ng-if='lookingFor == "companies"'>Total Funding</th>
82-
</tr>
83-
</thead>
84-
<tbody>
85-
<tr ng-repeat="item in lookingForList">
86-
<td><a href='#'>{{item.name}}</a></td>
87-
<td ng-if='lookingFor == "companies"'>{{item.total_funding | currency}}</td>
88-
</tr>
89-
</tbody>
90-
</table>
91-
</div>
92-
</div>
93-
</div>
9481

9582
</div>

0 commit comments

Comments
 (0)