diff --git a/frontend/controllers/SeasonManageController.coffee b/frontend/controllers/SeasonManageController.coffee index 16de6e1..8fa916a 100644 --- a/frontend/controllers/SeasonManageController.coffee +++ b/frontend/controllers/SeasonManageController.coffee @@ -10,6 +10,8 @@ angular.module("MagicStick.controllers").controller "SeasonManageController", [ comment: "" savedComment: "" $scope.isCurrentUser = (username) -> username is User.username + $scope.userLabel = (user) -> + user.username + if user.name? then " (#{user.name})" else "" $scope.seasonOwner = -> season?.owner?.username is User.username $scope.createSeasonGrouping = (groupingName) -> diff --git a/frontend/directives/auth.coffee b/frontend/directives/auth.coffee index af16833..053c8f4 100644 --- a/frontend/directives/auth.coffee +++ b/frontend/directives/auth.coffee @@ -9,6 +9,7 @@ angular.module("MagicStick.directives").directive("auth", [ -> User, -> $scope.username = User.username + $scope.avatar_url = User.avatar_url authed = false rolesRequired = attrs.auth if rolesRequired is "" diff --git a/frontend/directives/userView.coffee b/frontend/directives/userView.coffee index ce80168..bf2960b 100644 --- a/frontend/directives/userView.coffee +++ b/frontend/directives/userView.coffee @@ -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() - ] - diff --git a/frontend/scss/app.scss b/frontend/scss/app.scss index d29ea88..7d88360 100644 --- a/frontend/scss/app.scss +++ b/frontend/scss/app.scss @@ -23,18 +23,38 @@ bottom: 20%; } .avatar { - display: block; - overflow: hidden; + display: block; + overflow: hidden; +} +p.navbar-text.profile { + margin-bottom: .2em; + margin-top: .8em; + a.profile { + &:hover { + color: #4183c4; + img.nav-avatar { + border-color: #77B5F2; + } + } + font-weight: bold; + text-decoration: none; + img.nav-avatar { + border-radius: 100%; + border: 2px solid rgb(216, 214, 214); + height: 32px; + width: 32px; + } + } } .avatar-64 { - height: 64px; - width: 64px; + height: 64px; + width: 64px; } .avatar img { - display: block; - min-width: 100%; - min-height: 100%; - -ms-interpolation-mode: bicubic; /* Scaled images look a bit better in IE now */ + display: block; + min-width: 100%; + min-height: 100%; + -ms-interpolation-mode: bicubic; /* Scaled images look a bit better in IE now */ } #avatar-selector { cursor: pointer; @@ -59,7 +79,54 @@ div.panel.comments { div.preview { min-height: 60px; } + img.avatar { + display: inline-block; + border-radius: 100%; + border: 2px solid rgb(216, 214, 214); + height: 32px; + width: 32px; + } } span.markdown-help { font-size: 10pt; } +div.season-members { + button.btn-danger { + vertical-align: top; + } +} +div.user-view { + margin: 0 5px 0 5px; + display: inline-block; + padding: 4px; + border-radius: 4px; + width: 200px; + height: 40px; + background-color: rgb(66, 17, 82); + color: rgb(252, 250, 250); + div.left { + float: left; + width: 25%; + img.cell-avatar { + border-radius: 100%; + border: 2px solid #9334D3; + height: 32px; + width: 32px; + } + } + div.right { + float: right; + width: 75%; + p { + font-size: 10pt; + margin: 0; + text-overflow: ellipsis; + overflow-x: hidden; + white-space: nowrap; + &.name { + font-size: 8pt; + color: rgb(198, 186, 210); + } + } + } +} diff --git a/frontend/services/User.coffee b/frontend/services/User.coffee index 45bab54..5a65311 100644 --- a/frontend/services/User.coffee +++ b/frontend/services/User.coffee @@ -52,6 +52,7 @@ angular.module("MagicStick.services").factory "User", [ @logout() if status is 401 parsePrincipal: (data) -> return unless data? + @avatar_url = data.avatar_url @roles = {} for role in data.roles @roles[role.name] = true @@ -59,6 +60,7 @@ angular.module("MagicStick.services").factory "User", [ @loggedIn = false @username = "" @roles = {} + @avatar_url = null delete $http.defaults.headers.common['Authorization'] localStorageService.set('currentUser', null) @broadcastLoginStateChange() diff --git a/frontend/views/dashboard.html b/frontend/views/dashboard.html index b9fbdfb..2b56d83 100644 --- a/frontend/views/dashboard.html +++ b/frontend/views/dashboard.html @@ -1,6 +1,9 @@
+
+

Magic the Gathering League Website

+

This site is currently still under construction. Check out seasons above

+
-
diff --git a/frontend/views/season-manage.html b/frontend/views/season-manage.html index ec4de0b..4d12f23 100644 --- a/frontend/views/season-manage.html +++ b/frontend/views/season-manage.html @@ -43,19 +43,19 @@

Seasons > {{season.name}} [id: {{season.id}}] - - - - - -
{{member.username}} - -
+
+
+ + +
+
Match Groups
@@ -126,7 +126,7 @@

Members

id="nextMatchMember" class="form-control" ng-model="nextMatchMember" - ng-options="user as user.username for user in season.members"> + ng-options="user as userLabel(user) for user in season.members">

- {{user_season_match.user_season.user.username}} + {{ @@ -240,7 +240,7 @@

Members

- {{comment.user.username}} added a comment at {{comment.created_at}} + {{comment.user.username}} added a comment at {{comment.created_at}} diff --git a/frontend/views/user.html b/frontend/views/user.html index ea3f88f..785a830 100644 --- a/frontend/views/user.html +++ b/frontend/views/user.html @@ -1,3 +1,15 @@ -
- Logged in as {{user.username}} logout? +
+
+ +
+
+

+ {{user().username}} +

+

+ {{user().name}} +

+
diff --git a/public/index.html b/public/index.html index e9d0a17..751149a 100644 --- a/public/index.html +++ b/public/index.html @@ -67,7 +67,12 @@ --> - +