<commit_before>Template['recipePicker'].helpers({
	recipes: function(){
		return Recipes.find();
    },
    request_user_skills: function (user_id) {
        return Meteor.users.findOne({_id: user_id}).profile.skills;
    },
    selected_recipe: function() {
    	return Session.get('selected_recipe');
    },
    recipe_milestones: function() {
    	return Session.get('selected_recipe');
    },
    get_milestone: function (id) {
		return Milestones.findOne({_id: id});
	},
	get_subtasks: function (id) {
		return Subtasks.findOne({_id: id});
	},
    plus_one: function(num) {
    	return num+1;
    }
});

Template['recipePicker'].events({
	'click .select-recipe': function(e){
		Session.set('selected_recipe', this);
		$('#recipe-preview').show();
		$('#recipe-list').hide();
    },
    'click #confirm-recipe': function(e){
    	var recipe = Session.get('selected_recipe');
        var ap = Session.get('current_ap');
        if (ap.milestone_ids.length > 0)
            confirm("This will delete your progress and replace it with this recipe. Are you sure that you want to continue?")
        Meteor.call('action_plan_recipe', ap._id, recipe.milestone_ids);
    },
    'click #cancel-recipe': function(e){
		$('#recipe-preview').hide();
		$('#recipe-list').show();<commit_msg>Change view to milestone picker after selecting recipe<commit_after>Template['recipePicker'].helpers({
	recipes: function(){
		return Recipes.find();
    },
    request_user_skills: function (user_id) {
        return Meteor.users.findOne({_id: user_id}).profile.skills;
    },
    selected_recipe: function() {
    	return Session.get('selected_recipe');
    },
    recipe_milestones: function() {
    	return Session.get('selected_recipe');
    },
    get_milestone: function (id) {
		return Milestones.findOne({_id: id});
	},
	get_subtasks: function (id) {
		return Subtasks.findOne({_id: id});
	},
    plus_one: function(num) {
    	return num+1;
    }
});

Template['recipePicker'].events({
	'click .select-recipe': function(e){
		Session.set('selected_recipe', this);
		$('#recipe-preview').show();
		$('#recipe-list').hide();
    },
    'click #confirm-recipe': function(e){
    	var recipe = Session.get('selected_recipe');
        var ap = Session.get('current_ap');
        if (ap.milestone_ids.length > 0)
            confirm("This will delete your progress and replace it with this recipe. Are you sure that you want to continue?")
        Meteor.call('action_plan_recipe', ap._id, recipe.milestone_ids);
        Session.set('mode', 'msp');
    },
    'click #cancel-recipe': function(e){
		$('#recipe-preview').hide();
		$('#recipe-list').show();
{'fraction_non_alphanumeric': 0.16773949261643317, 'fraction_numerical': 0.0015145778114350624, 'mean_word_length': 3.6596119929453264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4321968', 'n_tokens_mistral': 878, 'n_tokens_neox': 862, 'n_words': 172}