(function () {
    // Create object that have the context information about the field that we want to change it's output render 
    var sessionStatus = {};

    sessionStatus.Templates = {};
    sessionStatus.Templates.Fields = {
        "Session_x0020_Review_x0020_Statu": { "View": sessionOverride }
    };

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(sessionStatus);

})();

function sessionOverride(ctx) {

    var reviewStatus = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
    // Return html element with appropriate color based on review status
    switch (reviewStatus) {
        case "Accepted":
            return "<span style='color :green'>" + reviewStatus + "</span>";
            break;
        case "Pending Review":
            return "<span style='color :blue'>" + reviewStatus + "</span>";
            break;
        case "Rejected":
            return "<span style='color :red'>" + reviewStatus + "</span>";
    }
}
