From 93fd4692f6eb753cae16358131c8049d84cfbb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 22 Jan 2015 08:30:07 +0100 Subject: symfony is there --- .../Resources/views/Demo/contact.html.twig | 15 ++++ .../Resources/views/Demo/hello.html.twig | 9 +++ .../Resources/views/Demo/index.html.twig | 14 ++++ .../Resources/views/Secured/hello.html.twig | 11 +++ .../Resources/views/Secured/helloadmin.html.twig | 9 +++ .../Resources/views/Secured/layout.html.twig | 6 ++ .../Resources/views/Secured/login.html.twig | 35 +++++++++ .../Resources/views/Welcome/index.html.twig | 83 ++++++++++++++++++++++ .../DemoBundle/Resources/views/layout.html.twig | 37 ++++++++++ 9 files changed, 219 insertions(+) create mode 100644 src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Demo/index.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Secured/login.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig create mode 100644 src/Acme/DemoBundle/Resources/views/layout.html.twig (limited to 'src/Acme/DemoBundle/Resources/views') diff --git a/src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig b/src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig new file mode 100644 index 00000000..e5b7523b --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig @@ -0,0 +1,15 @@ +{% extends "AcmeDemoBundle::layout.html.twig" %} + +{% block title "Symfony - Contact form" %} + +{% block content %} +
+ {{ form_errors(form) }} + + {{ form_row(form.email) }} + {{ form_row(form.message) }} + + {{ form_rest(form) }} + +
+{% endblock %} diff --git a/src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig b/src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig new file mode 100644 index 00000000..3997ff60 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig @@ -0,0 +1,9 @@ +{% extends "AcmeDemoBundle::layout.html.twig" %} + +{% block title "Hello " ~ name %} + +{% block content %} +

Hello {{ name }}!

+{% endblock %} + +{% set code = code(_self) %} diff --git a/src/Acme/DemoBundle/Resources/views/Demo/index.html.twig b/src/Acme/DemoBundle/Resources/views/Demo/index.html.twig new file mode 100644 index 00000000..454a3203 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Demo/index.html.twig @@ -0,0 +1,14 @@ +{% extends "AcmeDemoBundle::layout.html.twig" %} + +{% block title "Symfony - Demos" %} + +{% block content_header '' %} + +{% block content %} +

Available demos

+ +{% endblock %} diff --git a/src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig b/src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig new file mode 100644 index 00000000..faf95cf8 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig @@ -0,0 +1,11 @@ +{% extends "AcmeDemoBundle:Secured:layout.html.twig" %} + +{% block title "Hello " ~ name %} + +{% block content %} +

Hello {{ name }}!

+ + Hello resource secured for admin only. +{% endblock %} + +{% set code = code(_self) %} diff --git a/src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig b/src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig new file mode 100644 index 00000000..4e3649f7 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig @@ -0,0 +1,9 @@ +{% extends "AcmeDemoBundle:Secured:layout.html.twig" %} + +{% block title "Hello " ~ name %} + +{% block content %} +

Hello {{ name }} secured for Admins only!

+{% endblock %} + +{% set code = code(_self) %} diff --git a/src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig b/src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig new file mode 100644 index 00000000..aeea55c5 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig @@ -0,0 +1,6 @@ +{% extends "AcmeDemoBundle::layout.html.twig" %} + +{% block content_header_more %} + {{ parent() }} +
  • logged in as {{ app.user ? app.user.username : 'Anonymous' }} - Logout
  • +{% endblock %} diff --git a/src/Acme/DemoBundle/Resources/views/Secured/login.html.twig b/src/Acme/DemoBundle/Resources/views/Secured/login.html.twig new file mode 100644 index 00000000..3e76d1df --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Secured/login.html.twig @@ -0,0 +1,35 @@ +{% extends 'AcmeDemoBundle::layout.html.twig' %} + +{% block content %} +

    Login

    + +

    + Choose between two default users: user/userpass (ROLE_USER) or admin/adminpass (ROLE_ADMIN) +

    + + {% if error %} +
    {{ error.message }}
    + {% endif %} + +
    +
    + + +
    + +
    + + +
    + + +
    +{% endblock %} + +{% set code = code(_self) %} diff --git a/src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig b/src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig new file mode 100644 index 00000000..ea3a7299 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig @@ -0,0 +1,83 @@ +{% extends 'AcmeDemoBundle::layout.html.twig' %} + +{% block title %}Symfony - Welcome{% endblock %} + +{% block content_header '' %} + +{% block content %} + {% set version = constant('Symfony\\Component\\HttpKernel\\Kernel::MAJOR_VERSION') ~ '.' ~ constant('Symfony\\Component\\HttpKernel\\Kernel::MINOR_VERSION')%} + +

    Welcome!

    + +

    Congratulations! You have successfully installed a new Symfony application.

    + +
    + + {% if app.environment == 'dev' %} + + {% endif %} + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +{% endblock %} diff --git a/src/Acme/DemoBundle/Resources/views/layout.html.twig b/src/Acme/DemoBundle/Resources/views/layout.html.twig new file mode 100644 index 00000000..d7e97d56 --- /dev/null +++ b/src/Acme/DemoBundle/Resources/views/layout.html.twig @@ -0,0 +1,37 @@ +{% extends "TwigBundle::layout.html.twig" %} + +{% block head %} + + +{% endblock %} + +{% block title 'Demo Bundle' %} + +{% block body %} + {% for flashMessage in app.session.flashbag.get('notice') %} +
    + Notice: {{ flashMessage }} +
    + {% endfor %} + + {% block content_header %} + + +
    + {% endblock %} + +
    + {% block content %}{% endblock %} +
    + + {% if code is defined %} +

    Code behind this page

    +
    +
    {{ code|raw }}
    +
    + {% endif %} +{% endblock %} -- cgit v1.2.3