bgcc/sf-bootstrap-propel-admin-theme-plugin

基于 Bootstrap 的 symfony 1 针对 propel 1.6+ 的管理员生成器主题

1.0.5 2015-04-30 15:01 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:03:00 UTC


README

License Total Downloads Monthly Downloads Daily Downloads

描述

sfBootstrapPropelAdminThemePlugin 是一个 symfony 1.4 插件,提供基于 Bootstrap 3 的管理员主题,适用于 Propel 1.5+。所有图标都已替换为 Font Awesome

截图

可用截图

  • 登录
  • 导航
  • 列表
  • 响应式列表
  • 带有标签页的表单(第一个标签页选中)
  • 带有标签页的表单(第二个标签页选中)
  • 带有标签页和错误的表单(第二个标签页选中)
  • 响应式表单

http://imgur.com/a/Smu3G 下查看画廊。

特性

  • 来自 sfPropelORMPlugin 的 admin15 主题的完整特性
  • 附加特性
    • 基于会话的列表项批量选择(在导航时保持选择)
    • 通过 settings.yml 覆盖默认设置
    • 根据模块和操作更改页面标题
    • 表单内的分页
    • 增强的 generator.yml,带有标签页和面板
  • 响应式布局
  • Bootstrap 3
  • Font Awesome
  • Bootstrap 3 优化的小部件
  • 自动添加必要的 CSS 类到筛选器和表单小部件

要求

通过 Composer 安装

{
    "require": {
        "bgcc/sf-bootstrap-propel-admin-theme-plugin": "dev-master"
    }
}

通过 Git 安装

  • 安装插件并初始化子模块

    $ git submodule add git://github.com/bgcc/sfBootstrapPropelAdminThemePlugin.git plugins/sfBootstrapPropelAdminThemePlugin
    $ git submodule update --init --recursive
    

设置

  • 在您的 /config/ProjectConfiguration.class.php 中启用插件

    $this->enablePlugins('sfBootstrapPropelAdminThemePlugin');
  • 发布资源

    $ ./symfony plugin:publish-assets
    
  • 清除缓存

    $ ./symfony cc
    
  • 请查看插件中的配置文件夹,其中有 view.yml(用于应用程序)和 generator.yml 的示例。

  • 在您的 application_name/config/settings.yml 中启用模块

    all:
      .settings:
        enabled_modules:        [ theme ]
  • 使用 Bootstrap 主题生成 propel 管理员模块

    $ ./symfony propel:generate-admin --theme="bootstrap" application_name ModelName
    

包含的小部件

  • sfWidgetFormBootstrap3I18nNumber:带可选输入组的输入小部件,基于给定文化格式化数字。

    $this->setWidget('widget_name', new sfWidgetFormBootstrap3I18nNumber(array('culture' => 'de', 'prepend' => '')));
  • sfWidgetFormBootstrap3Input:带可选输入组的输入小部件,基于给定文化格式化数字。

    $this->setWidget('widget_name', new sfWidgetFormBootstrap3Input(array('append' => '')));
  • sfWidgetFormBootstrap3SelectCheckbox:扩展多选小部件的渲染类。

    $this->setWidget('widget_name', new sfWidgetFormChoice(array(
        'choices'        => $choices,
        'expanded'       => true,
        'multiple'       => true,
        'renderer_class' => 'sfWidgetFormBootstrap3SelectCheckbox'
    )));
  • sfWidgetFormBootstrap3SelectRadio:扩展选择小部件的渲染类。

    $this->setWidget('widget_name', new sfWidgetFormChoice(array(
        'choices'        => $choices,
        'expanded'       => true,
        'renderer_class' => 'sfWidgetFormBootstrap3SelectRadio'
    )));

附加功能

  • 检查 plugins/sfBootstrapPropelAdminThemePlugin/modules/theme/templates/signinSuccess.php 中的 signinSuccess.php,以获取漂亮的登录页面。将内容复制到您登录操作的模板中,并根据需要修改它。

  • 修改您登录操作所在的模块的 view.yml 并添加

    signinSuccess:
        layout:       %sf_plugins_dir%/sfBootstrapPropelAdminThemePlugin/templates/login

贡献

  • 欢迎问题和拉取请求。
  • 如果您有功能请求或问题,请随意打开一个问题。