Merge lp:~nataliabidart/locolander/add-media into lp:locolander

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 10
Merged at revision: 5
Proposed branch: lp:~nataliabidart/locolander/add-media
Merge into: lp:locolander
Diff against target: 351 lines (+196/-16)
13 files modified
.bzrignore (+1/-0)
README (+1/-1)
locolander/locolander/settings.py (+9/-0)
locolander/locolanderweb/static/css/reset.css (+47/-0)
locolander/locolanderweb/static/css/style.css (+70/-0)
locolander/locolanderweb/templates/base.html (+29/-1)
locolander/locolanderweb/templates/locolanderweb/home.html (+1/-1)
locolander/locolanderweb/templates/locolanderweb/project/_list.html (+7/-5)
locolander/locolanderweb/templates/locolanderweb/project/add.html (+4/-6)
locolander/locolanderweb/templates/registration/logged_out.html (+6/-0)
locolander/locolanderweb/templates/registration/login.html (+14/-0)
locolander/locolanderweb/urls.py (+6/-1)
locolander/locolanderweb/views.py (+1/-1)
To merge this branch: bzr merge lp:~nataliabidart/locolander/add-media
Reviewer Review Type Date Requested Status
Matias Bordese Approve
Review via email: mp+170910@code.launchpad.net

Commit message

- Added css stylesheets plus some more templates.

To post a comment you must log in.
Revision history for this message
Matias Bordese (matiasb) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2013-06-21 21:42:24 +0000
4@@ -0,0 +1,1 @@
5+locolander.db
6
7=== modified file 'README'
8--- README 2013-06-21 01:48:40 +0000
9+++ README 2013-06-21 21:42:24 +0000
10@@ -2,7 +2,7 @@
11 LocoLander
12 ==========
13
14-.. image:: doc/img/locolander.png
15+.. image:: locolander/locolanderweb/media/locolander.png
16
17
18 To Do
19
20=== removed directory 'doc'
21=== removed directory 'doc/img'
22=== modified file 'locolander/locolander/settings.py'
23--- locolander/locolander/settings.py 2013-06-21 15:34:22 +0000
24+++ locolander/locolander/settings.py 2013-06-21 21:42:24 +0000
25@@ -1,5 +1,12 @@
26 # Django settings for locolander project.
27
28+import os
29+
30+from django.core.urlresolvers import reverse
31+
32+
33+PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
34+
35 DEBUG = True
36 TEMPLATE_DEBUG = DEBUG
37
38@@ -156,6 +163,8 @@
39 }
40 }
41
42+LOGIN_URL = reverse('login')
43+LOGIN_REDIRECT_URL = reverse('home')
44
45 try:
46 from local_setting import *
47
48=== added directory 'locolander/locolanderweb/static/css'
49=== added file 'locolander/locolanderweb/static/css/reset.css'
50--- locolander/locolanderweb/static/css/reset.css 1970-01-01 00:00:00 +0000
51+++ locolander/locolanderweb/static/css/reset.css 2013-06-21 21:42:24 +0000
52@@ -0,0 +1,47 @@
53+/**
54+ * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
55+ * http://cssreset.com
56+ */
57+html, body, div, span, applet, object, iframe,
58+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
59+a, abbr, acronym, address, big, cite, code,
60+del, dfn, em, img, ins, kbd, q, s, samp,
61+small, strike, strong, sub, sup, tt, var,
62+b, u, i, center,
63+dl, dt, dd, ol, ul, li,
64+fieldset, form, label, legend,
65+table, caption, tbody, tfoot, thead, tr, th, td,
66+article, aside, canvas, details, embed,
67+figure, figcaption, footer, header, hgroup,
68+menu, nav, output, ruby, section, summary,
69+time, mark, audio, video {
70+ margin: 0;
71+ padding: 0;
72+ border: 0;
73+ font-size: 100%;
74+ font: inherit;
75+ vertical-align: baseline;
76+}
77+/* HTML5 display-role reset for older browsers */
78+article, aside, details, figcaption, figure,
79+footer, header, hgroup, menu, nav, section {
80+ display: block;
81+}
82+body {
83+ line-height: 1;
84+}
85+ol, ul {
86+ list-style: none;
87+}
88+blockquote, q {
89+ quotes: none;
90+}
91+blockquote:before, blockquote:after,
92+q:before, q:after {
93+ content: '';
94+ content: none;
95+}
96+table {
97+ border-collapse: collapse;
98+ border-spacing: 0;
99+}
100
101=== added file 'locolander/locolanderweb/static/css/style.css'
102--- locolander/locolanderweb/static/css/style.css 1970-01-01 00:00:00 +0000
103+++ locolander/locolanderweb/static/css/style.css 2013-06-21 21:42:24 +0000
104@@ -0,0 +1,70 @@
105+/* Remove the following once the reset.css is enabled */
106+* {
107+ margin: 0;
108+ padding: 0;
109+}
110+
111+ol, ul {
112+ list-style: none;
113+}
114+
115+/* end remove */
116+
117+#header,
118+#content,
119+#footer {
120+ padding: 10px;
121+}
122+
123+#header {
124+ background: #BCBCBC;
125+}
126+
127+#nav {
128+ float: right;
129+ padding: 5px;
130+}
131+
132+#nav li {
133+ display: inline;
134+ padding: 5px;
135+}
136+
137+a {
138+ color: black;
139+ text-decoration: none;
140+}
141+
142+.errorlist {
143+ color: red;
144+ float: right;
145+ padding: 5px;
146+}
147+
148+#messages .message {
149+ padding: 10px;
150+ margin: 10px;
151+ font-size: larger;
152+}
153+
154+#messages .message.info,
155+#messages .message.success {
156+ background: #66cc66;
157+ border: solid green 1px;
158+}
159+
160+#messages .message.warning {
161+ background: #ffff88;
162+ border: solid #ffff00 1px;
163+}
164+
165+#messages .message.error {
166+ background: #FF4545;
167+ border: solid red 1px;
168+}
169+
170+.actions {
171+ padding: 10px;
172+ margin-top: 10px;
173+ border-top: dotted grey 1px;
174+}
175
176=== added directory 'locolander/locolanderweb/static/images'
177=== renamed file 'doc/img/locolander.png' => 'locolander/locolanderweb/static/images/locolander.png'
178=== modified file 'locolander/locolanderweb/templates/base.html'
179--- locolander/locolanderweb/templates/base.html 2013-06-21 15:34:22 +0000
180+++ locolander/locolanderweb/templates/base.html 2013-06-21 21:42:24 +0000
181@@ -1,13 +1,41 @@
182+{% load staticfiles %}
183+
184 <html>
185 <head>
186 <title>{% block html-title %}Loco Lander{% endblock html-title %}</title>
187+ {% comment %}
188+ <link rel="stylesheet" href="{% static 'css/reset.css' %}" />
189+ {% endcomment %}
190+ <link rel="stylesheet" href="{% static 'css/style.css' %}" />
191 {% block head-extra %}{% endblock head-extra %}
192 </head>
193
194 <body>
195+ <div id="header">
196+ <a href="{% url 'home'%}">
197+ <img src="{% static 'images/locolander.png' %}" width="50px" />
198+ </a>
199+ <ul id="nav">
200+ {% if user.is_authenticated %}
201+ <li><a href="{% url 'project-list' %}">Your projects</a></li>
202+ <li><a href="{% url 'logout' %}">Logout</a></li>
203+ {% else %}
204+ <li><a href="{% url 'login' %}">Login</a></li>
205+ {% endif %}
206+ </div>
207+ </div>
208
209 <div id="content">
210- {% block content %}{% endblock content %}
211+ <div id="messages">
212+ {% if messages %}
213+ <ul>
214+ {% for message in messages %}
215+ <li class="message {{ message.tags }}">{{ message }}</li>
216+ {% endfor %}
217+ </ul>
218+ {% endif %}
219+ </div>
220+ {% block content %}{% endblock content %}
221 </div>
222
223 <div id="footer">
224
225=== modified file 'locolander/locolanderweb/templates/locolanderweb/home.html'
226--- locolander/locolanderweb/templates/locolanderweb/home.html 2013-06-21 20:34:15 +0000
227+++ locolander/locolanderweb/templates/locolanderweb/home.html 2013-06-21 21:42:24 +0000
228@@ -1,7 +1,7 @@
229 {% extends "base.html" %}
230
231 {% block content %}
232-<h1>Welcome!</h1>
233+<h1>Welcome {{ user.username }}!</h1>
234
235 {% include "locolanderweb/project/_list.html" %}
236
237
238=== modified file 'locolander/locolanderweb/templates/locolanderweb/project/_list.html'
239--- locolander/locolanderweb/templates/locolanderweb/project/_list.html 2013-06-21 20:28:55 +0000
240+++ locolander/locolanderweb/templates/locolanderweb/project/_list.html 2013-06-21 21:42:24 +0000
241@@ -1,17 +1,19 @@
242 <div id="projects">
243 {% if projects %}
244- <h3>Your projects:</h3>
245- <table>
246+ <h2>Your projects:</h2>
247+ <table class="project-list">
248 {% for p in projects %}
249 <tr>
250 <th>{{ p.name }}</th>
251- <td>{{ p.url }}</td>
252+ <td><a href="{{ p.url }}">{{ p.url }}</a></td>
253 </tr>
254 {% endfor %}
255 </table>
256 {% else %}
257- <h3>No projects.</h3>
258+ <h2>Currently you have no projects.</h2>
259 {% endif %}
260
261-<a href="{% url 'project-add' %}">Add a new project</a>
262+ <div class="actions">
263+ <a href="{% url 'project-add' %}">Add a new project</a>
264+ </div>
265 </div>
266
267=== modified file 'locolander/locolanderweb/templates/locolanderweb/project/add.html'
268--- locolander/locolanderweb/templates/locolanderweb/project/add.html 2013-06-21 15:34:22 +0000
269+++ locolander/locolanderweb/templates/locolanderweb/project/add.html 2013-06-21 21:42:24 +0000
270@@ -6,16 +6,14 @@
271 <div id="project-create">
272
273 <form action="." method="POST">
274+ {% csrf_token %}
275 <table>
276 {{ form.as_table }}
277- <tr>
278- <td />
279- <td class="text-left">
280- <input type="submit" name="create" value="Add" />
281- </td>
282 </table>
283+ <div class="actions">
284+ <input type="submit" name="create" value="Add" />
285+ </div>
286 </form>
287
288 </div>
289-
290 {% endblock content %}
291
292=== added directory 'locolander/locolanderweb/templates/registration'
293=== added file 'locolander/locolanderweb/templates/registration/logged_out.html'
294--- locolander/locolanderweb/templates/registration/logged_out.html 1970-01-01 00:00:00 +0000
295+++ locolander/locolanderweb/templates/registration/logged_out.html 2013-06-21 21:42:24 +0000
296@@ -0,0 +1,6 @@
297+{% extends "base.html" %}
298+
299+{% block content %}
300+<h1>You've been logged out.</h1>
301+<p><a href="{% url 'login' %}">Login back again</a></p>
302+{% endblock content %}
303
304=== added file 'locolander/locolanderweb/templates/registration/login.html'
305--- locolander/locolanderweb/templates/registration/login.html 1970-01-01 00:00:00 +0000
306+++ locolander/locolanderweb/templates/registration/login.html 2013-06-21 21:42:24 +0000
307@@ -0,0 +1,14 @@
308+{% extends "base.html" %}
309+
310+{% block content %}
311+<form action="." method="POST">
312+ {% csrf_token %}
313+ <table id="login">
314+ {{ form.as_table }}
315+ </table>
316+ <div class="actions">
317+ <input type="submit" name="login" value="Login">
318+ </div>
319+ <input type="hidden" name="next" value="{{ next }}" />
320+</form>
321+{% endblock content %}
322
323=== modified file 'locolander/locolanderweb/urls.py'
324--- locolander/locolanderweb/urls.py 2013-06-21 15:34:22 +0000
325+++ locolander/locolanderweb/urls.py 2013-06-21 21:42:24 +0000
326@@ -1,7 +1,12 @@
327 from django.conf.urls import patterns, include, url
328
329-
330 urlpatterns = patterns(
331+ 'django.contrib.auth.views',
332+ url(r'^login/$', 'login', name='login'),
333+ url(r'^logout/$', 'logout_then_login', name='logout'),
334+)
335+
336+urlpatterns += patterns(
337 'locolanderweb.views',
338 url(r'^$', 'home', name='home'),
339 url(r'^projects/$', 'project_list', name='project-list'),
340
341=== modified file 'locolander/locolanderweb/views.py'
342--- locolander/locolanderweb/views.py 2013-06-21 20:34:15 +0000
343+++ locolander/locolanderweb/views.py 2013-06-21 21:42:24 +0000
344@@ -31,7 +31,7 @@
345 messages.success(request, 'Project %s added.' % project.name)
346 return HttpResponseRedirect(reverse('project-list'))
347
348- messages.warning(request, 'Errors!')
349+ messages.error(request, 'Please correct the errors below.')
350 else:
351 form = ProjectForm(owner=request.user)
352

Subscribers

People subscribed via source and target branches

to all changes: