--- /dev/null
+.*.un~
+*~
--- /dev/null
+<?php
+
+namespace Rapsys\BlogBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class DefaultController extends Controller {
+ /**
+ * Redirect on first supported language version
+ */
+ public function rootAction() {
+ //Set default locale
+ $locale = 'en';
+
+ //Supported application languages
+ $supportedLanguage = explode('|', $this->getParameter('blog.locales'));
+
+ //Language list
+ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ //Init array
+ $httpAcceptLanguage = [];
+
+ //Extract languages
+ foreach(explode(',',str_replace('-','_',$_SERVER['HTTP_ACCEPT_LANGUAGE'])) as $candidate) {
+ //Extract candidate and optional weight
+ @list($candidate, $weight) = explode(';', $candidate);
+ if (!empty($candidate)) {
+ $httpAcceptLanguage[!empty($weight)?$weight:1][] = $candidate;
+ }
+ }
+
+ //Find first match
+ if (!empty($httpAcceptLanguage)) {
+ foreach($httpAcceptLanguage as $weight => $candidates) {
+ if (($candidate = array_intersect($candidates, $supportedLanguage)) && ($candidate = reset($candidate))) {
+ $locale = $candidate;
+ break;
+ }
+ }
+ }
+ }
+
+ //Redirect to localised homepage
+ return $this->redirectToRoute('homepage', array('_locale' => $locale), 302);
+ }
+}
--- /dev/null
+<?php
+
+namespace Rapsys\BlogBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class PageController extends Controller {
+ /**
+ * Localized homepage
+ */
+ public function indexAction() {
+ return $this->render('RapsysBlogBundle::index.html.twig');
+ }
+
+ /**
+ * Legal informations
+ */
+ public function aboutAction() {
+ return $this->render('RapsysBlogBundle::about.html.twig');
+ }
+
+ /**
+ * Contact form
+ */
+ public function contactAction() {
+ return $this->render('RapsysBlogBundle::contact.html.twig');
+ }
+}
--- /dev/null
+<?php
+
+namespace Rapsys\BlogBundle;
+
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+class RapsysBlogBundle extends Bundle
+{
+}
--- /dev/null
+parameters:
+ blog.locales: en|fr
+ database_host: 127.0.0.1
+ database_port: null
+ database_name: blog
+ database_user: blog
+ database_password: MacfingOcGu9Pon9
+ mailer_transport: smtp
+ mailer_host: 127.0.0.1
+ mailer_user: null
+ mailer_password: null
+ secret: 60a2f0298adc4afb51cfb11c3828c08b40547bf9
--- /dev/null
+root:
+ path: /
+ defaults: { _controller: RapsysBlogBundle:Default:root }
+
+homepage:
+ path: /{_locale}
+ defaults: { _controller: RapsysBlogBundle:Page:index }
+ requirements:
+ _locale: '%blog.locales%'
+
+about:
+ path: /{_locale}/about
+ defaults: { _controller: RapsysBlogBundle:Page:about }
+ requirements:
+ _locale: '%blog.locales%'
+
+contact:
+ path: /{_locale}/contact
+ defaults: { _controller: RapsysBlogBundle:Page:contact }
+ requirements:
+ _locale: '%blog.locales%'
+
+articles:
+ path: /{_locale}/articles
+ defaults: { _controller: RapsysBlogBundle:Default:articles }
+ requirements:
+ _locale: '%blog.locales%'
+
+articles_article:
+ path: /{_locale}/articles/{_article}
+ defaults: { _controller: RapsysBlogBundle:Default:article }
+ requirements:
+ _locale: '%blog.locales%'
+
+tags:
+ path: /{_locale}/tags
+ defaults: { _controller: RapsysBlogBundle:Default:tags }
+ requirements:
+ _locale: '%blog.locales%'
+
+tags_tag:
+ path: /{_locale}/tags/{_tag}
+ defaults: { _controller: RapsysBlogBundle:Default:tag }
+ requirements:
+ _locale: '%blog.locales%'
--- /dev/null
+services:
+# blog.example:
+# class: BlogBundle\Example
+# arguments: ["@service_id", "plain_value", "%parameter%"]
--- /dev/null
+
+
+/* Smartphones (portrait and landscape) ----------- */
+@media only screen
+and (min-device-width : 320px)
+and (max-device-width : 480px) {
+ /* Styles */
+}
+
+/* Smartphones (landscape) ----------- */
+@media only screen
+and (min-width : 321px) {
+ /* Styles */
+}
+
+/* Smartphones (portrait) ----------- */
+@media only screen
+and (max-width : 320px) {
+ /* Styles */
+}
+
+/* iPads (portrait and landscape) ----------- */
+@media only screen
+and (min-device-width : 768px)
+and (max-device-width : 1024px) {
+ /* Styles */
+}
+
+/* iPads (landscape) ----------- */
+@media only screen
+and (min-device-width : 768px)
+and (max-device-width : 1024px)
+and (orientation : landscape) {
+ /* Styles */
+}
+
+/* iPads (portrait) ----------- */
+@media only screen
+and (min-device-width : 768px)
+and (max-device-width : 1024px)
+and (orientation : portrait) {
+ /* Styles */
+}
+
+/* Desktops and laptops ----------- */
+@media only screen and (min-width : 1224px) {
+ /* Styles */
+}
+
+/* Large screens ----------- */
+@media only screen
+and (min-width : 1824px) {
+ /* Styles */
+}
+
+/* iPhone 4 ----------- */
+@media
+only screen and (-webkit-min-device-pixel-ratio : 1.5),
+only screen and (min-device-pixel-ratio : 1.5) {
+ /* Styles */
+}
--- /dev/null
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center, dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+body {
+ line-height: 1;
+}
+
+ol, ul {
+ list-style: none;
+}
+
+blockquote, q {
+ quotes: none;
+}
+
+blockquote:before, blockquote:after, q:before, q:after {
+ content: '';
+ content: none;
+}
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
--- /dev/null
+/* Reset link */
+a {
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+/* Default styling */
+h1 {
+ font-size: 2rem;
+ margin: 1.34rem 0;
+}
+
+h2 {
+ font-size: 1.5rem;
+ margin: 1.245rem 0;
+}
+
+h3 {
+ font-size: 1.17rem;
+ margin: 1.17rem 0;
+}
+
+h4 {
+ font-size: 1rem;
+ margin: 1.33rem 0;
+}
+
+h5 {
+ font-size: .83rem;
+ margin: 1.386rem 0;
+}
+
+h6 {
+ font-size: .67rem;
+ margin: 1.561rem 0;
+}
+
+#wrapper {
+ display: flex;
+ flex-flow: column wrap;
+}
+
+#header {
+ width: 100%;
+ border-top: .1rem solid #0074d9;
+ padding: .5rem;
+ background-color: #7fdbff;
+ color: #0074d9;
+ border-radius: 0 0 .5rem .5rem;
+}
+
+#header a {
+}
+
+#header h1 {
+}
+
+#header nav {
+ float: right;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ align-items: stretch;
+}
+
+#header nav a {
+ flex: 1;
+ text-align: center;
+ border-radius: .25rem;
+ padding: .25rem .5rem;
+ margin: 0 0 .5rem .5rem;
+ /*color: #399696;*/
+ color: #0093f9;
+ background-color: #001f3f;
+ font-weight: bold;
+}
+
+#footer {
+ font-size: .8rem;
+ width: 100%;
+ padding: .5rem;
+ background-color: #7fdbff;
+ color: #0074d9;
+ border-radius: .5rem;
+ bottom: 0;
+ position: absolute;
+}
+
+#footer summary {
+ display: inline;
+}
+
+#footer summary:after {
+ content: "\00a0";
+}
+
+/*
+#footer summary:after,
+#footer p:after {
+ content: ' - ';
+}
+
+#footer p:last-child:after {
+ content: '';
+}*/
--- /dev/null
+{% extends 'RapsysBlogBundle::body.html.twig' %}
+{% block title %}<h1><a href="{{ url('homepage') }}">Dev log</a></h1>{% endblock %}
+{% block content %}TODO: page de about{% endblock %}
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title>{% block title %}Welcome!{% endblock %} - Devlog</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ {% block stylesheets %}
+ {% stylesheets '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysBlogBundle/Resources/public/css/{reset,screen}.css' filter='toto' %}
+ <link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
+ {% endstylesheets %}
+ {% endblock %}
+ {% block javascripts %}
+ {% javascripts '@RapsysBlogBundle/Resources/js/*.js' output='js/compiled/main.js' %}
+ <script src="{{ asset_url }}"></script>
+ {% endjavascripts %}
+ {% endblock %}
+ <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
+ </head>
+ {% block body %}<body></body>{% endblock %}
+</html>
--- /dev/null
+{% extends 'RapsysBlogBundle::base.html.twig' %}
+{% block body %}
+ <body>
+ <section id="wrapper">
+ {% block header %}
+ <header id="header">
+ {% block nav %}
+ <nav>
+ <a href="{{ url('about') }}">About</a>
+ <a href="{{ url('contact') }}">Contact</a>
+ </nav>
+ {% endblock %}
+
+ {% block hgroup %}
+ <hgroup>
+ {% block blog_title %}<h1><a href="{{ url('homepage') }}">Dev log</a></h1>{% endblock %}
+ {% block blog_tagline %}
+ {% if tags is defined and tags %}
+ <ul>
+ {% for id, tag in tags %}
+ <li><h2><a href="#">Tag</a></h2></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% endblock %}
+ </hgroup>
+ {% endblock %}
+ </header>
+ {% endblock %}
+
+ {% block sidebar %}<aside id="sidebar"></aside>{% endblock %}
+
+ {% block content %}<section id="content"></section>{% endblock %}
+
+ {% block footer %}
+ <footer id="footer">
+ <summary>Copyright 2016</summary> - Raphaël Gertz all rights reserved.
+ </footer>
+ {% endblock %}
+ </section>
+ </body>
+{% endblock %}
--- /dev/null
+{% extends 'RapsysBlogBundle::body.html.twig' %}
+{% block title %}<h1><a href="{{ url('homepage') }}">Dev log</a></h1>{% endblock %}
+{% block content %}TODO: page de contact{% endblock %}
--- /dev/null
+{% extends 'RapsysBlogBundle::body.html.twig' %}
+{% block title %}Welcome!{% endblock %}
+{% block content %}Hello world !{% endblock %}