Blame progit/templates/pull_request.html

Pierre-Yves Chibon 706f31
{% extends "repo_master.html" %}
Pierre-Yves Chibon 7732a9
{% from "_formhelper.html" import render_field_in_row %}
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon f67de7
{% block title %}Pull request #{{ requestid }} - {{ repo.name }}{% endblock %}
Pierre-Yves Chibon 006f93
{%block tag %}home{% endblock %}
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon 706f31
{% block repo %}
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon 006f93

Request pull

Pierre-Yves Chibon ea8735
  
Pierre-Yves Chibon 006f93
    {{ repo.name }}
Pierre-Yves Chibon 006f93
  
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon ea8735
  (
Pierre-Yves Chibon 006f93
               repo=repo.name, identifier=commitid) }}"
Pierre-Yves Chibon 006f93
    >tree)
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon 006f93
Pierre-Yves Chibon 87ba70
{% if pull_request %}
Pierre-Yves Chibon 87ba70

Title: {{ pull_request.title }}

Pierre-Yves Chibon 87ba70
  {% if pull_request.status and repo_admin %}
Johan Cwiklinski fd18bd
  
Johan Cwiklinski fd18bd
    
Johan Cwiklinski fd18bd
        repo=repo.name, requestid=requestid) }}" method="POST">
Johan Cwiklinski fd18bd
        {{ mergeform.csrf_token }}
Johan Cwiklinski fd18bd
        <input type="submit" value="Merge">
Johan Cwiklinski fd18bd
    
Johan Cwiklinski fd18bd
    
Johan Cwiklinski fd18bd
        repo=repo.name, requestid=requestid) }}" method="POST">
Johan Cwiklinski fd18bd
        {{ mergeform.csrf_token }}
Johan Cwiklinski fd18bd
        <input id="cancel_pr" type="submit" value="Cancel">
Johan Cwiklinski fd18bd
    
Johan Cwiklinski 86d9c4
  
Pierre-Yves Chibon 87ba70
  {% elif pull_request and pull_request.status == False %}
Pierre-Yves Chibon 706f31
  Merged
Pierre-Yves Chibon 706f31
  {% endif %}
Pierre-Yves Chibon 7732a9
{% endif %}
Pierre-Yves Chibon 7732a9
Pierre-Yves Chibon 006f93
<section class="commit_list"></section>
Pierre-Yves Chibon 006f93
  
    Pierre-Yves Chibon 006f93
        {% for commit in diff_commits %}
    Pierre-Yves Chibon 006f93
        
  • Pierre-Yves Chibon 87ba70
        {% if pull_request and pull_request.status and pull_request.repo_from.is_fork %}
    Pierre-Yves Chibon 87ba70
          
    Pierre-Yves Chibon 87ba70
                      repo=pull_request.repo_from.name, commitid=commit.oid.hex)}}">
    Pierre-Yves Chibon b4d070
        {% else %}
    Pierre-Yves Chibon ea8735
          
    Pierre-Yves Chibon 006f93
                      repo=repo.name, commitid=commit.oid.hex)}}">
    Pierre-Yves Chibon b4d070
        {% endif %}
    Pierre-Yves Chibon 006f93
            {{ commit.message.split('\n')[0] }}
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
        
    Pierre-Yves Chibon 006f93
        {% endfor %}
    Pierre-Yves Chibon 006f93
      
    Pierre-Yves Chibon 006f93
    Pierre-Yves Chibon 006f93
    Pierre-Yves Chibon 7732a9
    {% if form %}
    Pierre-Yves Chibon 7732a9
    <section class="new_project"></section>
    Pierre-Yves Chibon 7732a9
      
    Pierre-Yves Chibon 7732a9
        repo=repo.name, commitid=commitid) }}" method="post">
    Pierre-Yves Chibon 7732a9
        
    Pierre-Yves Chibon 7732a9
          {{ render_field_in_row(form.title) }}
    Pierre-Yves Chibon 071f09
          
    Pierre-Yves Chibon 071f09
            To branch
    Pierre-Yves Chibon 071f09
            
    Pierre-Yves Chibon 071f09
              <select id="branch_select"></select>
    Pierre-Yves Chibon 071f09
                  <option>{{ branchname }}</option>
    Pierre-Yves Chibon 071f09
                {% for branch in branches |reverse %}
    Pierre-Yves Chibon 071f09
                  {% if branch != branchname %}
    Pierre-Yves Chibon 071f09
                  <option>{{ branch }}</option>
    Pierre-Yves Chibon 071f09
                  {% endif %}
    Pierre-Yves Chibon 071f09
                {% endfor %}
    Pierre-Yves Chibon 071f09
              
    Pierre-Yves Chibon 071f09
            
    Pierre-Yves Chibon 071f09
          
    Pierre-Yves Chibon 7732a9
        
    Pierre-Yves Chibon 7732a9
        

    Pierre-Yves Chibon 7732a9
          <input class="submit positive button" type="submit" value="Create">
    Pierre-Yves Chibon 7732a9
          <input class="button" onclick="history.back();" type="button" value="Cancel">
    Pierre-Yves Chibon 7732a9
          {{ form.csrf_token }}
    Pierre-Yves Chibon 7732a9
        

    Pierre-Yves Chibon 7732a9
      
    Pierre-Yves Chibon 7732a9
    Pierre-Yves Chibon 7732a9
    {% endif %}
    Pierre-Yves Chibon 7732a9
    Pierre-Yves Chibon 006f93
    <section class="request_diff"></section>
    Pierre-Yves Chibon 006f93
      

    Diff:

    Pierre-Yves Chibon 006f93
      {% for html_diff in html_diffs %}
    Pierre-Yves Chibon 006f93
        

    Commit: {{ diff_commits[loop.index - 1].oid.hex }}

    Pierre-Yves Chibon 006f93
    Pierre-Yves Chibon 006f93
        
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
            Author
    Pierre-Yves Chibon 006f93
            
    Pierre-Yves Chibon 006f93
              {{ diff_commits[loop.index - 1].author.name }} {{ '<' + diff_commits[loop.index - 1].author.email + '>' }}
    Pierre-Yves Chibon c26d39
              - {{ diff_commits[loop.index - 1].commit_time | format_ts }}
    Pierre-Yves Chibon 006f93
            
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
            Committer
    Pierre-Yves Chibon 006f93
            
    Pierre-Yves Chibon 006f93
              {{ diff_commits[loop.index - 1].committer.name }} {{ '<' + diff_commits[loop.index - 1].committer.email + '>' }}
    Pierre-Yves Chibon c26d39
              - {{ diff_commits[loop.index - 1].commit_time | format_ts }}
    Pierre-Yves Chibon 006f93
            
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
            Parent
    Pierre-Yves Chibon 006f93
            
    Pierre-Yves Chibon 006f93
              {% for parent in diff_commits[loop.index - 1].parents %}
    Pierre-Yves Chibon ea8735
                
    Pierre-Yves Chibon 006f93
                          repo=repo.name, commitid=parent.oid.hex) }}">
    Pierre-Yves Chibon 006f93
    Pierre-Yves Chibon 006f93
                {{ parent.oid.hex }}
    Pierre-Yves Chibon 006f93
               
    Pierre-Yves Chibon 006f93
              {% endfor %}
    Pierre-Yves Chibon 006f93
            
    Pierre-Yves Chibon 006f93
          
    Pierre-Yves Chibon 006f93
        
    Pierre-Yves Chibon 006f93
        

    Pierre-Yves Chibon 006f93
        {{ diff_commits[loop.index - 1].message }}
    Pierre-Yves Chibon 006f93
        

    Pierre-Yves Chibon 006f93
        {% autoescape false %}
    Pierre-Yves Chibon 87ba70
            {{ html_diff | format_loc(diff_commits[loop.index - 1], pull_request,
    Pierre-Yves Chibon 21f4a5
                index=loop.index) }}
    Pierre-Yves Chibon 006f93
        {% endautoescape %}
    Pierre-Yves Chibon 006f93
      {% endfor %}
    Pierre-Yves Chibon 006f93
    Pierre-Yves Chibon 006f93
    Pierre-Yves Chibon 267613
    Pierre-Yves Chibon 267613
    {% endblock %}
    Pierre-Yves Chibon 267613
    Pierre-Yves Chibon 267613
    {% block jscripts %}
    Pierre-Yves Chibon 267613
    {{ super() }}
    Pierre-Yves Chibon 267613
    <script type="text/javascript"></script>
    Pierre-Yves Chibon 071f09
     $(function(){
    Pierre-Yves Chibon 071f09
      $( "#branch_select" ).change(
    Pierre-Yves Chibon 071f09
        function() {
    Pierre-Yves Chibon bc7e3f
          var url = $(location).attr('href').split('?')[0];
    Pierre-Yves Chibon bc7e3f
          var params = $(location).attr('search').replace('?', '').split('&');
    Pierre-Yves Chibon 071f09
          var sel = $('#branch_select');
    Pierre-Yves Chibon bc7e3f
          /* Check all the current argument in the URL */
    Pierre-Yves Chibon bc7e3f
          var changed = false;
    Pierre-Yves Chibon bc7e3f
          for (i = 0; i < params.length; i++) {
    Pierre-Yves Chibon bc7e3f
            /* If we find branch=, updated it */
    Pierre-Yves Chibon bc7e3f
            if (params[i].match("^branch=")) {
    Pierre-Yves Chibon bc7e3f
              params[i] = 'branch=' + sel.val();
    Pierre-Yves Chibon bc7e3f
              changed = true;
    Pierre-Yves Chibon bc7e3f
            }
    Pierre-Yves Chibon bc7e3f
          }
    Pierre-Yves Chibon bc7e3f
          /* Otherwise add it */
    Pierre-Yves Chibon bc7e3f
          if (!changed) {
    Pierre-Yves Chibon bc7e3f
            params.push('branch=' + sel.val());
    Pierre-Yves Chibon bc7e3f
          }
    Pierre-Yves Chibon bc7e3f
          var final_url = url + '?' + params.join('&');
    Pierre-Yves Chibon bc7e3f
          window.location.href = final_url;
    Pierre-Yves Chibon 071f09
        }
    Pierre-Yves Chibon 071f09
      );
    Johan Cwiklinski 86d9c4
    Johan Cwiklinski 86d9c4
      $('#cancel_pr').click(function(){
    Johan Cwiklinski bad8e4
            return window.confirm("Are you sure you want to cancel this requested pull?");
    Johan Cwiklinski 86d9c4
      });
    Pierre-Yves Chibon 071f09
     });
    Pierre-Yves Chibon 071f09
    Pierre-Yves Chibon 267613
      function comment() {
    Pierre-Yves Chibon 267613
        $( ".cancel" ).click(
    Pierre-Yves Chibon 267613
          function() {
    Pierre-Yves Chibon 267613
            $(this).parent().parent().parent().parent().remove();
    Pierre-Yves Chibon 267613
          }
    Pierre-Yves Chibon 267613
        );
    Pierre-Yves Chibon 267613
      };
    Pierre-Yves Chibon 267613
    Pierre-Yves Chibon 267613
     $(function(){
    Pierre-Yves Chibon 267613
      $( "tr" ).hover(
    Pierre-Yves Chibon 267613
        function() {
    Pierre-Yves Chibon 267613
          $( this ).find( "img" ).show().width(13);
    Pierre-Yves Chibon 267613
        }, function() {
    Pierre-Yves Chibon 267613
          $( this ).find( "img" ).hide();
    Pierre-Yves Chibon 267613
        }
    Pierre-Yves Chibon 267613
      );
    Pierre-Yves Chibon 267613
    Pierre-Yves Chibon 267613
      $( ".prc" ).click(
    Pierre-Yves Chibon 267613
        function() {
    Pierre-Yves Chibon 267613
          var row = $( this ).attr('data-row');
    Pierre-Yves Chibon 267613
          var commit = $( this ).attr('data-commit');
    Pierre-Yves Chibon 267613
          var url = "{{ url_for(
    Pierre-Yves Chibon 267613
            'pull_request_add_comment', username=username, repo=repo.name,
    Pierre-Yves Chibon 267613
            requestid=requestid, commit='', row='') }}".slice(0, -1);
    Pierre-Yves Chibon 267613
          url = url + commit + '/' + row;
    Pierre-Yves Chibon 9738dc
          var rowid = $(this).prev().find('a').attr('id');
    Pierre-Yves Chibon c4550f
          var table = $( this ).parent().parent();
    Pierre-Yves Chibon 9738dc
          var nextid = rowid.replace('_' + row, '_' + (Number(row) + 1));
    Pierre-Yves Chibon 9738dc
          var next_row = table.find('#' + nextid).parent().parent();
    Pierre-Yves Chibon c4550f
          if (next_row.prev().find('.pr_comment_form').length == 0){
    Pierre-Yves Chibon 267613
            $.get( url , function( data ) {
    Pierre-Yves Chibon be1f52
              next_row.before(
    Pierre-Yves Chibon be1f52
                '' + data + '' );
    Pierre-Yves Chibon 267613
              comment();
    Pierre-Yves Chibon 267613
            });
    Pierre-Yves Chibon 55a67c
          } else {
    Pierre-Yves Chibon 0c2372
              next_row.prev().find('.pr_comment_form').parent().remove();
    Pierre-Yves Chibon 267613
          }
    Pierre-Yves Chibon 267613
        }
    Pierre-Yves Chibon 267613
      );
    Pierre-Yves Chibon 267613
    Pierre-Yves Chibon 267613
     });
    Pierre-Yves Chibon 267613
    Pierre-Yves Chibon 006f93
    {% endblock %}