Browse Source

add projects from database on frontend #4

Laszlo Lang 3 months ago
parent
commit
bf4642cbf0

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

@@ -142,3 +142,16 @@ body,
142 142
     display: block;
143 143
   }
144 144
 }
145
+
146
+@media screen and (max-width: 800px) {
147
+  #main-section #references {
148
+    width: 100%;
149
+    left: 0;
150
+    border: 5px solid #333;
151
+    margin-left: 0;
152
+  }
153
+
154
+  #main-section {
155
+    height: 720px;
156
+  }
157
+}

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

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

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

@@ -2,7 +2,9 @@
2 2
 
3 3
 namespace App\Controller;
4 4
 
5
+use App\Entity\Project;
5 6
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7
+use Symfony\Component\HttpFoundation\Response;
6 8
 
7 9
 /**
8 10
  * Class DefaultController
@@ -12,10 +14,18 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
12 14
  */
13 15
 class DefaultController extends AbstractController
14 16
 {
17
+    /**
18
+     * Default action for homepage
19
+     *
20
+     * @return Response
21
+     */
15 22
     public function index()
16 23
     {
17
-        return $this->render('default/index.html.twig', [
24
+        return $this->render('default/index.html.twig', array(
18 25
             'controller_name' => 'DefaultController',
19
-        ]);
26
+            'project' => $this->getDoctrine()
27
+                ->getRepository(Project::class)
28
+                ->findAll(),
29
+        ));
20 30
     }
21 31
 }

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

@@ -18,9 +18,6 @@
18 18
                     <div class="text-h3">
19 19
                         We design and create websites. We help You from the design of graphics to deploy
20 20
                         to your production server.
21
-                        <br>
22
-                        <br>
23
-                        This site is under construction yet. :)
24 21
                     </div>
25 22
                     <div class="mt-5">
26 23
                         <a href="#references" class="btn btn-shadow">References</a>
@@ -31,163 +28,11 @@
31 28
         </div>
32 29
         <section id="references">
33 30
             <div class="owl-carousel owl-theme">
34
-                <div>
35
-                    <img src="{{ asset('images/work/d-albamedical.jpg') }}" alt="" border="0">
36
-                </div>
37
-                <div>
38
-                    <img src="{{ asset('images/work/d-andreabakos.jpg') }}" alt="" border="0">
39
-                </div>
40
-                <div>
41
-                    <img src="{{ asset('images/work/d-atlaszbeton.jpg') }}" alt="" border="0">
42
-                </div>
43
-                <div>
44
-                    <img src="{{ asset('images/work/d-bambino.jpg') }}" alt="" border="0">
45
-                </div>
46
-                <div>
47
-                    <img src="{{ asset('images/work/d-bulihotel.jpg') }}" alt="" border="0">
48
-                </div>
49
-                <div>
50
-                    <img src="{{ asset('images/work/d-buscopan.jpg') }}" alt="" border="0">
51
-                </div>
52
-                <div>
53
-                    <img src="{{ asset('images/work/d-bynight.jpg') }}" alt="" border="0">
54
-                </div>
55
-                <div>
56
-                    <img src="{{ asset('images/work/d-calltivation.jpg') }}" alt="" border="0">
57
-                </div>
58
-                <div>
59
-                    <img src="{{ asset('images/work/d-cemetery-alsocsinger.jpg') }}" alt="" border="0">
60
-                </div>
61
-                <div>
62
-                    <img src="{{ asset('images/work/d-choco.jpg') }}" alt="" border="0">
63
-                </div>
64
-                <div>
65
-                    <img src="{{ asset('images/work/d-csaszar.jpg') }}" alt="" border="0">
66
-                </div>
67
-                <div>
68
-                    <img src="{{ asset('images/work/d-cukinet.jpg') }}" alt="" border="0">
69
-                </div>
70
-                <div>
71
-                    <img src="{{ asset('images/work/d-dayang.jpg') }}" alt="" border="0">
72
-                </div>
73
-                <div>
74
-                    <img src="{{ asset('images/work/d-djblade.jpg') }}" alt="" border="0">
75
-                </div>
76
-                <div>
77
-                    <img src="{{ asset('images/work/d-dunarama.jpg') }}" alt="" border="0">
78
-                </div>
79
-                <div>
80
-                    <img src="{{ asset('images/work/d-fallball-eu.jpg') }}" alt="" border="0">
81
-                </div>
82
-                <div>
83
-                    <img src="{{ asset('images/work/d-farbe.jpg') }}" alt="" border="0">
84
-                </div>
85
-                <div>
86
-                    <img src="{{ asset('images/work/d-feliratok.jpg') }}" alt="" border="0">
87
-                </div>
88
-                <div>
89
-                    <img src="{{ asset('images/work/d-greensmoke.jpg') }}" alt="" border="0">
90
-                </div>
91
-                <div>
92
-                    <img src="{{ asset('images/work/d-gs-christmas.jpg') }}" alt="" border="0">
93
-                </div>
94
-                <div>
95
-                    <img src="{{ asset('images/work/d-gs-valentine.jpg') }}" alt="" border="0">
96
-                </div>
97
-                <div>
98
-                    <img src="{{ asset('images/work/d-hummel.jpg') }}" alt="" border="0">
99
-                </div>
100
-                <div>
101
-                    <img src="{{ asset('images/work/d-iw-almaink-sportja.jpg') }}" alt="" border="0">
102
-                </div>
103
-                <div>
104
-                    <img src="{{ asset('images/work/d-iw-cserfalvi.jpg') }}" alt="" border="0">
105
-                </div>
106
-                <div>
107
-                    <img src="{{ asset('images/work/d-iw-hungaria.jpg') }}" alt="" border="0">
108
-                </div>
109
-                <div>
110
-                    <img src="{{ asset('images/work/d-iw-pestiekszer.jpg') }}" alt="" border="0">
111
-                </div>
112
-                <div>
113
-                    <img src="{{ asset('images/work/d-iw-vileda.jpg') }}" alt="" border="0">
114
-                </div>
115
-                <div>
116
-                    <img src="{{ asset('images/work/d-iw-vp-handball.jpg') }}" alt="" border="0">
117
-                </div>
118
-                <div>
119
-                    <img src="{{ asset('images/work/d-iw-vp-handball-fans.jpg') }}" alt="" border="0">
120
-                </div>
121
-                <div>
122
-                    <img src="{{ asset('images/work/d-kopogtato.jpg') }}" alt="" border="0">
123
-                </div>
124
-                <div>
125
-                    <img src="{{ asset('images/work/d-laszlolang.jpg') }}" alt="" border="0">
126
-                </div>
127
-                <div>
128
-                    <img src="{{ asset('images/work/d-matruelle.jpg') }}" alt="" border="0">
129
-                </div>
130
-                <div>
131
-                    <img src="{{ asset('images/work/d-pharmaton-kod.jpg') }}" alt="" border="0">
132
-                </div>
133
-                <div>
134
-                    <img src="{{ asset('images/work/d-pharmaton-rejtely.jpg') }}" alt="" border="0">
135
-                </div>
136
-                <div>
137
-                    <img src="{{ asset('images/work/d-pharmaton-vital.jpg') }}" alt="" border="0">
138
-                </div>
139
-                <div>
140
-                    <img src="{{ asset('images/work/d-pt-bbsz.jpg') }}" alt="" border="0">
141
-                </div>
142
-                <div>
143
-                    <img src="{{ asset('images/work/d-pt-bbsz-s2.jpg') }}" alt="" border="0">
144
-                </div>
145
-                <div>
146
-                    <img src="{{ asset('images/work/d-pt-hostels.jpg') }}" alt="" border="0">
147
-                </div>
148
-                <div>
149
-                    <img src="{{ asset('images/work/d-pt-hostelshungary.jpg') }}" alt="" border="0">
150
-                </div>
151
-                <div>
152
-                    <img src="{{ asset('images/work/d-pt-kormanyhivatalok.jpg') }}" alt="" border="0">
153
-                </div>
154
-                <div>
155
-                    <img src="{{ asset('images/work/d-pt-marko.jpg') }}" alt="" border="0">
156
-                </div>
157
-                <div>
158
-                    <img src="{{ asset('images/work/d-pt-olcsoutazasok.jpg') }}" alt="" border="0">
159
-                </div>
160
-                <div>
161
-                    <img src="{{ asset('images/work/d-pt-pann-tura.jpg') }}" alt="" border="0">
162
-                </div>
163
-                <div>
164
-                    <img src="{{ asset('images/work/d-pt-tauplitzerhof.jpg') }}" alt="" border="0">
165
-                </div>
166
-                <div>
167
-                    <img src="{{ asset('images/work/d-qecc.jpg') }}" alt="" border="0">
168
-                </div>
169
-                <div>
170
-                    <img src="{{ asset('images/work/d-slokat.jpg') }}" alt="" border="0">
171
-                </div>
172
-                <div>
173
-                    <img src="{{ asset('images/work/d-system7-cms.jpg') }}" alt="" border="0">
174
-                </div>
175
-                <div>
176
-                    <img src="{{ asset('images/work/d-szilasi.jpg') }}" alt="" border="0">
177
-                </div>
178
-                <div>
179
-                    <img src="{{ asset('images/work/d-vk.jpg') }}" alt="" border="0">
180
-                </div>
181
-                <div>
182
-                    <img src="{{ asset('images/work/d-vk-kupongyar.jpg') }}" alt="" border="0">
183
-                </div>
184
-                <div>
185
-                    <img src="{{ asset('images/work/d-vke.jpg') }}" alt="" border="0">
186
-                </div>
187
-                <div>
188
-                    <img src="{{ asset('images/work/d-vke-allati.jpg') }}" alt="" border="0">
189
-                </div>
190
-
31
+                {% for item in project %}
32
+                    <div>
33
+                        {% thumbnail item.media, 'large' %}
34
+                    </div>
35
+                {% endfor %}
191 36
             </div>
192 37
         </section>
193 38
     </section>
@@ -421,7 +266,9 @@
421 266
             <div class="row text-center">
422 267
                 <div class="col">
423 268
                     <img src="{{ asset('images/bear-3@1000.png') }}" alt="SplendidBear" border="0" width="150">
424
-                    <h3>SplendidBear Websites</h3>
269
+                    <h2>SplendidBear Websites</h2>
270
+                    <h3>Copyright &copy; 2009-{{ 'now'|date('Y') }}</h3>
271
+                    <h4>version {{ jotunVersion }}</h4>
425 272
                 </div>
426 273
             </div>
427 274
             <div class="row mt-4">