-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(user view): proliferate usage of name and avatar attrs
This involved, amongst other things, refactoring the userView directive to be a generic user-viewing directive that can be used anywhere. refs #19
- Loading branch information
1 parent
d682644
commit 2db8ec5
Showing
9 changed files
with
122 additions
and
36 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 |
---|---|---|
@@ -1,11 +1,5 @@ | ||
angular.module("MagicStick.directives").directive "userView", -> | ||
restrict: "E" | ||
scope: | ||
"user": "&" | ||
templateUrl: "user.html" | ||
controller: [ | ||
"$scope" | ||
"User" | ||
($scope, User) -> | ||
$scope.user = User | ||
$scope.logout = -> User.logout() | ||
] | ||
|
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
<div class="container"> | ||
<div class="dashboard-view"> | ||
<div> | ||
<p>Magic the Gathering League Website</p> | ||
<p>This site is currently still under construction. Check out seasons above</p> | ||
</div> | ||
<login-view></login-view> | ||
<user-view></user-view> | ||
</div> | ||
</div> |
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 |
---|---|---|
@@ -1,3 +1,15 @@ | ||
<div class="user-view" ng-if="user.loggedIn"> | ||
<span>Logged in as {{user.username}} <i><a ng-click="logout()">logout?</a></i></span> | ||
<div class="user-view clearfix"> | ||
<div class="left"> | ||
<img | ||
class="cell-avatar" | ||
ng-src="{{user().avatar_url}}"/> | ||
</div> | ||
<div class="right"> | ||
<p class="username"> | ||
{{user().username}} | ||
</p> | ||
<p class="name" ng-if="user().name != null"> | ||
{{user().name}} | ||
</p> | ||
</div> | ||
</div> |
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