Merge lp:~cjohnston/summit/add-summit-registration-links into lp:summit

Proposed by Chris Johnston
Status: Merged
Approved by: Michael Hall
Approved revision: 521
Merged at revision: 524
Proposed branch: lp:~cjohnston/summit/add-summit-registration-links
Merge into: lp:summit
Prerequisite: lp:~cjohnston/summit/registration-form
Diff against target: 91 lines (+53/-7)
2 files modified
summit/schedule/templates/schedule/summit.html (+3/-7)
summit/schedule/tests/registration.py (+50/-0)
To merge this branch: bzr merge lp:~cjohnston/summit/add-summit-registration-links
Reviewer Review Type Date Requested Status
Adnane Belmadiaf Approve
Review via email: mp+157520@code.launchpad.net

Commit message

Add links to register your attendance in Summit

To post a comment you must log in.
520. By Chris Johnston

Puts css in theme

Revision history for this message
Adnane Belmadiaf (daker) wrote :

+1

review: Approve
521. By Chris Johnston

Update from trunk

Revision history for this message
Adnane Belmadiaf (daker) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'summit/schedule/templates/schedule/summit.html'
2--- summit/schedule/templates/schedule/summit.html 2013-04-07 23:42:24 +0000
3+++ summit/schedule/templates/schedule/summit.html 2013-04-08 21:08:20 +0000
4@@ -38,19 +38,15 @@
5 <div class="row">
6 <section class="span-8">
7 {% if attendee %}
8- <p>You are attending, you can update the days and times of your attendance <ins></ins>
9- <a class="launchpad" href="http://launchpad.net/sprints/{{ summit.name }}/+attend"><img src="/media/img/gem-sm.png" /> Launchpad</a>.
10+ <p>You are registered as attending {{ summit.title }}. <a href="{% url registration summit %}">Update registration</a>.
11 </p>
12 <p>Download your
13 <a href="/{{ summit.name }}/participant/my_schedule_{{ attendee.secret_key }}.ical">Participation Schedule</a> to import into your Calendar.
14 </p>
15 {% else %}
16 {% if request.user.is_authenticated %}
17- <p><strong>You are not registered as attending.</strong></p>
18- <p>You can register your attendance in
19- <a class="launchpad" href="http://launchpad.net/sprints/{{ summit.name }}/+attend"><img src="/media/img/gem-sm.png" /> Launchpad</a>.
20- If you have recently done so, wait a few minutes and reload this page.
21- </p>
22+ <p><strong>You have not registered in Summit.</strong></p>
23+ <p><a class="link-cta" href="{% url registration summit %}">Register in Summit</a></p>
24 {% else %}
25 <p><strong>You are not logged in.</strong></p>
26 <p><a href="/openid/login?next={{login_next}}">Log in now</a></p>
27
28=== modified file 'summit/schedule/tests/registration.py'
29--- summit/schedule/tests/registration.py 2013-04-08 21:08:20 +0000
30+++ summit/schedule/tests/registration.py 2013-04-08 21:08:20 +0000
31@@ -85,6 +85,19 @@
32 attendee = Attendee.objects.get(user=self.user1)
33 return attendee
34
35+ def view_summit_page(self):
36+ rev_args = [self.summit.name, ]
37+ response = self.c.get(
38+ reverse(
39+ 'summit.schedule.views.summit',
40+ args=rev_args
41+ )
42+ )
43+ self.assertEqual(response.status_code, 200)
44+ self.assertTemplateUsed(response, 'schedule/summit.html')
45+
46+ return response
47+
48 def with_summit_registration_times(self):
49 """
50 Using the start and end of the summit as the registration times
51@@ -220,3 +233,40 @@
52 response.content
53 )
54 self.with_custom_registration_times()
55+
56+ def test_registered_view(self):
57+ """
58+ Test that when a user is already registered for the summit
59+ that they will see a link to update their registration
60+ """
61+ self.create_attendee()
62+ self.attendee1.from_launchpad = True
63+ self.attendee1.save()
64+ self.login()
65+ rev_args = [self.summit.name, ]
66+ response = self.view_summit_page()
67+ self.assertIn(
68+ reverse(
69+ 'registration',
70+ args=rev_args
71+ ),
72+ response.content
73+ )
74+ self.assertIn('Update registration', response.content)
75+
76+ def test_unregistered_view(self):
77+ """
78+ Test that when a user is not registered for the summit
79+ that they will see a button to register
80+ """
81+ self.login()
82+ rev_args = [self.summit.name, ]
83+ response = self.view_summit_page()
84+ self.assertIn(
85+ reverse(
86+ 'registration',
87+ args=rev_args
88+ ),
89+ response.content
90+ )
91+ self.assertIn('Register in Summit', response.content)

Subscribers

People subscribed via source and target branches