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

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Adnane Belmadiaf
Approved revision: 581
Merged at revision: 580
Proposed branch: lp:~daker/loco-team-portal/fix.839011-839014
Merge into: lp:loco-team-portal
Diff against target: 209 lines (+111/-7)
8 files modified
Vagrantfile (+1/-1)
loco_directory/articles/models.py (+6/-0)
loco_directory/articles/urls.py (+7/-0)
loco_directory/articles/views.py (+17/-2)
loco_directory/media/css/styles.css (+11/-0)
loco_directory/templates/articles/article_detail.html (+66/-0)
loco_directory/templates/index.html (+2/-4)
loco_directory/urls.py (+1/-0)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.839011-839014
Reviewer Review Type Date Requested Status
LoCo Team Portal Developers Pending
Review via email: mp+139810@code.launchpad.net

Commit message

Added team flag for each blog post
Added support for the full post

Description of the change

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

Fixed the description

581. By Adnane Belmadiaf

Fixed the titles

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Vagrantfile'
2--- Vagrantfile 2012-12-12 22:38:29 +0000
3+++ Vagrantfile 2012-12-13 23:13:21 +0000
4@@ -12,7 +12,7 @@
5 ltp.ssh.max_tries = 50
6 ltp.ssh.timeout = 300
7
8- ltp.vm.share_folder("v-root", "/home/vagrant/ltp", ".", :nfs => true)
9+ ltp.vm.share_folder("v-root", "/home/vagrant/ltp", ".")
10
11 ltp.vm.provision :puppet do |puppet|
12 puppet.manifests_path = "puppet/manifests"
13
14=== modified file 'loco_directory/articles/models.py'
15--- loco_directory/articles/models.py 2012-12-12 23:07:32 +0000
16+++ loco_directory/articles/models.py 2012-12-13 23:13:21 +0000
17@@ -7,6 +7,8 @@
18
19 from django.db import models
20 from django.conf import settings
21+from django.template.defaultfilters import slugify
22+
23
24 from teams.models import Team
25 from userprofiles.models import UserProfile
26@@ -119,3 +121,7 @@
27
28 def __unicode__(self):
29 return u'%s (%s)' % (self.title, self.author)
30+
31+ @models.permalink
32+ def get_absolute_url(self):
33+ return ('article-detail', [str(self.id), slugify(self.title)])
34
35=== added file 'loco_directory/articles/urls.py'
36--- loco_directory/articles/urls.py 1970-01-01 00:00:00 +0000
37+++ loco_directory/articles/urls.py 2012-12-13 23:13:21 +0000
38@@ -0,0 +1,7 @@
39+# -*- coding: utf-8 -*-
40+from django.conf.urls.defaults import *
41+
42+urlpatterns = patterns('',
43+ url(r'^(?P<article_id>\d+)-(?P<article_slug>[a-zA-Z0-9\-\.\+?]+)/$',
44+ 'articles.views.article_detail', name='article-detail'),
45+)
46
47=== modified file 'loco_directory/articles/views.py'
48--- loco_directory/articles/views.py 2011-06-01 22:19:20 +0000
49+++ loco_directory/articles/views.py 2012-12-13 23:13:21 +0000
50@@ -1,2 +1,17 @@
51-# Create your views here.
52-
53+# -*- coding: utf-8 -*-
54+from django.shortcuts import (render_to_response, get_object_or_404)
55+from django.template import RequestContext
56+from .models import Article
57+
58+
59+def article_detail(request, article_id, article_slug=None):
60+ """
61+ detailed view for an article
62+ """
63+ article = get_object_or_404(Article, pk=article_id)
64+
65+ context = {
66+ 'article': article,
67+ }
68+ return render_to_response('articles/article_detail.html',
69+ context, RequestContext(request))
70
71=== modified file 'loco_directory/media/css/styles.css'
72--- loco_directory/media/css/styles.css 2012-12-13 20:46:23 +0000
73+++ loco_directory/media/css/styles.css 2012-12-13 23:13:21 +0000
74@@ -1221,6 +1221,17 @@
75 margin-bottom: 0px;
76 }
77
78+.blog-entry-text ol, ul {
79+ text-align:justify;
80+ font-size: 13px;
81+ line-height: 1.4;
82+}
83+
84+.blog-entry-text img {
85+ max-width: 658px;
86+}
87+
88+
89 .rsvp-link {
90 margin: 0 auto;
91 margin-top: 10px!important;
92
93=== added directory 'loco_directory/templates/articles'
94=== added file 'loco_directory/templates/articles/article_detail.html'
95--- loco_directory/templates/articles/article_detail.html 1970-01-01 00:00:00 +0000
96+++ loco_directory/templates/articles/article_detail.html 2012-12-13 23:13:21 +0000
97@@ -0,0 +1,66 @@
98+{% extends "base.html" %}
99+{% load i18n %}
100+
101+{% block page_name %}{{ article.title }}{% endblock %}
102+
103+{% block extrahead %}{{ block.super }}
104+<meta property="fb:app_id" content="127188230723188"/>
105+<meta property="og:title" content="{{ article.title }}" />
106+<meta property="og:description" content="{{ article|safe|striptags|truncatewords_html:100 }}" />
107+<meta property="og:url" content="http://loco.ubuntu.com{{ article.get_absolute_url }}"/>
108+<meta property="og:image" content="http://loco.ubuntu.com/media/images/cof_orange_hex1.png"/>
109+<meta property="og:site_name" content="Loco Team Portal"/>
110+<meta property="og:type" content="article"/>
111+{% endblock %}
112+
113+
114+{% block content %}
115+<div class="row">
116+ <section class="span-9">
117+ <article class="blog-entry">
118+ {% if article.source.team %}
119+ <img class="blog-entry-image" src="{{ article.source.team.mugshot_url }}" />
120+ {% else %}
121+ {% if article.source.user %}
122+ <img class="blog-entry-image" src="{{ article.source.user.mugshot }}" />
123+ {% endif %}
124+ {% endif %}
125+ <h4 class="blog-entry-title"><a href="{{ article.link }}" target="_blank" title="{{ article.title }}">{{ article.title }}</a></h4>
126+ <div class="blog-entry-author">
127+ {% if article.source.team %}
128+ <a class="team" href="{% url team-detail article.source.team %}" target="_blank">{{ article.source.team.name }}</a>
129+ {% endif %}
130+ {% if article.source.user %}
131+ {% if article.source.team %}, {% endif %}
132+ <a class="user" href="{% url profile-detail article.source.user.user.username %}" target="_blank">{{ article.source.user }}</a>
133+ {% endif %}
134+ </div>
135+ <div class="share">
136+ <div id="fb-root"></div>
137+ <script>(function(d, s, id) {
138+ var js, fjs = d.getElementsByTagName(s)[0];
139+ if (d.getElementById(id)) {return;}
140+ js = d.createElement(s); js.id = id;
141+ js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=127188230723188";
142+ fjs.parentNode.insertBefore(js, fjs);
143+ }(document, 'script', 'facebook-jssdk'));</script>
144+ <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
145+ <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
146+ <g:plusone size="medium"></g:plusone>
147+ <a href="http://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a>
148+ <div class="fb-like" data-href="http://loco.ubuntu.com{{ article.get_absolute_url }}" data-send="false" data-layout="button_count" data-width="40" data-show-faces="false" data-font="arial"></div>
149+ </div>
150+ <div class="blog-entry-text">
151+ <p>
152+ {% autoescape off %}
153+ {{ article.content|safe }}
154+ {% endautoescape %}
155+ </p>
156+ <p class="more">
157+ <a href="{{ article.link }}" target="_blank" title="{% trans 'Read the original post' %}">{% trans 'Read the original post' %} ›</a>
158+ </p>
159+ </div>
160+ </article>
161+ </section>
162+</div>
163+{% endblock %}
164
165=== modified file 'loco_directory/templates/index.html'
166--- loco_directory/templates/index.html 2012-12-12 22:44:53 +0000
167+++ loco_directory/templates/index.html 2012-12-13 23:13:21 +0000
168@@ -69,7 +69,7 @@
169 <img class="blog-entry-image" src="{{ article.source.user.mugshot }}" />
170 {% endif %}
171 {% endif %}
172- <h4 class="blog-entry-title"><a href="{{ article.link }}" target="_blank">{{ article.title }}</a></h4>
173+ <h4 class="blog-entry-title"><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h4>
174 <div class="blog-entry-author">
175 {% if article.source.team %}
176 <a class="team" href="{% url team-detail article.source.team %}" target="_blank">{{ article.source.team.name }}</a>
177@@ -79,11 +79,10 @@
178 <a class="user" href="{% url profile-detail article.source.user.user.username %}" target="_blank">{{ article.source.user }}</a>
179 {% endif %}
180 </div>
181-
182 <div class="blog-entry-text">
183 <p>{{ article.content|safe|striptags|truncatewords_html:100 }}</p>
184 <p class="more">
185- <a href="{{ article.link }}" target="_blank">{% trans 'Read More' %} ›</a>
186+ <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">{% trans 'Read More' %} ›</a>
187 </p>
188 </div>
189 </article>
190@@ -92,7 +91,6 @@
191 <section class="span-4 last">
192 <h2>{% if team_event_count %}{{ team_event_count }} {% endif %}{% trans "Upcoming Events" %}</h2>
193 <a href="{% url event-list %}"><img src="{{ MEDIA_URL }}img/home-map.png" /></a>
194-
195 <h2>{% trans "Latest social messages" %}</h2>
196 <div class="twidenash" id="locoteams"></div>
197 </section>
198
199=== modified file 'loco_directory/urls.py'
200--- loco_directory/urls.py 2012-12-09 15:08:12 +0000
201+++ loco_directory/urls.py 2012-12-13 23:13:21 +0000
202@@ -29,6 +29,7 @@
203 url(r'^admin/(.*)', admin.site.root),
204 url(r'^data/xml', 'teams.views.xml_team_data', name='xml_team_data'),
205 url(r'^teams/', include('teams.urls')),
206+ url(r'^planet/', include('articles.urls')),
207 url(r'^events/venues/', include('venues.urls')),
208 url(r'^events/', include('events.urls')),
209 url(r'^meetings/', include('meetings.urls')),

Subscribers

People subscribed via source and target branches