Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some style problems #730

Open
jagltoro opened this issue Mar 7, 2014 · 11 comments
Open

Some style problems #730

jagltoro opened this issue Mar 7, 2014 · 11 comments

Comments

@jagltoro
Copy link

jagltoro commented Mar 7, 2014

Now i can see the AdminGenerator, but it only shows the ID for the table. And some errors of style.
I attached an image.
1

My Generator.yml, Entity and Repository are here:
#729

@cedriclombardot
Copy link
Member

You ve only one column in your table model :

/**

  • Pilotos
    *

  • @Orm\Table(name="pilotos")

  • @Orm\Entity(repositoryClass="Open\OpenBundle\Repository\UsuarioRepository")
    /
    class Pilotos
    {
    /
    *

    • @var integer
      *
    • @Orm\Column(name="id", type="integer", nullable=false)
    • @Orm\Id
    • @Orm\GeneratedValue(strategy="AUTO")
      */
      private $id;

    /**

    • @var string
      */
      private $nombres;

    /**

    • @var string
      */
      private $apellidos;

    /**

    • @var integer

      */
      private $edad;

eg $edad is not a column

2014-03-07 17:17 GMT+01:00 jagltoro [email protected]:

Now i can see the AdminGenerator, but it only shows the ID for the table.
And some errors of style.
I attached an image.
[image: 1]https://f.cloud.github.com/assets/6497296/2359094/ad17851c-a613-11e3-8ad6-b41067b28b37.png

My Generator.yml, Entity and Repository are here:
#729#729

Reply to this email directly or view it on GitHubhttps://github.com//issues/730
.

@jagltoro
Copy link
Author

jagltoro commented Mar 7, 2014

Fixed that ORM. Thanks!!, i wouldn't notice that

Now about the text?

pagerfanta.next
pagerfanta.view.perpage
pagerfanta.num.elements
action.generic.new
list.button.filter
list.button.reset

What i have to do to correct it?
Also the documentation about translation is a bit confusing, how i activate the default spanish translation?

generator: admingenerator.generator.doctrine
params:
    model: At\OtBundle\Entity\Pilotos
    namespace_prefix: At
    concurrency_lock: ~
    bundle_name: OtBundle
    i18n_catalog: GeneratorBundle

Like that??

Thanks in advance

@cedriclombardot
Copy link
Member

See
https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle/blob/master/Resources/doc/internationalization/generator-translation.mdto
understand i18n config. I think you forgot to activate the symfony
config http://symfony.com/doc/current/book/translation.html#configurationdon
t forget to clear your cache after.

Cedric
Le 7 mars 2014 22:48, "jagltoro" [email protected] a écrit :

Fixed that ORM. Thanks!!, i wouldn't notice that

Now about the text?

pagerfanta.next
pagerfanta.view.perpage
pagerfanta.num.elements
action.generic.new
list.button.filter
list.button.reset

What i have to do to correct it?
Also the documentation about translation is a bit confusing, how i
activate the default spanish translation?

generator: admingenerator.generator.doctrine
params:
model: At\OtBundle\Entity\Pilotos
namespace_prefix: At
concurrency_lock: ~
bundle_name: OtBundle
i18n_catalog: GeneratorBundle

Like that??

Thanks in advance

Reply to this email directly or view it on GitHubhttps://github.com//issues/730#issuecomment-37071431
.

@jagltoro
Copy link
Author

jagltoro commented Mar 8, 2014

Thanks a lot.. Really helpme and hope helps others..
One last thing, can i show partials like Sf1?

@cedriclombardot
Copy link
Member

Yes see
#514

You can use partial or subcontrollers

Cedric
Le 8 mars 2014 01:38, "jagltoro" [email protected] a écrit :

Thanks a lot.. Really helpme and hope helps others..
One last thing, can i show partials like Sf1?

Reply to this email directly or view it on GitHubhttps://github.com//issues/730#issuecomment-37082808
.

@jagltoro
Copy link
Author

need partials more like SF1
Like this below

builders:
    list:
        params:
            title: Persons
            display: [_photo,id,firstName,lastName]
            sort: [ id, ASC ]
            actions:
                new: ~
            object_actions:
                edit: ~

@cedriclombardot
Copy link
Member

Just override blocks in twig

http://symfony2admingenerator.org/documentation/list.html#overwrite-the-rendering-of-a-field

See in cache to find good block name and good file
Le 27 mars 2014 18:44, "jagltoro" [email protected] a écrit :

need partials more like SF1
Like this below

builders:
list:
params:
title: Persons
display: [_photo,id,firstName,lastName]
sort: [ id, ASC ]
actions:
new: ~
object_actions:
edit: ~

Reply to this email directly or view it on GitHubhttps://github.com//issues/730#issuecomment-38836928
.

@jagltoro
Copy link
Author

That field is not in the Entity, is ahother new that i want to be shown. This is a custom field just to show the photo of a person, it's not stored in any entity, is directly in a folder in web/images.
I dont know if this could work calling a controller action. Because i need it to for some others fields, doing some calls to DB

have read this:
symfony2admingenerator/AvocodeFormExtensionsBundle#46
#90

But now says :
Method "foto" for object "Myapp\MyBundle\Entity\People" does not exist in Admingenerated/MyappMyBundle/Resources/views/PList/row.html.twig at line 5

params:
    ....
    fields: 
        id: {label: Id}
        primerNombre: {label: 1º Nombre}
        primerApellido: {label: 1º Apellido}
        foto:
            label:            Image
            dbType:   string
            addFormOptions:
                data_class:     Symfony\Component\HttpFoundation\File\File

@cedriclombardot
Copy link
Member

Try to set :

foto:
  label:            Image
  getter: myCustomGetter

Cedric

@jagltoro
Copy link
Author

I need something more like this:
#514
In the list, because i dont have a method to that photo, or is stored in a DB.
this is the line i want to be shown in list:

<img src="{{ assets('images/fotos_personal/'~f.id~'.jpg') }}" width="80"/><br/>
builders:
    list:
        params:
            title: Persons
            display: [photo,id,firstName,lastName]
            sort: [ id, ASC ]
            actions:
                new: ~
            object_actions:
                edit: ~

@cedriclombardot
Copy link
Member

The list use in fact a default getter in background to buid cache this one
will be overwritten by your custom block. Try :

params:
fields:
photo:
sort_on: id
getter: id
filter

list:
params:
display: [ photo, .... ]

and in row.html.twig

{% block list_td_column_photo %}{#Check block name in cache #}


{% endblock %}

Cédric

2014-03-28 18:06 GMT+01:00 jagltoro [email protected]:

I need something more like this:
#514#514
In the list, because i dont have a method to that photo, or is stored in a
DB.
this is the line i want to be shown in list:


builders:
list:
params:
title: Persons
display: [photo,id,firstName,lastName]
sort: [ id, ASC ]
actions:
new: ~
object_actions:
edit: ~

Reply to this email directly or view it on GitHubhttps://github.com//issues/730#issuecomment-38943308
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants