| 1 | <%def name="renderDescription(text)"> |
|---|
| 2 | % if isStringHTML(text): |
|---|
| 3 | ${text} |
|---|
| 4 | % else: |
|---|
| 5 | <pre>${text}</pre> |
|---|
| 6 | % endif |
|---|
| 7 | </%def> |
|---|
| 8 | |
|---|
| 9 | <%def name="renderLocation(item, parent=None, span='')"> |
|---|
| 10 | <% location, room, url = getLocationInfo(item) %> |
|---|
| 11 | % if location and not parent or getLocationInfo(parent)[0] != location: |
|---|
| 12 | ${location} |
|---|
| 13 | % if room: |
|---|
| 14 | ( |
|---|
| 15 | % endif |
|---|
| 16 | % endif |
|---|
| 17 | % if room: |
|---|
| 18 | ${'<a href="${url}">' if url else ''} |
|---|
| 19 | <span class="${span}">${room}</span> |
|---|
| 20 | ${'</a>' if url else ''} |
|---|
| 21 | % if location and not parent or getLocationInfo(parent)[0] != location: |
|---|
| 22 | ) |
|---|
| 23 | % endif |
|---|
| 24 | % endif |
|---|
| 25 | </%def> |
|---|
| 26 | |
|---|
| 27 | <%def name="renderLocationAdministrative(item, parent=None)"> |
|---|
| 28 | <% location, room, url = getLocationInfo(item) %> |
|---|
| 29 | % if location and not parent or getLocationInfo(parent)[0] != location: |
|---|
| 30 | <b>${location}</b> |
|---|
| 31 | % if room: |
|---|
| 32 | ( ${room} ) |
|---|
| 33 | % endif |
|---|
| 34 | % elif room: |
|---|
| 35 | ${room} |
|---|
| 36 | % endif |
|---|
| 37 | </%def> |
|---|
| 38 | |
|---|
| 39 | <%def name="renderLocationText(item, parent=None)"> |
|---|
| 40 | <% location, room, url = getLocationInfo(item) %> |
|---|
| 41 | % if location and not parent or getLocationInfo(parent)[0] != location: |
|---|
| 42 | <b>${location}</b> |
|---|
| 43 | % if room: |
|---|
| 44 | ( |
|---|
| 45 | % endif |
|---|
| 46 | % endif |
|---|
| 47 | % if room: |
|---|
| 48 | ${room} |
|---|
| 49 | % if location and not parent or getLocationInfo(parent)[0] != location: |
|---|
| 50 | ) |
|---|
| 51 | % endif |
|---|
| 52 | % endif |
|---|
| 53 | </%def> |
|---|
| 54 | |
|---|
| 55 | <%def name="renderUsers(userList, unformatted='', spanClass='', title=True, italicAffilation=False, useSpan=True, separator=', ')"> |
|---|
| 56 | <% |
|---|
| 57 | result = [] |
|---|
| 58 | for user in userList: |
|---|
| 59 | userText = "%s %s" % (user.getFirstName(), user.getFamilyName()) |
|---|
| 60 | if title: |
|---|
| 61 | userText = user.getTitle() + " " + userText |
|---|
| 62 | if user.getAffiliation(): |
|---|
| 63 | affiliation = user.getAffiliation() |
|---|
| 64 | if italicAffilation: |
|---|
| 65 | affiliation = '<i>' + affiliation + '</i>' |
|---|
| 66 | userText += ' (%s)' % affiliation |
|---|
| 67 | if useSpan: |
|---|
| 68 | result.append('<span class="%s">%s</span>' % (spanClass, userText)) |
|---|
| 69 | else: |
|---|
| 70 | result.append(userText) |
|---|
| 71 | if unformatted: |
|---|
| 72 | result.append(unformatted) |
|---|
| 73 | %> |
|---|
| 74 | ${separator.join(result)} |
|---|
| 75 | </%def> |
|---|
| 76 | |
|---|
| 77 | <%def name="renderEventTime(startDate, endDate, timezone, strong=True)"> |
|---|
| 78 | <% timeFormat = "<strong>%s</strong>" if strong else "%s" %> |
|---|
| 79 | % if getDate(startDate) == getDate(endDate): |
|---|
| 80 | ${prettyDate(startDate)} |
|---|
| 81 | % if not isTime0H0M(startDate): |
|---|
| 82 | from ${timeFormat % getTime(startDate)} |
|---|
| 83 | % endif |
|---|
| 84 | % if not isTime0H0M(endDate): |
|---|
| 85 | to ${timeFormat % getTime(endDate)} |
|---|
| 86 | % endif |
|---|
| 87 | % else: |
|---|
| 88 | from ${prettyDate(startDate)} at ${timeFormat % getTime(startDate)} |
|---|
| 89 | to ${prettyDate(endDate)} at ${timeFormat % getTime(endDate)} |
|---|
| 90 | % endif |
|---|
| 91 | (${str(timezone)}) |
|---|
| 92 | </%def> |
|---|
| 93 | |
|---|
| 94 | <%def name="renderEventTime2(startDate, endDate, timezone='')"> |
|---|
| 95 | % if getDate(startDate) == getDate(endDate): |
|---|
| 96 | ${prettyDate(startDate)} |
|---|
| 97 | % if not isTime0H0M(startDate): |
|---|
| 98 | - <u>${ getTime(startDate)}</u> |
|---|
| 99 | % endif |
|---|
| 100 | % else: |
|---|
| 101 | from ${prettyDate(startDate)} (${getTime(startDate)}) |
|---|
| 102 | to ${prettyDate(endDate)} (${getTime(endDate)}) |
|---|
| 103 | % endif |
|---|
| 104 | % if timezone!='': |
|---|
| 105 | (${str(timezone)}) |
|---|
| 106 | % endif |
|---|
| 107 | |
|---|
| 108 | </%def> |
|---|
| 109 | |
|---|
| 110 | <%def name="renderEventTimeText(startDate, endDate)"> |
|---|
| 111 | % if getDate(startDate) == getDate(endDate): |
|---|
| 112 | ${prettyDate(startDate)} |
|---|
| 113 | % else: |
|---|
| 114 | ${prettyDate(startDate)} to ${prettyDate(endDate)} |
|---|
| 115 | % endif |
|---|
| 116 | |
|---|
| 117 | </%def> |
|---|
| 118 | |
|---|
| 119 | <%def name="renderEventTimeCompact(startDate, endDate)"> |
|---|
| 120 | % if getDate(startDate) == getDate(endDate): |
|---|
| 121 | ${prettyDate(startDate)} |
|---|
| 122 | % if not isTime0H0M(startDate): |
|---|
| 123 | - <u>${ getTime(startDate)}</u> |
|---|
| 124 | % endif |
|---|
| 125 | % else: |
|---|
| 126 | from <b>${prettyDate(startDate)} (${getTime(startDate)})</b> |
|---|
| 127 | to <b>${prettyDate(endDate)} (${getTime(endDate)})</b> |
|---|
| 128 | % endif |
|---|
| 129 | </%def> |
|---|
| 130 | |
|---|