Merge lp:~gesha/linaro-license-protection/update-dir-template into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Georgy Redkozubov
Status: Merged
Merged at revision: 119
Proposed branch: lp:~gesha/linaro-license-protection/update-dir-template
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 63 lines (+6/-11)
3 files modified
license_protected_downloads/tests/test_views.py (+2/-2)
license_protected_downloads/views.py (+2/-1)
templates/dir_template.html (+2/-8)
To merge this branch: bzr merge lp:~gesha/linaro-license-protection/update-dir-template
Reviewer Review Type Date Requested Status
Fathi Boudra Approve
Linaro Infrastructure Pending
Review via email: mp+121329@code.launchpad.net

Description of the change

After switching to the new django-based server almost all build scripts that rely on regexp patterns for searching builds failed.
This branch updates links part of dir_template.html so it looks like in page produced by apache before switching to django-based version of server.

To post a comment you must log in.
Revision history for this message
Fathi Boudra (fboudra) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'license_protected_downloads/tests/test_views.py'
2--- license_protected_downloads/tests/test_views.py 2012-08-24 14:17:02 +0000
3+++ license_protected_downloads/tests/test_views.py 2012-08-26 08:45:23 +0000
4@@ -266,8 +266,8 @@
5
6 # If we have access to the file, we will get an X-Sendfile response
7 self.assertContains(response,
8- r"<th></th><th>Name</th><th>License</th><th>Last modified</th>"
9- "<th>Size</th>")
10+ r"<th></th><th>Name</th><th>Last modified</th>"
11+ "<th>Size</th><th>License</th>")
12
13 def test_not_found_file(self):
14 target_file = "12qwaszx"
15
16=== modified file 'license_protected_downloads/views.py'
17--- license_protected_downloads/views.py 2012-08-24 14:13:10 +0000
18+++ license_protected_downloads/views.py 2012-08-26 08:45:23 +0000
19@@ -54,7 +54,8 @@
20 file = os.path.join(path, file)
21
22 if os.path.exists(file):
23- mtime = time.ctime(os.path.getmtime(file))
24+ mtime = time.strftime('%d-%b-%Y %H:%M',
25+ time.localtime(os.path.getmtime(file)))
26 else:
27 # If the file we are looking at doesn't exist (broken symlink for
28 # example), it doesn't have a mtime.
29
30=== modified file 'templates/dir_template.html'
31--- templates/dir_template.html 2012-07-27 18:57:32 +0000
32+++ templates/dir_template.html 2012-08-26 08:45:23 +0000
33@@ -4,7 +4,7 @@
34 {{ header_content|safe }}
35 <table>
36 <tr>
37- <th></th><th>Name</th><th>License</th><th>Last modified</th><th>Size</th>
38+ <th></th><th>Name</th><th>Last modified</th><th>Size</th><th>License</th>
39 <tr><th colspan="5"><hr></th>
40 </tr>
41 {% if up_dir != None %}
42@@ -20,11 +20,7 @@
43 {% endif %}
44
45 {% for value in dirlist %}
46- <tr>
47- <td>
48- <img src="{{ STATIC_URL }}/static/{{ value.type }}.png" alt="{{ value.type }}"/>
49- </td>
50- <td><a href="{{ value.url }}">{{ value.name }}</a></td>
51+ <tr><td valign="top"><img src="{{ STATIC_URL }}/static/{{ value.type }}.png" alt="{{ value.type }}"/></td><td><a href="{{ value.url }}">{{ value.name }}</a></td><td align="right">{{ value.mtime }} </td><td align="right"> {% if value.type != 'folder' %}{{ value.size }}{% endif %}</td>
52 <td>
53 {% if value.license_digest_list == "OPEN" %}
54 <i>open</i>
55@@ -34,8 +30,6 @@
56 {% endfor %}
57 {% endif %}
58 </td>
59- <td>{{ value.mtime }}</td>
60- <td>{% if value.type != 'folder' %}{{ value.size }}{% endif %}</td>
61 </tr>
62 {% endfor %}
63 </table>

Subscribers

People subscribed via source and target branches