Anonymous avatar Anonymous committed 3077796 Merge

merged

Comments (0)

Files changed (4)

templates/web/statistics.html

     {% if talktot and deltot %}
         <div class="more">
             <br><a  href="{% url index %}">{% trans "Back to index ..." %} </a><br>
-	</div>
+    </div>
     <h2>{% trans "Statistics" %}</h2>
        <h5>{%trans "Registered Delegates: "%}{{deltot}}</h5>
        <h5>{%trans "Registered Talks: "%}{{talktot}}</h5>
             <th>{% trans "Number of delegates" %}</th>
             <th>{% trans "Percentage" %}</th>
    </tr>
-    	{% for x,y in occup_count.items %}
+        {% for x,y in occup_count.items %}
     <tr>
             
             <td class ="check">{{x}}</td>
     </tr>
    
     </table>
+    
+{% if teesizes %}
+    <table>
+        
+     <tr><th  class = "Thalign"  colspan=2>{% trans "Tee shirt sizes" %}</th></tr>
+   
+    <tr>
+            <th>{% trans "Tee size " %}</th>
+            <th>{% trans "Number" %}</th>
+    {% for x,y in teesizes.items %}
+    <tr>
+            <td class ="check">{{x}}</td>
+            <td class ="check">{{y}}</td>
+    </tr>
+    {% endfor %}        
+    <tr>
+            <td class ="check">{% trans "Total teeshirts" %}</td>
+            <td class ="check">{{teetot}}</td>
+    </tr>
+    </table>
+{% endif %}
 {% endif %}    
     
 {% else %}
 from django import forms
 from django.utils.translation import gettext_lazy as _
 from conference.web.models import *
+from conference.web.models import TEE_SIZES
 from tagging.forms import TagField
 from django.utils.safestring import mark_safe
 from django.db.models import Q
                                required=False)
     photo = forms.ImageField(label=_("Photo"),
                              required=False)
+    teesize = forms.ChoiceField(label=_("Tee shirt size"),
+                                   choices=TEE_SIZES,
+                                   required=False)
     bio = forms.CharField(max_length=1000,
                              label=_("Bio"),
                              widget=forms.Textarea,
     ('A', _("Advanced")),
     )
 
+TEE_SIZES=(
+    ('SM', _("Small")),
+    ('ME', _("Medium")),
+    ('LA', _("Large")),
+    ('X1', _("XL")),
+    ('X2', _("XXL")),
+    ('X3', _("XXXL")),
+    )
+
 rating_list=(
     ('+1', _("Accept")),
     ('0', _("No Comment")),
     joindate = models.DateTimeField(_("Date of registration"),default=datetime.now,
                                     editable=False)
     private = models.BooleanField(_("Keep my email private"),blank=True,null=True)
+    teesize = models.CharField(_("Tee shirt size"),choices = TEE_SIZES,
+                        max_length=2,blank=True,null=True)
 
     def __unicode__(self):
         return User.objects.get(username=self.username.username).get_full_name()
 from django.utils.translation import gettext_lazy as _
 from django.shortcuts import render_to_response
 from conference.web.models import *
+from conference.web.models import TEE_SIZES
 from django.http import HttpResponse, HttpResponseRedirect
 from django.contrib.auth.models import User
 from django.contrib.auth import authenticate, login
             changed = False
             newdel,created = Delegate.objects.get_or_create(username=request.user)
             newdel.bio = fm['bio']
+            newdel.teesize = fm['teesize']
             newdel.occupation_id= int(fm['occupation'])
             newdel.city = fm['city']
             newdel.organisation = fm['organisation']
         try:
             a = Delegate.objects.get(username=request.user)
             data['bio'] = a.bio
+            data['teesize'] = a.teesize
             data['occupation'] = a.occupation.id
             data['city'] = a.city
             data['organisation'] = a.organisation
         if talknum > 0:
             talkpercent = round((float(talknum)/deltot)*100,2)
             occup_count[occ.name] = [talknum,talkpercent]
+    teesizes = {}
+    teetot = 0
+    for sz in TEE_SIZES:
+        x = Delegate.objects.filter(teesize=sz[0]).count()
+        teesizes[sz[1]] = x
+        teetot = teetot +x
+        
     t = loader.get_template('web/statistics.html')
     c = RequestContext(request,
                 {'talktot': talktot,
                 'categ_count': categ_count,
                 'occup_count': occup_count,
                 'level_count': level_count,
+                'teesizes': teesizes,
+                'teetot': teetot,
                  })
     return HttpResponse(t.render(c))
 
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.