Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

Commit

Permalink
home bundle, assetic, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
rlbaltha committed Apr 14, 2014
1 parent 0daa2ef commit b679c4a
Show file tree
Hide file tree
Showing 1,616 changed files with 463,901 additions and 51 deletions.
282 changes: 278 additions & 4 deletions .idea/workspace.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ public function registerBundles()
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Vich\UploaderBundle\VichUploaderBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Murky\UserBundle\MurkyUserBundle(),
new Murky\HomeBundle\MurkyHomeBundle(),
);

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
Expand Down
9 changes: 9 additions & 0 deletions app/Resources/FOSUserBundle/views/layout.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends '::base.html.twig' %}

{% block title %}{{ application_name }}{% endblock %}

{% block body %}
<div class="container">
{% block fos_user_content %}{% endblock %}
</div>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% block extends %}
{{ "{% extends '::base.html.twig' %}" }}
{% endblock extends %}

{% block body %}
{{ "{% block body -%}" }}
<h1>{{ entity }} edit</h1>

{{ '{{ form(edit_form) }}' }}

{% set hide_edit, hide_delete = true, false %}
{% include 'crud/views/others/record_actions.html.twig.twig' %}
{{ "{% endblock %}" }}
{% endblock body %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{% block extends %}
{{ "{% extends '::base.html.twig' %}" }}
{% endblock extends %}

{% block body %}
{{ "{% block body -%}" }}
<h1>{{ entity }} list</h1>

<table class="table table-hover">
<thead>
<tr>
{%- for field, metadata in fields %}

<th>{{ field|capitalize }}</th>

{%- endfor %}

<th>Actions</th>
</tr>
</thead>
<tbody>
{{ '{% for entity in entities %}' }}
<tr>

{%- for field, metadata in fields %}
{%- if loop.first and ('show' in actions) %}

<td><a href="{{ "{{ path('" ~ route_name_prefix ~ "_show', { 'id': entity.id }) }}" }}">{{ '{{ entity.' ~ field|replace({'_': ''}) ~ ' }}' }}</a></td>

{%- elseif metadata.type in ['date', 'datetime'] %}

<td>{{ '{% if entity.' ~ field|replace({'_': ''}) ~ ' %}{{ entity.' ~ field|replace({'_': ''}) ~ '|date(\'Y-m-d H:i:s\') }}{% endif %}' }}</td>

{%- else %}

<td>{{ '{{ entity.' ~ field|replace({'_': ''}) ~ ' }}' }}</td>

{%- endif %}

{%- if loop.last %}

<td>
{%- include "crud/views/others/actions.html.twig.twig" %}
</td>

{%- endif %}
{%- endfor %}

</tr>
{{ '{% endfor %}' }}
</tbody>
</table>

{% if 'new' in actions %}
<ul>
<li>
<a class="btn btn-default" href="{{ "{{ path('" ~ route_name_prefix ~ "_new') }}" }}">
Create a new entry
</a>
</li>
</ul>
{% endif %}
{{ "{% endblock %}" }}
{% endblock body %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% block extends %}
{{ "{% extends '::base.html.twig' %}" }}
{% endblock extends %}

{% block body %}
{{ "{% block body -%}" }}
<h1>{{ entity }} creation</h1>

{{ '{{ form(form) }}' }}

{% set hide_edit, hide_delete = true, true %}
{% include 'crud/views/others/record_actions.html.twig.twig' %}
{{ "{% endblock %}" }}
{% endblock body %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<ul>

{%- for action in record_actions %}

<li>
<a class="btn btn-default" href="{{ "{{ path('" ~ route_name_prefix ~ "_" ~ action ~ "', { 'id': entity.id }) }}" }}">{{ action }}</a>
</li>

{%- endfor %}

</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<ul class="record_actions">
<li>
<a href="{{ "{{ path('" ~ route_name_prefix ~ "') }}" }}">
Back to the list
</a>
</li>
{% if ('edit' in actions) and (not hide_edit) %}
<li>
<a class="btn btn-default" href="{{ "{{ path('" ~ route_name_prefix ~ "_edit', { 'id': entity.id }) }}" }}">
Edit
</a>
</li>
{% endif %}
{% if ('delete' in actions) and (not hide_delete) %}
<li>{{ '{{ form(delete_form) }}' }}</li>
{% endif %}
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% block extends %}
{{ "{% extends '::base.html.twig' %}" }}
{% endblock extends %}

{% block body %}
{{ "{% block body -%}" }}
<h1>{{ entity }}</h1>

<table class="table table-hover">
<tbody>
{%- for field, metadata in fields %}

<tr>
<th>{{ field|capitalize }}</th>

{%- if metadata.type in ['date', 'datetime'] %}

<td>{{ '{{ entity.' ~ field|replace({'_': ''}) ~ '|date(\'Y-m-d H:i:s\') }}' }}</td>

{%- else %}

<td>{{ '{{ entity.' ~ field|replace({'_': ''}) ~ ' }}' }}</td>

{%- endif %}

</tr>

{%- endfor %}

</tbody>
</table>

{% set hide_edit, hide_delete = false, false %}
{% include 'crud/views/others/record_actions.html.twig.twig' %}
{{ "{% endblock %}" }}
{% endblock body %}
Binary file added app/Resources/java/cssembed-0.4.5.jar
Binary file not shown.
Binary file added app/Resources/java/yuicompressor-2.4.8.jar
Binary file not shown.
72 changes: 61 additions & 11 deletions app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,63 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
<html xmlns="http://www.w3.org/1999/html">
<head>
<title>{% block title %}Bootstrap 101 Template{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->

{% block stylesheets %}
{% stylesheets '@bootstrap_less' combine=true %}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="{{ asset('bundles/murkyhome/css/local.css') }}">
{% endstylesheets %}
{% endblock %}

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-header col-sm-2">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a name="top"></a>
<a class="navbar-brand" href="#" title="{{ application_name }}">{{ application_name }}</a>
</div>

<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li></li>
<li></li>
{% if is_granted('ROLE_USER') %}
<li><a title="Logout" href="{{ path('fos_user_security_logout') }}">Logout</a></li>
{% endif %}
</ul>
</div>
</nav>

<div class="container">
<div class="col-sm-2 hidden-xs">
<ul class="nav nav-list">

</ul>
</div>
<div class="col-sm-10 hidden-xs">
{{ block('body') }}
</div>
</div>


{% block javascripts %}
{% javascripts '@jquery_js' '@bootstrap_js' filter='?yui_js' combine=true %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
</body>
</html>
94 changes: 88 additions & 6 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,49 @@ framework:
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
globals:
application_name: "Murky"

# Assetic Configuration
assetic:
debug: "%kernel.debug%"
debug: %kernel.debug%
use_controller: false
bundles: [ ]
#java: /usr/bin/java
java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
cssembed:
jar: %kernel.root_dir%/Resources/java/cssembed-0.4.5.jar
yui_js:
jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.8.jar
less:
node: /usr/bin/node
node_paths: [%kernel.root_dir%/../node_modules]
apply_to: "\.less$"
assets:
jquery_js:
inputs:
- '%kernel.root_dir%/../components/jquery/jquery.min.js'
filters: [?yui_js]
bootstrap_js:
inputs:
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/transition.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/alert.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/modal.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/dropdown.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/scrollspy.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/tab.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/tooltip.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/popover.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/button.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/collapse.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/carousel.js'
- '%kernel.root_dir%/../vendor/twbs/bootstrap/js/affix.js'
filters: [?yui_js]
bootstrap_less:
inputs:
- '%kernel.root_dir%/../vendor/twbs/bootstrap/less/bootstrap.less'
filters: [less,cssembed]

# Doctrine Configuration
doctrine:
Expand All @@ -67,3 +97,55 @@ swiftmailer:
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }

fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Murky\UserBundle\Entity\User

# Doctrine extensions
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
timestampable: true
sluggable: true

knp_paginator:
page_range: 5 # default page range used in pagination control
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
template:
pagination: KnpPaginatorBundle:Pagination:sliding.html.twig # sliding pagination controls template
sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template

vich_uploader:
db_driver: orm # or mongodb
twig: true
gaufrette: false # set to true to enable gaufrette support
storage: vich_uploader.storage.file_system
mappings:
property_file:
uri_prefix: %upload_path% # uri prefix to resource
upload_destination: %upload_path% # gaufrette storage fs id, required
namer: namer.upload_file # specify a file namer service id for this entity, null default
directory_namer: directory_namer.upload_file # specify a directory namer service id for this entity, null default
delete_on_remove: true # determines whether to delete file upon removal of entity
inject_on_load: true # determines whether to inject a File instance upon load

ivory_ck_editor:
configs:
editor_default:
startupFocus: true
toolbar: "toolbar_default"
extraPlugins: 'wordcount,mediaembed'
removePlugins: "elementspath"
allowedContent: 'p h2 h3 h4 img{text-align,margin-left}(*); a[!href,target]{*}(*); table th tr td strong em; ol ul li span(*){font-size,font-family,color,background-color}; img[*]{*}; iframe{*}[*];'
disableNativeSpellChecker: false
height: 300
toolbars:
configs:
toolbar_default: [ ['Styles','Bold','Italic','Underline','Strike','JustifyLeft','JustifyCenter','JustifyRight','TextColor','BGColor','FontSize'],['Link','Unlink','NumberedList','BulletedList','Outdent','Indent','Image','MediaEmbed'],[ 'PasteText', 'PasteFromWord', 'Undo', 'Redo','RemoveFormat'] ]
5 changes: 5 additions & 0 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
murky_home:
resource: "@MurkyHomeBundle/Controller/"
type: annotation
prefix: /

murky_user:
resource: "@MurkyUserBundle/Controller/"
type: annotation
Expand Down
Loading

0 comments on commit b679c4a

Please sign in to comment.