"Fossies" - the Fresh Open Source Software Archive

Member "PURELIB/trac/templates/list_of_attachments.html" (27 Aug 2019, 3347 Bytes) of package /windows/misc/Trac-1.4.win32.exe:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 {# Copyright (C) 2010-2014 Edgewall Software
    2 
    3   This software is licensed as described in the file COPYING, which
    4   you should have received as part of this distribution. The terms
    5   are also available at https://trac.edgewall.org/wiki/TracLicense.
    6 
    7   This software consists of voluntary contributions made by many
    8   individuals. For the exact contribution history, see the revision
    9   history and logs, available at https://trac.edgewall.org/.
   10 #}
   11 
   12 ## Displays a list of attachments.
   13 
   14 {# Arguments:
   15  - alist: the data for the list of attachments
   16  - compact=False: if True, show the list in compact format (e.g. as used in the wiki view)
   17  - add_button_title=None: the title of the "Attach" button
   18  - foldable=False: if True, make the list of attachments foldable
   19 #}
   20 
   21 # macro show_one_attachment(attachment)
   22 #   set attachment_links
   23 <a href="${url_of(attachment.resource)}" title="${_('View attachment')}">${
   24   attachment.filename
   25   }</a><a href="${url_of(attachment.resource, format='raw')}"
   26           class="trac-rawlink" title="${_('Download')}">&#8203;</a>
   27 #  endset
   28 #   with
   29 #     set size
   30 <span title="${ngettext('%(num)d byte', '%(num)d bytes', num=attachment.size)}">${
   31   pretty_size(attachment.size)}</span>
   32 #     endset
   33 #     set author = authorinfo(attachment.author)
   34 #     set date = pretty_dateinfo(attachment.date)
   35 #     trans attachment_links, size, author, date
   36 
   37 ${attachment_links} (${size}) - added by ${author} ${date}.
   38 
   39 #     endtrans
   40 #   endwith
   41 # endmacro
   42 
   43 
   44 # with
   45 #   set compact = compact|default(false)
   46 #   set add_button_title = add_button_title|default(none)
   47 #   set foldable = foldable|default(false)
   48 
   49 #   set download_all_as_zip
   50 <p>
   51   ${_("Download all attachments as:")}
   52   <a rel="nofollow" href="${alist.download_href}">.zip</a>
   53 </p>
   54 #   endset
   55 
   56 #   if alist.attachments or alist.can_create:
   57 <div id="attachments">
   58   #   if compact and alist.attachments:
   59   <h3 ${{'class': 'foldable' if foldable}|htmlattr}>
   60     ${_("Attachments")}
   61     <span class="trac-count">(${len(alist.attachments)})</span></h3>
   62   <div>
   63     <ul>
   64       # for attachment in alist.attachments:
   65       <li>
   66         ${show_one_attachment(attachment)}
   67         # if compact and attachment.description:
   68         <q>${wiki_to_oneliner(context, attachment.description)}</q>
   69         # endif
   70       </li>
   71       # endfor
   72     </ul>
   73     #   if alist.download_href:
   74     ${ download_all_as_zip|safe }
   75     #   endif
   76   </div>
   77   #   elif not compact:
   78   <h3 ${{'class': 'foldable' if foldable}|htmlattr}>
   79     ${_("Attachments")}
   80     <span class="trac-count">(${len(alist.attachments)})</span></h3>
   81   #     if alist.attachments or alist.can_create:
   82   <div class="attachments">
   83     #     if alist.attachments:
   84     <dl class="attachments">
   85       #     for attachment in alist.attachments:
   86       <dt>${show_one_attachment(attachment)}</dt>
   87       #       if attachment.description:
   88       <dd>${wiki_to_oneliner(context, attachment.description)}</dd>
   89       #       endif
   90       #     endfor
   91     </dl>
   92     #     endif
   93     #     if alist.attachments and alist.download_href:
   94     ${ download_all_as_zip|safe }
   95     #     endif
   96     #     include 'attach_file_form.html'
   97   </div>
   98   #     endif
   99   #   endif
  100 </div>
  101 #   endif
  102 # endwith
  103 ## jinjacheck: "got (a a span CDATA p div )" OK