From c492d30be3c1aee603881c9f9392e517ea4885ae Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sun, 23 Oct 2016 00:12:32 +0200 Subject: [PATCH] major refactoring and cleanup --- README.md | 36 +- app/AppKernel.php | 2 +- .../views/Exception/error.html.twig | 2 +- .../views/Exception/error404.html.twig | 2 +- .../views/Exception/error500.html.twig | 2 +- app/Resources/translations/messages.de.xliff | 50 +- .../views/admin/blog/_form.html.twig | 25 - app/Resources/views/admin/blog/edit.html.twig | 26 - .../views/admin/blog/index.html.twig | 57 -- app/Resources/views/admin/blog/new.html.twig | 27 - app/Resources/views/admin/blog/show.html.twig | 48 -- app/Resources/views/admin/layout.html.twig | 9 - app/Resources/views/base.html.twig | 135 +---- .../views/blog/_comment_form.html.twig | 35 -- .../blog/_delete_post_confirmation.html.twig | 19 - app/Resources/views/blog/about.html.twig | 15 - .../views/blog/comment_form_error.html.twig | 11 - app/Resources/views/blog/index.html.twig | 27 - app/Resources/views/blog/post_show.html.twig | 64 -- app/Resources/views/bootstrap.html.twig | 119 ++++ app/Resources/views/dashboard/index.html.twig | 7 + app/Resources/views/menu/admin_menu.html.twig | 1 - app/Resources/views/menu/main_menu.html.twig | 18 - app/Resources/views/security/login.html.twig | 3 +- app/config/config.yml | 5 + app/config/routing.yml | 5 + app/config/services.yml | 12 +- composer.json | 2 +- composer.lock | 172 ++---- src/AppBundle/Command/AddUserCommand.php | 280 --------- src/AppBundle/Command/DeleteUserCommand.php | 149 ----- src/AppBundle/Command/ListUsersCommand.php | 143 ----- .../Controller/Admin/BlogController.php | 222 ------- src/AppBundle/Controller/BlogController.php | 132 ---- .../Controller/DashboardController.php | 39 ++ .../DataFixtures/ORM/LoadFixtures.php | 34 +- src/AppBundle/Entity/Comment.php | 126 ---- ...maiConfiguration.php => Configuration.php} | 19 +- src/AppBundle/Entity/KimaiExpenses.php | 345 ----------- src/AppBundle/Entity/KimaiFixedrates.php | 113 ---- .../Entity/KimaiProjectsActivities.php | 175 ------ src/AppBundle/Entity/KimaiRates.php | 146 ----- src/AppBundle/Entity/KimaiStatuses.php | 66 -- src/AppBundle/Entity/KimaiUsers.php | 562 ------------------ src/AppBundle/Entity/Post.php | 184 ------ src/AppBundle/Entity/User.php | 498 +++++++++++++++- ...imaiPreferences.php => UserPreference.php} | 49 +- .../Event/ConfigureAdminMenuEvent.php | 37 +- .../Event/ConfigureMainMenuEvent.php | 31 +- src/AppBundle/Event/ConfigureMenuEvent.php | 80 +++ src/AppBundle/EventListener/MenuBuilder.php | 120 ++++ src/AppBundle/Form/CommentType.php | 58 -- src/AppBundle/Form/PostType.php | 76 --- src/AppBundle/Menu/MenuBuilder.php | 129 ---- src/AppBundle/Repository/PostRepository.php | 61 -- src/AppBundle/Repository/UserRepository.php | 1 - .../Controller/Admin/BlogControllerTest.php | 75 --- .../Tests/Controller/BlogControllerTest.php | 42 -- .../Controller/DefaultControllerTest.php | 6 +- .../Controller/Admin/TimesheetController.php | 43 ++ .../DataFixtures/ORM/LoadFixtures.php | 9 +- .../Entity/Activity.php} | 48 +- .../Entity/Customer.php} | 101 ++-- .../Entity/Project.php} | 38 +- src/TimesheetBundle/Entity/Timesheet.php | 60 +- src/TimesheetBundle/EventListener/Menu.php | 35 +- .../Resources/views/timesheet/index.html.twig | 52 +- src/TimesheetBundle/TimesheetBundle.php | 11 + web/apple-touch-icon.png | Bin 10784 -> 26164 bytes web/favicon.ico | Bin 1150 -> 1150 bytes 70 files changed, 1304 insertions(+), 4027 deletions(-) delete mode 100644 app/Resources/views/admin/blog/_form.html.twig delete mode 100644 app/Resources/views/admin/blog/edit.html.twig delete mode 100644 app/Resources/views/admin/blog/index.html.twig delete mode 100644 app/Resources/views/admin/blog/new.html.twig delete mode 100644 app/Resources/views/admin/blog/show.html.twig delete mode 100644 app/Resources/views/admin/layout.html.twig delete mode 100644 app/Resources/views/blog/_comment_form.html.twig delete mode 100644 app/Resources/views/blog/_delete_post_confirmation.html.twig delete mode 100644 app/Resources/views/blog/about.html.twig delete mode 100644 app/Resources/views/blog/comment_form_error.html.twig delete mode 100644 app/Resources/views/blog/index.html.twig delete mode 100644 app/Resources/views/blog/post_show.html.twig create mode 100644 app/Resources/views/bootstrap.html.twig create mode 100644 app/Resources/views/dashboard/index.html.twig delete mode 100644 app/Resources/views/menu/admin_menu.html.twig delete mode 100644 app/Resources/views/menu/main_menu.html.twig delete mode 100644 src/AppBundle/Command/AddUserCommand.php delete mode 100644 src/AppBundle/Command/DeleteUserCommand.php delete mode 100644 src/AppBundle/Command/ListUsersCommand.php delete mode 100644 src/AppBundle/Controller/Admin/BlogController.php delete mode 100644 src/AppBundle/Controller/BlogController.php create mode 100644 src/AppBundle/Controller/DashboardController.php delete mode 100644 src/AppBundle/Entity/Comment.php rename src/AppBundle/Entity/{KimaiConfiguration.php => Configuration.php} (91%) delete mode 100644 src/AppBundle/Entity/KimaiExpenses.php delete mode 100644 src/AppBundle/Entity/KimaiFixedrates.php delete mode 100644 src/AppBundle/Entity/KimaiProjectsActivities.php delete mode 100644 src/AppBundle/Entity/KimaiRates.php delete mode 100644 src/AppBundle/Entity/KimaiStatuses.php delete mode 100644 src/AppBundle/Entity/KimaiUsers.php delete mode 100644 src/AppBundle/Entity/Post.php rename src/AppBundle/Entity/{KimaiPreferences.php => UserPreference.php} (84%) create mode 100644 src/AppBundle/Event/ConfigureMenuEvent.php create mode 100644 src/AppBundle/EventListener/MenuBuilder.php delete mode 100644 src/AppBundle/Form/CommentType.php delete mode 100644 src/AppBundle/Form/PostType.php delete mode 100644 src/AppBundle/Menu/MenuBuilder.php delete mode 100644 src/AppBundle/Repository/PostRepository.php delete mode 100644 src/AppBundle/Tests/Controller/Admin/BlogControllerTest.php delete mode 100644 src/AppBundle/Tests/Controller/BlogControllerTest.php create mode 100644 src/TimesheetBundle/Controller/Admin/TimesheetController.php rename src/{AppBundle/Entity/KimaiActivities.php => TimesheetBundle/Entity/Activity.php} (85%) rename src/{AppBundle/Entity/KimaiCustomers.php => TimesheetBundle/Entity/Customer.php} (89%) rename src/{AppBundle/Entity/KimaiProjects.php => TimesheetBundle/Entity/Project.php} (94%) diff --git a/README.md b/README.md index c056436e..9f776993 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,29 @@ -# Kimai - Time Tracking Application +# Kimai v2 - Time Tracking -Kimai v2 - the reloaded open source Time-Tracking application, based on Symfony and powered by PHP. +Kimai v2 - the reloaded open source Time-Tracking application. [![Build Status](https://travis-ci.org/kevinpapst/kimai2.svg?branch=master)](https://travis-ci.org/kevinpapst/kimai2) -Requirements ------------- +## Introduction + +This is the reloaded version of the open source time-tracking application [Kimai](http://www.kimai.org). + +It is based on the following components: + - Symfony Framework 2.x + - AdminLTE Control Panel Template (through the AdminThemeBundle) + +## Requirements * PHP 5.5.9 or higher; * One PHP extension of PDO-SQLite and/or PDO-MySQL enabled; * and the [usual Symfony application requirements](http://symfony.com/doc/current/reference/requirements.html). + * bower (through npm) If unsure about meeting these requirements, download the demo application and browse the `http://localhost:8000/config.php` script to get more detailed information. -Installation ------------- +## Installation [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) @@ -29,6 +36,13 @@ $ cd kimai2/ $ composer install ``` +Lets prepare the environment +```bash +$ php bin/console assets:install --symlink +$ php bin/console avanzu:admin:fetch-vendor +``` + + This was the basic task of the installation. If you have not yet setup a database, you can create it and import example data by executing these commands: ```bash @@ -44,8 +58,7 @@ If you have imported the example data, you can login with two accounts: - Username: *tony_teamlead* / Password: *kitten* / Role: Teamlead - Username: *anna_admin* / Password: *kitten* / Role: Administrator -Usage ------ +## Usage There is no need to configure a virtual host in your web server to access the application. Just use the built-in web server: @@ -65,3 +78,10 @@ terminal. > Kimai, configure it to point at the `web/` directory of the project. > For more details, see: > http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html + +## Troubleshooting + +Cannot see any assets (like images) and/or missing styles? Try executing: +```bash +$ php bin/console assets:install --symlink +``` \ No newline at end of file diff --git a/app/AppKernel.php b/app/AppKernel.php index 76aaef52..2c14036e 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -32,9 +32,9 @@ class AppKernel extends Kernel new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), - new Knp\Bundle\MenuBundle\KnpMenuBundle(), new AppBundle\AppBundle(), new TimesheetBundle\TimesheetBundle(), + new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(), ]; // Bundles only used for development or unit and functional tests diff --git a/app/Resources/TwigBundle/views/Exception/error.html.twig b/app/Resources/TwigBundle/views/Exception/error.html.twig index cc0a883c..05c97565 100644 --- a/app/Resources/TwigBundle/views/Exception/error.html.twig +++ b/app/Resources/TwigBundle/views/Exception/error.html.twig @@ -19,7 +19,7 @@ {{ 'http_error.description'|trans({ '%status_code%': status_code }) }}

- {{ 'http_error.suggestion'|trans({ '%url%': path('blog_index') })|raw }} + {{ 'http_error.suggestion'|trans({ '%url%': path('homepage') })|raw }}

{% endblock %} diff --git a/app/Resources/TwigBundle/views/Exception/error404.html.twig b/app/Resources/TwigBundle/views/Exception/error404.html.twig index 3d9dbced..135e52a6 100644 --- a/app/Resources/TwigBundle/views/Exception/error404.html.twig +++ b/app/Resources/TwigBundle/views/Exception/error404.html.twig @@ -19,7 +19,7 @@ {{ 'http_error_404.description'|trans }}

- {{ 'http_error_404.suggestion'|trans({ '%url%': path('blog_index') })|raw }} + {{ 'http_error_404.suggestion'|trans({ '%url%': path('homepage') })|raw }}

{% endblock %} diff --git a/app/Resources/TwigBundle/views/Exception/error500.html.twig b/app/Resources/TwigBundle/views/Exception/error500.html.twig index d84088d8..a3900645 100644 --- a/app/Resources/TwigBundle/views/Exception/error500.html.twig +++ b/app/Resources/TwigBundle/views/Exception/error500.html.twig @@ -19,7 +19,7 @@ {{ 'http_error_500.description'|trans }}

- {{ 'http_error_500.suggestion'|trans({ '%url%': path('blog_index') })|raw }} + {{ 'http_error_500.suggestion'|trans({ '%url%': path('homepage') })|raw }}

{% endblock %} diff --git a/app/Resources/translations/messages.de.xliff b/app/Resources/translations/messages.de.xliff index 39edb9ad..3b33e011 100644 --- a/app/Resources/translations/messages.de.xliff +++ b/app/Resources/translations/messages.de.xliff @@ -2,6 +2,52 @@ + + browser.title + Kimai - Time Tracking + + + app.title + Kimai + + + + http_error.name + Error + + + http_error.description + Error + + + http_error.suggestion + Error + + + http_error_403.description + Error + + + http_error_403.suggestion + Error + + + http_error_404.description + Error + + + http_error_404.suggestion + Error + + + http_error_405.description + Error + + + http_error_405.suggestion + Error + + action.browse_admin Zum Backend @@ -38,10 +84,6 @@ menu.logout Abmelden - - menu.homepage - Blog - menu.admin Backend diff --git a/app/Resources/views/admin/blog/_form.html.twig b/app/Resources/views/admin/blog/_form.html.twig deleted file mode 100644 index be01ff4a..00000000 --- a/app/Resources/views/admin/blog/_form.html.twig +++ /dev/null @@ -1,25 +0,0 @@ -{# - By default, forms enable client-side validation. This means that you can't - test the server-side validation errors from the browser. To temporarily - disable this validation, add the 'novalidate' attribute: - - {{ form_start(form, { attr: { novalidate: 'novalidate' } }) }} -#} - -{% if show_confirmation|default(false) %} - {% set attr = {'data-confirmation': 'true'} %} - {{ include('blog/_delete_post_confirmation.html.twig') }} -{% endif %} - -{{ form_start(form, { attr: attr|default({}) }) }} - {{ form_widget(form) }} - - - - {% if include_back_to_home_link|default(false) %} - - {{ 'action.back_to_list'|trans }} - - {% endif %} -{{ form_end(form) }} diff --git a/app/Resources/views/admin/blog/edit.html.twig b/app/Resources/views/admin/blog/edit.html.twig deleted file mode 100644 index 5cc40153..00000000 --- a/app/Resources/views/admin/blog/edit.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{% extends 'admin/layout.html.twig' %} - -{% block body_id 'admin_post_edit' %} - -{% block main %} -

{{ 'title.edit_post'|trans({'%id%': post.id}) }}

- - {{ include('admin/blog/_form.html.twig', { - form: edit_form, - button_label: 'action.save'|trans, - include_back_to_home_link: true, - }, with_context = false) }} -{% endblock %} - -{% block sidebar %} -
- {{ include('admin/blog/_form.html.twig', { - form: delete_form, - button_label: 'action.delete_post'|trans, - button_css: 'btn btn-lg btn-block btn-danger', - show_confirmation: true, - }, with_context = false) }} -
- - {{ parent() }} -{% endblock %} diff --git a/app/Resources/views/admin/blog/index.html.twig b/app/Resources/views/admin/blog/index.html.twig deleted file mode 100644 index a658dfb1..00000000 --- a/app/Resources/views/admin/blog/index.html.twig +++ /dev/null @@ -1,57 +0,0 @@ -{% extends 'admin/layout.html.twig' %} - -{% block body_id 'admin_post_index' %} - -{% block main %} -

{{ 'title.post_list'|trans }}

- - - - - - - - - - - - {% for post in posts %} - - - - {# it's not mandatory to set the timezone in localizeddate(). This is done to - avoid errors when the 'intl' PHP extension is not available and the application - is forced to use the limited "intl polyfill", which only supports UTC and GMT #} - - - - {% else %} - - - - {% endfor %} - -
{{ 'label.title'|trans }} {{ 'label.author'|trans }} {{ 'label.published_at'|trans }} {{ 'label.actions'|trans }}
{{ post.title }}{{ post.authorEmail }}{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short', null, 'UTC') }}{% endif %} -
- - {{ 'action.show'|trans }} - - - {% if post.isAuthor(app.user) %} - - {{ 'action.edit'|trans }} - - {% endif %} -
-
{{ 'post.no_posts_found'|trans }}
-{% endblock %} - -{% block sidebar %} - - - {{ parent() }} -{% endblock %} diff --git a/app/Resources/views/admin/blog/new.html.twig b/app/Resources/views/admin/blog/new.html.twig deleted file mode 100644 index 6981b5b0..00000000 --- a/app/Resources/views/admin/blog/new.html.twig +++ /dev/null @@ -1,27 +0,0 @@ -{% extends 'admin/layout.html.twig' %} - -{% block body_id 'admin_post_new' %} - -{% block main %} -

{{ 'title.post_new'|trans }}

- - {{ form_start(form) }} - {{ form_row(form.title) }} - {{ form_row(form.summary) }} - {{ form_row(form.content) }} - {{ form_row(form.authorEmail) }} - {{ form_row(form.publishedAt) }} - - - - {{ form_widget(form.saveAndCreateNew, { label: 'label.save_and_create_new', attr: { class: 'btn btn-primary' } }) }} - - - {{ 'action.back_to_list'|trans }} - - {{ form_end(form) }} -{% endblock %} - -{% block sidebar %} - {{ parent() }} -{% endblock %} diff --git a/app/Resources/views/admin/blog/show.html.twig b/app/Resources/views/admin/blog/show.html.twig deleted file mode 100644 index d74022a8..00000000 --- a/app/Resources/views/admin/blog/show.html.twig +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'admin/layout.html.twig' %} - -{% block body_id 'admin_post_show' %} - -{% block main %} -

{{ post.title }}

- - - - - - - - - - - - - - - - - - {# it's not mandatory to set the timezone in localizeddate(). This is done to - avoid errors when the 'intl' PHP extension is not available and the application - is forced to use the limited "intl polyfill", which only supports UTC and GMT #} - - - -
{{ 'label.summary'|trans }}{{ post.summary|md2html }}
{{ 'label.content'|trans }}{{ post.content|md2html }}
{{ 'label.author'|trans }}

{{ post.authorEmail }}

{{ 'label.published_at'|trans }}

{{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}

-{% endblock %} - -{% block sidebar %} - - -
- {{ include('admin/blog/_form.html.twig', { - form: delete_form, - button_label: 'action.delete_post'|trans, - button_css: 'btn btn-lg btn-block btn-danger', - show_confirmation: true, - }, with_context = false) }} -
-{% endblock %} diff --git a/app/Resources/views/admin/layout.html.twig b/app/Resources/views/admin/layout.html.twig deleted file mode 100644 index 4d768752..00000000 --- a/app/Resources/views/admin/layout.html.twig +++ /dev/null @@ -1,9 +0,0 @@ -{# - This is the base template of the all backend pages. - See http://symfony.com/doc/current/book/templating.html#template-inheritance-and-layouts -#} -{% extends 'base.html.twig' %} - -{% block header_navigation_links %} - {{ knp_menu_render('admin', {'template': 'menu/admin_menu.html.twig'}) }} -{% endblock %} diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index db05f320..05dda3e6 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -1,122 +1,33 @@ - - - - - - {% block title %}Symfony Demo application{% endblock %} +{% extends 'AvanzuAdminThemeBundle:layout:base-layout.html.twig' %} - {% block stylesheets %} - {# uncomment the following lines to compile SCSS assets with Assetic +{% block page_content %} + {% block main %} + {% endblock %} +{% endblock %} - {% stylesheets filter="scssphp" output="css/app.css" - "%kernel.root_dir%/Resources/assets/scss/bootstrap-flatly.scss" - "%kernel.root_dir%/Resources/assets/scss/font-awesome.scss" - "%kernel.root_dir%/Resources/assets/css/*.css" - "%kernel.root_dir%/Resources/assets/scss/main.scss" - %} - - {% endstylesheets %} - #} +{% block flash_messages %} + {{ include('default/_flash_messages.html.twig') }} +{% endblock %} - - {% endblock %} + +{# + {% block title %}{{ 'browser.title'|trans }}{% endblock %} - - + - {% block header %} -
- -
- {% endblock %} - -
- {% block body %} -
-
- {{ include('default/_flash_messages.html.twig') }} - - {% block main %}{% endblock %} -
-
- {% endblock %} -
- - {% block footer %} -
-
-
- - -
-
-
- {% endblock %} - - {% block javascripts %} - {# uncomment the following lines to combine and minimize JavaScript assets with Assetic - {% javascripts filter="?jsqueeze" output="js/app.js" - "%kernel.root_dir%/Resources/assets/js/jquery-2.1.4.js" - "%kernel.root_dir%/Resources/assets/js/moment.min.js" - "%kernel.root_dir%/Resources/assets/js/bootstrap-3.3.4.js" - "%kernel.root_dir%/Resources/assets/js/highlight.pack.js" - "%kernel.root_dir%/Resources/assets/js/bootstrap-datetimepicker.min.js" - "%kernel.root_dir%/Resources/assets/js/main.js" %} - - {% endjavascripts %} - #} - - - {% endblock %} - - {# it's not mandatory to set the timezone in localizeddate(). This is done to - avoid errors when the 'intl' PHP extension is not available and the application - is forced to use the limited "intl polyfill", which only supports UTC and GMT #} - - - +#} \ No newline at end of file diff --git a/app/Resources/views/blog/_comment_form.html.twig b/app/Resources/views/blog/_comment_form.html.twig deleted file mode 100644 index 0f010a8a..00000000 --- a/app/Resources/views/blog/_comment_form.html.twig +++ /dev/null @@ -1,35 +0,0 @@ -{# - By default, forms enable client-side validation. This means that you can't - test the server-side validation errors from the browser. To temporarily - disable this validation, add the 'novalidate' attribute: - - {{ form_start(form, { method: ..., action: ..., attr: { novalidate: 'novalidate' } }) }} -#} - -{{ form_start(form, { method: 'POST', action: path('comment_new', { 'postSlug': post.slug }) }) }} - {# instead of displaying form fields one by one, you can also display them - all with their default options and styles just by calling to this function: - - {{ form_widget(form) }} - #} - -
- {{ 'title.add_comment'|trans }} - - {# Render any global form error (e.g. when a constraint on a public getter method failed) #} - {{ form_errors(form) }} - -
- {{ form_label(form.content, 'label.content', { label_attr: { class: 'hidden' }}) }} - - {# Render any errors for the "content" field (e.g. when a class property constraint failed) #} - {{ form_errors(form.content) }} - - {{ form_widget(form.content, { attr: { rows: 10 } }) }} -
- -
- -
-
-{{ form_end(form) }} diff --git a/app/Resources/views/blog/_delete_post_confirmation.html.twig b/app/Resources/views/blog/_delete_post_confirmation.html.twig deleted file mode 100644 index 68d043f1..00000000 --- a/app/Resources/views/blog/_delete_post_confirmation.html.twig +++ /dev/null @@ -1,19 +0,0 @@ -{# Bootstrap modal, see http://getbootstrap.com/javascript/#modals #} - diff --git a/app/Resources/views/blog/about.html.twig b/app/Resources/views/blog/about.html.twig deleted file mode 100644 index 6e402f7e..00000000 --- a/app/Resources/views/blog/about.html.twig +++ /dev/null @@ -1,15 +0,0 @@ -
-
-

- {{ 'help.app_description'|trans|raw }} -

-

- {{ 'help.more_information'|trans|raw }} -

-
-
- -{# it's not mandatory to set the timezone in localizeddate(). This is done to - avoid errors when the 'intl' PHP extension is not available and the application - is forced to use the limited "intl polyfill", which only supports UTC and GMT #} - diff --git a/app/Resources/views/blog/comment_form_error.html.twig b/app/Resources/views/blog/comment_form_error.html.twig deleted file mode 100644 index 67c2517b..00000000 --- a/app/Resources/views/blog/comment_form_error.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block body_id 'comment_form_error' %} - -{% block main %} -

{{ 'title.comment_error'|trans }}

- -
- {{ include('blog/_comment_form.html.twig') }} -
-{% endblock %} diff --git a/app/Resources/views/blog/index.html.twig b/app/Resources/views/blog/index.html.twig deleted file mode 100644 index 173881dd..00000000 --- a/app/Resources/views/blog/index.html.twig +++ /dev/null @@ -1,27 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block body_id 'blog_index' %} - -{% block main %} - {% for post in posts %} - - {% else %} -
{{ 'post.no_posts_found'|trans }}
- {% endfor %} - - -{% endblock %} - -{% block sidebar %} - {{ parent() }} -{% endblock %} diff --git a/app/Resources/views/blog/post_show.html.twig b/app/Resources/views/blog/post_show.html.twig deleted file mode 100644 index ebef170d..00000000 --- a/app/Resources/views/blog/post_show.html.twig +++ /dev/null @@ -1,64 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block body_id 'blog_post_show' %} - -{% block main %} -

{{ post.title }}

- - {{ post.content|md2html }} - -
- {# The 'IS_AUTHENTICATED_FULLY' role ensures that the user has entered - his/her credentials (login + password) during this session. If he/she - is automatically logged via the 'Remember Me' functionality, he/she won't - be able to add a comment. - See http://symfony.com/doc/current/cookbook/security/remember_me.html#forcing-the-user-to-re-authenticate-before-accessing-certain-resources - #} - {% if is_granted('IS_AUTHENTICATED_FULLY') %} - {{ render(controller('AppBundle:Blog:commentForm', { 'id': post.id })) }} - {% else %} -

- - {{ 'action.sign_in'|trans }} - - {{ 'post.to_publish_a_comment'|trans }} -

- {% endif %} -
- -

{{ 'post.num_comments'|transchoice(post.comments|length) }}

- - {% for comment in post.comments %} -
-

- {{ comment.authorEmail }} {{ 'post.commented_on'|trans }} - {# it's not mandatory to set the timezone in localizeddate(). This is done to - avoid errors when the 'intl' PHP extension is not available and the application - is forced to use the limited "intl polyfill", which only supports UTC and GMT #} - {{ comment.publishedAt|localizeddate('medium', 'short', null, 'UTC') }} -

-
- {{ comment.content|md2html }} -
-
- {% else %} -
-

{{ 'post.no_comments'|trans }}

-
- {% endfor %} -{% endblock %} - -{% block sidebar %} - {% if app.user and post.isAuthor(app.user) %} - - {% endif %} - - {# the parent() function includes the contents defined by the parent template - ('base.html.twig') for this block ('sidebar'). This is a very convenient way - to share common contents in different templates #} - {{ parent() }} -{% endblock %} diff --git a/app/Resources/views/bootstrap.html.twig b/app/Resources/views/bootstrap.html.twig new file mode 100644 index 00000000..d53a62ee --- /dev/null +++ b/app/Resources/views/bootstrap.html.twig @@ -0,0 +1,119 @@ + + + + + + {% block title %}{{ 'browser.title'|trans }}{% endblock %} + + {% block stylesheets %} + {# uncomment the following lines to compile SCSS assets with Assetic + + {% stylesheets filter="scssphp" output="css/app.css" + "%kernel.root_dir%/Resources/assets/scss/bootstrap-flatly.scss" + "%kernel.root_dir%/Resources/assets/scss/font-awesome.scss" + "%kernel.root_dir%/Resources/assets/css/*.css" + "%kernel.root_dir%/Resources/assets/scss/main.scss" + %} + + {% endstylesheets %} + #} + + + {% endblock %} + + + + + +{% block header %} +
+ +
+{% endblock %} + +
+ {% block body %} +
+
+ {{ include('default/_flash_messages.html.twig') }} + + {% block main %}{% endblock %} +
+
+ {% endblock %} +
+ +{% block footer %} +
+
+
+ + +
+
+
+{% endblock %} + +{% block javascripts %} + {# uncomment the following lines to combine and minimize JavaScript assets with Assetic + {% javascripts filter="?jsqueeze" output="js/app.js" + "%kernel.root_dir%/Resources/assets/js/jquery-2.1.4.js" + "%kernel.root_dir%/Resources/assets/js/moment.min.js" + "%kernel.root_dir%/Resources/assets/js/bootstrap-3.3.4.js" + "%kernel.root_dir%/Resources/assets/js/highlight.pack.js" + "%kernel.root_dir%/Resources/assets/js/bootstrap-datetimepicker.min.js" + "%kernel.root_dir%/Resources/assets/js/main.js" %} + + {% endjavascripts %} + #} + + +{% endblock %} + +{# it's not mandatory to set the timezone in localizeddate(). This is done to + avoid errors when the 'intl' PHP extension is not available and the application + is forced to use the limited "intl polyfill", which only supports UTC and GMT #} + + + diff --git a/app/Resources/views/dashboard/index.html.twig b/app/Resources/views/dashboard/index.html.twig new file mode 100644 index 00000000..4635af83 --- /dev/null +++ b/app/Resources/views/dashboard/index.html.twig @@ -0,0 +1,7 @@ +{% extends 'base.html.twig' %} + +{% block page_title %}Dashboard{% endblock %} +{% block page_subtitle %}Welcome!{% endblock %} + +{% block main %} +{% endblock %} diff --git a/app/Resources/views/menu/admin_menu.html.twig b/app/Resources/views/menu/admin_menu.html.twig deleted file mode 100644 index df9eba8e..00000000 --- a/app/Resources/views/menu/admin_menu.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% extends 'menu/main_menu.html.twig' %} diff --git a/app/Resources/views/menu/main_menu.html.twig b/app/Resources/views/menu/main_menu.html.twig deleted file mode 100644 index e8d22d6f..00000000 --- a/app/Resources/views/menu/main_menu.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% extends 'knp_menu.html.twig' %} - -{% block linkElement %} - - {% if item.childrenAttributes.icon is defined %} - - {% endif %} - {{ block('label') }} - -{% endblock %} - -{% block label %} - {% if options.allow_safe_labels and item.getExtra('safe_label', false) %} - {{ item.label|raw }} - {% else %} - {{ item.label|trans }} - {% endif %} -{% endblock %} diff --git a/app/Resources/views/security/login.html.twig b/app/Resources/views/security/login.html.twig index 9361297a..fdad8b35 100644 --- a/app/Resources/views/security/login.html.twig +++ b/app/Resources/views/security/login.html.twig @@ -1,4 +1,4 @@ -{% extends 'base.html.twig' %} +{% extends 'bootstrap.html.twig' %} {% block body_id 'login' %} @@ -40,6 +40,7 @@ {{ parent() }}