Commit 8cdc2ef0 authored by chris's avatar chris

Choice are datetime objects. It allow specifying the time of one's meeting.

parent f0207683
......@@ -8,7 +8,7 @@ class PollForm(forms.ModelForm):
fields = ('title','description')
class ChoiceForm(forms.ModelForm):
choice = forms.DateField(widget=forms.DateTimeInput(format='%d-%m-%Y',attrs={'class':'hasdatepicker','size':'12',}),input_formats=['%d-%m-%Y'])
choice = forms.DateTimeField(widget=forms.DateTimeInput(format='%d-%m-%Y %H:%M',attrs={'class':'hasdatepicker','size':'20',}),input_formats=['%d-%m-%Y %H:%M'])
details = forms.CharField(required=False,max_length='200',widget=forms.TextInput(attrs={'size':'32',}))
class Meta:
model = Choice
......
......@@ -21,7 +21,7 @@ class Poll(models.Model):
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.DateField()
choice = models.DateTimeField()
details = models.CharField(max_length=200,blank=True)
votecount = models.IntegerField(default=0,blank=True)
class Meta:
......
......@@ -48,6 +48,7 @@
buttonImageOnly: true,
minDate: '+1d',
gotoCurrent: true,
constrainInput: false,
});
// Remove hasDatepicker class: not to be touched next time function is called
$(this).removeClass('hasdatepicker');
......
......@@ -24,7 +24,9 @@
<tr>
<td class='names'></td>
{% for choice in object.choice_set.all %}
<td> {{ choice.choice|date:"d/m" }} <span class="tooltip"><b> {{ choice.choice|date:"l d F"}} </b> <br /><font class="blue">{{ choice.details }}</font></span><div class="subl"><!-- --></div></td>
<td> {{ choice.choice|date:"d/m" }} <span class="tooltip"><b> {{ choice.choice|date:'l d F'}} </b> <br />
{{ choice.choice|date:'P'}} <br />
<font class="blue">{{ choice.details }}</font></span><div class="subl"><!-- --></div></td>
{% endfor %}
</tr>
......@@ -84,7 +86,8 @@
<h3>Details</h3>
{% for choice in object.choice_set.all %}
<p class="indent" id='info-{{ choice }}'>
<span class="da">{{ choice.choice|date:"l d F"}} </span> <span class="blue">{{ choice.details }} </span> ({{ choice.votecount }})<br />
<span class="da">{{ choice.choice|date:"l d F, P"}} </span> -
<span class="blue">{{ choice.details }}</span>&nbsp; ({{ choice.votecount }})<br />
{% for bulletin in object.bulletin_set.all %}
{% for vote in bulletin.vote_set.all %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment