Show view modify

57 views
Skip to first unread message

Cesar Cardenas

unread,
Nov 19, 2013, 12:40:24 PM11/19/13
to symfony2adm...@googlegroups.com
Hi, im having troubles with the show template and tabs,im using last version of symfony 2.3.7 and last version of admingeneratorbudnle, the problem comes when i try to use tabs all the fields in the show display on right side like in the image, besides i need to add info of other entity  to my show and i cant find any information about this, as an example y have a pays entity and a need to show all pays of the user in the user show.

 


here my generator:

generator: admingenerator.generator.doctrine
params:
    model: puntotron\legaladminBundle\Entity\Persona
    namespace_prefix: puntotron
    concurrency_lock: ~
    bundle_name: legaladminBundle
    pk_requirement: ~
    fields:
      nombre:
        label: Nombre
        addFormOptions:
          required: true
          invalid_message: Este campo es obligatorio
      rut:
        label: RUT
        addFormOptions:
          required: true
          invalid_message: El rut no es correcto
      fNac:
        label: Fecha nacimiento
        formType: afe_date_picker
        addFormOptions:
          formatSubmit: dd-mm-yyyy
          startDate: Jun 1, 1910
          format: "d-M-y"
          input: datetime
          language: es
          required: true
      estadoCivil:
        label: Estado Civil
      telefono:
        help: Telefono de contacto
        addFormOptions: 
          required: true
          invalid_message: Este campo es  obligatorio
        #Pagos.monto:
         # dbType: string
          #getter: pagos.monto
    object_actions:
        delete: ~
    batch_actions:
        delete: ~
builders:
    list:
        params:
            title: Listando Clientes
            display: [nombre,rut,telefono,notas]
            sort: [nombre , ASC]
            actions:
                new: 
                  label: Nuevo Cliente
            object_actions:
                show: ~
                edit: 
                  label: Editar
                delete: ~
                
    filters:
        params:
            display: [nombre,rut]
    new:
        params:
            title: Agregando nuevo cliente
            tabs:
              "Personal": 
                "Datos": [[nombre , rut, fNac], [estadoCivil, conyuge]]
              "Contacto": 
                "informacion": [[direccion, comuna, region],[telefono, email]]
                "Extra": [notas]
            actions:
                save: 
                  label: Guardar
                list: 
                  label: Volver
    edit:
        params:
            title: "Editando a: \"%object%\"|{ %object%: Persona.nombre }|"
            tabs:
              "Personal": 
                "Datos": [[nombre , rut, fNac], [estadoCivil, conyuge]]
              "Contacto": 
                "informacion": [[direccion, comuna, region],[telefono, email]]
                "Extra": [notas]
            actions:
                save: 
                  label: Guardar
                list: 
                  label: Volver al listado
    show:
        params:
            title: "Viendo \"%object%\"|{ %object%: Persona.nombre }|"
            tabs:
              "Personal": 
                "Datos": [[nombre , rut, fNac], [estadoCivil, conyuge]]
              "Contacto": 
                "informacion": [[direccion, comuna, region],[telefono, email]]
              "tab 3": 
                "pagos": [notas]
            actions:
                list:
                  label: Volver
            object_actions:
                edit: ~
    actions:
        params:
            object_actions:
                delete: ~
            batch_actions:
                delete: ~

ty for your time and any help would be apreciated, if you need extra info just tell me

Cédric Lombardot

unread,
Nov 20, 2013, 10:03:02 AM11/20/13
to Symfony2 Admingenerator bundles support for users
Not sure to well understand your ask : You want to see in show a list (table) of related objects linked to the current object ?


2013/11/19 Cesar Cardenas <thecho...@gmail.com>
--
--
You received this message because you are subscribed to the Google
Groups "Symfony2 Admingenerator bundles support for users" group.
To post to this group, send email to
symfony2adm...@googlegroups.com
To unsubscribe from this group, send email to
symfony2admingene...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Cesar Cardenas

unread,
Nov 20, 2013, 12:19:01 PM11/20/13
to symfony2adm...@googlegroups.com
first thanks for your reply.
maybe i don't explain well, i have an admingenerated view and works fine until i use tabs , when i use tabs all the text in show action (admin/5/show) aligns to right like you can see in the image, i want to change the align of the text but i dont know if i have to use css  or twig or centain config in the generator.yml, so my question is what is the best or correct way to do it?
besides i need to add info from anoter entity to the show view but this info dont need to be showed in the edit o new jut in show action, i am tinking to add a new field like this
params:
  fields:
    pays_info:
      formType: \MyCompagny\MyBundle\Type\MyType 

but i dont know how to meke it non editable (besides dont adding to the new or edit config in generator file)

i hope this clarify my questions and thanks again .


2013/11/19 Cesar Cardenas <thecho...@gmail.com>

For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingenerator+unsub...@googlegroups.com.

Cédric Lombardot

unread,
Nov 20, 2013, 12:39:33 PM11/20/13
to Symfony2 Admingenerator bundles support for users

Ok so i think can be a css problem. Or an html structure problem.

You can see what is generared in app/cache/dev/Admingenerated take a look if there is something stange in your show template.  You ll also understand here how overwrite twig blocks (copying blocks names in the non generared twig template)

If you find an html structure bug eg close tag missing you ll find source of twig views structure in the template folder of the bundle admingenerator

Hope this help you

Cedric


For more options, visit this group at
http://groups.google.com/group/symfony2admingenerator?hl=en
 
---
Found bundle documentation at http://symfony2admingenerator.org/
 
---
You received this message because you are subscribed to the Google Groups "Symfony2 Admingenerator bundles support for users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2admingene...@googlegroups.com.

Cesar Cardenas

unread,
Nov 22, 2013, 7:01:56 PM11/22/13
to symfony2adm...@googlegroups.com
Finaly i found the mistake it was that i use the same configuration for show and edit, it solves changin show and deleting nested []

my code for show now is:
show:
        params:
            title: "Esta viendo a \"%object%\"|{ %object%: Persona.nombre }|"
            tabs:
              "Personal": 
                "Datos": [nombre , rut, fnac, estadoCivil, conyuge]
              "Contacto": 
                "informacion": [direccion, comuna, region,telefono, email]
                "Extra": [notas]
            actions:
                list: ~
                new: ~

insted of 
show:
        params:
            title: "Esta viendo a \"%object%\"|{ %object%: Persona.nombre }|"
            tabs:
              "Personal": 
                "Datos": [[nombre , rut, fnac], [estadoCivil, conyuge]]
              "Contacto": 
                "informacion": [[direccion, comuna,] [region,telefono, email]]
                "Extra": [notas]
            actions:
                list: ~
                new: ~

ty for your hel  cédric maybe i change the template for anoter proyect
Reply all
Reply to author
Forward
0 new messages