Martin Owens has proposed merging lp:~doctormo/loco-directory/event-page-design 
into lp:loco-directory.

Requested reviews:
  LoCo Team Portal Developers (loco-directory-dev)

For more details, see:
https://code.launchpad.net/~doctormo/loco-directory/event-page-design/+merge/81231

When I was looking at the Event page I noticed lots of repetition and bad 
design, so I cleared it up and put it to the side, so we can see more of the 
page at once. You'll notice the links all appear in the same place and the 
maybe and sure lists are separated so we can see right away who/how many are 
certain to come and only then look at the possibles.
-- 
https://code.launchpad.net/~doctormo/loco-directory/event-page-design/+merge/81231
Your team LoCo Team Portal Developers is requested to review the proposed merge 
of lp:~doctormo/loco-directory/event-page-design into lp:loco-directory.
=== modified file 'loco_directory/events/models.py'
--- loco_directory/events/models.py	2011-08-27 23:19:01 +0000
+++ loco_directory/events/models.py	2011-11-04 04:21:28 +0000
@@ -158,6 +158,15 @@
         self.date_end = self.fromlocaltime(local_end)
     local_date_end = property(get_local_end, set_local_end)
     
+    def attending(self):
+        return self.attendee_set.filter(promise__exact='sure')
+
+    def maybe_attending(self):
+        return self.attendee_set.filter(promise__exact='maybe')
+
+    def not_attending(self):
+        return self.attendee_set.filter(promise__exact='not')
+
     def first_team(self):
         try:
             return self.teams.all()[0]

=== modified file 'loco_directory/media/css/newstyle.css'
--- loco_directory/media/css/newstyle.css	2011-11-03 19:32:34 +0000
+++ loco_directory/media/css/newstyle.css	2011-11-04 04:21:28 +0000
@@ -661,3 +661,15 @@
     font-size: 13px;
     line-height: 1.4;
 }
+
+table.side-table {
+    width: 350px;
+    float: right;
+    display: block;
+}
+
+.short-content {
+    width: 500px;
+    clear: none;
+}
+

=== added file 'loco_directory/media/img/default-mugshot.png'
Binary files loco_directory/media/img/default-mugshot.png	1970-01-01 00:00:00 +0000 and loco_directory/media/img/default-mugshot.png	2011-11-04 04:21:28 +0000 differ
=== modified file 'loco_directory/templates/events/team_event_detail.inc.html'
--- loco_directory/templates/events/team_event_detail.inc.html	2010-11-27 15:04:43 +0000
+++ loco_directory/templates/events/team_event_detail.inc.html	2011-11-04 04:21:28 +0000
@@ -10,22 +10,12 @@
     {% endif %}
 </article>
 
-<article class="main-content">
+<article class="main-content short-content">
     <h3>{% trans "Details" %}</h3>
     {% include "events/team_event_detail_basic.inc.html" %}
 </article>
 
-<article class="main-content">
-    {% if team_event_object.registration %}
-        <h3>{% trans "Register" %}</h3>
-        <p>
-            <a href="{{team_event_object.registration}}" target="external_registration">{% trans 'Register for this Event' %}</a>
-        </p>
-    {% else %}
-        <h3>{% trans "Attendees" %}</h3>
-        {% include "events/team_event_detail_attendees.inc.html" %}
-    {% endif %}
-</article>
+{% include "events/team_event_detail_attendees.inc.html" %}
 
 {% if team_event_object.teameventcomment_set.all %}
 <article class="main-content">

=== added file 'loco_directory/templates/events/team_event_detail_attendee.inc.html'
--- loco_directory/templates/events/team_event_detail_attendee.inc.html	1970-01-01 00:00:00 +0000
+++ loco_directory/templates/events/team_event_detail_attendee.inc.html	2011-11-04 04:21:28 +0000
@@ -0,0 +1,20 @@
+{% load i18n %}
+
+<!--Alternative display using mugshots, enable when bug #734520 is fixed.
+<tr>
+  <td class="attendee-cell">
+    {% for registration in people %}
+      <a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}"; >
+        <img src="{% if registration.attendee_profile.mugshot %}{{registration.attendee_profile.mugshot}}{% else %}{{MEDIA_URL}}img/default-mugshot.png{% endif %}" title="{{registration.attendee_profile.realname}}" valign="top" width="32" height="32">
+      </a>
+    {% endfor %}
+  </td>
+</tr>-->
+
+<!--Disable when you have mugshot functionality-->        
+  <tr class="team_event_list_row {% cycle "odd" "even" %}">
+    <td align="center" class="attendee-cell">
+      <a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}"; >{{registration.attendee_profile.realname}}</a>
+        {% if registration.guests %}(+{{registration.guests}}){% endif %}
+    </td>
+  </tr>

=== modified file 'loco_directory/templates/events/team_event_detail_attendees.inc.html'
--- loco_directory/templates/events/team_event_detail_attendees.inc.html	2011-09-16 17:25:55 +0000
+++ loco_directory/templates/events/team_event_detail_attendees.inc.html	2011-11-04 04:21:28 +0000
@@ -1,64 +1,60 @@
 {% load i18n %}
-<table id="team-event-totals" class="data_table">
-    <thead>
-        <tr>
-            <td colspan="2">
-                {% if user.is_authenticated %}
-                    {% if user_is_attending %}
-                        <a href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Change your Registration Status' %}</a>
-                    {% else %}
-                        <a href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Register for this Event' %}</a>
-                    {% endif %}
-                {% else %}
-                    <a href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Register for this Event' %}</a>
-                {% endif %}
-            </td>
-        </tr>   
-    </thead>
-    <tfoot>
-    </tfoot>
-    <tbody> 
-        <tr>
-            <th class="form-item-label">{% trans 'Confirmed attending:' %} {{ team_event_object.total_attending }}</th>
-            <th class="form-item-label">{% trans 'Maybe attending:' %} {{ team_event_object.total_maybe_attending }}</th>
-        </tr>
-    </tbody>
-</table>
-
-{% if team_event_object.attendee_set.all %}
-<table id="team-event-attendees" class="basic">
-    <thead>
-        <tr>
-<!--- Commenting out until bug #734520 is fixed.
-            <th></th>
--->
-            <th>{% trans "Attendees" %}</th>
-            <th>{% trans "Registration Status" %}</th>
-            <th>{% trans "Additional Guests" %}</th>
-        </tr>
-    </thead>
-    <tfoot>
-    </tfoot>
-    <tbody>
-        {% for registration in team_event_object.attendee_set.all %}
-        <tr class="team_event_list_row {% cycle "odd" "even" %}">
-<!--- Commenting out until bug #734520 is fixed.
-            <td align="center" class="attendee-mugshot">
-                <a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}"; >
-                {% if registration.attendee_profile.mugshot %}
-                    <img src="{{registration.attendee_profile.mugshot}}" title="{{registration.attendee_profile.realname}}" valign="top" width="32" height="32">
-                {% endif %}
-                </a>
-            </td>
--->
-            <td align="center" class="attendee-cell">
-                <a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}"; >{{registration.attendee_profile.realname}}</a>
-            </td>
-            <td align="center" class="attendee-cell">{{registration.get_promise_display}}</td>
-            <td align="center" class="attendee-cell">{{registration.guests}}</td>
-        </tr>
-        {% endfor %}
-    </tbody>
-</table>
-{% endif %}
-
+
+<table id="team-event-attendees" class="basic side-table">
+    <thead>
+      <tr>
+        <th class="form-item-label">
+          {% if team_event_object.registration %}
+            {% trans "Register" %}
+          {% else %}
+            {% trans 'Attending' %}
+          {% endif %}
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td align="center" class="attendee-cell">
+          {% if team_event_object.registration %}
+            <a href="{{team_event_object.registration}}" target="external_registration">{% trans 'Register for this Event' %}</a>
+          {% else %}
+          {% if user.is_authenticated and user_is_attending %} 
+            <a href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Change your Registration Status' %}</a>
+          {% else %}
+            <a href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Register for this Event' %}</a>
+          {% endif %}
+          {% endif %}
+        </td>
+      </tr>
+    </tbody>
+
+{% if team_event_object.attending %}
+    <thead>
+      <tr>
+        <th class="form-item-label">{% trans 'Confirmed' %} ({{ team_event_object.total_attending }})</th>
+      </tr>
+    </thead>
+    <tfoot>
+    </tfoot>
+    <tbody>
+    {% for registration in team_event_object.attending %}
+      {% include "events/team_event_detail_attendee.inc.html" %}
+    {% endfor %}
+    </tbody>
+{% endif %}
+
+{% if team_event_object.maybe_attending %}
+    <thead>
+      <tr>
+        <th class="form-item-label">{% trans 'Maybe Attending' %} ({{ team_event_object.total_maybe_attending }})</th>
+      </tr>
+    </thead>
+    <tfoot>
+    </tfoot>
+    <tbody>
+    {% for registration in team_event_object.maybe_attending %}
+      {% include "events/team_event_detail_attendee.inc.html" %}
+    {% endfor %}
+    </tbody>
+{% endif %}
+</table>

_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to