浏览代码

FD3-535 se muestra host dhcp en show de cablemodem

Espinoza Guillermo 7 年之前
父节点
当前提交
06f68e4942

+ 18 - 9
src/CablemodemBundle/Admin/CablemodemAdmin.php

@@ -85,19 +85,28 @@ class CablemodemAdmin extends WorkflowBaseAdmin
             ->add('profile')
             ->add('mtaEnabled')
         ;
+        
+        $this->addDHCPTab($showMapper);
+    }
 
+    /**
+     * @param ShowMapper $showMapper
+     */
+    protected function addDHCPTab(ShowMapper $showMapper)
+    {
         if ($showMapper->hasOpenTab()) {
             $showMapper
-                ->end()
-                ->end();
-        }
-        $showMapper
-            ->tab('DHCP')
-            ->with('Host')
-            ->add('host', null, array(
-                'template' => 'CablemodemBundle:CRUD:host_show_field.html.twig',
-            ))
             ->end()
             ->end();
+        }
+        $showMapper
+        ->tab('DHCP')
+        ->with('Host')
+        ->add('host', null, array(
+            'template' => 'CablemodemBundle:CRUD:host_show_field.html.twig',
+        ))
+        ->end()
+        ->end();
     }
+
 }

+ 8 - 0
src/CablemodemBundle/Resources/translations/CablemodemBundle.es.yml

@@ -129,3 +129,11 @@ show:
     label_library: Librería
     label_docs_version: Versión DOCSIS
     label_mta_enabled: MTA Enabled
+
+Mac: Mac
+Options: Opciones
+HostType: Tipo Host
+State: Estado
+active: Activo
+suspended: Suspendido
+disabled: Inactivo

+ 6 - 6
src/CablemodemBundle/Resources/views/CRUD/host_show_field.html.twig

@@ -1,24 +1,24 @@
-{% extends "SonataAdminBundle:CRUD:base_show_field.html.twig" %}
-
 {% set host = get_json('dhcp_host_post_url', { mac: object.mac }) %}
 
 {% block field %}
 {% if host %}
+<td>
 <table class="table">
     <tbody>
         <tr class="sonata-ba-view-container">
-            <th>Mac</th><td>{{ host.mac }}</td>
+            <th>{{ 'Mac'|trans({}, 'CablemodemBundle') }}</th><td>{{ host.mac }}</td>
         </tr>
         <tr class="sonata-ba-view-container">
-            <th>Options</th><td>{{ host.options }}</td>
+            <th>{{ 'Options'|trans({}, 'CablemodemBundle') }}</th><td>{{ host.options }}</td>
         </tr>
         <tr class="sonata-ba-view-container">
-            <th>HostType</th><td>{{ host.hostType.name }}</td>
+            <th>{{ 'HostType'|trans({}, 'CablemodemBundle') }}</th><td>{{ host.hostType.name }}</td>
         </tr>
         <tr class="sonata-ba-view-container">
-            <th>State</th><td>{{ host.state }}</td>
+            <th>{{ 'State'|trans({}, 'CablemodemBundle') }}</th><td>{{ host.state|trans({}, 'CablemodemBundle') }}</td>
         </tr>
     </tbody>
 </table>
+</td>
 {% endif %}
 {% endblock %}