Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
partie fonctionelle
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoNF committed Mar 27, 2018
1 parent d7200ac commit 50adf8d
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 31 deletions.
14 changes: 14 additions & 0 deletions public/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ img {
border: solid rgba(82, 82, 82, 0.61) 3px;
}

.formresume{
width: 350px;
height: 200px;
background-color: #1f1f1f;
color: #675a4c;
position: absolute;
top: 30%;
left: 20%;
transform: translateY(-25%);
z-index: 999;
border-radius: 5px;
border: solid rgba(82, 82, 82, 0.61) 3px;
}

.content1 input{
width: 40% !important;
text-align: center;
Expand Down
17 changes: 12 additions & 5 deletions public/assets/js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

$(function () {
$('.connection').click(function () {
$('.connectinterface').remove();
Expand Down Expand Up @@ -179,6 +178,7 @@ $( function() {
$('.Resume').hide();
$('.ongletchat').css('background','white');
$('.Persocreer').hide();
$('.formresume').hide();
});
function ongletchat() {
$('.Perso').hide();
Expand Down Expand Up @@ -216,8 +216,8 @@ function fermer2() {
$('.Persocreer').fadeOut(400);
}

function diminuer(){

function fermer3() {
$('.formresume').fadeOut(400);
}

$(function () {
Expand All @@ -244,8 +244,15 @@ $(function () {
});


$(function () {

$('.creeresume').click(function () {
$('.formresume').show();
});
});



function reload() {
$(document).delay(400);
$(document).reload()
}

5 changes: 4 additions & 1 deletion src/Controller/RollAndPlay/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function partie($id , Request $request , Request $request2) {
$fiche = $rpPerso->findAll();

$rpResume = $this->getDoctrine()->getRepository(Resume::class);
$Resume = $rpResume->findAll();

$Resume = $rpResume->getResume();

// nouveau msg
$nvmessages = new Chat();
$auteur = $this->getDoctrine()->getRepository(Users::class)->find(1);
Expand All @@ -96,6 +98,7 @@ public function partie($id , Request $request , Request $request2) {
// resume

$resume = new Resume();
$resume->setDate(time());
$formresume = $this->createForm(ResumeType::class , $resume);
$formresume->handleRequest($request);

Expand Down
37 changes: 37 additions & 0 deletions src/Entity/Resume.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,43 @@ class Resume
*/
private $titre;

/**
* @ORM\Column(type="integer")
*/
private $date;

/**
* @return mixed
*/
public function getDate()
{
return $this->date;
}

/**
* @param mixed $date
*/
public function setDate($date): void
{
$this->date = $date;
}

/**
* @return mixed
*/
public function getPartie()
{
return $this->partie;
}

/**
* @param mixed $partie
*/
public function setPartie($partie): void
{
$this->partie = $partie;
}

/**
* @return mixed
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Form/ResumeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
])
->add('envoi' ,SubmitType::class,[
'attr' => [
'class' => 'send'
'class' => 'btn btn-primary btn-block send',
'onclick' =>'reload()'
]
]);
}
Expand Down
1 change: 1 addition & 0 deletions src/Repository/ChatRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function addMessage(){
}



// /**
// * @return Chat[] Returns an array of Chat objects
// */
Expand Down
9 changes: 9 additions & 0 deletions src/Repository/ResumeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ public function __construct(RegistryInterface $registry)
parent::__construct($registry, Resume::class);
}

public function getResume(){
return
$this->createQueryBuilder('a')
->orderBy('a.date','DESC')
->setMaxResults(5)
->getQuery()
->getResult();
}

// /**
// * @return Resume[] Returns an array of Resume objects
// */
Expand Down
36 changes: 12 additions & 24 deletions templates/Partie/partie.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,20 @@
<li onclick="ongletresume()" class="ongletpageresume">Résumé</li>
</ul>
</div>
<div class="tchat">
<div id="tchat">
{% for msg in message %}
<p><strong>{{ msg.pseudo }} : </strong> {{ msg.message }}</p>

{% endfor %}
</div>
<div id="tchatForm" style="position: fixed;bottom: 0;width: 24%; ">
<form action="#" method="post">
<div style="margin-right: 0;">
{{ form(form) }}
</div>
<div style="position: absolute;top: 12px;right: 25px;">
<input type="submit" value="Envoyer">
</div>
</form>
</div>
</div>
<div class="tchat" style="margin-top: 30px">
<script id="cid0020000183154357079" data-cfasync="false" async src="//st.chatango.com/js/gz/emb.js" style="width: 100%;height: 913vh;">{"handle":"rolllandplay","arch":"js","styles":{"b":100,"c":"000000","d":"000000","l":"FFFFFF","m":"FFFFFF","p":"10","r":100,"fwtickm":1}}</script> </div>
<div class="Resume">
<div id="Resume">
<div>
{{ form(formresume) }}
<input type=button name=Bouton class="creeresume btn btn-primary btn-block" value="Ajouter dans le résumé"/>
<div class="formresume">
<span onclick="fermer3()" class="croix2"><i class="fa fa-times-circle"></i></span><br>
{{ form(formresume) }}
</div>
<div>
{% for resumes in resume %}
{{ resumes.titre }}
<h2>{{ resumes.titre }}</h2><br>
{{ resumes.contenu }}
<hr>
{% endfor %}
</div>
</div>
Expand All @@ -83,11 +70,12 @@

</div>
</div>
<div>
<div id="Persoafficher" >
{% for fichep in fiche %}
<div style="background: url({{ fichep.image }});height: 150px;background-size: cover;text-align: center;">
<strong style="color: white;font-size: 22px;">{{ fichep.nom }}</strong>
<div class="Persoafficher" style="background: url({{ fichep.image }});height: 150px;background-size: cover;text-align: center;">
<strong style="color: black;font-size: 22px;">{{ fichep.nom }}</strong>
</div>
<hr style="color: black;border: 4px!important;">
{% endfor %}
</div>
</div>
Expand Down

0 comments on commit 50adf8d

Please sign in to comment.