Conjunto de mudanças 6614 no repositório publico


Ignorar:
Timestamp:
10/07/2012 13:18:59 (8 anos atrás)
Autor:
mazza
Mensagem:

pagina de edicao dos carrosseis ajustada (para diferentes tipos)

Arquivo:
1 editado

Legenda:

Não Modificado
Adicionado
Removido
  • PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/browser/boxes/carousel.py

    r6607 r6614  
    2525        boxes = [(panel, Box(ICarouselItem, panel)) for panel in self.panels]
    2626        return template.render(
    27             carousel_edit_href=carousel_edit_href(self.number),
     27            carousel_edit_href=carousel_edit_href(self.kind, self.number),
    2828            items=[(panel,
    2929                    box.get_data(self.context),
     
    7777    @property
    7878    def edit_href(self):
    79         return carousel_edit_href(self.number)
     79        return carousel_edit_href(self.kind, self.number)
    8080
    8181
    82 def carousel_edit_href(number):
    83     return "carousel_edit_%s" % number
     82def carousel_edit_href(kind, number):
     83    return "carousel_edit_%s_%s" % (kind, number)
    8484
    85 def build_CarouselEditView(number):
     85def build_CarouselEditView(kind, number):
    8686
    8787    class CarouselEditView(grok.View):
    88         grok.name(carousel_edit_href(number))
     88        grok.name(carousel_edit_href(kind, number))
    8989        grok.context(Interface)
    9090        grok.require('cmf.ModifyPortalContent')
    9191
    9292        template = ZopeTwoPageTemplate(filename="carouseledit.pt")
     93        kind = kind
    9394        number = number
    9495
     
    9798
    9899        def update(self, **kwargs):
    99             self._carousel = Carousel(self.number, self.context)
     100            self._carousel = Carousel(self.kind, self.number, self.context)
    100101            if 'add' in self.request:
    101102                self._carousel.add_item()
     
    105106                self._carousel.reorder(self.request['reorder'])
    106107
    107     globals()['CarouselEditView_%s' % number] = CarouselEditView
     108    globals()['CarouselEditView_%s_%s' % (kind, number)] = CarouselEditView
    108109
    109 # XXX: one more elaborated POG, to avoid complex traversals
    110 for number in range(8):
    111     build_CarouselEditView(number)
    112110
    113111class ProductsAndServices(CarouselBox):
    114112    kind = 'products-and-services'
     113
     114# XXX: one more elaborated POG, to avoid complex traversals
     115for kind in CarouselBox.kind, ProductsAndServices.kind:
     116    for number in range(8):
     117        build_CarouselEditView(kind, number)
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.