Ignore:
Timestamp:
29 Sep 2014, 05:32:52 (10 years ago)
Author:
Henrik Bettermann
Message:

Hide export download button 24 hours after file generation.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r11794 r11826  
    216216        status = job.failed and 'FAILED' or status
    217217        start_time = getattr(job, 'begin_after', None)
     218        time_delta = None
    218219        if start_time:
    219             start_time = start_time.astimezone(
    220                 getUtility(
    221                     IKofaUtils).tzinfo).strftime("%Y-%m-%d %H:%M:%S %Z")
     220            tz = getUtility(IKofaUtils).tzinfo
     221            time_delta = datetime.now(tz) - start_time
     222            start_time = start_time.astimezone(tz).strftime(
     223                "%Y-%m-%d %H:%M:%S %Z")
    222224        download_url = view.url(view.context, 'download_export',
    223225                                data=dict(job_id=job_id))
     226        show_download_button = job.finished and not \
     227                               job.failed and time_delta and \
     228                               time_delta.days < 1
    224229        new_entry = dict(
    225230            job=job_id,
     
    230235            start_time=start_time,
    231236            download_url=download_url,
    232             show_download_button = (job.finished and not job.failed),
     237            show_download_button = show_download_button,
    233238            show_refresh_button = not job.finished,
    234239            show_discard_button = job.finished,)
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterexportpage.pt

    r11254 r11826  
    44  selection below. The file will be generated and then be
    55  made available for you to download in the table below.
     6  Files can only be downloaded within 24 hours after generation.
     7  The download link disappears afterwards.
    68</p>
    79
Note: See TracChangeset for help on using the changeset viewer.