Skip to content
This repository has been archived by the owner on Jun 25, 2018. It is now read-only.

Commit

Permalink
various
Browse files Browse the repository at this point in the history
  • Loading branch information
romainnorberg committed Apr 16, 2017
1 parent 5ef35d0 commit 84aed71
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 180 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'AppBundle::base_pages.html.twig' %}
{% extends 'AppBundle::base_page.html.twig' %}

{% block content %}
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'AppBundle::base_pages.html.twig' %}
{% extends 'AppBundle::base_page.html.twig' %}

{% block content %}
<div class="container">
Expand Down
76 changes: 0 additions & 76 deletions app/Resources/views/default/index.html.twig

This file was deleted.

10 changes: 10 additions & 0 deletions app/config/config/twig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
twig:
globals:
metas:
title: "Entrepreneur général en bâtiment | Construct-Tim"
description: "Construct-Tim s’inscrit comme un prestataire unique au service de votre projet de construction, rénovation et extension d’habitation."
keywords: "construction, rénovation, batîments, Extensions de bâtiment, entrepreneur, namur, qualité"
author: "Construct-tim Timothée Wery"
upload:
image_path: "/uploads/images/"
file_path: "/uploads/medias/"
3 changes: 1 addition & 2 deletions app/config/config_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ monolog:
action_level: error
handler: nested
nested:
type: stream
path: "php://stderr"
type: error_log
level: debug
console:
type: console
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"minimum-stability": "stable",
"require": {
"php": ">=7.0",
"symfony/symfony": "3.2.7",
"symfony/symfony": "3.2.*",
"twig/twig": "~2.2",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
Expand Down
98 changes: 28 additions & 70 deletions src/AppBundle/Entity/ProjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ class ProjectType
*
* @var File
*/
private $imageFile;
private $image_file;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
private $imageName;
private $image_name;

/**
* @var ArrayCollection
Expand Down Expand Up @@ -137,7 +137,15 @@ public function __toString()
}

/**
* Set page_title
* Constructor
*/
public function __construct()
{
$this->projects = new \Doctrine\Common\Collections\ArrayCollection();
}

/**
* Set pageTitle
*
* @param string $pageTitle
*
Expand All @@ -151,7 +159,7 @@ public function setPageTitle($pageTitle)
}

/**
* Get page_title
* Get pageTitle
*
* @return string
*/
Expand Down Expand Up @@ -257,87 +265,27 @@ public function getContent()
}

/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
* Set imageName
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*
* @return ProjectType
*/
public function setImageFile(File $image = null)
{
$this->imageFile = $image;

if ($image) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updated = new \DateTime('now');
}

return $this;
}

/**
* @return File
*/
public function getImageFile()
{
return $this->imageFile;
}

/**
* @param string $imageName
*
* @return Product
* @return ProjectType
*/
public function setImageName($imageName)
{
$this->imageName = $imageName;
$this->image_name = $imageName;

return $this;
}

/**
* Get imageName
*
* @return string
*/
public function getImageName()
{
return $this->imageName;
}

/**
* Set projects
*
* @param \AppBundle\Entity\Project $projects
*
* @return ProjectType
*/
public function setProjects(\AppBundle\Entity\Project $projects = null)
{
$this->projects = $projects;

return $this;
}

/**
* Get projects
*
* @return \AppBundle\Entity\Project
*/
public function getProjects()
{
return $this->projects;
}

/**
* Constructor
*/
public function __construct()
{
$this->projects = new \Doctrine\Common\Collections\ArrayCollection();
return $this->image_name;
}

/**
Expand All @@ -363,4 +311,14 @@ public function removeProject(\AppBundle\Entity\Project $project)
{
$this->projects->removeElement($project);
}

/**
* Get projects
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProjects()
{
return $this->projects;
}
}
52 changes: 28 additions & 24 deletions src/AppBundle/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,42 @@
<html>
<head>
<meta charset="UTF-8"/>
<title>{% block title %}Welcome!{% endblock %}</title>
<title>{% block title %}{{ metas.title }}{% endblock %}</title>
<meta content="{{ metas.description }}" name="description">
<meta content="{{ metas.keywords }}" name="keywords">
<meta content="{{ metas.author }}" name="author">
<link rel="stylesheet" href="{{ asset('built/app/css/main.css') }}" type="text/css"/>
{% block stylesheets %}{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
</head>
<body class="{{ app.request.attributes.get('_route') }}">
{% block body %}{% endblock %}
{% block body %}{% endblock %}

<div class="device-xs visible-xs"></div>
<div class="device-sm visible-sm"></div>
<div class="device-md visible-md"></div>
<div class="device-lg visible-lg"></div>
<div class="device-xs visible-xs"></div>
<div class="device-sm visible-sm"></div>
<div class="device-md visible-md"></div>
<div class="device-lg visible-lg"></div>

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCHdbqYdUSYJmjFTftqRB1LBGBI3YScx3s"></script>
<script src="{{ asset('built/app/js/main.min.js') }}"></script>
<script type="text/javascript">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCHdbqYdUSYJmjFTftqRB1LBGBI3YScx3s"></script>
<script src="{{ asset('built/app/js/main.min.js') }}"></script>
<script type="text/javascript">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-64376223-1', {});
ga('create', 'UA-64376223-1', {});
ga('send', 'pageview');
</script>
{% block javascripts %}{% endblock %}
ga('send', 'pageview');
</script>
{% block javascripts %}{% endblock %}
<a href="http://romainnorberg.be" id="sign_rn_button" target="_blank" title="Romain Norberg | Web &amp; Print solutions"></a>
</body>
</html>
3 changes: 1 addition & 2 deletions src/AppBundle/Resources/views/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@
<div class="content posts">
<article>
<div class="row">
<div class="col-lg-3"><img alt="Test" itemprop="thumbnail" src="/images/thumb_list/missing.png"/>
</div>
<div class="col-lg-3">image</div>
<div class="col-lg-9">
<h3><a href="/blog/testtest" title="Test">Test</a></h3>
<p>Vestibulum vehicula efficitur pharetra. Aliquam auctor imperdiet tellus, eu semper tellus rutrum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
<div class="row">
<div class="col-sm-6 service">
<a href="/projets/entreprise-construction-maison-batiment-namur-brabant-wallon"><img alt="Entrepreneur en construction à Namur et Brabant wallon" class="img-responsive" src="/images/frontend/static/about/a_propos_gros_oeuvre.jpg"/>
<a href="{{ path('project_type_show', {'slug': 'entreprise-construction-maison-batiment-namur-brabant-wallon'}) }}"><img alt="Entrepreneur en construction à Namur et Brabant wallon" class="img-responsive" src="/images/frontend/static/about/a_propos_gros_oeuvre.jpg"/>
<h2>Nouvelles constructions</h2>
<p class="services-description">Entrepreneur en construction à Namur et Brabant wallon
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{% extends 'AppBundle::base_project.html.twig' %}

{% block content %}
<div>Carousel</div>
<section class="carousel slide" id="ZCarousel">
<div class="carousel-inner">
<div class="item active">
<div class="fill" style="background-image:url('{{ upload.image_path ~ project_type.imageName }}');"></div>
</div>
</div>
</section>

<section class="content html">
<div class="container">
Expand Down
19 changes: 19 additions & 0 deletions src/AppBundle/Tests/Controller/DefaultControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,23 @@ public function testIndex()

$this->assertEquals(200, $client->getResponse()->getStatusCode());
}

public function test404()
{
$client = static::createClient();

$crawler = $client->request('GET', '/_error/404');

$this->assertContains("Page non trouvée", $client->getResponse()->getContent());
}

public function test500()
{
$client = static::createClient();

$crawler = $client->request('GET', '/_error/500');

$this->assertContains("Erreur", $client->getResponse()->getContent());
}

}
Loading

0 comments on commit 84aed71

Please sign in to comment.