mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Basis for user view is finished
This commit is contained in:
parent
972d231ff5
commit
ebdbc0f891
8 changed files with 65 additions and 11 deletions
|
@ -37,6 +37,8 @@
|
|||
|
||||
a.disabled
|
||||
color: #5b5855
|
||||
text-decoration: none
|
||||
cursor: default
|
||||
|
||||
#top-nav
|
||||
a.navbar-brand
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
@import "../bootstrap/variables"
|
||||
@import "../bootstrap/mixins"
|
||||
|
||||
#user-home-view
|
||||
margin-top: 20px
|
||||
|
||||
.left-column
|
||||
+make-sm-column(4)
|
||||
|
||||
.right-column
|
||||
+make-sm-column(8)
|
||||
|
||||
.picture-wrapper
|
||||
text-align: center
|
||||
outline: 1px solid darkgrey
|
||||
max-width: 80%
|
||||
+center-block()
|
||||
|
||||
> .picture
|
||||
max-width: 100%
|
||||
border: 4px solid white
|
||||
|
||||
> .name
|
||||
margin: 0px auto
|
||||
padding: 10px inherit
|
||||
background: white
|
||||
color: white
|
||||
text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 1px 1px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000
|
||||
|
|
@ -5,7 +5,6 @@ block content
|
|||
.col-sm-6.clearfix
|
||||
h2 Account Settings
|
||||
hr
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
h3.panel-title
|
||||
|
|
|
@ -2,16 +2,20 @@ extends /templates/base
|
|||
|
||||
// User pages might have some user page specific header, if not remove this
|
||||
block content
|
||||
div
|
||||
if user && viewName
|
||||
ol.breadcrumb
|
||||
li
|
||||
- var userName = user.get('name');
|
||||
a(href="/user/#{user.id}") #{userName}
|
||||
li.active
|
||||
| #{viewName}
|
||||
.clearfix
|
||||
//-
|
||||
if user && viewName
|
||||
ol.breadcrumb
|
||||
li
|
||||
- var userName = user.get('name');
|
||||
//_a(href="/user/#{user.id}") #{userName}
|
||||
li.active
|
||||
//-| #{viewName}
|
||||
if !userLoaded
|
||||
| LOADING
|
||||
else if !user
|
||||
// TODO Ruben make this all fancy as soon as we can query users by name
|
||||
| User not found.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
extends /templates/kinds/user
|
||||
|
||||
block append content
|
||||
if user
|
||||
.left-column
|
||||
.picture-wrapper
|
||||
img.picture(src="#{me.getPhotoURL(150)}" alt="")
|
||||
h3.name= user.get('name')
|
||||
.right-column
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
h3.panel-title Achievements
|
||||
.panel-body
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
h3.panel-title S. Levels
|
||||
.panel-body
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
h3.panel-title M. Levels
|
||||
.panel-body
|
||||
|
|
|
@ -20,16 +20,18 @@ module.exports = class UserView extends RootView
|
|||
fetchUser: (id) ->
|
||||
User.getByID id, {}, true,
|
||||
success: (@user) =>
|
||||
@userLoaded = true
|
||||
@trigger 'userNotFound' unless @user
|
||||
@trigger 'userLoaded', @user
|
||||
error: =>
|
||||
console.debug 'Error while fetching user'
|
||||
@userLoaded = true
|
||||
@trigger 'userNotFound'
|
||||
|
||||
getRenderData: ->
|
||||
context = super()
|
||||
context.viewName = @viewName
|
||||
context.user = @user unless @user?.isAnonymous()
|
||||
context.userLoaded = @userLoaded
|
||||
context
|
||||
|
||||
isMe: -> @userID is me.id
|
||||
|
|
|
@ -236,7 +236,7 @@ module.exports = class ProfileView extends UserView
|
|||
jobProfile.name ?= (@user.get('firstName') + ' ' + @user.get('lastName')).trim() if @user?.get('firstName')
|
||||
context.profile = jobProfile
|
||||
context.user = @user
|
||||
context.myProfile = @user?.id is context.me.id
|
||||
context.myProfile = @isMe()
|
||||
context.allowedToViewJobProfile = @user and (me.isAdmin() or 'employer' in me.get('permissions') or (context.myProfile && !me.get('anonymous')))
|
||||
context.allowedToEditJobProfile = @user and (me.isAdmin() or (context.myProfile && !me.get('anonymous')))
|
||||
context.profileApproved = @user?.get 'jobProfileApproved'
|
||||
|
|
Loading…
Reference in a new issue