mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 17:33:31 -04: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
app
styles
templates
views
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
a.disabled
|
a.disabled
|
||||||
color: #5b5855
|
color: #5b5855
|
||||||
|
text-decoration: none
|
||||||
|
cursor: default
|
||||||
|
|
||||||
#top-nav
|
#top-nav
|
||||||
a.navbar-brand
|
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
|
.col-sm-6.clearfix
|
||||||
h2 Account Settings
|
h2 Account Settings
|
||||||
hr
|
hr
|
||||||
|
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
.panel-heading
|
.panel-heading
|
||||||
h3.panel-title
|
h3.panel-title
|
||||||
|
|
|
@ -2,16 +2,20 @@ extends /templates/base
|
||||||
|
|
||||||
// User pages might have some user page specific header, if not remove this
|
// User pages might have some user page specific header, if not remove this
|
||||||
block content
|
block content
|
||||||
div
|
.clearfix
|
||||||
if user && viewName
|
//-
|
||||||
ol.breadcrumb
|
if user && viewName
|
||||||
li
|
ol.breadcrumb
|
||||||
- var userName = user.get('name');
|
li
|
||||||
a(href="/user/#{user.id}") #{userName}
|
- var userName = user.get('name');
|
||||||
li.active
|
//_a(href="/user/#{user.id}") #{userName}
|
||||||
| #{viewName}
|
li.active
|
||||||
|
//-| #{viewName}
|
||||||
|
if !userLoaded
|
||||||
|
| LOADING
|
||||||
else if !user
|
else if !user
|
||||||
// TODO Ruben make this all fancy as soon as we can query users by name
|
// TODO Ruben make this all fancy as soon as we can query users by name
|
||||||
| User not found.
|
| User not found.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,21 @@
|
||||||
extends /templates/kinds/user
|
extends /templates/kinds/user
|
||||||
|
|
||||||
block append content
|
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) ->
|
fetchUser: (id) ->
|
||||||
User.getByID id, {}, true,
|
User.getByID id, {}, true,
|
||||||
success: (@user) =>
|
success: (@user) =>
|
||||||
|
@userLoaded = true
|
||||||
@trigger 'userNotFound' unless @user
|
@trigger 'userNotFound' unless @user
|
||||||
@trigger 'userLoaded', @user
|
@trigger 'userLoaded', @user
|
||||||
error: =>
|
error: =>
|
||||||
console.debug 'Error while fetching user'
|
@userLoaded = true
|
||||||
@trigger 'userNotFound'
|
@trigger 'userNotFound'
|
||||||
|
|
||||||
getRenderData: ->
|
getRenderData: ->
|
||||||
context = super()
|
context = super()
|
||||||
context.viewName = @viewName
|
context.viewName = @viewName
|
||||||
context.user = @user unless @user?.isAnonymous()
|
context.user = @user unless @user?.isAnonymous()
|
||||||
|
context.userLoaded = @userLoaded
|
||||||
context
|
context
|
||||||
|
|
||||||
isMe: -> @userID is me.id
|
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')
|
jobProfile.name ?= (@user.get('firstName') + ' ' + @user.get('lastName')).trim() if @user?.get('firstName')
|
||||||
context.profile = jobProfile
|
context.profile = jobProfile
|
||||||
context.user = @user
|
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.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.allowedToEditJobProfile = @user and (me.isAdmin() or (context.myProfile && !me.get('anonymous')))
|
||||||
context.profileApproved = @user?.get 'jobProfileApproved'
|
context.profileApproved = @user?.get 'jobProfileApproved'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue