Files @ 4304595d246c
Branch filter:

Location: kallithea/kallithea/templates/pullrequests/pullrequest_data.html

Mads Kiilerich
style: in preparation for Bootstrap, refactor to use Bootstrap compatible form class names

Based on work by Dominik Ruf.

Mostly:

sed -i \
-e 's,<table>,<table class="table">,g' \
-e 's,<div class="fields">,<div class="form-horizontal">,g' \
-e 's,<div class="field">,<div class="form-group">,g' \
-e 's,<label for="\([^"]*\)">,<label class="control-label" for="\1">,g' \
`hg mani`

cat kallithea/public/css/style.css | \
sed -e '/\.fields\>/{p;s/\.fields/.form-horizontal/g}' | \
sed -e '/\.fields\>/s/ {$/,/g' | \
sed -e '/\.field\>/{p;s/\.field\>/.form-group/g}' | \
sed -e '/\.field\>/s/ {$/,/g' | \
sed -e '/\.fields\>.*\.form-group\>/d' | \
sed -e '/\.form-horizontal\>.*\.field\>/d ' | \
cat - > kallithea/public/css/style.css.tmp
mv kallithea/public/css/style.css.tmp kallithea/public/css/style.css
## -*- coding: utf-8 -*-

<%def name="pullrequest_overview(pullrequests)">

%if not len(pullrequests):
    <div class="normal-indent empty_data">${_('No entries')}</div>
    <% return %>
%endif

<div class="table">
  <table class="table">
    <thead>
      <tr>
        <th class="left">${_('Vote')}</th>
        <th class="left">${_('Title')}</th>
        <th class="left">${_('Owner')}</th>
        <th class="left">${_('Age')}</th>
        <th class="left">${_('From')}</th>
        <th class="left">${_('To')}</th>
        <th class="right" style="padding-right:5px">${_('Delete')}</th>
      </tr>
    </thead>
% for pr in pullrequests:
    <tr class="${'pr-closed' if pr.is_closed() else ''}">
      <td width="80px">
        <% status = pr.user_review_status(c.authuser.user_id) %>
        %if status:
          <i class="icon-circle changeset-status-${status}" title="${_("You voted: %s") % h.changeset_status_lbl(status)}"></i>
        %else:
          <i class="icon-circle changeset-status-not_reviewed" title="${_("You didn't vote")}"></i>
        %endif
      </td>
      <td>
        <a href="${pr.url()}">
        ${pr.title or _("(no title)")}
        %if pr.is_closed():
          <span class="pr-closed-tag">${_('Closed')}</span>
        %endif
        </a>
      </td>
      <td>
        ${pr.owner.full_name_and_username}
      </td>
      <td>
        <span class="tooltip" title="${h.fmt_date(pr.created_on)}">
          ${h.age(pr.created_on)}
        </span>
      </td>
      <td>
        <% org_ref_name=pr.org_ref.rsplit(':', 2)[-2] %>
        <a href="${h.url('summary_home', repo_name=pr.org_repo.repo_name, anchor=org_ref_name)}">
          ${pr.org_repo.repo_name}#${org_ref_name}
        </a>
      </td>
      <td>
        <% other_ref_name=pr.other_ref.rsplit(':', 2)[-2] %>
        <a href="${h.url('summary_home', repo_name=pr.other_repo.repo_name, anchor=other_ref_name)}">
          ${pr.other_repo.repo_name}#${other_ref_name}
        </a>
      </td>
      <td style="text-align:right">
        %if pr.owner_id == c.authuser.user_id:
          ${h.form(url('pullrequest_delete', repo_name=pr.other_repo.repo_name, pull_request_id=pr.pull_request_id), style="display:inline-block")}
          <button class="action_button"
                  id="remove_${pr.pull_request_id}"
                  name="remove_${pr.pull_request_id}"
                  title="${_('Delete Pull Request')}"
                  onclick="return confirm('${_('Confirm to delete this pull request')}')
                      && ((${len(pr.comments)} == 0) ||
                          confirm('${_('Confirm again to delete this pull request with %s comments') % len(pr.comments)}'))
                      ">
            <i class="icon-minus-circled"></i>
          </button>
          ${h.end_form()}
        %endif
      </td>
    </tr>
% endfor
  </table>
</div>

%if hasattr(pullrequests, 'pager'):
<div class="notification-paginator">
  <div class="pagination-wh pagination-left">
  ${pullrequests.pager('$link_previous ~2~ $link_next', **request.GET.mixed())}
  </div>
</div>
%endif

</%def>