mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-29 10:35:51 -05:00
Merge pull request #1272 from codecombat/master
Various employer page changes
This commit is contained in:
commit
b449ca5224
8 changed files with 51 additions and 5 deletions
|
@ -1,7 +1,12 @@
|
|||
CocoModel = require 'models/CocoModel'
|
||||
|
||||
module.exports = class CocoCollection extends Backbone.Collection
|
||||
loaded: false
|
||||
model: null
|
||||
|
||||
initialize: ->
|
||||
if not @model
|
||||
console.error @constructor.name, 'does not have a model defined. This will not do!'
|
||||
super()
|
||||
@once 'sync', =>
|
||||
@loaded = true
|
||||
|
|
|
@ -21,14 +21,14 @@ module.exports = class User extends CocoModel
|
|||
lang: ->
|
||||
@get('preferredLanguage') or 'en-US'
|
||||
|
||||
getPhotoURL: (size=80, useJobProfilePhoto=false) ->
|
||||
getPhotoURL: (size=80, useJobProfilePhoto=false, useEmployerPageAvatar=false) ->
|
||||
photoURL = if useJobProfilePhoto then @get('jobProfile')?.photoURL else null
|
||||
photoURL ||= @get('photoURL')
|
||||
if photoURL
|
||||
prefix = if photoURL.search(/\?/) is -1 then '?' else '&'
|
||||
return "#{photoURL}#{prefix}s=#{size}" if photoURL.search('http') isnt -1 # legacy
|
||||
return "/file/#{photoURL}#{prefix}s=#{size}"
|
||||
return "/db/user/#{@id}/avatar?s=#{size}"
|
||||
return "/db/user/#{@id}/avatar?s=#{size}&employerPageAvatar=#{useEmployerPageAvatar}"
|
||||
|
||||
@getByID = (id, properties, force) ->
|
||||
{me} = require 'lib/auth'
|
||||
|
|
|
@ -147,6 +147,10 @@ UserSchema = c.object {},
|
|||
title: 'Seniority'
|
||||
type: 'string'
|
||||
enum: ['College Student', 'Recent Grad', 'Junior', 'Senior', 'Management']
|
||||
featured:
|
||||
title: 'Featured'
|
||||
type: 'boolean'
|
||||
description: 'Should this candidate be prominently featured on the site?'
|
||||
jobProfileApproved: {title: 'Job Profile Approved', type: 'boolean', description: 'Whether your profile has been approved by CodeCombat.'}
|
||||
jobProfileNotes: {type: 'string', maxLength: 1000, title: 'Our Notes', description: 'CodeCombat\'s notes on the candidate.', format: 'markdown', default: ''}
|
||||
employerAt: c.shortString {description: 'If given employer permissions to view job candidates, for which employer?'}
|
||||
|
|
2
app/styles/docs/components.sass
Normal file
2
app/styles/docs/components.sass
Normal file
|
@ -0,0 +1,2 @@
|
|||
#docs-components-view
|
||||
color: saddlebrown
|
6
app/templates/docs/components.jade
Normal file
6
app/templates/docs/components.jade
Normal file
|
@ -0,0 +1,6 @@
|
|||
extends /templates/base
|
||||
|
||||
block content
|
||||
ul
|
||||
for component in components
|
||||
li= component.get('name')
|
|
@ -112,7 +112,7 @@ block content
|
|||
tr.candidate-row(data-candidate-id=candidate.id, id=candidate.id, class=expired ? "expired" : "")
|
||||
td(rowspan=2)
|
||||
.candidate-picture
|
||||
img(src=candidate.getPhotoURL(50), alt=profile.name, title=profile.name, width=50)
|
||||
img(src=candidate.getPhotoURL(50,false,true), alt=profile.name, title=profile.name, width=50)
|
||||
if curated && curated.shortDescription
|
||||
td.candidate-description #{curated.shortDescription}
|
||||
else
|
||||
|
@ -130,8 +130,9 @@ block content
|
|||
img(src="/images/pages/employer/education.png")
|
||||
| #{curated.education}
|
||||
td.work_column
|
||||
img(src="/images/pages/employer/briefcase.png")
|
||||
| #{workHistory}
|
||||
if workHistory
|
||||
img(src="/images/pages/employer/briefcase.png")
|
||||
| #{workHistory}
|
||||
else
|
||||
td Hi
|
||||
|
||||
|
|
26
app/views/docs/components_view.coffee
Normal file
26
app/views/docs/components_view.coffee
Normal file
|
@ -0,0 +1,26 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
template = require 'templates/docs/components'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
|
||||
class ComponentDocsCollection extends CocoCollection
|
||||
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation'
|
||||
model: LevelComponent
|
||||
|
||||
module.exports = class UnnamedView extends RootView
|
||||
id: 'docs-components-view'
|
||||
template: template
|
||||
|
||||
constructor: (options) ->
|
||||
super(options)
|
||||
@componentDocs = new ComponentDocsCollection()
|
||||
@supermodel.loadCollection @componentDocs, 'components'
|
||||
|
||||
onLoaded: ->
|
||||
console.log 'we have the components...', (c.get('name') for c in @componentDocs.models)
|
||||
super()
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.components = @componentDocs.models
|
||||
c
|
|
@ -221,6 +221,8 @@ UserHandler = class UserHandler extends Handler
|
|||
photoURL = document?.get('photoURL')
|
||||
if photoURL
|
||||
photoURL = "/file/#{photoURL}"
|
||||
else if req.query.employerPageAvatar is "true"
|
||||
photoURL = @buildGravatarURL document, req.query.s, "/images/pages/employer/anon_user.png"
|
||||
else
|
||||
photoURL = @buildGravatarURL document, req.query.s, req.query.fallback
|
||||
res.redirect photoURL
|
||||
|
|
Loading…
Reference in a new issue