Changeset 650:e00d746e826f

Show
Ignore:
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:
3 modified

Legend:

Unmodified
Added
Removed
  • transifex/languages/urls.py

    r533 r650  
    11from django.conf.urls.defaults import * 
     2from django.conf import settings 
    23from django.contrib import admin 
    34from models import Language 
     
    5354        view = language_release, 
    5455    ), 
    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     ), 
    6056) 
     57 
     58#TODO: Make this setting work throughout the applications 
     59if 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) 
  • transifex/settings/40-apps.conf

    r644 r650  
    2424ENABLE_WEBTRANS = True 
    2525 
     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 
     28ENABLE_COMPRESSED_DOWNLOAD = False 
     29 
    2630# Django-profile 
    2731AUTH_PROFILE_MODULE = 'txcommon.profile' 
  • transifex/templates/languages/language_release.html

    r579 r650  
    3535{% lang_stats_table pofile_list %} 
    3636 
    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 %} 
    3839 
    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> 
    4242 
     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  
    4348{% endif %} 
    4449