Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Knupp
committed
Jan 30, 2014
1 parent
46ff5cb
commit a8f3405
Showing
7 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.mention-true { | ||
text-color: lightGrey; | ||
} | ||
.mention-false { | ||
font-weight: 700; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var eavesApp = angular.module('eavesApp', []); | ||
|
||
eavesApp.controller('MentionCtrl', function ($scope, $http) { | ||
|
||
$http.get('/mentions').success(function (data) { | ||
$scope.mentions = data; | ||
}); | ||
|
||
$scope.addMention = function() { | ||
$scope.mentions.push({text: $scope.mentionText, read:false}); | ||
$scope.mentionText = ""; | ||
}; | ||
$scope.unread = function() { | ||
var count = 0; | ||
angular.forEach($scope.mentions, function(mention) { | ||
count += mention.read ? 1 : 0; | ||
}); | ||
return count; | ||
}; | ||
$scope.orderProp = 'name'; | ||
}); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!doctype html> | ||
<html ng-app="eavesApp"> | ||
<head> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script> | ||
<script src="../static/js/controllers.js"></script> | ||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="../static/css/style.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="container" ng-controller="MentionCtrl"> | ||
<h2>Mentions</h2> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
|
||
|
||
<p>Search: <input ng-model="query"></p> | ||
<p>Order By:</p> | ||
<select ng-model="orderProp"> | ||
<option value="found">Newest</option> | ||
<option value="name">Alphabetical</option> | ||
</select> | ||
|
||
|
||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-12" > | ||
{% raw %} | ||
<span>{{unread()}} of {{mentions.length}} unread</span> | ||
<ul class="unstyled"> | ||
<li ng-repeat="mention in mentions | filter:query | orderBy:orderProp"> | ||
<span class="mention-{{ mention.read }}">{{ mention.read ? "read" : "unread"}}</span> | ||
<p>{{ mention.text }}</p> | ||
</li> | ||
</ul> | ||
{% endraw %} | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |