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"; 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.listPollChoices()">

                                          <input type="checkbox"
                                                 class="noborder"
                                                 name="choice:list"
                                                 id="#"
                                                 value="#"
                                                 tal:attributes="value
repeat/choice/index;
                                                 type
python:test((here.getPollNumber() > 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.listPollChoices() != [] 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>

Reply via email to