From 3d59b19a21d5cd2c6c33e3ec344210a5960976a7 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 5 Jan 2014 14:45:09 +0100 Subject: [PATCH] added classes to grid, list and detail view to allow specific styling also fixed an issue with gridview sort indicator css. fixes #1000 --- apps/advanced/backend/web/css/site.css | 4 ++++ apps/advanced/frontend/web/css/site.css | 4 ++++ apps/basic/web/css/site.css | 4 ++++ framework/yii/grid/GridView.php | 5 +++++ framework/yii/widgets/DetailView.php | 2 +- framework/yii/widgets/ListView.php | 5 +++++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/advanced/backend/web/css/site.css b/apps/advanced/backend/web/css/site.css index f460b45..66be560 100644 --- a/apps/advanced/backend/web/css/site.css +++ b/apps/advanced/backend/web/css/site.css @@ -60,6 +60,10 @@ a.desc:after { content: "\e156"; } +.grid-view th { + white-space: nowrap; +} + .hint-block { display: block; margin-top: 5px; diff --git a/apps/advanced/frontend/web/css/site.css b/apps/advanced/frontend/web/css/site.css index f460b45..66be560 100644 --- a/apps/advanced/frontend/web/css/site.css +++ b/apps/advanced/frontend/web/css/site.css @@ -60,6 +60,10 @@ a.desc:after { content: "\e156"; } +.grid-view th { + white-space: nowrap; +} + .hint-block { display: block; margin-top: 5px; diff --git a/apps/basic/web/css/site.css b/apps/basic/web/css/site.css index f460b45..66be560 100644 --- a/apps/basic/web/css/site.css +++ b/apps/basic/web/css/site.css @@ -60,6 +60,10 @@ a.desc:after { content: "\e156"; } +.grid-view th { + white-space: nowrap; +} + .hint-block { display: block; margin-top: 5px; diff --git a/framework/yii/grid/GridView.php b/framework/yii/grid/GridView.php index 35d89b2..e270974 100644 --- a/framework/yii/grid/GridView.php +++ b/framework/yii/grid/GridView.php @@ -49,6 +49,11 @@ class GridView extends BaseListView */ public $tableOptions = ['class' => 'table table-striped table-bordered']; /** + * @var array the HTML attributes for the container tag of the grid view. + * The "tag" element specifies the tag name of the container element and defaults to "div". + */ + public $options = ['class' => 'grid-view']; + /** * @var array the HTML attributes for the table header row */ public $headerRowOptions = []; diff --git a/framework/yii/widgets/DetailView.php b/framework/yii/widgets/DetailView.php index 8ced307..3a45a4e 100644 --- a/framework/yii/widgets/DetailView.php +++ b/framework/yii/widgets/DetailView.php @@ -90,7 +90,7 @@ class DetailView extends Widget * @var array the HTML attributes for the container tag of this widget. The "tag" option specifies * what container tag should be used. It defaults to "table" if not set. */ - public $options = ['class' => 'table table-striped table-bordered']; + public $options = ['class' => 'table table-striped table-bordered detail-view']; /** * @var array|Formatter the formatter used to format model attribute values into displayable texts. * This can be either an instance of [[Formatter]] or an configuration array for creating the [[Formatter]] diff --git a/framework/yii/widgets/ListView.php b/framework/yii/widgets/ListView.php index c112554..43eaab4 100644 --- a/framework/yii/widgets/ListView.php +++ b/framework/yii/widgets/ListView.php @@ -52,6 +52,11 @@ class ListView extends BaseListView * @var string the HTML code to be displayed between any two consecutive items. */ public $separator = "\n"; + /** + * @var array the HTML attributes for the container tag of the list view. + * The "tag" element specifies the tag name of the container element and defaults to "div". + */ + public $options = ['class' => 'list-view']; /**