-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from VEAF/feature/52-add-perun-player-edition
Feature/52 add perun player edition
- Loading branch information
Showing
17 changed files
with
505 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
services: | ||
Tetranz\Select2EntityBundle\Service\AutocompleteService: | ||
alias: tetranz_select2entity.autocomplete_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace App\Form; | ||
|
||
use App\Entity\User; | ||
use App\Perun\Entity\Player; | ||
use Doctrine\ORM\QueryBuilder; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; | ||
|
||
class PlayerLinkType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilderInterface $builder, array $options) | ||
{ | ||
$builder | ||
->add('user', Select2EntityType::class, [ | ||
'multiple' => false, | ||
'remote_route' => 'admin_dcs_player_autocomplete', | ||
'remote_params' => [], // static route parameters for request->query | ||
'class' => User::class, | ||
'primary_key' => 'id', | ||
'text_property' => 'nickname', | ||
'property' => 'nickname', | ||
'minimum_input_length' => 3, | ||
'page_limit' => 10, | ||
'allow_clear' => false, | ||
'delay' => 250, | ||
'language' => 'fr', | ||
'placeholder' => 'Sélectionner un utilisateur', | ||
'callback' => function (QueryBuilder $qb, $data) { | ||
$qb->andWhere('e.player is null'); | ||
|
||
}, | ||
]); | ||
} | ||
|
||
public function configureOptions(OptionsResolver $resolver) | ||
{ | ||
$resolver->setDefaults([ | ||
'data_class' => Player::class, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{% extends 'admin/layout.html.twig' %} | ||
{% set libKilikTable=true %} | ||
{% set section="admin" %} | ||
{% set subSection="player" %} | ||
|
||
{% block pageContent %} | ||
<div class="row mb-4"> | ||
<div class="col-md-6"> | ||
<div class="bs-component"> | ||
<div class="card mb-3"> | ||
<h3 class="card-header">Modifier le joueur DCS</h3> | ||
<div class="card-body"> | ||
<table class="table"> | ||
<tr> | ||
<td> | ||
Dernier Pseudo: | ||
</td> | ||
<td> | ||
{{ player.lastName }} | ||
</td> | ||
</tr> | ||
</table> | ||
{{ form_start(form) }} | ||
{{ form_rest(form) }} | ||
{{ form_errors(form) }} | ||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<a href="{{ path('admin_dcs_player_view', {'player': player.id}) }}" | ||
class="btn btn-lg btn-primary form-control"> | ||
<i class="fa fa-arrow-circle-left"></i> Annuler | ||
</a> | ||
</div> | ||
<div class="col-sm-6"> | ||
<button class="btn btn-lg btn-danger form-control " type="submit"> | ||
<i class="fa fa-save"></i> Enregistrer | ||
</button> | ||
</div> | ||
</div> | ||
{{ form_end(form) }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock pageContent %} |
Oops, something went wrong.