Commit 6a7c82e0 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

New timeline tab

parent 8bada24b
......@@ -172,87 +172,55 @@ def get_menu(request, with_extra_links=False, with_signout=True):
append = l.append
item = MenuItem
item.current_path = absolute(request, request.path)
append(
item(
append(item(
url=absolute(request, reverse('index')),
name=user.email
)
)
append(
item(
url=absolute(request, reverse('edit_profile')),
name="My account"
)
)
name=user.email))
append(item(url=absolute(request, reverse('edit_profile')),
name="My account"))
if with_extra_links:
if user.has_usable_password() and user.provider in ('local', ''):
append(
item(
append(item(
url=absolute(request, reverse('password_change')),
name="Change password"
)
)
name="Change password"))
if EMAILCHANGE_ENABLED:
append(
item(
append(item(
url=absolute(request, reverse('email_change')),
name="Change email"
)
)
name="Change email"))
if INVITATIONS_ENABLED:
append(
item(
append(item(
url=absolute(request, reverse('invite')),
name="Invitations"
)
)
append(
item(
name="Invitations"))
append(item(
url=absolute(request, reverse('feedback')),
name="Feedback"
)
)
append(
item(
name="Feedback"))
append(item(
url=absolute(request, reverse('group_list')),
name="Groups",
submenu=(
item(
url=absolute(request, reverse('group_list')),
name="Overview"
),
item(
url=absolute(request,
reverse('group_create_list')
),
name="Create"
),
item(
url=absolute(request, reverse('group_search')),
name="Join"
),
)
)
)
append(
item(
submenu=(item(
url=absolute(request,
reverse('group_list')),
name="Overview"),
item(
url=absolute(request,
reverse('group_create_list')),
name="Create"),
item(
url=absolute(request,
reverse('group_search')),
name="Join"),)))
append(item(
url=absolute(request, reverse('resource_list')),
name="Resources"
)
)
append(
item(
name="Resources"))
append(item(
url=absolute(request, reverse('billing')),
name="Billing"
)
)
name="Billing"))
append(item(
url=absolute(request, reverse('timeline')),
name="Timeline"))
if with_signout:
append(
item(
append(item(
url=absolute(request, reverse('logout')),
name="Sign out"
)
)
name="Sign out"))
callback = request.GET.get('callback', None)
data = json.dumps(tuple(l))
......
......@@ -47,14 +47,12 @@ from django.utils.encoding import smart_str
from django.forms.extras.widgets import SelectDateWidget
from django.conf import settings
from astakos.im.models import (
AstakosUser, EmailChange, AstakosGroup, Invitation,
Membership, GroupKind, get_latest_terms
)
from astakos.im.models import (AstakosUser, EmailChange, AstakosGroup,
Invitation, Membership, GroupKind, Resource,
get_latest_terms)
from astakos.im.settings import (INVITATIONS_PER_LEVEL, BASEURL, SITENAME,
RECAPTCHA_PRIVATE_KEY, RECAPTCHA_ENABLED, DEFAULT_CONTACT_EMAIL,
LOGGING_LEVEL
)
RECAPTCHA_PRIVATE_KEY, RECAPTCHA_ENABLED,
DEFAULT_CONTACT_EMAIL, LOGGING_LEVEL)
from astakos.im.widgets import DummyWidget, RecaptchaWidget
from astakos.im.functions import send_change_email
......@@ -525,8 +523,6 @@ class ExtendedPasswordChangeForm(PasswordChangeForm):
class AstakosGroupCreationForm(forms.ModelForm):
# issue_date = forms.DateField(widget=SelectDateWidget())
# expiration_date = forms.DateField(widget=SelectDateWidget())
kind = forms.ModelChoiceField(
queryset=GroupKind.objects.all(),
label="",
......@@ -598,3 +594,16 @@ class AddGroupMembersForm(forms.Form):
class AstakosGroupSearchForm(forms.Form):
q = forms.CharField(max_length=200, label='Search group')
class TimelineForm(forms.Form):
entity = forms.ModelChoiceField(
queryset=AstakosUser.objects.none(),
label="",
widget=forms.HiddenInput()
)
resource = forms.ModelChoiceField(
queryset=Resource.objects.all(),
)
start_date = forms.DateTimeField()
end_date = forms.DateTimeField()
action = forms.ChoiceField(choices=())
\ No newline at end of file
......@@ -174,6 +174,19 @@ $(document).ready(function() {
$( "#id_issue_date" ).datepicker( "option", "maxDate", selectedDate );
}
});
$( "#id_start_date" ).datepicker({
dateFormat: "YYYY-mm-ddTHH:MM:SS.FFF",
onSelect: function( selectedDate ) {
$( "#id_start_date" ).datepicker( "option", "maxDate", selectedDate );
}
});
$( "#id_end_date" ).datepicker({
dateFormat: "YYYY-mm-ddTHH:MM:SS.FFF",
onSelect: function( selectedDate ) {
$( "#id_end_date" ).datepicker( "option", "maxDate", selectedDate );
}
});
}
});
......
......@@ -60,6 +60,7 @@ urlpatterns = patterns('astakos.im.views',
url(r'^resources/?$',
'resource_list', {}, name='resource_list'),
url(r'^billing/?$', 'billing', {}, name='billing'),
url(r'^timeline/?$', 'timeline', {}, name='timeline'),
url(r'^group/add/(?P<kind_name>\w+)?$',
'group_add', {}, name='group_add'),
url(r'^group/list/?$',
......
......@@ -67,7 +67,8 @@ from astakos.im.forms import (LoginForm, InvitationForm, ProfileForm,
FeedbackForm, SignApprovalTermsForm,
ExtendedPasswordChangeForm, EmailChangeForm,
AstakosGroupCreationForm, AstakosGroupSearchForm,
AstakosGroupUpdateForm, AddGroupMembersForm)
AstakosGroupUpdateForm, AddGroupMembersForm,
TimelineForm)
from astakos.im.functions import (send_feedback, SendMailError,
invite as invite_func, logout as auth_logout,
activate as activate_func,
......@@ -1019,3 +1020,30 @@ def clear_billing_data(data):
data['bill_addcredits'] = filter(servicefilter('addcredits'), data['bill'])
return data
def timeline(request):
data = None
l = []
if request.method == 'POST':
data = request.POST
l =[(u'test/apples', u'2012-09-20T11:39:53.1797', 192172055040L, 25569215632749L),
(u'test/pears/kate.jpg', u'2012-09-20T11:45:14.1153', 381640896L, 25626036449581L),
(u'test/pears/kate_beckinsale.jpg', u'2012-09-20T11:45:14.5830', 0L, 25626036449581L),
(u'test/pears/How To Win Friends And Influence People.pdf', u'2012-09-20T11:45:15.0694', 0L, 25626036449581L),
(u'test/pears/moms_birthday.jpg', u'2012-09-20T11:45:15.5615', 0L, 25626036449581L),
(u'test/pears/poodle_strut.mov', u'2012-09-20T11:45:16.0290', 0L, 25626036449581L),
(u'test/pears/Disturbed - Down With The Sickness.mp3', u'2012-09-20T11:45:16.4950', 0L, 25626036449581L),
(u'test/pears/army_of_darkness.avi', u'2012-09-20T11:45:16.9844', 0L, 25626036449581L),
(u'test/pears/the_mad.avi', u'2012-09-20T11:45:17.4516', 0L, 25626036449581L),
(u'test/apples/photos/animals/dogs/poodle.jpg', u'2012-09-20T11:45:17.9281', 0L, 25626036449581L),
(u'test/apples/photos/animals/dogs/terrier.jpg', u'2012-09-20T11:45:18.3918', 0L, 25626036449581L),
(u'test/apples/photos/animals/cats/persian.jpg', u'2012-09-20T11:45:18.8626', 0L, 25626036449581L),
(u'test/apples/photos/animals/cats/siamese.jpg', u'2012-09-20T11:45:19.3686', 0L, 25626036449581L),
(u'test/apples/photos/plants/fern.jpg', u'2012-09-20T11:45:19.8464', 0L, 25626036449581L),
(u'test/apples/photos/plants/rose.jpg', u'2012-09-20T11:45:20.7334', 0L, 25626036449581L)]
form = TimelineForm(data)
return render_response(template='im/timeline.html',
context_instance=get_context(request),
form=form,
l=l)
\ No newline at end of file
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