Valeu Jeferson!!

Consegui aki, mas o script não era PlonePopoll_view e sim
PlonePopoll_vote...

com alguns ajuste aki funcionou...

Obrigado!!


Wander Jardim

2008/11/25 Jeferson Lelis C. dos Santos <[EMAIL PROTECTED]>

>   Wander,
>
> Existe um script python chamado [image: Script 
> (Python)]<http://67.225.169.37:8090/ecod/site_ecod/portal_skins/220i_WWW/plonepopoll_view/manage_workspace>
> plonepopoll_view<http://67.225.169.37:8090/ecod/site_ecod/portal_skins/220i_WWW/plonepopoll_view/manage_workspace>que
>  o PlonePopoll usa para redirecionar para qual template o usuário vai
> depois do voto. criar este script na sua skin com o mesmo nome e redireciona
> para o seu outro template do popoll.
>
> para redirecionar usa.
>
> request = container.REQUEST
> RESPONSE =  request.RESPONSE
>
> return RESPONSE.redirect('/nome do seu template')
>
> abs,
>
> *Atenciosamente,
> *
> *Jeferson Lelis.*
>
> ------------------------------
> *De:* Wander Jardim <[EMAIL PROTECTED]>
> *Para:* zope-pt@yahoogrupos.com.br
> *Enviadas:* Terça-feira, 25 de Novembro de 2008 9:38:55
> *Assunto:* [zope-pt] Dúvida com o PlonePopoll
>
>  Pessoal, é o seguinte:
>
> Eu criei cinco page templates que exibem uma enquete diferente em cada um,
> o que eu gostaria de saber é como eu faria pra quando a pessoa clicar no
> botão votar da primeira enquete, o sistema contabilizar o voto e direcionar
> para o template da segunda enquete, sem exibir o resultado dessa primeira.
>
> segue o código do template q fiz:
>
> <html xmlns="http://www.w3. org/1999/ xhtml <http://www.w3.org/1999/xhtml>"
> xml:lang="en"
>       lang="en"
>       metal:use-macro="here/main_template/ macros/master"
>       i18n:domain="plone">
>
> <body>
>
>   <div metal:fill-slot="main">
>
>       <div tal:define="result python:here. portal_catalog. searchResults(
> meta_type='PlonePopoll',
>
> id='plonepopoll. 2008-11-19. 0614906287',
>
> sort_on='Date',
>
> sort_order='reverse')[:1]"
>
> tal:condition="python:len(result) ==1">
>           <div class="box"
>                     tal:define="here python:result[ 0].getObject( );
>                     object_url python:here. absolute_ url();">
>               <h5 tal:content="here/title">Poll</h5>
>               <div class="body">
>                   <div>
>
>                       <dl class="portlet" id="portlet-popoll">
>
>                           <dt class="portletHeader">
>                               <a tal:attributes="href string:${portal_
> url}/polls2" i18n:translate="box_link_polls">
>                                   <span
> tal:content="here/title">Poll</span>
>                               </a>
>                           </dt>
>                           <dd class="portletItem even" >
>                               <div align="left">
>                                   <b><span tal:replace="python:here.
> getPollQuestion( )">Question</span></b>
>                               </div>
>                           </dd>
>                           <dd class="portletItem odd" >
>                               <div align="left">
>
>                                   <form tal:condition="python:(not
> here.hasVoted( ) and here.isEnabled( ))" name="results" action=""
> method="post"
>
> enctype="multipart/form- data" tal:attributes="action string:${object_
> url}/PlonePopoll _vote2 ${object_url} /questao02">
>
>                                       <span tal:repeat="choice python:
> here.listPollChoice s()">
>
>                                           <input type="checkbox"
>                                                  class="noborder"
>                                                  name="choice:list"
>                                                  id="#"
>                                                  value="#"
>                                                  tal:attributes="value
> repeat/choice/ index;
>                                                  type python:test(
> (here.getPollNum ber() > 1), 'checkbox', 'radio');
>                                                  id string:cb${repeat/
> choice/index} ;"/>
>                                              <span tal:define="choice_index
> repeat/choice/ index;" tal:replace="structure
> string:${choice}">>Choice</span><br/>
>
>                                       </span>
>
>                                        <input class="context" type="submit"
> name="vote" value="Vote" i18n:attributes="value"/>
>                                       <span tal:replace="nothing"> ####
> HIDDEN VARIABLE FOR THE FORM_TOOL #### </span>
>                                       <input type="hidden"
> name="form_submitted" value="1" tal:attributes="value template/id" />
>
>                                   </form>
>
>                                   <table tal:define="public python:
> here.isVisible( ); owner python: here.Creator( ); current_user python:
> user.getUserName( )"
>                                          tal:condition="python:(here.
> hasVoted( ) or here.isDisabled( )) and (public == 1 or current_user ==
> owner)"
>                                          cellspacing="0" border="0"
> cellpadding="2">
>
>                                       <tr tal:repeat="choice python:
> here.getResults( )" align=left>
>                                           <td tal:define="choice_id
> python:choice[ 0];
>                                               choice_count python:choice[
> 1]; choice_percentage python:'%0.2f'%choice[2]; bar_percentage
> python:int(choice[ 2])">
>                                               <img src="bar_1_10.gif"
> height="10" tal:attributes="width string:${bar_ percentage}">
>                                               <b
> tal:content="string:${choice_ percentage} %">44%</b><br />
>                                               <span tal:replace="structure
> string:${choice_ id}">Choice 1</span>
>                                           </td>
>                                       </tr>
>                                   </table>
>                                   <div class="field" tal:define="public
> python: here.isVisible( ); owner python: here.Creator( );
>                                        current_user python:
> user.getUserName( )"
>                                        tal:condition="python:
> here.listPollChoice s() != [] and (public == 0 and current_user != owner)">
>
>                                       <b i18n:translate="text_results_
> not_visible">Results will appear later.</b>
>                                   </div>
>                               </div>
>                           </dd>
>
>                           <dd class="portletFooter">
>                               <a tal:attributes="href string:${object_
> url}/PlonePopoll _results2" i18n:translate="box_link_results">
>                                   Resultados[<span
> tal:replace="python:here. getVotesCount( )"/>]
>                               </a>
>                           </dd>
>
>                       </dl>
>                   </div>
>               </div>
>           </div>
>       </div>
>
>
>   </div>
> </body>
> </html>
>
>
> ------------------------------
> Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 
> 10<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/>-
> Celebridades<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/celebridades/>-
> Música<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/m%C3%BAsica/>-
> Esportes<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/esportes/>
> 
>

Responder a