## Render changelog table with id 'changesets' with the range of changesets, ## statuses, and comments. ## Optionally, pass a js snippet to run whenever a table resize is triggered. <%def name="changelog(repo_name, cs_range, cs_statuses, cs_comments, show_checkbox=False, show_branch=True, show_index=False, resize_js='')"> <% num_cs = len(cs_range) %> %for cnt,cs in enumerate(cs_range): %if show_checkbox: %endif %if show_index: %endif <% message_lines = cs.message.splitlines() %> %if len(message_lines) > 1: %else: %endif %endfor
${h.checkbox(cs.raw_id,class_="changeset_range")} <% index = num_cs - cnt if index == 1: title = _('First (oldest) changeset in this list') elif index == num_cs: title = _('Last (most recent) changeset in this list') else: title = _('Position in this list of changesets') %> ${index} %if cs_statuses.get(cs.raw_id): %if cs_statuses.get(cs.raw_id)[2]: %else: %endif %endif ${h.gravatar(h.email_or_none(cs.author), size=16)} ${h.person(cs.author)} ${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id), class_='changeset_hash')}
${h.age(cs.date,True)}
${h.urlify_text(message_lines[0], c.repo_name,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))}
%if len(message_lines) > 1: %endif
%if cs_comments.get(cs.raw_id): ${len(cs_comments[cs.raw_id])} %endif %for book in cs.bookmarks: ${h.link_to(book,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))} %endfor %for tag in cs.tags: ${h.link_to(tag,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))} %endfor %if cs.bumped: Bumped %endif %if cs.divergent: Divergent %endif %if cs.extinct: Extinct %endif %if cs.unstable: Unstable %endif %if cs.phase: ${cs.phase} %endif %if show_branch: %for branch in cs.branches: ${h.link_to(branch,h.url('changelog_home',repo_name=repo_name,branch=branch))} %endfor %endif