Fixed a few misc bugs I noticed with the job profiles.

This commit is contained in:
Nick Winter 2014-09-19 11:18:33 -07:00
parent 4f2daf1a1d
commit 81a5b73f93
4 changed files with 7 additions and 6 deletions
app
server/users

View file

@ -192,7 +192,7 @@ block content
span= session.levelName
if session.team
span.spl - #{session.team}
if session.codeLanguage != 'javascript'
if session.codeLanguage && session.codeLanguage != 'javascript'
span.spl - #{{coffeescript: 'CoffeeScript', python: 'Python', lua: 'Lua', io: 'Io', clojure: 'Clojure'}[session.codeLanguage]}
if !editing && !sessions.length
h3(data-i18n="account_profile.player_code") Player Code

View file

@ -43,17 +43,17 @@ block content
ul.nav.nav-pills
li.active
a(href="#featured-candidates", data-toggle="tab")
span(data-i18n="employers.featured_developers") Featured Developers
span.spr(data-i18n="employers.featured_developers") Featured Developers
| (#{featuredCandidates.length})
if otherCandidates.length
li
a(href="#other-candidates", data-toggle="tab")
span(data-i18n="employers.other_developers") Other Developers
span.spr(data-i18n="employers.other_developers") Other Developers
| (#{otherCandidates.length})
if me.isAdmin() && inactiveCandidates.length
li
a(href="#inactive-candidates", data-toggle="tab")
span(data-i18n="employers.inactive_developers") Inactive Developers
span.spr(data-i18n="employers.inactive_developers") Inactive Developers
| (#{inactiveCandidates.length})
div.tab-content
for area, tabIndex in [{id: "featured-candidates", candidates: featuredCandidates}, {id: "other-candidates", candidates: otherCandidates}, {id: "inactive-candidates", candidates: inactiveCandidates}]
@ -74,7 +74,7 @@ block content
th ✓?
tbody
for candidate, index in area.candidates
- var profile = candidate.get('jobProfile');
- var profile = candidate.get('jobProfile', true);
- var authorized = candidate.id; // If we have the id, then we are authorized.
- var profileAge = (new Date() - new Date(profile.updated)) / 86400 / 1000;
- var expired = profileAge > 2 * 30.4;

View file

@ -85,6 +85,7 @@ module.exports = class JobProfileView extends UserView
$.post "/db/user/#{me.id}/track/view_candidate"
$.post "/db/user/#{@userID}/track/viewed_by_employer" unless me.isAdmin()
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(@userID), 'candidate_sessions').model
@listenToOnce @sessions, 'sync', => @render?()
if me.isAdmin()
# Mimicking how the VictoryModal fetches LevelFeedback
@remark = new UserRemark()

View file

@ -225,7 +225,7 @@ UserHandler = class UserHandler extends Handler
getLevelSessionsForEmployer: (req, res, userID) ->
return @sendForbiddenError(res) unless req.user._id+'' is userID or req.user.isAdmin() or ('employer' in (req.user.get('permissions') ? []))
query = creator: userID, levelID: {$in: ['gridmancer', 'greed', 'dungeon-arena', 'brawlwood', 'gold-rush']}
query = creator: userID, levelID: {$in: ['criss-cross', 'gridmancer', 'greed', 'dungeon-arena', 'brawlwood', 'gold-rush']}
projection = 'levelName levelID team playtime codeLanguage submitted code totalScore teamSpells level'
LevelSession.find(query).select(projection).exec (err, documents) =>
return @sendDatabaseError(res, err) if err