소스 검색

Merge pull request #452 from sushicodeur/5a2568153715f386a62f33a542f47c67599221f6

Fixes styles in show views
Thomas 13 년 전
부모
커밋
bf058419e7
3개의 변경된 파일45개의 추가작업 그리고 4개의 파일을 삭제
  1. 13 2
      Admin/Admin.php
  2. 1 1
      Admin/AdminExtensionInterface.php
  3. 31 1
      Resources/public/css/layout.css

+ 13 - 2
Admin/Admin.php

@@ -68,7 +68,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     private $show;
 
     /**
-     * The show FieldDescription constructed from the configureShowField method
+     * The show FieldDescription constructed from the configureShowFields method
      *
      * @var array
      */
@@ -395,6 +395,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     }
 
     /**
+     * @deprecated Use configureShowFields instead.
      * @param \Sonata\AdminBundle\Show\ShowMapper $filter
      * @return void
      */
@@ -403,6 +404,15 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
 
     }
 
+    /**
+     * @param \Sonata\AdminBundle\Show\ShowMapper $filter
+     * @return void
+     */
+    protected function configureShowFields(ShowMapper $filter)
+    {
+
+    }
+
     /**
      * configure the Admin routes
      *
@@ -550,7 +560,8 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         $collection = new FieldDescriptionCollection();
         $mapper = new ShowMapper($this->showBuilder, $collection, $this);
 
-        $this->configureShowField($mapper);
+        $this->configureShowField($mapper); // deprecated, use configureShowFields instead
+        $this->configureShowFields($mapper);
 
         $this->show = $collection;
     }

+ 1 - 1
Admin/AdminExtensionInterface.php

@@ -48,7 +48,7 @@ interface AdminExtensionInterface
      * @param \Sonata\AdminBundle\Show\ShowMapper $filter
      * @return void
      */
-    function configureShowField(ShowMapper $filter);
+    function configureShowFields(ShowMapper $filter);
 
     /**
      * @abstract

+ 31 - 1
Resources/public/css/layout.css

@@ -178,4 +178,34 @@ div.sonata-medium-date div {
 .sonata-ba-field-inline-table textarea.sonata-medium,
 .sonata-ba-field-inline-table input.sonata-medium {
     width: 150px;
-}
+}
+
+.sonata-ba-view-title {
+  font-size:19.5px;
+  line-height:1;
+  color:#404040;
+  *padding:0 0 5px 0;
+  *line-height:1.5;
+}
+
+.sonata-ba-view-title td, .sonata-ba-view-title th {
+  border:0;
+}
+
+.sonata-ba-view-container th {
+  width:130px;
+}
+
+.sonata-ba-view-container td, .sonata-ba-view-container th {
+  border-bottom:0;
+  border-top: 1px solid #eee;
+}
+
+.sonata-ba-view-container:nth-child(2n) td, .sonata-ba-view-container:nth-child(2n) th {
+  background-color:#f9f9f9;
+}
+
+.sonata-ba-view-container:nth-child(2n):hover td, .sonata-ba-view-container:nth-child(2n):hover th {
+  background-color:#f5f5f5;
+}
+