Revision c3f6cdf1

b/snf-astakos-app/astakos/im/forms.py
102 102
            self.fields.keyOrder.extend(['recaptcha_challenge_field',
103 103
                                         'recaptcha_response_field', ])
104 104
        if get_latest_terms():
105
            self.fields.keyOrder.append('has_signed_terms')
105
		self.fields.keyOrder.append('has_signed_terms')
106 106

  
107 107
        if 'has_signed_terms' in self.fields:
108 108
            # Overriding field label since we need to apply a link
......
603 603
    )
604 604
    start_date = forms.DateTimeField()
605 605
    end_date = forms.DateTimeField()
606
    action = forms.ChoiceField(choices=(), required=False)
607
    
606
    details = forms.BooleanField(required=False, label="detailed listing?")
607
    operation = forms.ChoiceField(choices = (
608
                        ('',                '[Choose Charging Method]'),
609
                        ('charge_usage',    'Charge Usage'),
610
                        ('charge_traffic',  'Charge Traffic')
611
                ))
608 612
    def clean(self):
609 613
        super(TimelineForm, self).clean()
610 614
        d = self.cleaned_data
611 615
        if 'resource' in d:
612 616
            d['resource'] = str(d['resource'])
613 617
        if 'start_date' in d:
614
            d['start_date'] = d['start_date'].strftime("%Y-%m-%dT%H:%M:%S.%f")
618
            d['start_date'] = d['start_date'].strftime("%Y-%m-%dT%H:%M:%S.%f")[:24]
615 619
        if 'end_date' in d:
616
            d['end_date'] = d['end_date'].strftime("%%Y-%m-%dT%H:%M:%S.%f")
617
        return d
620
            d['end_date'] = d['end_date'].strftime("%Y-%m-%dT%H:%M:%S.%f")[:24]
621
        return d
622

  
b/snf-astakos-app/astakos/im/templates/im/timeline.html
12 12
	    </form>
13 13
	</div>
14 14
</div>
15
{% for o in l %}
15
<div class="timeline">
16
<table>
17
    <tr style="color:black; font-weight:bold;">
18
    {% for i in timeline_header %}
19
        <td>{{i}}</td>
20
    {% endfor %}
21
    </tr>
22
{% for o in timeline_body %}
23
    <tr style="color:black">
16 24
    {% for i in o %}
17
        {{i}}
25
        <td>{{i}}</td>
18 26
    {% endfor %}
19
    <br>
27
    </tr>
20 28
{% endfor %}
29
</table>
30
</div>
21 31
{% endblock %}
b/snf-astakos-app/astakos/im/views.py
365 365
                        logger.log(LOGGING_LEVEL, msg)
366 366
                if user and user.is_active:
367 367
                    next = request.POST.get('next', '')
368
		    transaction.commit()
368
                    transaction.commit()
369 369
                    return prepare_response(request, user, next=next)
370 370
                messages.add_message(request, status, message)
371
		transaction.commit()
371
                transaction.commit()
372 372
                return render_response(on_success,
373 373
                                       context_instance=get_context(request, extra_context))
374 374
            except SendMailError, e:
......
1028 1028
    l = []
1029 1029
    if request.method == 'POST':
1030 1030
        data = request.POST
1031
        l =[(u'test/apples', u'2012-09-20T11:39:53.1797', 192172055040L, 25569215632749L),
1032
            (u'test/pears/kate.jpg', u'2012-09-20T11:45:14.1153', 381640896L, 25626036449581L),
1033
            (u'test/pears/kate_beckinsale.jpg', u'2012-09-20T11:45:14.5830', 0L, 25626036449581L),
1034
            (u'test/pears/How To Win Friends And Influence People.pdf', u'2012-09-20T11:45:15.0694', 0L, 25626036449581L),
1035
            (u'test/pears/moms_birthday.jpg', u'2012-09-20T11:45:15.5615', 0L, 25626036449581L),
1036
            (u'test/pears/poodle_strut.mov', u'2012-09-20T11:45:16.0290', 0L, 25626036449581L),
1037
            (u'test/pears/Disturbed - Down With The Sickness.mp3', u'2012-09-20T11:45:16.4950', 0L, 25626036449581L),
1038
            (u'test/pears/army_of_darkness.avi', u'2012-09-20T11:45:16.9844', 0L, 25626036449581L),
1039
            (u'test/pears/the_mad.avi', u'2012-09-20T11:45:17.4516', 0L, 25626036449581L),
1040
            (u'test/apples/photos/animals/dogs/poodle.jpg', u'2012-09-20T11:45:17.9281', 0L, 25626036449581L),
1041
            (u'test/apples/photos/animals/dogs/terrier.jpg', u'2012-09-20T11:45:18.3918', 0L, 25626036449581L),
1042
            (u'test/apples/photos/animals/cats/persian.jpg', u'2012-09-20T11:45:18.8626', 0L, 25626036449581L),
1043
            (u'test/apples/photos/animals/cats/siamese.jpg', u'2012-09-20T11:45:19.3686', 0L, 25626036449581L),
1044
            (u'test/apples/photos/plants/fern.jpg', u'2012-09-20T11:45:19.8464', 0L, 25626036449581L),
1045
            (u'test/apples/photos/plants/rose.jpg', u'2012-09-20T11:45:20.7334', 0L, 25626036449581L)]
1046
    
1031
        #l =[(u'test/apples', u'2012-09-20T11:39:53.1797', 192172055040L, 25569215632749L),
1032
        #    (u'test/pears/kate.jpg', u'2012-09-20T11:45:14.1153', 381640896L, 25626036449581L),
1033
        #    (u'test/pears/kate_beckinsale.jpg', u'2012-09-20T11:45:14.5830', 0L, 25626036449581L),
1034
        #    (u'test/pears/How To Win Friends And Influence People.pdf', u'2012-09-20T11:45:15.0694', 0L, 25626036449581L),
1035
        #    (u'test/pears/moms_birthday.jpg', u'2012-09-20T11:45:15.5615', 0L, 25626036449581L),
1036
        #    (u'test/pears/poodle_strut.mov', u'2012-09-20T11:45:16.0290', 0L, 25626036449581L),
1037
        #    (u'test/pears/Disturbed - Down With The Sickness.mp3', u'2012-09-20T11:45:16.4950', 0L, 25626036449581L),
1038
        #    (u'test/pears/army_of_darkness.avi', u'2012-09-20T11:45:16.9844', 0L, 25626036449581L),
1039
        #    (u'test/pears/the_mad.avi', u'2012-09-20T11:45:17.4516', 0L, 25626036449581L),
1040
        #    (u'test/apples/photos/animals/dogs/poodle.jpg', u'2012-09-20T11:45:17.9281', 0L, 25626036449581L),
1041
        #    (u'test/apples/photos/animals/dogs/terrier.jpg', u'2012-09-20T11:45:18.3918', 0L, 25626036449581L),
1042
        #    (u'test/apples/photos/animals/cats/persian.jpg', u'2012-09-20T11:45:18.8626', 0L, 25626036449581L),
1043
        #    (u'test/apples/photos/animals/cats/siamese.jpg', u'2012-09-20T11:45:19.3686', 0L, 25626036449581L),
1044
        #    (u'test/apples/photos/plants/fern.jpg', u'2012-09-20T11:45:19.8464', 0L, 25626036449581L),
1045
        #    (u'test/apples/photos/plants/rose.jpg', u'2012-09-20T11:45:20.7334', 0L, 25626036449581L)]
1046
        timeline_header = (data['entity'], data['resource'],
1047
                           data['start_date'], data['end_date'],
1048
                           data['details'], data['operation'])
1049
        timeline_body = [timeline_header] * 2
1047 1050
    form = TimelineForm(data)
1048 1051
    if form.is_valid():
1049 1052
        print '>>>', form.cleaned_data
1050 1053
    return render_response(template='im/timeline.html',
1051 1054
                           context_instance=get_context(request),
1052 1055
                           form=form,
1053
                           l=l)
1056
                           timeline_header=timeline_header,
1057
                           timeline_body=timeline_body)

Also available in: Unified diff