<commit_before>//-
	-----------------------------------------------------------------------------
	Copyright (c) 2014-2015 <NAME>

	This software is provided 'as-is', without any express or implied warranty. 
	In no event will the authors be held liable for any damages arising from the 
	use of this software.

	Permission is granted to anyone to use this software for any purpose, 
	including commercial applications, and to alter it and redistribute it 
	freely, subject to the following restrictions:

	1. The origin of this software must not be misrepresented; you must not 
	claim that you wrote the original software. If you use this software in a 
	product, an acknowledgment in the product documentation would be appreciated 
	but is not required.

	2. Altered source versions must be plainly marked as such, and must not be 
	misrepresented as being the original software.

	3. This notice may not be removed or altered from any source distribution.
	-----------------------------------------------------------------------------

extends layout.jade

block content
	h1 LAN Editor
	hr
	form.validated-form#lan-editor-form(role = "form")
		if !lan
			.row
				.form-group.col-xs-4
					label Begin Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "beginDate")
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-4
					label End Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "endDate")
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-2
					label Active
					.btn-group(data-toggle = "buttons")
						label(class = "btn btn-default")
							input(type = "radio", name = "active-yes")
							| Yes
						label(class = "btn btn-default active")
							input(type = "radio", name = "active-no")
							| No
				.form-group.col-xs-2
					label RSVPs
					.btn-group(data-toggle = "buttons")
						label(class = "btn btn-default")
							input(type = "radio", name = "acceptingRsvps-yes")
							| Yes
						label(class = "btn btn-default active")
							input(type = "radio", name = "acceptingRsvps-no")
							| No
			.row
				fieldset.col-xs-12
					legend Games
					.row.gameList
						.well.col-xs-12
							each game in games
								.row
									.col-xs-4
										.form-group.checkbox
											label
												input(type = "checkbox", name = "game-selector")
												| #{game.name}
									.col-xs-4
										.form-group.checkbox
											label
												input(type = "checkbox", name = "tournament-selector")
												| Tournament
									.col-xs-4
										.form-group
											label Tournament Name
											input(type = "text", name = "tournament-name")
			.row
				fieldset.col-xs-7
					legend Food List
					.row.foodList
						.form-group.col-xs-9
							label Name
							input.form-control(type = "text", name = "foodName")
						.form-group.col-xs-2
							label Amount
							input.form-control(type = "text", name = "foodAmount")
					a.addItem(class = "btn btn-default glyphicon glyphicon-plus", data-toggle = "tooltip", data-placement = "right", data-insertion = "<div class='row foodList' style='margin-top:.5em;'><div class='col-xs-9'><input type='text' name='foodName' class='form-control'></div><div class='col-xs-2'><input type='text' name='foodAmount' class='form-control'></div><a data-toggle='tooltip' data-placement='right' title='Remove this item' class='removeItem col-xs-1 btn btn-default glyphicon glyphicon-minus' style='margin-top:-1px;' /></div>", title = "Add another item")
			hr
			a.submitButton(class = "btn btn-default", onclick = "addLAN();", disabled = "disabled") Submit
			a(class = "btn btn-link" href = "/admin/lan") Cancel
		else
			.row
				.form-group.col-xs-4
					label Begin Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "beginDate", value = getFormattedTime(lan.beginDate, true, true))
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-4
					label End Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "endDate", value = getFormattedTime(lan.endDate, true, true))
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-2
					label Active
					.btn-group(data-toggle = "buttons")
						if lan.active
							label(class = "btn btn-default active")
								input(type = "radio", name = "active-yes")
								| Yes
							label(class = "btn btn-default")
								input(type = "radio", name = "active-no")
								| No
						else
							label(class = "btn btn-default")
								input(type = "radio", name = "active-yes")
								| Yes
							label(class = "btn btn-default active")
								input(type = "radio", name = "active-no")
								| No
				.form-group.col-xs-2
					label RSVPs
					.btn-group(data-toggle = "buttons")
						if lan.acceptingRsvps
							label(class = "btn btn-default active")
								input(type = "radio", name = "acceptingRsvps-yes")
								| Yes
							label(class = "btn btn-default")
								input(type = "radio", name = "acceptingRsvps-no")
								| No
						else
							label(class = "btn btn-default")
								input(type = "radio", name = "acceptingRsvps-yes")
								| Yes
							label(class = "btn btn-default active")
								input(type = "radio", name = "acceptingRsvps-no")
								| No
			.row
				fieldset.col-xs-12
					legend Games
					.row.gameList
						.well.col-xs-12
							each game in games
								.game(name = game._id)
									.col-xs-4
										.form-group.checkbox
											if lan.hasGame(game._id)
												input(type = "checkbox", name = "game-selector", checked = "checked")
											else
												input(type = "checkbox", name = "game-selector")
											| #{game.name}
									.col-xs-4
										.form-group.checkbox
											if lan.game(game._id).tournament
												input(type = "checkbox", name = "tournament-selector", checked = "checked")
											else
												input(type = "checkbox", name = "tournament-selector")
											| Tournament
									.col-xs-4
										.form-group
											label Tournament Name
											input(type = "text", name = "tournament-name", value = lan.game(game._id).tournamentName)
			.row
				fieldset.col-xs-7
					legend Food List
					if lan.foodRequired.length > 0
						.row.foodList
							.form-group.col-xs-9
								label Name
								input.form-control(type = "text", name = "foodName", value = lan.foodRequired[0].name)
							.form-group.col-xs-2<commit_msg>Fixed new LAN creation not saving games, fixed potential nullrefs in LAN editor<commit_after>//-
	-----------------------------------------------------------------------------
	Copyright (c) 2014-2015 Seth Anderson

	This software is provided 'as-is', without any express or implied warranty. 
	In no event will the authors be held liable for any damages arising from the 
	use of this software.

	Permission is granted to anyone to use this software for any purpose, 
	including commercial applications, and to alter it and redistribute it 
	freely, subject to the following restrictions:

	1. The origin of this software must not be misrepresented; you must not 
	claim that you wrote the original software. If you use this software in a 
	product, an acknowledgment in the product documentation would be appreciated 
	but is not required.

	2. Altered source versions must be plainly marked as such, and must not be 
	misrepresented as being the original software.

	3. This notice may not be removed or altered from any source distribution.
	-----------------------------------------------------------------------------

extends layout.jade

block content
	h1 LAN Editor
	hr
	form.validated-form#lan-editor-form(role = "form")
		if !lan
			.row
				.form-group.col-xs-4
					label Begin Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "beginDate")
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-4
					label End Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "endDate")
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-2
					label Active
					.btn-group(data-toggle = "buttons")
						label(class = "btn btn-default")
							input(type = "radio", name = "active-yes")
							| Yes
						label(class = "btn btn-default active")
							input(type = "radio", name = "active-no")
							| No
				.form-group.col-xs-2
					label RSVPs
					.btn-group(data-toggle = "buttons")
						label(class = "btn btn-default")
							input(type = "radio", name = "acceptingRsvps-yes")
							| Yes
						label(class = "btn btn-default active")
							input(type = "radio", name = "acceptingRsvps-no")
							| No
			.row
				fieldset.col-xs-12
					legend Games
					.row.gameList
						.well.col-xs-12
							each game in games
								.game(name = game._id)
									.col-xs-4
										.form-group.checkbox
											label
												input(type = "checkbox", name = "game-selector")
												| #{game.name}
									.col-xs-4
										.form-group.checkbox
											label
												input(type = "checkbox", name = "tournament-selector")
												| Tournament
									.col-xs-4
										.form-group
											label Tournament Name
											input(type = "text", name = "tournament-name")
			.row
				fieldset.col-xs-7
					legend Food List
					.row.foodList
						.form-group.col-xs-9
							label Name
							input.form-control(type = "text", name = "foodName")
						.form-group.col-xs-2
							label Amount
							input.form-control(type = "text", name = "foodAmount")
					a.addItem(class = "btn btn-default glyphicon glyphicon-plus", data-toggle = "tooltip", data-placement = "right", data-insertion = "<div class='row foodList' style='margin-top:.5em;'><div class='col-xs-9'><input type='text' name='foodName' class='form-control'></div><div class='col-xs-2'><input type='text' name='foodAmount' class='form-control'></div><a data-toggle='tooltip' data-placement='right' title='Remove this item' class='removeItem col-xs-1 btn btn-default glyphicon glyphicon-minus' style='margin-top:-1px;' /></div>", title = "Add another item")
			hr
			a.submitButton(class = "btn btn-default", onclick = "addLAN();", disabled = "disabled") Submit
			a(class = "btn btn-link" href = "/admin/lan") Cancel
		else
			.row
				.form-group.col-xs-4
					label Begin Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "beginDate", value = getFormattedTime(lan.beginDate, true, true))
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-4
					label End Date 
						span.text-danger (Required)
					.input-group.datefield
						input.form-control(type = "text", name = "endDate", value = getFormattedTime(lan.endDate, true, true))
						span.input-group-btn
							span.btn.btn-default(class = "glyphicon glyphicon-calendar")
				.form-group.col-xs-2
					label Active
					.btn-group(data-toggle = "buttons")
						if lan.active
							label(class = "btn btn-default active")
								input(type = "radio", name = "active-yes")
								| Yes
							label(class = "btn btn-default")
								input(type = "radio", name = "active-no")
								| No
						else
							label(class = "btn btn-default")
								input(type = "radio", name = "active-yes")
								| Yes
							label(class = "btn btn-default active")
								input(type = "radio", name = "active-no")
								| No
				.form-group.col-xs-2
					label RSVPs
					.btn-group(data-toggle = "buttons")
						if lan.acceptingRsvps
							label(class = "btn btn-default active")
								input(type = "radio", name = "acceptingRsvps-yes")
								| Yes
							label(class = "btn btn-default")
								input(type = "radio", name = "acceptingRsvps-no")
								| No
						else
							label(class = "btn btn-default")
								input(type = "radio", name = "acceptingRsvps-yes")
								| Yes
							label(class = "btn btn-default active")
								input(type = "radio", name = "acceptingRsvps-no")
								| No
			.row
				fieldset.col-xs-12
					legend Games
					.row.gameList
						.well.col-xs-12
							each game in games
								.game(name = game._id)
									.col-xs-4
										.form-group.checkbox
											if lan.hasGame(game._id)
												input(type = "checkbox", name = "game-selector", checked = "checked")
											else
												input(type = "checkbox", name = "game-selector")
											| #{game.name}
									.col-xs-4
										.form-group.checkbox
											if lan.hasGame(game._id) && lan.game(game._id).tournament
												input(type = "checkbox", name = "tournament-selector", checked = "checked")
											else
												input(type = "checkbox", name = "tournament-selector")
											| Tournament
									.col-xs-4
										.form-group
											label Tournament Name
											input(type = "text", name = "tournament-name", value = lan.hasGame(game._id) ? lan.game(game._id).tournamentName : "")
			.row
				fieldset.col-xs-7
					legend Food List
					if lan.foodRequired.length > 0
						.row.foodList
							.form-group.col-xs-9
								label Name
								input.form-control(type = "text", name = "foodName", value = lan.foodRequired[0].name)
							.form-group.col-xs-2
{'fraction_non_alphanumeric': 0.14689880304678998, 'fraction_numerical': 0.006819006166122597, 'mean_word_length': 2.126786119301429, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, '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': '2318188', 'n_tokens_mistral': 6055, 'n_tokens_neox': 4153, 'n_words': 1079}