Changeset 650:e00d746e826f
- Timestamp:
- 07/03/09 08:48:07 (9 months ago)
- Author:
- Diego Búrigo Zacarão <diegobz@…>
- Branch:
- default
- Children:
- 651:8a10fee1ffed, 1123:217bae310c10
- Message:
-
Added option in settings for enable download of compressed files
- Location:
- transifex
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r533
|
r650
|
|
| 1 | 1 | from django.conf.urls.defaults import * |
| | 2 | from django.conf import settings |
| 2 | 3 | from django.contrib import admin |
| 3 | 4 | from models import Language |
| … |
… |
|
| 53 | 54 | view = language_release, |
| 54 | 55 | ), |
| 55 | | url( |
| 56 | | name = 'language_release_download', |
| 57 | | regex = '^(?P<slug>[-_@\w]+)/collection/(?P<collection_slug>[-\w]+)/(?P<release_slug>[-\w]+)/download_(?P<filetype>[\w]+)/$', |
| 58 | | view = language_release_download, |
| 59 | | ), |
| 60 | 56 | ) |
| | 57 | |
| | 58 | #TODO: Make this setting work throughout the applications |
| | 59 | if getattr(settings, 'ENABLE_COMPRESSED_DOWNLOAD', True): |
| | 60 | urlpatterns += patterns('', |
| | 61 | url( |
| | 62 | name = 'language_release_download', |
| | 63 | regex = '^(?P<slug>[-_@\w]+)/collection/(?P<collection_slug>[-\w]+)/(?P<release_slug>[-\w]+)/download_(?P<filetype>[\w]+)/$', |
| | 64 | view = language_release_download, |
| | 65 | ), |
| | 66 | ) |
-
|
r644
|
r650
|
|
| 24 | 24 | ENABLE_WEBTRANS = True |
| 25 | 25 | |
| | 26 | # Enable download of compressed zip/targz files in the Language x Release page |
| | 27 | # For now it's dissabled by default until we find out a faster way to compact those files on fly |
| | 28 | ENABLE_COMPRESSED_DOWNLOAD = False |
| | 29 | |
| 26 | 30 | # Django-profile |
| 27 | 31 | AUTH_PROFILE_MODULE = 'txcommon.profile' |
-
|
r579
|
r650
|
|
| 35 | 35 | {% lang_stats_table pofile_list %} |
| 36 | 36 | |
| 37 | | <h4>Download</h4> |
| | 37 | {% url language_release_download slug=language.code collection_slug=release.collection.slug release_slug=release.slug filetype="zip" as zip_download_url %} |
| | 38 | {% url language_release_download slug=language.code collection_slug=release.collection.slug release_slug=release.slug filetype="targz" as targz_download_url %} |
| 38 | 39 | |
| 39 | | Receive all the translation files in a compressed archive. |
| 40 | | <a class="i16 compress buttonized" href="{% url language_release_download slug=language.code collection_slug=release.collection.slug release_slug=release.slug filetype="zip" %}">Get <code>.zip</code></a> |
| 41 | | <a class="i16 compress buttonized" href="{% url language_release_download slug=language.code collection_slug=release.collection.slug release_slug=release.slug filetype="targz" %}">Get <code>.tar.gz</code></a> |
| | 40 | {% if zip_download_url %} |
| | 41 | <h4>Download</h4> |
| 42 | 42 | |
| | 43 | Receive all the translation files in a compressed archive. |
| | 44 | <a class="i16 compress buttonized" href="{{ zip_download_url }}">Get <code>.zip</code></a> |
| | 45 | <a class="i16 compress buttonized" href="{{ targz_download_url }}">Get <code>.tar.gz</code></a> |
| | 46 | {% endif %} |
| | 47 | |
| 43 | 48 | {% endif %} |
| 44 | 49 | |