Skip to content

Commit

Permalink
Fixbug before launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Boyquotes committed Jun 12, 2021
1 parent 3dfe501 commit 57d249c
Show file tree
Hide file tree
Showing 34 changed files with 704 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ MAILER_DSN=mailgun+https://$MAILGUN_KEY:$MAILGUN_DOMAIN@default?region=eu
###> AntiBots ###
HOST_DEV=127.0.0.1:8000
HOST_PROD=garden-exchange.org
ANTI_SPAM=true
ANTI_SPAM=false
SEND_LOG_SPAM=true
TIME_NOT_BOT=4
###< AntiBots ###
16 changes: 14 additions & 2 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function initAjaxPost(){
$.each( msg.route, function( key, value ) {
$.ajax({
url: value,
method: 'POST'
method: 'GET'
})
.done(function(data) {
$(key).html(data);
Expand All @@ -117,7 +117,7 @@ function initAjaxPost(){
$.each( msg.route, function( key, value ) {
$.ajax({
url: value,
method: 'POST'
method: 'GET'
})
.done(function(data) {
$(key).html(data);
Expand Down Expand Up @@ -398,4 +398,16 @@ $(document).ready( function(){
$('#baseModal').modal('show');
});

$('#main').find('.ajaxLink').click(function () {
// requete ajax
var urlAction = $(this).attr('data-action');
$.ajax({
url: urlAction,
method: 'GET'
})
.done(function(data) {
$('.notification').html(data.success);
});
});

});
26 changes: 20 additions & 6 deletions assets/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ a.index-content-conversation{
.users-list{
display: flex;
flex-direction: column;
border: 1px solid #DDD;
}
.user-list:hover{
background: #dadada;
Expand Down Expand Up @@ -754,6 +755,13 @@ a.index-content-conversation{
width: 80%;
margin: 4em auto;
}
.contact-verified .btn{
cursor: auto;
}
.contact-verified .btn-warning:hover{
background: #F39C12;
border-color: #F39C12;
}

/* Homepage ------------------------------------------------------------------------- */
#homepage .homedream-container{
Expand Down Expand Up @@ -794,9 +802,7 @@ a.index-content-conversation{
text-align: center;
}
.homepage-intro{
padding: 2em 0em;
}
.homepage-intro{
padding: .5em 0em;
font-size: 1.5em;
}
.homepage-encart{
Expand Down Expand Up @@ -826,7 +832,7 @@ a.index-content-conversation{
.homepage-video{
background: rgba(0, 0, 0, 0.2);
font-size: 1.5em;
padding: 0 0 0 0;
padding: 2em 0;
}
.homepage-central-links{
margin: 3em 0 0 0;
Expand Down Expand Up @@ -958,7 +964,7 @@ gardensCarte{
text-align: center;
}
.contact{
position: sticky;
position: fixed;
top: 100px;
margin: 100px 0 0 0;
float: right;
Expand Down Expand Up @@ -1198,4 +1204,12 @@ footer p {
p, ul, ol {
font-size: 1em;
}

/* NOTIFICATION ------------------------------------------------------------------------- */
.notification{
width: 100%;
background: #59F;
color: #FFF;
padding: 2rem;
font-size: 2rem;
font-weight: bold;
}
6 changes: 6 additions & 0 deletions assets/scss/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ hr{
.hidden{
display: none;
}
.notAlink{
cursor: auto;
}
.navbar-default .navbar-nav > li > a.notAlink:hover{
background: #FFF;
}
36 changes: 36 additions & 0 deletions migrations/Version20210417042100.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210417042100 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE profile_night (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_E60E9045A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE profile_night ADD CONSTRAINT FK_E60E9045A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('DROP TABLE profile_night');
}
}
38 changes: 38 additions & 0 deletions migrations/Version20210422184535.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210422184535 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE profile_night_swap (id INT AUTO_INCREMENT NOT NULL, garden_id INT DEFAULT NULL, host_id INT DEFAULT NULL, camper_id INT DEFAULT NULL, status LONGTEXT NOT NULL, night_date DATETIME NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_575FBA8739F3B087 (garden_id), INDEX IDX_575FBA871FB8D185 (host_id), INDEX IDX_575FBA877701A506 (camper_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE profile_night_swap ADD CONSTRAINT FK_575FBA8739F3B087 FOREIGN KEY (garden_id) REFERENCES garden (id)');
$this->addSql('ALTER TABLE profile_night_swap ADD CONSTRAINT FK_575FBA871FB8D185 FOREIGN KEY (host_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE profile_night_swap ADD CONSTRAINT FK_575FBA877701A506 FOREIGN KEY (camper_id) REFERENCES user (id)');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('DROP TABLE profile_night_swap');
}
}
10 changes: 10 additions & 0 deletions public/build/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,16 @@ $(document).ready(function () {
});
$('#baseModal').modal('show');
});
$('#main').find('.ajaxLink').click(function () {
// requete ajax
var urlAction = $(this).attr('data-action');
$.ajax({
url: urlAction,
method: 'GET'
}).done(function (data) {
$('.notification').html(data.success);
});
});
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")))

Expand Down
37 changes: 31 additions & 6 deletions public/build/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -8811,6 +8811,14 @@ hr {
display: none;
}

.notAlink {
cursor: auto;
}

.navbar-default .navbar-nav > li > a.notAlink:hover {
background: #FFF;
}

/* Lato (normal, regular) */
@font-face {
font-family: Lato;
Expand Down Expand Up @@ -9610,6 +9618,7 @@ a.index-content-conversation {
.users-list {
display: flex;
flex-direction: column;
border: 1px solid #DDD;
}

.user-list:hover {
Expand Down Expand Up @@ -9647,6 +9656,15 @@ a.index-content-conversation {
margin: 4em auto;
}

.contact-verified .btn {
cursor: auto;
}

.contact-verified .btn-warning:hover {
background: #F39C12;
border-color: #F39C12;
}

/* Homepage ------------------------------------------------------------------------- */
#homepage .homedream-container {
position: relative;
Expand Down Expand Up @@ -9691,10 +9709,7 @@ a.index-content-conversation {
}

.homepage-intro {
padding: 2em 0em;
}

.homepage-intro {
padding: .5em 0em;
font-size: 1.5em;
}

Expand Down Expand Up @@ -9731,7 +9746,7 @@ a.index-content-conversation {
.homepage-video {
background: rgba(0, 0, 0, 0.2);
font-size: 1.5em;
padding: 0 0 0 0;
padding: 2em 0;
}

.homepage-central-links {
Expand Down Expand Up @@ -9894,7 +9909,7 @@ gardensCarte {
}

.contact {
position: sticky;
position: fixed;
top: 100px;
margin: 100px 0 0 0;
float: right;
Expand Down Expand Up @@ -10181,6 +10196,16 @@ p, ul, ol {
font-size: 1em;
}

/* NOTIFICATION ------------------------------------------------------------------------- */
.notification {
width: 100%;
background: #59F;
color: #FFF;
padding: 2rem;
font-size: 2rem;
font-weight: bold;
}

/* Responsive ------------------------------------------------------------------------- */
@media only screen and (max-device-width: 767px) {
.is-hidden-mobile {
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Admin/ConversationExchangeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
Expand Down
5 changes: 4 additions & 1 deletion src/Controller/Admin/GardenAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use App\Form\GardenType;
use App\Repository\GardenRepository;
use App\Security\GardenVoter;
use App\Utils\Nigth;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
Expand All @@ -25,6 +26,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
Expand Down Expand Up @@ -311,7 +313,7 @@ public function deleteGardenModal(Request $request, Garden $garden): Response
/**
* @Route("/{id}/publish", name="publish_garden", methods={"POST"})
*/
public function publishGarden(Request $request, MailerInterface $mailer, TranslatorInterface $translator, Garden $garden){
public function publishGarden(Request $request, MailerInterface $mailer, TranslatorInterface $translator, Garden $garden, Nigth $nigth){
$token = $request->request->get('_token');
$user = $this->getUser();

Expand Down Expand Up @@ -351,6 +353,7 @@ public function publishGarden(Request $request, MailerInterface $mailer, Transla
// error message or try to resend the message
}

$nigth->addProfilNight($user, '1', 'garden_profil_ok', 'available');

$routeReload = array( '#garden'.$garden->getId() => $this->generateUrl( 'actions_garden', array('id' => $garden->getId()) ) );
$response = array(
Expand Down
2 changes: 0 additions & 2 deletions src/Controller/HomepageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function homepage(Request $request, LoggerInterface $bigbLogger, GardenRe
$allGardens = $gardens->findAll();
$encartPosts = $posts->findThreeFisrt();
$introPost = $posts->findIntro();
$nuiteesPost = $posts->findNuitees();

$form = $this->createForm(SimpleSearchType::class);
$form->handleRequest($request);
Expand All @@ -48,7 +47,6 @@ public function homepage(Request $request, LoggerInterface $bigbLogger, GardenRe
'allGardens' => $allGardens,
'encartPosts' => $encartPosts,
'introPost' => $introPost,
'nuiteesPost' => $nuiteesPost,
]);
}

Expand Down
Loading

0 comments on commit 57d249c

Please sign in to comment.