Compare commits

...

4 Commits

Author SHA1 Message Date
Thomas MONCHICOURT feca14ae4d Fix : ajouter au menu et changement status direct #7177 @0h10 2018-09-05 12:26:58 +02:00
Thomas MONCHICOURT 33c1221cb2 Feat : lister les candidatures en admin #7177 @1h 2018-09-05 12:16:56 +02:00
Thomas MONCHICOURT b13ebb9d0f Fix: birtday date error on save 2018-08-29 14:20:53 +02:00
Maxime Thévenot 76f557501e Fix : update registration template to fix button 2018-08-28 15:27:09 +02:00
5 changed files with 159 additions and 2 deletions
@@ -15,7 +15,7 @@
</p>
{% endif %}
<br/><br/>
{% if app.request.cookies.get('redirect_register')is defined %}
{% if app.request.cookies.get('redirect_register') is defined and app.request.cookies.get('redirect_register') is not null %}
<div class="center">
<a href="{{ app.request.cookies.get('redirect_register') }}" class="btn btn-default">Poursuivre votre candidature</a>
</div>
@@ -0,0 +1,104 @@
{% extends 'admin/base_admin.html.twig' %}
{% block contentHeader %}
<h1>
Liste des Candidatures
</h1>
<ol class="breadcrumb">
<li><a href="{{ path('admin_dashboard') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li class="active">Annonces</li>
</ol>
{% endblock %}
{% block content %}
<div class="box box-primary">
<div class="box-body">
<table id="answer_list_table" class="table table-hover table-bordered">
<thead>
<tr>
<th class="col-xs-2">Date d'envoi</th>
<th>Utilisateur</th>
<th>Annonce / Entreprise</th>
<th>video</th>
<th>Status</th>
<th>action</th>
</tr>
</thead>
<tbody>
{% for answer in answers if answer.status != "DRAFT" %}
<tr>
<td data-order="{{ answer.sendTime|date('U') }}">{{ answer.sendTime|date('d/m/Y') }}</td>
<td>{{ answer.user.firstname }} {{ answer.user.lastname }}</td>
{% if answer.ad %}
<td>{{ answer.ad.company.brandname }} - {{ answer.ad.title }}</td>
{% else %}
<td>{{ answer.company.brandname }}</td>
{% endif %}
<td>
<iframe src="https://player.vimeo.com/video/{{ answer.video.cdnUrl|replace({ "/videos/": ""}) }}"
width="auto" height="auto" frameborder="0" webkitallowfullscreen mozallowfullscreen
allowfullscreen></iframe>
</td>
<td class="status">{{ answer.status }}</td>
<td>
Actions :
<select class="changeStatus" name="changeStatus" data-id="{{ answer.id }}">
<option value="null">choisir</option>
<option value="DRAFT">Brouillon</option>
<option value="REFUSED">Refuser</option>
</select>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
{% block javascripts %}
<script>
$(function () {
$('.changeStatus').change(function(e){
e.preventDefault();
var idAnswer = $(this).data('id');
var value = $(this).val();
var route = '/app_dev.php/admin/config/answer/' + idAnswer + '/status/' + value;
var select = $(this);
$.ajax({
type: "POST",
url: route,
dataType: "json",
success: function (msg) {
console.log("ok");
select.parent().prev('.status').html(value);
}
});
});
$('#answer_list_table').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false,
"language": {
"url": "http://cdn.datatables.net/plug-ins/1.10.11/i18n/French.json"
},
"columnDefs": [
{"targets": 1, "searchable": true, "orderable": true},
{"targets": 2, "searchable": true, "orderable": true},
{"targets": 4, "searchable": true, "orderable": true, "className": "text-center"},
],
"order": [[ 0, "desc" ]]
});
});
</script>
{% endblock %}
@@ -28,6 +28,11 @@
<i class="fa fa-file-video-o" aria-hidden="true"></i> <span>Vidéos Talent</span>
</a>
</li>
<li>
<a href="{{ path('admin_anwser_moderation_list') }}">
<i class="fa fa-file-video-o" aria-hidden="true"></i> <span>Candidatures</span>
</a>
</li>
</ul>
<ul class="sidebar-menu">
<li class="header">ENTITEES</li>
@@ -0,0 +1,48 @@
<?php
namespace AppBundle\Controller\Admin;
use AppBundle\Entity\Answer;
use AppBundle\Entity\Ad;
use AppBundle\Form\Admin\AdType;
use AppBundle\Form\Admin\ModerationDeclineType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
class AnswerController extends Controller
{
/***********************
* MODERATION
***********************/
/**
* @Route("/admin/moderation/anwser/list", name="admin_anwser_moderation_list")
*/
public function adminAnswerModerationListAction()
{
$em = $this->getDoctrine()->getManager();
$answers = $em->getRepository('AppBundle:Answer')->findAll();
return $this->render('admin/answer_list_moderation.html.twig', array(
'answers' => $answers,
));
}
/**
* @Route("/admin/config/answer/{id}/status/{status}", name="admin_answer_status")
*/
public function adminStatusAnswerAction(Answer $answer, $status)
{
$em = $this->getDoctrine()->getManager();
$answer->setStatus($status);
$em->persist($answer);
$em->flush();
$result = array("msg" => "toggle ok");
return new JsonResponse($result);
}
}
@@ -56,7 +56,7 @@ class TalentController extends Controller
$form = $this->createForm(TalentProfileType::class, $user);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$birthday = new \DateTime($form->getData()->getBirthday());
$birthday = \DateTime::createFromFormat('d/m/Y', $form->getData()->getBirthday());
$user->setBirthday($birthday);
$companyManager = $this->get('app.company_manager');
$companyManager->updateTalent($user);