<commit_before><template name="eventEdit">
	<form>
	<div class="edit-page">
		{{#if _id}}
			<h2>{{mf 'course.event.edit.edit' 'Edit event'}}</h2>
		{{else}}
			<h2>{{mf 'course.event.edit.add' 'Add event'}}</h2>
			{{#unless hasParentCourse}}
				{{mf 'course.createEventInfo' 'Use this form if you want to publish a singular, one-off, allready organised event. Otherwise create or propose a course here:'}}
				<a href="/courses/propose">{{mf 'menue.ProposeCourse'}}</a>
			{{/unless}}
		{{/if}}

		<div class="edit-page-header event-edit-header">
			{{#unless showRegionSelection}}
				{{> regionTag}}
			{{/unless}}
			<div class="form-group">
				<label>{{mf 'course.event.edit.title' 'Event title'}}</label>
				<input type="text" class="form-control input-lg" id="eventEditTitle"
					name="_"
					placeholder="{{mf 'event.title.placeholder' 'Put a catchy title here'}}"
					size="30"
					value="{{this.title}}"/>
			</div>
			<div class="form-group">
				<div class="form-group-element">
					<label>{{mf 'course.event.edit.date_start' 'Date'}}</label>
					<div class="input-group">
						<span class="input-group-addon">
							<span class="fa fa-calendar fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text" class="form-control js-event-start-date"
							value="{{localDate start}}"
							{{disableForPast}}/>
					</div>
				</div>
				<div class="form-group-element">
					<label>{{mf 'course.event.edit.time_start' 'Time start'}}</label>
					<div class="input-group">
						<span class="input-group-addon">
							<span class="fa fa-hourglass-start fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text" class="form-control" id="editEventStartTime"
							size="5"
							value="{{timeformat start}}"
							{{disableForPast}}/>
					</div>
				</div>
				<div class="form-group-element time-end">
					<label style="display:none">
						{{mf 'course.event.edit.duration' 'Duration (in minutes)'}}
						<button type="button" class="js-toggle-duration btn-icon"
							data-tooltip="{{mf 'course.event.edit.switch_time_end' 'Switch to end time'}}">
							<span class="fa fa-exchange"></span>
						</button>
					</label>
					<div class="input-group" style="display:none">
						<span class="input-group-addon">
							<span class="fa fa-hourglass-end fa-fw" aria-hidden="true"></span>
						</span>
						<input type="number" class="form-control" id="editEventDuration"
							value="{{timeformat Duration}}"
							size="5"/>
					</div>
					<label>
						{{mf 'course.event.edit.time_end' 'Time end'}}
						<button type="button" class="js-toggle-duration btn-icon"
							data-tooltip="{{mf 'course.event.edit.swich_duration' 'Switch to duration'}}">
							<span class="fa fa-exchange"></span>
						</button>
					</label>
					<div class="input-group">
						<span class="input-group-addon">
							<span class="fa fa-hourglass-end fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text" class="form-control"	id="editEventEndTime"
							size="5"
							value="{{timeformat end}}"/>
					</div>
				</div>
			</div>
		</div>
		<div class="edit-page-body event-edit-body">
			<div class="form-group">
				<label>{{mf 'course.event.edit.desc' 'Description'}}</label>
				<div class="input-group">
					<span class="input-group-addon">
						<span class="fa fa-info fa-fw" aria-hidden="true"></span>
					</span>
					{{> eventDescriptionEdit description}}
				</div>
			</div>

			<div class="form-group event-edit-files">
				<label>
					{{mf 'course.event.edit.files' 'Files'}}
					<small> {{mf '_inputField.optional'}}</small>
				</label>
				<input type="file" class="js-event-add-file" value=""/>
				<table class="table table-hover file-list">
					<tbody>
						{{#each files}}
							{{> eventAttachmentsEdit}}
						{{/each}}
						{{#each uploaded}}
							{{> eventAttachmentsEdit}}
						{{/each}}
					</tbody>
				</table>
			</div>

			{{#if showRegionSelection}}
				<div class="form-group">
					<label>{{mf 'course.edit.region' 'Region'}}</label>
					<div class="input-group">
						<div class="input-group-addon">
							<span class="fa fa-dot-circle-o fa-fw" aria-hidden="true"></span>
						</div>
						<select class="region_select js-select-region form-control"
							name='region'>
							<option value='' disabled selected class="select_placeholder">
								{{mf '_selection.pleaseSelect'}}
							</option>
							{{#each regions}}
								<option value='{{_id}}' selected="{{#if currentRegion this}}selected{{/if}}">
									{{name}}
								</option>
							{{/each}}
						</select>
					</div>
				</div>
			{{/if}}

			{{#if showLocationSelection}}
				{{>eventEditLocation}}
				<div class="form-group">
					<label>
						{{mf 'course.event.edit.room' 'Room'}}
						<small> {{mf '_inputField.optional'}}</small>
					</label>
					<div class="input-group" id="editform_room" name="editform_room">
						<span class="input-group-addon">
							<span class="fa fa-map-signs fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text" class="form-control"	id="eventEditRoom"
						size="40"
						value="{{room}}"/>
					</div>
				</div>
			{{/if}}


			<div class="form-group">
				<div class="form-group-element">
					<div class="checkbox">
						<label>
							<input type="checkbox" class="js-check-event-internal" {{isInternal}}/>
							{{mf 'event.edit.internal' 'Internal'}}
							<span class="help-block">
								{{mf 'event.edit.internal.description' 'Internal events are only shown in group and location-details'}}
							</span>
						</label>
					</div>
				</div>
				{{#if affectedReplicaCount}}
					<div class="form-group-element">
						<div class="checkbox">
							<label>
								<input type="checkbox" name="updateReplicas">
								{{mf 'event.edit.updateReplicas'
									"Update {COUNT, plural, one {later copy} other {# later copies as well}}"
									COUNT=affectedReplicaCount
								}}
								<span class="help-block">
									<i class="fa fa-warning fa-fw" aria-hidden="true"></i>
										{{mf 'event.edit.updateReplicas.times'
										"Time-changes will not be updated in {COUNT, plural, one {copy} other {copies}}."
										COUNT=affectedReplicaCount
									}}
								</span>
							</label>
						</div>
					</div>
				{{/if}}
			</div>

			<div class="form-actions">
				{{> buttonCancel event="js-event-edit-cancel"}}
				{{> buttonSave}}
			</div>
		</div>
	</div>
	</form>
</template>

<template name="eventDescriptionEdit">
	<div class="form-control editable-textarea"
		id="eventEditDescription"
		data-placeholder="{{mf 'event.description.placeholder' 'Describe your event as accurately as possible. This helps people to know how to prepare and what to expect from this meeting (eg. level, prerequisites, activities, teaching methods, what to bring, et cetera)'}}">
		{{{this}}}
	</div>
</template>

<template name="eventAttachmentsEdit">
	<tr id="row-{{_id}}">
		<td><commit_msg>code formatting<commit_after><template name="eventEdit">
	<form>
	<div class="edit-page">
		{{#if _id}}
			<h2>{{mf 'course.event.edit.edit' 'Edit event'}}</h2>
		{{else}}
			<h2>{{mf 'course.event.edit.add' 'Add event'}}</h2>
			{{#unless hasParentCourse}}
				{{#mf KEY='course.createEventInfo'}}
					Use this form if you want to publish a singular, one-off, allready organised event.
					Otherwise create or propose a course here:
				{{/mf}}
				<a href="/courses/propose">{{mf 'menue.ProposeCourse'}}</a>
			{{/unless}}
		{{/if}}

		<div class="edit-page-header event-edit-header">
			{{#unless showRegionSelection}}
				{{> regionTag}}
			{{/unless}}
			<div class="form-group">
				<label>{{mf 'course.event.edit.title' 'Event title'}}</label>
				<input type="text"
				       class="form-control input-lg"
				       id="eventEditTitle"
				       name="_"
				       placeholder="{{mf 'event.title.placeholder' 'Put a catchy title here'}}"
				       size="30"
				       value="{{this.title}}">
			</div>
			<div class="form-group">
				<div class="form-group-element">
					<label>{{mf 'course.event.edit.date_start' 'Date'}}</label>
					<div class="input-group">
						<span class="input-group-addon">
							<span class="fa fa-calendar fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text"
						       class="form-control js-event-start-date"
						       value="{{localDate start}}"
						       {{disableForPast}}>
					</div>
				</div>
				<div class="form-group-element">
					<label>{{mf 'course.event.edit.time_start' 'Time start'}}</label>
					<div class="input-group">
						<span class="input-group-addon">
							<span class="fa fa-hourglass-start fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text"
						       class="form-control"
						       id="editEventStartTime"
						       size="5"
						       value="{{timeformat start}}"
						       {{disableForPast}}>
					</div>
				</div>
				<div class="form-group-element time-end">
					<label style="display:none">
						{{mf 'course.event.edit.duration' 'Duration (in minutes)'}}
						<button type="button"
						        class="js-toggle-duration btn-icon"
						        data-tooltip="{{mf 'course.event.edit.switch_time_end' 'Switch to end time'}}">
							<span class="fa fa-exchange"></span>
						</button>
					</label>
					<div class="input-group" style="display:none">
						<span class="input-group-addon">
							<span class="fa fa-hourglass-end fa-fw" aria-hidden="true"></span>
						</span>
						<input type="number"
						       class="form-control"
						       id="editEventDuration"
						       value="{{timeformat Duration}}"
						       size="5">
					</div>
					<label>
						{{mf 'course.event.edit.time_end' 'Time end'}}
						<button type="button"
						        class="js-toggle-duration btn-icon"
						        data-tooltip="{{mf 'course.event.edit.swich_duration' 'Switch to duration'}}">
							<span class="fa fa-exchange"></span>
						</button>
					</label>
					<div class="input-group">
						<span class="input-group-addon">
							<span class="fa fa-hourglass-end fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text"
						       class="form-control"
						       id="editEventEndTime"
						       size="5"
						       value="{{timeformat end}}">
					</div>
				</div>
			</div>
		</div>
		<div class="edit-page-body event-edit-body">
			<div class="form-group">
				<label>{{mf 'course.event.edit.desc' 'Description'}}</label>
				<div class="input-group">
					<span class="input-group-addon">
						<span class="fa fa-info fa-fw" aria-hidden="true"></span>
					</span>
					{{> eventDescriptionEdit description}}
				</div>
			</div>

			<div class="form-group event-edit-files">
				<label>
					{{mf 'course.event.edit.files' 'Files'}}
					<small> {{mf '_inputField.optional'}}</small>
				</label>
				<input type="file" class="js-event-add-file" value=""/>
				<table class="table table-hover file-list">
					<tbody>
						{{#each files}}
							{{> eventAttachmentsEdit}}
						{{/each}}
						{{#each uploaded}}
							{{> eventAttachmentsEdit}}
						{{/each}}
					</tbody>
				</table>
			</div>

			{{#if showRegionSelection}}
				<div class="form-group">
					<label>{{mf 'course.edit.region' 'Region'}}</label>
					<div class="input-group">
						<div class="input-group-addon">
							<span class="fa fa-dot-circle-o fa-fw" aria-hidden="true"></span>
						</div>
						<select class="region_select js-select-region form-control"
							name='region'>
							<option value='' disabled selected class="select_placeholder">
								{{mf '_selection.pleaseSelect'}}
							</option>
							{{#each regions}}
								<option value='{{_id}}' selected="{{#if currentRegion this}}selected{{/if}}">
									{{name}}
								</option>
							{{/each}}
						</select>
					</div>
				</div>
			{{/if}}

			{{#if showLocationSelection}}
				{{>eventEditLocation}}
				<div class="form-group">
					<label>
						{{mf 'course.event.edit.room' 'Room'}}
						<small> {{mf '_inputField.optional'}}</small>
					</label>
					<div class="input-group" id="editform_room" name="editform_room">
						<span class="input-group-addon">
							<span class="fa fa-map-signs fa-fw" aria-hidden="true"></span>
						</span>
						<input type="text"
						       class="form-control"
						       id="eventEditRoom"
						       size="40"
						       value="{{room}}">
					</div>
				</div>
			{{/if}}


			<div class="form-group">
				<div class="form-group-element">
					<div class="checkbox">
						<label>
							<input type="checkbox" class="js-check-event-internal" {{isInternal}}/>
							{{mf 'event.edit.internal' 'Internal'}}
							<span class="help-block">
								{{mf 'event.edit.internal.description' 'Internal events are only shown in group and location-details'}}
							</span>
						</label>
					</div>
				</div>
				{{#if affectedReplicaCount}}
					<div class="form-group-element">
						<div class="checkbox">
							<label>
								<input type="checkbox" name="updateReplicas">
								{{#mf KEY='event.edit.updateReplicas' COUNT=affectedReplicaCount}}
									Update {COUNT, plural,
										one {later copy}
										other {# later copies as well}
									}
								{{/mf}}
								<span class="help-block">
									<span class="fa fa-warning fa-fw" aria-hidden="true"></span>
									{{#mf KEY='event.edit.updateReplicas.times' COUNT=affectedReplicaCount}}
										Time-changes will not be updated in {COUNT, plural,
											one {copy}
											other {copies}
										}
									{{/mf}}
								</span>
							</label>
						</div>
					</div>
				{{/if}}
			</div>

			<div class="form-actions">
				{{> buttonCancel event="js-event-edit-cancel"}}
				{{> buttonSave}}
			</div>
		</div>
	</div>
	</form>
</template>

<template name="eventDescriptionEdit">
	<div class="form-control editable-textarea"
		id="eventEditDescription"
		data-placeholder="{{mf 'event.description.placeholder' 'Describe your event as accurately as possible. This helps people to know how to prepare and what to expect from this meeting (eg. level, prerequisites, activities, teaching methods, what to bring, et cetera)'}}">
		{{{this}}}
	</div>
</template>

<template name="eventAttachmentsEdit">
	<tr id="row-{{_id}}">
		<td>
{'fraction_non_alphanumeric': 0.18686233403214536, 'fraction_numerical': 0.0015373864430468203, 'mean_word_length': 2.695068422411567, 'pattern_counts': {'":': 0, '<': 311, '<?xml version=': 0, '>': 325, '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': '6527132', 'n_tokens_mistral': 6362, 'n_tokens_neox': 4543, 'n_words': 971}