Ronnie has proposed merging lp:~ronnie.vd.c/loco-directory/my-teams into
lp:loco-directory with lp:~mhall119/loco-directory/bzr-apps-upgrades as a
prerequisite.
Requested reviews:
loco-directory-dev (loco-directory-dev)
For more details, see:
https://code.launchpad.net/~ronnie.vd.c/loco-directory/my-teams/+merge/56147
Added my Teams page
--
https://code.launchpad.net/~ronnie.vd.c/loco-directory/my-teams/+merge/56147
Your team loco-directory-dev is requested to review the proposed merge of
lp:~ronnie.vd.c/loco-directory/my-teams into lp:loco-directory.
=== modified file '.bzrignore'
--- .bzrignore 2010-08-28 19:27:47 +0000
+++ .bzrignore 2011-04-04 12:36:43 +0000
@@ -10,3 +10,5 @@
local_settings.py
loco_directory/ubuntu_website
data
+bzr_apps
+loco_directory/media/js/twidenash
=== modified file 'loco_directory/events/models.py'
--- loco_directory/events/models.py 2011-03-16 18:52:30 +0000
+++ loco_directory/events/models.py 2011-04-04 12:36:43 +0000
@@ -90,6 +90,10 @@
class TeamEventManager(models.Manager):
""" manager for a team event """
+ def next_3_events(self):
+ """ a list with the next 3 events """
+ return self.filter(date_end__gt=datetime.datetime.now()).order_by('date_end')[:3]
+
def next_5_events(self):
""" a list with the next 5 events """
return self.filter(date_end__gt=datetime.datetime.now()).order_by('date_end')[:5]
=== modified file 'loco_directory/media/css/newstyle.css'
--- loco_directory/media/css/newstyle.css 2011-03-15 13:08:01 +0000
+++ loco_directory/media/css/newstyle.css 2011-04-04 12:36:43 +0000
@@ -479,3 +479,69 @@
position: absolute;
right: 10px;
}
+
+/* My Teams style */
+h2.dynamic-width {
+ display: inline-block;
+ margin-bottom: 0;
+}
+
+.resources {
+ font-size: 0.75em;
+ float: right;
+ margin-top: 21px;
+}
+
+.resources a {
+ margin-left: 8px;
+}
+
+.flickr a {
+ display: inline-block;
+ padding: 7px;
+}
+
+.main-content-split {
+ width:450px;
+ margin-top: 15px;
+}
+
+.main-content-split.left {
+ float: left;
+}
+
+.main-content-split.right {
+ float: right;
+}
+
+.main-content-split.left .title {
+ font-size: 0.875em;
+}
+
+.main-content-split.left .new {
+ float: right;
+ font-size: 0.75em;
+}
+
+.event-summary {
+ margin-top:15px;
+}
+
+hr.no-top {
+ margin: 0 0;
+}
+
+img.bottom {
+ vertical-align: bottom;
+}
+
+ul.indent {
+ list-style: none;
+ background-color: #F7F7F7;
+ padding: 2px 2px 2px 15px;
+}
+
+ul.indent li {
+ line-height:1.2em;
+ margin: 0.5em 0;
+}
=== modified file 'loco_directory/media/css/twidenash.css'
--- loco_directory/media/css/twidenash.css 2011-04-04 12:36:43 +0000
+++ loco_directory/media/css/twidenash.css 2011-04-04 12:36:43 +0000
@@ -18,6 +18,7 @@
float: left;
vertical-align: top;
padding-right: 10px;
+ margin-top: 3px;
}
.twidenash li .comment {
=== added file 'loco_directory/media/img/rss.png'
Binary files loco_directory/media/img/rss.png 1970-01-01 00:00:00 +0000 and loco_directory/media/img/rss.png 2011-04-04 12:36:43 +0000 differ
=== modified file 'loco_directory/meetings/models.py'
--- loco_directory/meetings/models.py 2011-03-18 13:37:13 +0000
+++ loco_directory/meetings/models.py 2011-04-04 12:36:43 +0000
@@ -38,7 +38,14 @@
class TeamMeetingManager(models.Manager):
""" manager for a team event """
-
+ def next_3_meetings(self):
+ """ a list with the next 3 team meetings """
+ return self.next_meetings()[:3]
+
+ def next_5_meetings(self):
+ """ a list with the next 5 team meetings """
+ return self.next_meetings()[:5]
+
def next_meetings(self):
""" a list with all upcoming team meetings """
return self.filter(date_end__gt=datetime.datetime.now()).order_by('date_end')
=== modified file 'loco_directory/settings.py'
--- loco_directory/settings.py 2011-04-04 12:36:43 +0000
+++ loco_directory/settings.py 2011-04-04 12:36:43 +0000
@@ -174,7 +174,7 @@
'ubuntu_website': ('bzr+ssh://bazaar.launchpad.net/~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme', '32'),
## twidenash supplied microblog embedding javascript
- 'media/js/twidenash': ('bzr+ssh://bazaar.launchpad.net/~django-foundations-dev/twidenash/2.0/', '2'),
+ 'media/js/twidenash': ('bzr+ssh://bazaar.launchpad.net/~django-foundations-dev/twidenash/2.0/', '3'),
}
import logging
=== modified file 'loco_directory/teams/models.py'
--- loco_directory/teams/models.py 2011-01-18 20:49:15 +0000
+++ loco_directory/teams/models.py 2011-04-04 12:36:43 +0000
@@ -128,6 +128,6 @@
if len(events_and_meetings) > 5:
events_and_meetings = events_and_meetings[:5]
return events_and_meetings
-
+
def teams_without_country():
return Team.objects.filter(countries__isnull=True)
=== modified file 'loco_directory/teams/urls.py'
--- loco_directory/teams/urls.py 2011-02-17 21:16:56 +0000
+++ loco_directory/teams/urls.py 2011-04-04 12:36:43 +0000
@@ -2,6 +2,7 @@
urlpatterns = patterns('',
url(r'^$', 'teams.views.team_list', name='team-list'),
+ url(r'^me$', 'teams.views.my_teams', name='my-teams'),
url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/edit$', 'teams.views.team_edit', name='team-edit'),
url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/merge/(?P<other_team_slug>[a-zA-Z0-9\-\.\+?]+)/$', 'teams.views.team_merge', name='team-merge'),
url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/merge', 'teams.views.select_other_team', name='select-other-team'),
=== modified file 'loco_directory/teams/views.py'
--- loco_directory/teams/views.py 2011-02-17 21:16:56 +0000
+++ loco_directory/teams/views.py 2011-04-04 12:36:43 +0000
@@ -78,6 +78,16 @@
return render_to_response('teams/team_list.html', context,
RequestContext(request))
+@login_required
+def my_teams(request):
+ teams = Team.objects.filter(lp_name__in=[group.name for group in request.user.groups.all()])
+ context = {
+ 'teams': teams,
+ }
+ return render_to_response('teams/my_teams.html', context,
+ RequestContext(request))
+
+
def team_ical(request, team_slug):
"""
Return a ical list with the events and meetings in ical format.
=== modified file 'loco_directory/templates/base.html'
--- loco_directory/templates/base.html 2011-03-15 13:08:01 +0000
+++ loco_directory/templates/base.html 2011-04-04 12:36:43 +0000
@@ -15,11 +15,8 @@
{% trans "Logged in as:" %}
<a class="top-login-item" href="http://launchpad.net/~{{ user.username }}">{{ user.username }}</a>
<span class="top-login-separator">|</span>
- {% comment %}
- <!-- Need to be activated when https://code.launchpad.net/~ronnie.vd.c/loco-directory/my-teams is merged -->
<a class="top-login-item" href="{% url my-teams %}">{% trans "My Teams" %}</a>
<span class="top-login-separator">|</span>
- {% endcomment %}
<a class="top-login-item" href="{% url logout %}" title="{% trans "Log Out" %}: {{ user.username }}">{% trans "Log Out" %}</a>
{% else %}
<a class="top-login-item" href="/openid/login?next={{login_next}}" title="{% trans "Log In" %}">{% trans "Log In" %}</a>
=== added file 'loco_directory/templates/teams/my_teams.html'
--- loco_directory/templates/teams/my_teams.html 1970-01-01 00:00:00 +0000
+++ loco_directory/templates/teams/my_teams.html 2011-04-04 12:36:43 +0000
@@ -0,0 +1,103 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans "My Teams" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
+
+{% block extrahead %}{{ block.super }}
+ <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />
+ <script type="text/javascript" src="{{MEDIA_URL}}jquery/jquery.js"></script>
+ <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.lightbox-0.5.min.js"></script>
+ <link rel="stylesheet" href="{{MEDIA_URL}}css/jquery.lightbox-0.5.css" type="text/css" media="screen" />
+ <script type="text/javascript" src="{{MEDIA_URL}}js/jquery-flickr.js"></script>
+ <script src="{{ MEDIA_URL }}js/twidenash/jquery-twidenash.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ //<![CDATA[
+ $(function () {
+ $('.twidenash').twidenash({ amount: 3 });
+ {% for team in teams %}
+ $('#flickr-{{ team.lp_name }}').flickr({ key: "{{ flickr_api_key }}", id: "{{ team.flickr_id }}", amount: 10 });
+ {% endfor %}
+ });
+ //]]>
+ </script>
+ {# <!-- TODO: this shpuld be rss of events AND meetings --> #}
+ {% for team in teams %}
+ <link type="application/rss+xml" rel="alternate" title="{% trans "Team Events (RSS)" %}" href="{% url team-events-rss team_slug=team.lp_name %}" />
+ {% endfor %}
+{% endblock %}
+
+
+{% block sub_nav_links %}
+ <a class="sub-nav-item" href="{% url my-teams %}" title="{% trans 'My Teams' %}">{% trans "My Teams" %}</a>
+ <a class="sub-nav-item" href="{% url team-list %}" title="{% trans 'All Teams' %}">{% trans "All Teams" %}</a>
+ {% comment %}
+ <!-- TODO: Need to create those pages -->
+ <a class="sub-nav-item" href="" title="{% trans 'Join a Team' %}">{% trans "Join a Team" %}</a>
+ <a class="sub-nav-item" href="" title="{% trans 'Create a Team' %}">{% trans "Create a Team" %}</a>
+ {% endcomment %}
+{% endblock %}
+
+{% block content %}
+ {% for team in teams %}
+ <article class="main-content">
+ <h2 class="dynamic-width">
+ <a href="{% url team-detail team_slug=team.lp_name %}" class="team-title" title="{{ team.name }}">{{ team.name }}</a>
+ {% comment %}
+ <a href="{% url team-calendar team_slug=team.lp_name %}" title="{% trans "Team Calendar (ICAL)" %}"><img class="bottom" src="{{ MEDIA_URL }}img/ical.png" /></a>
+ {# <!-- TODO: this shpuld be rss of events AND meetings --> #}
+ {# <!-- TODO: Change icon to RSS icon --> #}
+ <a href="{% url team-events-rss team_slug=team.lp_name %}" title="{% trans "Team Feed (RSS)" %}"><img class="bottom" src="{{ MEDIA_URL }}img/rss.png" /></a>
+ {% endcomment %}
+ </h2>
+ <aside class="resources">
+ <span>{% trans "Resources: " %}</span>
+ {% if team.web_url %}<a href="{{ team.web_url }}">{% trans "Website" %}</a>{% endif %}
+ {% if team.wiki_url %}<a href="{{ team.wiki_url }}">{% trans "Wiki" %}</a>{% endif %}
+ {% if team.forum_url %}<a href="{{ team.forum_url }}">{% trans "Forums" %}</a>{% endif %}
+ {% if team.ml_url %}<a href="{{ team.ml_url }}">{% trans "Mailing List" %}</a>{% endif %}
+ {# <!-- There should be a separate chat page which supports joining channel by url-tag --> #}
+ {% if team.irc_chan %}<a href="/chat">{% trans "IRC Channel" %}</a>{% endif %}
+ </aside>
+ <hr class="no-top" />
+ <section class="main-content-split left">
+ <section class="meeting-summary">
+ <a href="{% url team-meeting-list team_slug=team.lp_name %}" class="title">{% trans "Meetings" %}</a>
+ <a href="{% url team-meeting-new team_slug=team.lp_name %}" class="new">{% trans "+ new meeting" %}</a>
+ <hr class="no-top" />
+ <ul class="indent">
+ {% if team.teammeeting_set.next_3_meetings %}
+ {% for team_event in team.teammeeting_set.next_3_meetings %}
+ {% include 'meetings/team_meeting_li.inc.html' %}
+ {% endfor %}
+ {% else %}
+ <li>{% trans "There are no schedules meetings for this team" %}</li>
+ {% endif %}
+ </ul>
+ </section>
+ <section class="event-summary">
+ <a href="{% url team-event-list team_slug=team.lp_name %}" class="title">{% trans "Events" %}</a>
+ <a href="{% url team-event-new team_slug=team.lp_name %}" class="new">{% trans "+ new event" %}</a>
+ <hr class="no-top" />
+ <ul class="indent">
+ {% if team.teamevent_set.next_3_events %}
+ {% for team_event in team.teamevent_set.next_3_events %}
+ {% include 'events/team_event_li.inc.html' %}
+ {% endfor %}
+ {% else %}
+ <li>{% trans "There are no schedules events for this team" %}</li>
+ {% endif %}
+ </ul>
+ </section>
+ </section>
+ <section class="main-content-split right">
+ {% if team.microbloghashtag %}
+ <div class="twidenash" id="{{ team.microbloghashtag }}"></div>
+ {% else %}
+ {% if team.flickr_id %} {# or team.picasa_id or team.pixie_id %}#}
+ <div class="flickr" id="flickr-{{ team.lp_name }}"></div>
+ {% endif %}
+ {% endif %}
+ </section>
+ </article>
+ {% endfor %}
+{% endblock %}
=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html 2011-04-04 12:36:43 +0000
+++ loco_directory/templates/teams/team_detail.html 2011-04-04 12:36:43 +0000
@@ -30,7 +30,7 @@
{% if team.flickr_id %}
- $('#flickr').flickr({ key: "{{ flickr_api_key }}", id: "{{ team.flickr_id }}", amount: perPage });
+ $('#flickr').flickr({ key: "{{ flickr_api_key }}", id: "{{ team.flickr_id }}", amount: 6 });
{% endif %}
{% if team.picasa_id %}
var picasa_userId = '{{ team.picasa_id }}';
_______________________________________________
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