<commit_before><!-- @author <NAME> -->

@extends('layout')

@section('content')
	<div id="container">
		<a href="{{ route('tournaments.index') }}"><i class="fa fa-4x fa-arrow-circle-left return" aria-hidden="true"></i></a>	
		<h1>Modifier un tournoi</h1>

		@if ($errors->any() || isset($customErrors) || empty($dropdownListSports) /*dropdownListSports is empty if all court deleted*/)
			<div class="alert alert-danger">
				@if ($errors->any())
		            @foreach ($errors->all() as $error)
		                {{ $error }}<br>
		            @endforeach
		        @endif
		        @if (isset($customErrors))
		        	@foreach ($customErrors as $customError)
		                {{ $customError }}<br>
		            @endforeach
		        @endif
		        @if(empty($dropdownListSports)/*Sport is empty if we deleted all sport*/)
		        	Veuillez creer un sport et le lié à un terrain, ou en choisir un.
		        @endif
	        </div>
        @endif

		{{ Form::open(array('url' => route('tournaments.update', $tournament->id), 'method' => 'put', 'id' => 'formTournament')) }}

			{{ Form::label('name', 'Nom :') }}
			{{ Form::text('name', $tournament->name) }}
			<br>
			<br>
			{{ Form::label('Sport', 'Sport :') }}
			@if(!empty($dropdownListSports) && !empty($sport)/*Normal case : a sport is linked to the tournament*/)
				{{ Form::select('sport', $dropdownListSports, $sport->id, array('placeholder' => 'Sélectionner', 'class' => 'allSameStyle', 'id' => 'sport')) }}
			@else
				<!-- court doesn't exists ... -->
				{{ Form::select('sport', $dropdownListSports, null, array('placeholder' => 'Sélectionner', 'class' => 'allSameStyle', 'id' => 'sport')) }}

			@endif
			<br>
			
			(la liste contient uniquement les sports qui ont au minimum un terrain lié)
			<br>
			<br>
			{{ Form::label('startDate', 'Date de début :') }}
			{{ Form::date('startDate', $tournament->start_date, array('class' => 'allSameStyle')) }}
			<br>
			<br>
			{{ Form::label('startTime', 'Heure de début :') }}
			{{ Form::text('startTime', date("H:i", strtotime($tournament->start_date)), array('placeholder' => 'hh:mm')) }}
			<br>
			<br>
			{{ Form::label('teams', 'Équipes participantes :') }}
			@if(!empty($teamsAreParticipatingId))
				{{ Form::select('teams[]', $dropdownListTeams, $teamsAreParticipatingId, array('class' => 'allSameStyle', 'id' => 'multiple-teams-select', 'multiple')) }}
			@else
				{{ Form::select('teams[]', $dropdownListTeams, null, array('class' => 'allSameStyle', 'id' => 'multiple-teams-select', 'multiple')) }}
			@endif
			<br>
			<br>
			{{ Form::button('Enregistrer', array('class' => 'btn btn-success formSend')) }}

		{{ Form::close() }}

		<br>


	</div>
@stop<commit_msg>Added example for groups in select<commit_after><!-- @author <NAME> -->

@extends('layout')

@section('content')
	<div id="container">
		<a href="{{ route('tournaments.index') }}"><i class="fa fa-4x fa-arrow-circle-left return" aria-hidden="true"></i></a>	
		<h1>Modifier un tournoi</h1>

		@if ($errors->any() || isset($customErrors) || empty($dropdownListSports) /*dropdownListSports is empty if all court deleted*/)
			<div class="alert alert-danger">
				@if ($errors->any())
		            @foreach ($errors->all() as $error)
		                {{ $error }}<br>
		            @endforeach
		        @endif
		        @if (isset($customErrors))
		        	@foreach ($customErrors as $customError)
		                {{ $customError }}<br>
		            @endforeach
		        @endif
		        @if(empty($dropdownListSports)/*Sport is empty if we deleted all sport*/)
		        	Veuillez creer un sport et le lié à un terrain, ou en choisir un.
		        @endif
	        </div>
        @endif

		{{ Form::open(array('url' => route('tournaments.update', $tournament->id), 'method' => 'put', 'id' => 'formTournament')) }}

			{{ Form::label('name', 'Nom :') }}
			{{ Form::text('name', $tournament->name) }}
			<br>
			<br>

			{{ Form::select('sport', array('Terrains' => $dropdownListSports, 'Sans terrains' => $dropdownListSports), $sport->id, array('placeholder' => 'Sélectionner', 'class' => 'allSameStyle', 'id' => 'sport')) }}

			{{ Form::label('Sport', 'Sport :') }}
			@if(!empty($dropdownListSports) && !empty($sport)/*Normal case : a sport is linked to the tournament*/)
				{{ Form::select('sport', $dropdownListSports, $sport->id, array('placeholder' => 'Sélectionner', 'class' => 'allSameStyle', 'id' => 'sport')) }}

			@else
				{{ Form::select('sport', $dropdownListSports, null, array('placeholder' => 'Sélectionner', 'class' => 'allSameStyle', 'id' => 'sport')) }}
			@endif
			<br>
			<br>
			{{ Form::label('startDate', 'Date de début :') }}
			{{ Form::date('startDate', $tournament->start_date, array('class' => 'allSameStyle')) }}
			<br>
			<br>
			{{ Form::label('startTime', 'Heure de début :') }}
			{{ Form::text('startTime', date("H:i", strtotime($tournament->start_date)), array('placeholder' => 'hh:mm')) }}
			<br>
			<br>
			{{ Form::label('teams', 'Équipes participantes :') }}
			@if(!empty($teamsAreParticipatingId))
				{{ Form::select('teams[]', $dropdownListTeams, $teamsAreParticipatingId, array('class' => 'allSameStyle', 'id' => 'multiple-teams-select', 'multiple')) }}
			@else
				{{ Form::select('teams[]', $dropdownListTeams, null, array('class' => 'allSameStyle', 'id' => 'multiple-teams-select', 'multiple')) }}
			@endif
			<br>
			<br>
			{{ Form::button('Enregistrer', array('class' => 'btn btn-success formSend')) }}

		{{ Form::close() }}

		<br>


	</div>
@stop
{'fraction_non_alphanumeric': 0.216265169353378, 'fraction_numerical': 0.0010867596449918493, 'mean_word_length': 3.6055045871559632, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 109, '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': '5204807', 'n_tokens_mistral': 2066, 'n_tokens_neox': 1800, 'n_words': 392}