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
=== modified file 'loco_directory/media/css/styles.css'
--- loco_directory/media/css/styles.css 2012-12-13 22:48:12 +0000
+++ loco_directory/media/css/styles.css 2012-12-18 22:38:19 +0000
@@ -670,6 +670,7 @@
670670
671.events-meetings-wrapper {671.events-meetings-wrapper {
672 margin-top: 5px;672 margin-top: 5px;
673 border-bottom: 1px solid #E6E6E6;
673}674}
674675
675.events-meetings-wrapper h3.title676.events-meetings-wrapper h3.title
@@ -710,6 +711,16 @@
710 font-style: italic;711 font-style: italic;
711}712}
712713
714.team-planet-wrapper {
715 margin-top: 5px;
716}
717
718.team-planet-wrapper h3.title {
719 margin: 0;
720 padding-left: 15px;
721 padding-bottom: 5px;
722}
723
713.team-photos-wrapper {724.team-photos-wrapper {
714 border-top: #CCC 1px dotted;725 border-top: #CCC 1px dotted;
715 padding-top: 10px;726 padding-top: 10px;
@@ -1166,6 +1177,14 @@
1166 position: relative;1177 position: relative;
1167}1178}
11681179
1180article.team-blog-entry {
1181 border-top: 1px dotted #DFDCD9;
1182 overflow: hidden;
1183 padding: 15px 20px;
1184 margin: 0;
1185 position: relative;
1186}
1187
1169.blog-entry-image {1188.blog-entry-image {
1170 float: left;1189 float: left;
1171 margin: 0 10px 0 0;1190 margin: 0 10px 0 0;
11721191
=== modified file 'loco_directory/teams/views.py'
--- loco_directory/teams/views.py 2012-11-28 00:46:29 +0000
+++ loco_directory/teams/views.py 2012-12-18 22:38:19 +0000
@@ -16,6 +16,7 @@
1616
17from events.models import TeamEvent17from events.models import TeamEvent
18from meetings.models import TeamMeeting18from meetings.models import TeamMeeting
19from articles.models import Article
1920
20import forms21import forms
2122
@@ -148,8 +149,10 @@
148 return render_to_response('teams/team_meeting_history.html', context,149 return render_to_response('teams/team_meeting_history.html', context,
149 RequestContext(request))150 RequestContext(request))
150151
152
151def team_detail(request, team_slug):153def team_detail(request, team_slug):
152 team_object = get_object_or_404(Team, lp_name=team_slug)154 team_object = get_object_or_404(Team, lp_name=team_slug)
155 articles = Article.objects.filter(source__team=team_object)[:5]
153 is_member = False156 is_member = False
154 is_admin = False157 is_admin = False
155 if request.user.is_authenticated():158 if request.user.is_authenticated():
@@ -157,12 +160,14 @@
157 is_admin = launchpad.is_admin_or_owner(request.user.username, team_object) or launchpad.is_user_on_loco_council(request.user)160 is_admin = launchpad.is_admin_or_owner(request.user.username, team_object) or launchpad.is_user_on_loco_council(request.user)
158 context = {161 context = {
159 'team': team_object,162 'team': team_object,
160 'is_member' : is_member,163 'articles': articles,
161 'is_admin' : is_admin,164 'is_member': is_member,
165 'is_admin': is_admin,
162 }166 }
163 return render_to_response('teams/team_detail.html',167 return render_to_response('teams/team_detail.html',
164 context, RequestContext(request))168 context, RequestContext(request))
165169
170
166@login_required171@login_required
167def select_other_team(request, team_slug):172def select_other_team(request, team_slug):
168 team_object = get_object_or_404(Team, lp_name=team_slug)173 team_object = get_object_or_404(Team, lp_name=team_slug)
169174
=== modified file 'loco_directory/templates/index.html'
--- loco_directory/templates/index.html 2012-12-13 23:11:46 +0000
+++ loco_directory/templates/index.html 2012-12-18 22:38:19 +0000
@@ -72,11 +72,11 @@
72 <h4 class="blog-entry-title"><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h4>72 <h4 class="blog-entry-title"><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h4>
73 <div class="blog-entry-author">73 <div class="blog-entry-author">
74 {% if article.source.team %}74 {% if article.source.team %}
75 <a class="team" href="{% url team-detail article.source.team %}" target="_blank">{{ article.source.team.name }}</a>75 <a class="team" href="{% url team-detail article.source.team %}">{{ article.source.team.name }}</a>
76 {% endif %}76 {% endif %}
77 {% if article.source.user %}77 {% if article.source.user %}
78 {% if article.source.team %}, {% endif %}78 {% if article.source.team %}, {% endif %}
79 <a class="user" href="{% url profile-detail article.source.user.user.username %}" target="_blank">{{ article.source.user }}</a>79 <a class="user" href="{% url profile-detail article.source.user.user.username %}">{{ article.source.user }}</a>
80 {% endif %}80 {% endif %}
81 </div>81 </div>
82 <div class="blog-entry-text">82 <div class="blog-entry-text">
8383
=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html 2012-12-09 15:08:12 +0000
+++ loco_directory/templates/teams/team_detail.html 2012-12-18 22:38:19 +0000
@@ -201,6 +201,35 @@
201 {% endif %}201 {% endif %}
202 </div>202 </div>
203203
204 {% if articles %}
205 <div class="team-planet-wrapper">
206 <div style="overflow: auto;">
207 <h3 class="title">{% trans "Planet Feed" %}</h3>
208 </div>
209 {% for article in articles %}
210 <article class="team-blog-entry">
211 {% if article.source.user %}
212 <img class="blog-entry-image" src="{{ article.source.user.mugshot }}" />
213 {% endif %}
214 <h4 class="blog-entry-title">
215 <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">{{ article.title }}</a>
216 </h4>
217 <div class="blog-entry-author">
218 {% if article.source.user %}
219 <a class="user" href="{% url profile-detail article.source.user.user.username %}">{{ article.source.user }}</a>
220 {% endif %}
221 </div>
222 <div class="blog-entry-text">
223 <p>{{ article.content|safe|striptags|truncatewords_html:100 }}</p>
224 <p class="more">
225 <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">{% trans 'Read More' %} ›</a>
226 </p>
227 </div>
228 </article>
229 {% endfor %}
230 </div>
231 {% endif %}
232
204 {% if team.flickr_id or team.picasa_id or team.pixie_id %}233 {% if team.flickr_id or team.picasa_id or team.pixie_id %}
205 <div class="team-photos-wrapper">234 <div class="team-photos-wrapper">
206 {% with team.name as team_name %}235 {% with team.name as team_name %}

Subscribers

People subscribed via source and target branches