mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
1eb2adbc61
4 changed files with 103 additions and 18 deletions
|
@ -27,3 +27,10 @@
|
||||||
margin: 2px 0
|
margin: 2px 0
|
||||||
display: inline-block
|
display: inline-block
|
||||||
text-transform: lowercase
|
text-transform: lowercase
|
||||||
|
|
||||||
|
td:nth-child(3) select
|
||||||
|
min-width: 100px
|
||||||
|
td:nth-child(6) select
|
||||||
|
min-width: 50px
|
||||||
|
td:nth-child(7) select
|
||||||
|
min-width: 100px
|
||||||
|
|
|
@ -27,8 +27,8 @@ block content
|
||||||
th(data-i18n="employers.candidate_years_experience") Yrs Exp
|
th(data-i18n="employers.candidate_years_experience") Yrs Exp
|
||||||
th(data-i18n="employers.candidate_last_updated") Last Updated
|
th(data-i18n="employers.candidate_last_updated") Last Updated
|
||||||
if me.isAdmin()
|
if me.isAdmin()
|
||||||
th ✓?
|
th Us?
|
||||||
th ಥ_ಥ
|
th Them?
|
||||||
|
|
||||||
tbody
|
tbody
|
||||||
for candidate, index in candidates
|
for candidate, index in candidates
|
||||||
|
@ -53,13 +53,13 @@ block content
|
||||||
code= skill
|
code= skill
|
||||||
span
|
span
|
||||||
td= profile.experience
|
td= profile.experience
|
||||||
td= moment(profile.updated).fromNow()
|
td(data-profile-age=(new Date() - new Date(profile.updated)) / 86400 / 1000)= moment(profile.updated).fromNow()
|
||||||
if me.isAdmin()
|
if me.isAdmin()
|
||||||
if candidate.get('jobProfileApproved')
|
if candidate.get('jobProfileApproved')
|
||||||
td ✓
|
td ✓
|
||||||
else
|
else
|
||||||
td ✗
|
td ✗
|
||||||
if profile.active
|
if profile.active
|
||||||
td ᶘ ᵒᴥᵒᶅ
|
td ✓
|
||||||
else
|
else
|
||||||
td ⨂_⨂
|
td ✗
|
|
@ -56,27 +56,105 @@ module.exports = class EmployersView extends View
|
||||||
even: "" # odd row zebra striping
|
even: "" # odd row zebra striping
|
||||||
odd: "" # even row zebra striping
|
odd: "" # even row zebra striping
|
||||||
|
|
||||||
|
|
||||||
|
# e = exact text from cell
|
||||||
|
# n = normalized value returned by the column parser
|
||||||
|
# f = search filter input value
|
||||||
|
# i = column index
|
||||||
|
# $r = ???
|
||||||
|
filterSelectExactMatch = (e, n, f, i, $r) -> e is f
|
||||||
|
|
||||||
# call the tablesorter plugin and apply the uitheme widget
|
# call the tablesorter plugin and apply the uitheme widget
|
||||||
@$el.find(".tablesorter").tablesorter(
|
@$el.find(".tablesorter").tablesorter
|
||||||
theme: "bootstrap"
|
theme: "bootstrap"
|
||||||
widthFixed: true
|
widthFixed: true
|
||||||
headerTemplate: "{content} {icon}"
|
headerTemplate: "{content} {icon}"
|
||||||
|
textSorter:
|
||||||
|
6: (a, b, direction, column, table) ->
|
||||||
|
days = []
|
||||||
|
for s in [a, b]
|
||||||
|
n = parseInt s
|
||||||
|
n = 0 unless _.isNumber n
|
||||||
|
for [duration, factor] in [
|
||||||
|
[/second/i, 1 / (86400 * 1000)]
|
||||||
|
[/minute/i, 1 / 1440]
|
||||||
|
[/hour/i, 1 / 24]
|
||||||
|
[/week/i, 7]
|
||||||
|
[/month/i, 30.42]
|
||||||
|
[/year/i, 365.2425]
|
||||||
|
]
|
||||||
|
if duration.test s
|
||||||
|
n *= factor
|
||||||
|
break
|
||||||
|
if /^in /i.test s
|
||||||
|
n *= -1
|
||||||
|
days.push n
|
||||||
|
days[0] - days[1]
|
||||||
|
sortList: [[6, 0]]
|
||||||
# widget code contained in the jquery.tablesorter.widgets.js file
|
# widget code contained in the jquery.tablesorter.widgets.js file
|
||||||
# use the zebra stripe widget if you plan on hiding any rows (filter widget)
|
# use the zebra stripe widget if you plan on hiding any rows (filter widget)
|
||||||
widgets: [
|
widgets: ["uitheme", "zebra", "filter"]
|
||||||
"uitheme"
|
|
||||||
"zebra"
|
|
||||||
]
|
|
||||||
widgetOptions:
|
widgetOptions:
|
||||||
# using the default zebra striping class name, so it actually isn't included in the theme variable above
|
# using the default zebra striping class name, so it actually isn't included in the theme variable above
|
||||||
# this is ONLY needed for bootstrap theming if you are using the filter widget, because rows are hidden
|
# this is ONLY needed for bootstrap theming if you are using the filter widget, because rows are hidden
|
||||||
zebra: [
|
zebra: ["even", "odd"]
|
||||||
"even"
|
|
||||||
"odd"
|
# extra css class applied to the table row containing the filters & the inputs within that row
|
||||||
]
|
filter_cssFilter: ""
|
||||||
# reset filters button
|
|
||||||
|
# If there are child rows in the table (rows with class name from "cssChildRow" option)
|
||||||
|
# and this option is true and a match is found anywhere in the child row, then it will make that row
|
||||||
|
# visible; default is false
|
||||||
|
filter_childRows: false
|
||||||
|
|
||||||
|
# if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
|
||||||
|
# below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
|
||||||
|
filter_hideFilters: false
|
||||||
|
|
||||||
|
# Set this option to false to make the searches case sensitive
|
||||||
|
filter_ignoreCase: true
|
||||||
|
|
||||||
|
# jQuery selector string of an element used to reset the filters
|
||||||
filter_reset: ".reset"
|
filter_reset: ".reset"
|
||||||
)
|
|
||||||
|
# Use the $.tablesorter.storage utility to save the most recent filters
|
||||||
|
filter_saveFilters: true
|
||||||
|
|
||||||
|
# Delay in milliseconds before the filter widget starts searching; This option prevents searching for
|
||||||
|
# every character while typing and should make searching large tables faster.
|
||||||
|
filter_searchDelay: 150
|
||||||
|
|
||||||
|
# Set this option to true to use the filter to find text from the start of the column
|
||||||
|
# So typing in "a" will find "albert" but not "frank", both have a's; default is false
|
||||||
|
filter_startsWith: false
|
||||||
|
|
||||||
|
filter_functions:
|
||||||
|
2:
|
||||||
|
"Full-time": filterSelectExactMatch
|
||||||
|
"Part-time": filterSelectExactMatch
|
||||||
|
"Contracting": filterSelectExactMatch
|
||||||
|
"Remote": filterSelectExactMatch
|
||||||
|
"Internship": filterSelectExactMatch
|
||||||
|
5:
|
||||||
|
"0-1": (e, n, f, i, $r) -> n <= 1
|
||||||
|
"2-5": (e, n, f, i, $r) -> 2 <= n <= 5
|
||||||
|
"6+": (e, n, f, i, $r) -> 6 <= n
|
||||||
|
6:
|
||||||
|
"Last day": (e, n, f, i, $r) ->
|
||||||
|
days = parseFloat $($r.find('td')[i]).data('profile-age')
|
||||||
|
days <= 1
|
||||||
|
"Last week": (e, n, f, i, $r) ->
|
||||||
|
days = parseFloat $($r.find('td')[i]).data('profile-age')
|
||||||
|
days <= 7
|
||||||
|
"Last 4 weeks": (e, n, f, i, $r) ->
|
||||||
|
days = parseFloat $($r.find('td')[i]).data('profile-age')
|
||||||
|
days <= 28
|
||||||
|
7:
|
||||||
|
"✓": filterSelectExactMatch
|
||||||
|
"✗": filterSelectExactMatch
|
||||||
|
8:
|
||||||
|
"✓": filterSelectExactMatch
|
||||||
|
"✗": filterSelectExactMatch
|
||||||
|
|
||||||
onCandidateClicked: (e) ->
|
onCandidateClicked: (e) ->
|
||||||
id = $(e.target).closest('tr').data('candidate-id')
|
id = $(e.target).closest('tr').data('candidate-id')
|
||||||
|
|
|
@ -332,7 +332,7 @@ module.exports = class Handler
|
||||||
res = tv4.validateMultiple(input, @jsonSchema)
|
res = tv4.validateMultiple(input, @jsonSchema)
|
||||||
res
|
res
|
||||||
|
|
||||||
@isID: (id) -> _.isString(id) and id.length is 24 and id.match(/[a-z0-9]/gi)?.length is 24
|
@isID: (id) -> _.isString(id) and id.length is 24 and id.match(/[a-f0-9]/gi)?.length is 24
|
||||||
|
|
||||||
getDocumentForIdOrSlug: (idOrSlug, done) ->
|
getDocumentForIdOrSlug: (idOrSlug, done) ->
|
||||||
idOrSlug = idOrSlug+''
|
idOrSlug = idOrSlug+''
|
||||||
|
|
Loading…
Reference in a new issue