Merge lp:~daker/loco-team-portal/fix.1089686 into lp:loco-team-portal

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Adnane Belmadiaf
Approved revision: 584
Merged at revision: 583
Proposed branch: lp:~daker/loco-team-portal/fix.1089686
Merge into: lp:loco-team-portal
Diff against target: 141 lines (+57/-4)
4 files modified
loco_directory/media/css/styles.css (+19/-0)
loco_directory/teams/views.py (+7/-2)
loco_directory/templates/index.html (+2/-2)
loco_directory/templates/teams/team_detail.html (+29/-0)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.1089686
Reviewer Review Type Date Requested Status
LoCo Team Portal Developers Pending
Review via email: mp+140563@code.launchpad.net

Commit message

Show a team's blog feed on the team details page

Description of the change

To post a comment you must log in.
584. By Adnane Belmadiaf

Remove print statement

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/media/css/styles.css'
2--- loco_directory/media/css/styles.css 2012-12-13 22:48:12 +0000
3+++ loco_directory/media/css/styles.css 2012-12-18 22:38:19 +0000
4@@ -670,6 +670,7 @@
5
6 .events-meetings-wrapper {
7 margin-top: 5px;
8+ border-bottom: 1px solid #E6E6E6;
9 }
10
11 .events-meetings-wrapper h3.title
12@@ -710,6 +711,16 @@
13 font-style: italic;
14 }
15
16+.team-planet-wrapper {
17+ margin-top: 5px;
18+}
19+
20+.team-planet-wrapper h3.title {
21+ margin: 0;
22+ padding-left: 15px;
23+ padding-bottom: 5px;
24+}
25+
26 .team-photos-wrapper {
27 border-top: #CCC 1px dotted;
28 padding-top: 10px;
29@@ -1166,6 +1177,14 @@
30 position: relative;
31 }
32
33+article.team-blog-entry {
34+ border-top: 1px dotted #DFDCD9;
35+ overflow: hidden;
36+ padding: 15px 20px;
37+ margin: 0;
38+ position: relative;
39+}
40+
41 .blog-entry-image {
42 float: left;
43 margin: 0 10px 0 0;
44
45=== modified file 'loco_directory/teams/views.py'
46--- loco_directory/teams/views.py 2012-11-28 00:46:29 +0000
47+++ loco_directory/teams/views.py 2012-12-18 22:38:19 +0000
48@@ -16,6 +16,7 @@
49
50 from events.models import TeamEvent
51 from meetings.models import TeamMeeting
52+from articles.models import Article
53
54 import forms
55
56@@ -148,8 +149,10 @@
57 return render_to_response('teams/team_meeting_history.html', context,
58 RequestContext(request))
59
60+
61 def team_detail(request, team_slug):
62 team_object = get_object_or_404(Team, lp_name=team_slug)
63+ articles = Article.objects.filter(source__team=team_object)[:5]
64 is_member = False
65 is_admin = False
66 if request.user.is_authenticated():
67@@ -157,12 +160,14 @@
68 is_admin = launchpad.is_admin_or_owner(request.user.username, team_object) or launchpad.is_user_on_loco_council(request.user)
69 context = {
70 'team': team_object,
71- 'is_member' : is_member,
72- 'is_admin' : is_admin,
73+ 'articles': articles,
74+ 'is_member': is_member,
75+ 'is_admin': is_admin,
76 }
77 return render_to_response('teams/team_detail.html',
78 context, RequestContext(request))
79
80+
81 @login_required
82 def select_other_team(request, team_slug):
83 team_object = get_object_or_404(Team, lp_name=team_slug)
84
85=== modified file 'loco_directory/templates/index.html'
86--- loco_directory/templates/index.html 2012-12-13 23:11:46 +0000
87+++ loco_directory/templates/index.html 2012-12-18 22:38:19 +0000
88@@ -72,11 +72,11 @@
89 <h4 class="blog-entry-title"><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h4>
90 <div class="blog-entry-author">
91 {% if article.source.team %}
92- <a class="team" href="{% url team-detail article.source.team %}" target="_blank">{{ article.source.team.name }}</a>
93+ <a class="team" href="{% url team-detail article.source.team %}">{{ article.source.team.name }}</a>
94 {% endif %}
95 {% if article.source.user %}
96 {% if article.source.team %}, {% endif %}
97- <a class="user" href="{% url profile-detail article.source.user.user.username %}" target="_blank">{{ article.source.user }}</a>
98+ <a class="user" href="{% url profile-detail article.source.user.user.username %}">{{ article.source.user }}</a>
99 {% endif %}
100 </div>
101 <div class="blog-entry-text">
102
103=== modified file 'loco_directory/templates/teams/team_detail.html'
104--- loco_directory/templates/teams/team_detail.html 2012-12-09 15:08:12 +0000
105+++ loco_directory/templates/teams/team_detail.html 2012-12-18 22:38:19 +0000
106@@ -201,6 +201,35 @@
107 {% endif %}
108 </div>
109
110+ {% if articles %}
111+ <div class="team-planet-wrapper">
112+ <div style="overflow: auto;">
113+ <h3 class="title">{% trans "Planet Feed" %}</h3>
114+ </div>
115+ {% for article in articles %}
116+ <article class="team-blog-entry">
117+ {% if article.source.user %}
118+ <img class="blog-entry-image" src="{{ article.source.user.mugshot }}" />
119+ {% endif %}
120+ <h4 class="blog-entry-title">
121+ <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">{{ article.title }}</a>
122+ </h4>
123+ <div class="blog-entry-author">
124+ {% if article.source.user %}
125+ <a class="user" href="{% url profile-detail article.source.user.user.username %}">{{ article.source.user }}</a>
126+ {% endif %}
127+ </div>
128+ <div class="blog-entry-text">
129+ <p>{{ article.content|safe|striptags|truncatewords_html:100 }}</p>
130+ <p class="more">
131+ <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">{% trans 'Read More' %} ›</a>
132+ </p>
133+ </div>
134+ </article>
135+ {% endfor %}
136+ </div>
137+ {% endif %}
138+
139 {% if team.flickr_id or team.picasa_id or team.pixie_id %}
140 <div class="team-photos-wrapper">
141 {% with team.name as team_name %}

Subscribers

People subscribed via source and target branches