Rael Max avatar Rael Max committed 3248ced

form to register

Comments (0)

Files changed (12)

Add a comment to this file

adalberto13/apps/participar/__init__.py

Empty file added.

adalberto13/apps/participar/models.py

+# -*- coding: utf-8 -*-
+from django.db import models
+
+class Participar(models.Model):
+    nome = models.CharField(max_length=255)
+    email = models.EmailField("E-mail")
+    endereco = models.CharField(max_length=255)
+    bairro = models.CharField(max_length=15)
+    telefone = models.CharField(max_length=15)
+    voluntario = models.BooleanField()
+    doacao = models.BooleanField()
+    santinho = models.BooleanField()
+    bandeira = models.BooleanField()
+    adesivo = models.BooleanField()
+    receber_email = models.BooleanField()
+
+    def __unicode__(self):
+        return '%s - %s' % (self.nome, self.email)

adalberto13/apps/participar/tests.py

+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.assertEqual(1 + 1, 2)

adalberto13/apps/participar/urls.py

+from django.conf.urls.defaults import *
+from adalberto13.apps.participar.views import ParticiparView
+
+urlpatterns = patterns('',
+    url(r'^$', ParticiparView.as_view(), name='participar'),
+)

adalberto13/apps/participar/views.py

+# -*- coding: utf-8 -*-
+from django.views.generic.edit import CreateView
+from adalberto13.apps.participar.models import Participar
+
+
+class ParticiparView(CreateView):
+    model = Participar
+    template_name = 'base.html'
+    success_url = '/?sucesso=sim'

adalberto13/settings.py

 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': '',                      # Or path to database file if using sqlite3.
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'base.db',                      # Or path to database file if using sqlite3.
         'USER': '',                      # Not used with sqlite3.
         'PASSWORD': '',                  # Not used with sqlite3.
         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'django.contrib.admin',
+    
+    'adalberto13.apps.participar',
 )
 
 # A sample logging configuration. The only tangible logging

adalberto13/static/css/style.css

   font-style: italic;
   font-size: 13px;
 }
+h4 {
+  font-weight: 400;
+}
 p {
   font-size: 12px;
 }
-h3, p {
+h3, h4, p {
   margin: 0;
   padding: 0;
 }
 #main {
   position: relative;
   min-height: 626px;
+}
+#main,
+.rodape p {
   margin: 0 auto;
-  width: 980px;
+  width: 980px;  
 }
 .frase {
   position: absolute;
   float: left;
 }
 .input-submit {
-  background: url(../img/bt_participar.gif) no-repeat;
+  background: url(../img/bt_participar.png) no-repeat;
   position: absolute;
   bottom: -18px;
   border: none;
   width: 167px;
-  height: 44px;
+  height: 42px;
   right: 42px;
 }
 .input-submit:hover {
   height: 114px;
   width: 442px;
 }
-.cycle-in p {
+.cycle-in h4 {
   background: url(../img/bg_vereador.gif) repeat-x;
   line-height: 23px;
   padding-left: 10px;
   height: 23px;
   color: #fff;
 }
+.cycle-in p {
+  background: url(../img/bg_caixa_vereador.png) no-repeat;
+  padding: 10px;
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 184px;
+  height: 287px;
+  display: none;
+}
 .cycle-in li {
+  position: relative;
+  width: 99px;
   float: left;
   border: 1px solid #df4343;
   margin-right: 11px;
   background: url(../img/bt_seta_dir.gif) no-repeat;
   right: 10px;
 }
-
+.rodape {
+  position: relative;
+  background: #b00000;
+  padding: 10px 0;
+  height: 100%;
+  color: #fff;
+}
 
 
 @media only screen and (min-width: 35em) {
Add a comment to this file

adalberto13/static/img/bg_caixa_vereador.png

Added
New image
Add a comment to this file

adalberto13/static/img/bt_participar.png

Added
New image

adalberto13/static/js/script.js

 $(document).ready(function(){
     $('.cycle-in').cycle({
         fx: 'scrollHorz',
-        timeout: 0, 
+        timeout: 1000, 
         next:   '.bt-next', 
         prev:   '.bt-prev' 
-    }); 
+    });
+    //$('.cycle-in').find('li').hover(function(){
+    //    $(this).find('p').show();  
+    //}, function(){
+    //    $(this).find('p').hide();    
+    //});
 });
 
 

adalberto13/templates/base.html

         Junte-se a nós na construção de um governo democrático, transparente, honesto e competente.
       </p>
     </div>
-    <form>
+    <form action="{% url participar %}" method="post">
+      {% csrf_token %}
       <fieldset class="form1">
         <div class="field-sep">
-          <input type="text" placeholder="Nome:">
+          <input type="text" name="nome" placeholder="Nome:">
         </div>
         <div class="field-sep">
-          <input type="email" placeholder="Seu email:">
+          <input type="email" name="email" placeholder="Seu email:">
         </div>
         <div class="field-sep">
-          <input type="text" placeholder="Endereço:">
+          <input type="text" name="endereco" placeholder="Endereço:">
         </div>
         <div class="field-group">
           <div class="field-sep">
-            <input type="text" placeholder="Bairro:">
+            <input type="text" name="bairro" placeholder="Bairro:">
           </div>
           <div class="field-sep">
-            <input type="text" placeholder="Telefone:">
+            <input type="text" name="telefone" placeholder="Telefone:">
           </div>        
         </div>
         <div class="field-check">
-          <input id="id_receive_mail" type="checkbox" checked>
+          <input id="id_receive_mail" name="receber_email" type="checkbox" checked>
           <label for="id_receive_mail">Quero receber e-mails informativos sobre a campanha</label>
         </div>
       </fieldset>
       <fieldset class="form2">
         <div class="field-check">
-          <input id="id_voluntario" type="checkbox">
+          <input id="id_voluntario" name="voluntario" type="checkbox">
           <label for="id_voluntario">Quero ser voluntário com o meu trabalho.</label>
         </div>
         <div class="field-check">
-          <input id="id_doacao" type="checkbox">
+          <input id="id_doacao" name="doacao" type="checkbox">
           <label for="id_doacao">Quero fazer doação financeira.</label>
         </div>
         <div class="field-check">
-          <input id="id_santinho" type="checkbox">
+          <input id="id_santinho" name="santinho" type="checkbox">
           <label for="id_santinho">Quero santinhos ou adesivos.</label>
         </div>
         <div class="field-check">
-          <input id="id_bandeira" type="checkbox">
+          <input id="id_bandeira" name="bandeira" type="checkbox">
           <label for="id_bandeira">Quero bandeiras para carro ou moto.</label>
         </div>
         <div class="field-check">
-          <input id="id_adesivo" type="checkbox">
+          <input id="id_adesivo" name="adesivo" type="checkbox">
           <label for="id_adesivo">Quero adesivo furado para carro.</label>
         </div>
       </fieldset>
           {% for i in "1234" %}
           <li{% if forloop.last %} class="noborder"{% endif %}>
             <a href="#"><img src="{{ MEDIA_URL }}vereadores/{{ i }}.jpg" alt="#"></a>
-            <p>Fulano de Tal</p>
+            <h4>Fulano de Tal</h4>
           </li>
           {% endfor %}
         </ul>
       <div class="controls bt-next"></div>
     </div>
   </div>
+  <footer class="rodape">
+    <p>
+      <b>www.adalberto13.com.br</b> - Campanha majoritária do Partido dos Trabalhadores / Imperatriz-MA
+    </p>    
+  </footer>
+
   <!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>-->
   <script>window.jQuery || document.write('<script src="{{ STATIC_URL }}js/libs/jquery-1.7.1.min.js"><\/script>')</script>
   <script src="{{ STATIC_URL }}js/jquery.cycle.all.js"></script>

adalberto13/urls.py

 
 urlpatterns = patterns('',
     url(r'^$', 'adalberto13.views.home', name='home'),
+    url(r'^participar/', include('adalberto13.apps.participar.urls')),
     url(r'^admin/', include(admin.site.urls)),
 )
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.