35 lines
874 B
JavaScript
35 lines
874 B
JavaScript
/**
|
|
* Common utility functions.
|
|
*/
|
|
(function (context, $) {
|
|
|
|
"use strict";
|
|
|
|
context.JK = context.JK || {};
|
|
var sessionUtils = {};
|
|
var rest = new context.JK.Rest();
|
|
context.JK.SessionUtils = sessionUtils;
|
|
var logger = context.JK.logger;
|
|
|
|
sessionUtils.createOpenSlot = function($openSlotsTemplate, slot) {
|
|
var inst = context.JK.getInstrumentIcon24(slot.instrument_id);
|
|
|
|
var proficiency_desc = slot.proficiency_desc;
|
|
if(!proficiency_desc) {
|
|
// this is to allow unstructured RSVPs to not specify proficiency_desc
|
|
proficiency_desc = "Any Skill Level";
|
|
}
|
|
|
|
if(!slot.proficiency_desc) {
|
|
proficiency_desc
|
|
}
|
|
var slot = {
|
|
instrument_url: inst,
|
|
instrument: slot.description,
|
|
proficiency: proficiency_desc
|
|
};
|
|
|
|
return context.JK.fillTemplate($openSlotsTemplate.html(), slot);
|
|
}
|
|
|
|
})(window, jQuery); |