mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-28 15:03:57 -04:00
Fixed a few misc bugs I noticed with the job profiles.
This commit is contained in:
parent
4f2daf1a1d
commit
81a5b73f93
4 changed files with 7 additions and 6 deletions
app
server/users
|
@ -192,7 +192,7 @@ block content
|
||||||
span= session.levelName
|
span= session.levelName
|
||||||
if session.team
|
if session.team
|
||||||
span.spl - #{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]}
|
span.spl - #{{coffeescript: 'CoffeeScript', python: 'Python', lua: 'Lua', io: 'Io', clojure: 'Clojure'}[session.codeLanguage]}
|
||||||
if !editing && !sessions.length
|
if !editing && !sessions.length
|
||||||
h3(data-i18n="account_profile.player_code") Player Code
|
h3(data-i18n="account_profile.player_code") Player Code
|
||||||
|
|
|
@ -43,17 +43,17 @@ block content
|
||||||
ul.nav.nav-pills
|
ul.nav.nav-pills
|
||||||
li.active
|
li.active
|
||||||
a(href="#featured-candidates", data-toggle="tab")
|
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})
|
| (#{featuredCandidates.length})
|
||||||
if otherCandidates.length
|
if otherCandidates.length
|
||||||
li
|
li
|
||||||
a(href="#other-candidates", data-toggle="tab")
|
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})
|
| (#{otherCandidates.length})
|
||||||
if me.isAdmin() && inactiveCandidates.length
|
if me.isAdmin() && inactiveCandidates.length
|
||||||
li
|
li
|
||||||
a(href="#inactive-candidates", data-toggle="tab")
|
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})
|
| (#{inactiveCandidates.length})
|
||||||
div.tab-content
|
div.tab-content
|
||||||
for area, tabIndex in [{id: "featured-candidates", candidates: featuredCandidates}, {id: "other-candidates", candidates: otherCandidates}, {id: "inactive-candidates", candidates: inactiveCandidates}]
|
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 ✓?
|
th ✓?
|
||||||
tbody
|
tbody
|
||||||
for candidate, index in area.candidates
|
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 authorized = candidate.id; // If we have the id, then we are authorized.
|
||||||
- var profileAge = (new Date() - new Date(profile.updated)) / 86400 / 1000;
|
- var profileAge = (new Date() - new Date(profile.updated)) / 86400 / 1000;
|
||||||
- var expired = profileAge > 2 * 30.4;
|
- var expired = profileAge > 2 * 30.4;
|
||||||
|
|
|
@ -85,6 +85,7 @@ module.exports = class JobProfileView extends UserView
|
||||||
$.post "/db/user/#{me.id}/track/view_candidate"
|
$.post "/db/user/#{me.id}/track/view_candidate"
|
||||||
$.post "/db/user/#{@userID}/track/viewed_by_employer" unless me.isAdmin()
|
$.post "/db/user/#{@userID}/track/viewed_by_employer" unless me.isAdmin()
|
||||||
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(@userID), 'candidate_sessions').model
|
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(@userID), 'candidate_sessions').model
|
||||||
|
@listenToOnce @sessions, 'sync', => @render?()
|
||||||
if me.isAdmin()
|
if me.isAdmin()
|
||||||
# Mimicking how the VictoryModal fetches LevelFeedback
|
# Mimicking how the VictoryModal fetches LevelFeedback
|
||||||
@remark = new UserRemark()
|
@remark = new UserRemark()
|
||||||
|
|
|
@ -225,7 +225,7 @@ UserHandler = class UserHandler extends Handler
|
||||||
|
|
||||||
getLevelSessionsForEmployer: (req, res, userID) ->
|
getLevelSessionsForEmployer: (req, res, userID) ->
|
||||||
return @sendForbiddenError(res) unless req.user._id+'' is userID or req.user.isAdmin() or ('employer' in (req.user.get('permissions') ? []))
|
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'
|
projection = 'levelName levelID team playtime codeLanguage submitted code totalScore teamSpells level'
|
||||||
LevelSession.find(query).select(projection).exec (err, documents) =>
|
LevelSession.find(query).select(projection).exec (err, documents) =>
|
||||||
return @sendDatabaseError(res, err) if err
|
return @sendDatabaseError(res, err) if err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue