Browse Source

add projects from database on frontend #4

tags/Beta-2
Laszlo Lang 1 year ago
parent
commit
bf4642cbf0
4 changed files with 37 additions and 166 deletions
  1. +13
    -0
      assets/css/app.scss
  2. +4
    -3
      config/packages/sonata_media.yaml
  3. +12
    -2
      src/Controller/DefaultController.php
  4. +8
    -161
      templates/default/index.html.twig

+ 13
- 0
assets/css/app.scss View File

@@ -142,3 +142,16 @@ body,
display: block;
}
}

@media screen and (max-width: 800px) {
#main-section #references {
width: 100%;
left: 0;
border: 5px solid #333;
margin-left: 0;
}

#main-section {
height: 720px;
}
}

+ 4
- 3
config/packages/sonata_media.yaml View File

@@ -16,9 +16,10 @@ sonata_media:
providers:
- sonata.media.provider.image
formats:
preview: { width: 100, quality: 100}
small: { width: 200, quality: 100}
large: { width: 600, quality: 100}
preview: { width: 100, quality: 100}
small: { width: 320, quality: 200}
large: { width: 1280, quality: 720}
original: { width: 1920, quality: 1080}
cdn:
server:
path: /upload/media # http://media.sonata-project.org/


+ 12
- 2
src/Controller/DefaultController.php View File

@@ -2,7 +2,9 @@

namespace App\Controller;

use App\Entity\Project;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

/**
* Class DefaultController
@@ -12,10 +14,18 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
*/
class DefaultController extends AbstractController
{
/**
* Default action for homepage
*
* @return Response
*/
public function index()
{
return $this->render('default/index.html.twig', [
return $this->render('default/index.html.twig', array(
'controller_name' => 'DefaultController',
]);
'project' => $this->getDoctrine()
->getRepository(Project::class)
->findAll(),
));
}
}

+ 8
- 161
templates/default/index.html.twig View File

@@ -18,9 +18,6 @@
<div class="text-h3">
We design and create websites. We help You from the design of graphics to deploy
to your production server.
<br>
<br>
This site is under construction yet. :)
</div>
<div class="mt-5">
<a href="#references" class="btn btn-shadow">References</a>
@@ -31,163 +28,11 @@
</div>
<section id="references">
<div class="owl-carousel owl-theme">
<div>
<img src="{{ asset('images/work/d-albamedical.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-andreabakos.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-atlaszbeton.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-bambino.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-bulihotel.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-buscopan.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-bynight.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-calltivation.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-cemetery-alsocsinger.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-choco.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-csaszar.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-cukinet.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-dayang.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-djblade.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-dunarama.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-fallball-eu.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-farbe.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-feliratok.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-greensmoke.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-gs-christmas.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-gs-valentine.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-hummel.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-almaink-sportja.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-cserfalvi.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-hungaria.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-pestiekszer.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-vileda.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-vp-handball.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-iw-vp-handball-fans.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-kopogtato.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-laszlolang.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-matruelle.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pharmaton-kod.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pharmaton-rejtely.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pharmaton-vital.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-bbsz.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-bbsz-s2.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-hostels.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-hostelshungary.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-kormanyhivatalok.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-marko.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-olcsoutazasok.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-pann-tura.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-pt-tauplitzerhof.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-qecc.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-slokat.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-system7-cms.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-szilasi.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-vk.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-vk-kupongyar.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-vke.jpg') }}" alt="" border="0">
</div>
<div>
<img src="{{ asset('images/work/d-vke-allati.jpg') }}" alt="" border="0">
</div>

{% for item in project %}
<div>
{% thumbnail item.media, 'large' %}
</div>
{% endfor %}
</div>
</section>
</section>
@@ -421,7 +266,9 @@
<div class="row text-center">
<div class="col">
<img src="{{ asset('images/bear-3@1000.png') }}" alt="SplendidBear" border="0" width="150">
<h3>SplendidBear Websites</h3>
<h2>SplendidBear Websites</h2>
<h3>Copyright &copy; 2009-{{ 'now'|date('Y') }}</h3>
<h4>version {{ jotunVersion }}</h4>
</div>
</div>
<div class="row mt-4">


Loading…
Cancel
Save