This symfony1 plugin provides a dashboard/menu and a theme for the admin generator for your backend. It is based on the Twitter Bootstrap. It works with Propel or Doctrine. The generated dashboard/menu is based on the great sfAdminDashPlugin.
For a Propel
use, you will have to install sfPropelORMPlugin instead of sfPropelPlugin.
You might need sfGuardPlugin (or sfDoctrineGuardPlugin) for the user management.
Preview of list:
Preview of edit:
Preview of login:
In config/ProjectConfiguration.class.php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('sfTwitterBootstrapPlugin');
...
In apps/backend/config/view.yml
default:
stylesheets:
- /sfTwitterBootstrapPlugin/bootstrap/bootstrap.css
- /sfTwitterBootstrapPlugin/css/style.css
- /sfTwitterBootstrapPlugin/css/jquery-ui-1.8.16.custom.css # For date pickers ...
- main.css
javascripts:
- "/sfTwitterBootstrapPlugin/js/jquery-1.7.min.js"
- "/sfTwitterBootstrapPlugin/js/jquery.tablesorter.min.js"
- "/sfTwitterBootstrapPlugin/js/google-code-prettify/prettify.js"
- "/sfTwitterBootstrapPlugin/bootstrap/js/bootstrap-dropdown.js"
- "/sfTwitterBootstrapPlugin/bootstrap/js/bootstrap-twipsy.js"
- "/sfTwitterBootstrapPlugin/bootstrap/js/bootstrap-scrollspy.js"
- "/sfTwitterBootstrapPlugin/bootstrap/js/bootstrap-modal.js"
- "/sfTwitterBootstrapPlugin/js/application.js"
- "/sfTwitterBootstrapPlugin/js/bootbox/bootbox.min.js"
- "/sfTwitterBootstrapPlugin/js/jquery-ui-1.8.16.custom.min.js" # For date pickers ...
layout: %SF_PLUGINS_DIR%/sfTwitterBootstrapPlugin/templates/layout
If you want to active colors by env add stylesheet :
default:
stylesheets:
- /sfTwitterBootstrapPlugin/css/color-my-env.css
In apps/backend/config/app.yml
all:
sf_twitter_bootstrap:
site: Your project name
# if you want top links to fieldset legend in new/edit page (like "Admin & Content" in the edit screenshot)
top_link_to_fieldset: true
# if you *also* want to display the pagination on top of the list
display_top_pagination: true
In apps/backend/config/settings.yml
all:
.settings:
enabled_modules: [default, sfTwitterBootstrap, ...]
Configure the form formatter :
In apps/backend/config/backendConfiguration.class.php
class backendConfiguration extends sfApplicationConfiguration
{
public function configure()
{
sfWidgetFormSchema::setDefaultFormFormatterName('TwitterBootstrap');
}
}
Change the theme value to :
generator:
...
param:
...
theme: twitter
...
Edit view.yml
default:
components:
sf_twitter_bootstrap_permanent_slot: [ Module, component ]
In your form class :
$formatterObj = $this->widgetSchema->getFormFormatter();
$formatterObj->setValidatorSchema($this->getValidatorSchema());
Of course, if you are using an admin generator it's automatic !!
Overwrite the signinSuccess into apps/backend/modules/sfGuardAuth/templates/signinSuccess.php
<?php include_partial('sfTwitterBootstrap/login', array('form' => $form)); ?>
You can follow Step 3 to Step 5 from the readme file of sfAdminDashPlugin to setup dashboard / menu items.
We use different icons in comparison to sfAdminDash. Check the folder images
.
generator:
...
config:
...
edit:
...
partial: ['module/partial']
Some partials are bundeled with the plugin :
- versionable:
propel_behaviors/versionable_version_list
- auditable:
propel_behaviors/auditable_log_list
missing : Timestampable, Geocodable, I18n, Taggable, Ratable, Commentable, NestedSet, Sluggable