Blame progit/templates/issue.html

Pierre-Yves Chibon 6e76e1
{% extends "repo_master.html" %}
Johan Cwiklinski bc00dc
{% from "_formhelper.html" import render_field %}
Pierre-Yves Chibon 6e76e1
Pierre-Yves Chibon 301ea7
{% block title %}Issue #{{ issueid }} - {{ repo.name }}{% endblock %}
Pierre-Yves Chibon 6e76e1
{%block tag %}home{% endblock %}
Pierre-Yves Chibon 6e76e1
Pierre-Yves Chibon 3d3baf
{% macro show_comment(user, date, content) %}
Johan Cwiklinski bc00dc
  <section class="issue_comment"></section>
Johan Cwiklinski bc00dc
    <header></header>
Johan Cwiklinski bc00dc
      {{ user.user | avatar(16) | safe }}
Johan Cwiklinski bc00dc
      
Johan Cwiklinski bc00dc
        {{ user.user }}
Pierre-Yves Chibon 77d026
       - {{ date | humanize}}
Pierre-Yves Chibon 6df8a0
      <aside class="issue_action"></aside>
Pierre-Yves Chibon 6df8a0
        
Pierre-Yves Chibon 6df8a0
          reply
Pierre-Yves Chibon 6df8a0
        
Pierre-Yves Chibon 6df8a0
      
Johan Cwiklinski bc00dc
    
Johan Cwiklinski bc00dc
    
Johan Cwiklinski bc00dc
      {% autoescape false %}
Johan Cwiklinski bc00dc
        {{ content | markdown }}
Johan Cwiklinski bc00dc
      {% endautoescape %}
Johan Cwiklinski bc00dc
    
Johan Cwiklinski bc00dc
  
Johan Cwiklinski bc00dc
{% endmacro %}
Pierre-Yves Chibon 6e76e1
Pierre-Yves Chibon 6e76e1
{% block repo %}
Pierre-Yves Chibon 6e76e1
Pierre-Yves Chibon ea16af
{% if authenticated and form %}
Pierre-Yves Chibon ea16af
  
Pierre-Yves Chibon ea16af
           repo=repo.name, issueid=issueid) }}" method="post">
Pierre-Yves Chibon 070654
  {{ form.csrf_token }}
Pierre-Yves Chibon ea16af
{% endif %}
Pierre-Yves Chibon ea16af
Johan Cwiklinski bc00dc

Johan Cwiklinski bc00dc
    #{{ issueid }} {{ issue.title }}
Pierre-Yves Chibon bad774
    {% if authenticated and repo_admin %}
Johan Cwiklinski bc00dc
    -  
Pierre-Yves Chibon 6bf823
                  repo=repo.name, issueid=issueid) }}">
Pierre-Yves Chibon 11013f
        Edit
Johan Cwiklinski bc00dc
    {% endif %}
Pierre-Yves Chibon 3d3baf
    <aside class="issue_action"></aside>
Pierre-Yves Chibon bad774
    {% if authenticated and repo_admin %}
Pierre-Yves Chibon 3d3baf
        {{ render_field(form.status) }}
Pierre-Yves Chibon 3d3baf
        <input class="submit positive button" type="submit" value="Update">
Pierre-Yves Chibon 3d3baf
    {% else %}
Pierre-Yves Chibon 3d3baf
        Status: {{ issue.status }}
Pierre-Yves Chibon 3d3baf
    {% endif %}
Pierre-Yves Chibon 3d3baf
    
Johan Cwiklinski bc00dc
Pierre-Yves Chibon 11013f
Pierre-Yves Chibon 16fdbf
<section id="tags"></section>
Pierre-Yves Chibon 16fdbf
    Tags:
Pierre-Yves Chibon 16fdbf
    {% for tag in issue.tags %}
Pierre-Yves Chibon 16fdbf
    
Pierre-Yves Chibon 16fdbf
               repo=repo.name, tags=tag.tag) }}">
Pierre-Yves Chibon 958e06
        {{ tag.tag }}{%- if not loop.last -%},{%- endif -%}
Pierre-Yves Chibon 16fdbf
    {% endfor %}
Pierre-Yves Chibon bad774
    {% if authenticated and repo_admin %}
Pierre-Yves Chibon 958e06
      
Pierre-Yves Chibon 958e06
        placeholder="tag1, tag2" name="tag" title="comma separated list of tags">
Pierre-Yves Chibon 16fdbf
    {% endif %}
Pierre-Yves Chibon 16fdbf
Pierre-Yves Chibon 16fdbf
Pierre-Yves Chibon 4c2dd9
<section id="assigned"></section>
Pierre-Yves Chibon 4c2dd9
    Assigned:
Pierre-Yves Chibon 4c2dd9
    {% if issue.assignee %}
Pierre-Yves Chibon 4c2dd9
    
Pierre-Yves Chibon 4c2dd9
               repo=repo.name, assignee=issue.assignee.username) }}">
Pierre-Yves Chibon 4c2dd9
        {{ issue.assignee.username }}
Pierre-Yves Chibon 4c2dd9
    {% endif %}
Pierre-Yves Chibon ea16af
    {% if authenticated %}
Pierre-Yves Chibon 837bd6
        
Pierre-Yves Chibon 837bd6
          name="assignee" id="assignee" placeholder="username" >
Pierre-Yves Chibon 4c2dd9
    {% endif %}
Pierre-Yves Chibon 4c2dd9
Pierre-Yves Chibon 4c2dd9
Pierre-Yves Chibon c92cdd
<section id="blocks"></section>
Pierre-Yves Chibon c92cdd
    Blocking:
Pierre-Yves Chibon c92cdd
    {% if issue.parents %}
Pierre-Yves Chibon c92cdd
    {% for ticket in issue.parents %}
Pierre-Yves Chibon c92cdd
        
Pierre-Yves Chibon c92cdd
                  repo=repo.name, issueid=ticket.id) }}">
Pierre-Yves Chibon c92cdd
        {{ ticket.id }}
Pierre-Yves Chibon c92cdd
    {% endfor %}
Pierre-Yves Chibon c92cdd
    {% endif %}
Pierre-Yves Chibon c92cdd
Pierre-Yves Chibon ea16af
    {% if authenticated %}
Pierre-Yves Chibon 3ea0f3
        
Pierre-Yves Chibon 3ea0f3
            placeholder="issue blocked" name="blocks"
Pierre-Yves Chibon 3ea0f3
            value="{{ issue.blocks_text | join(',') }}">
Pierre-Yves Chibon c92cdd
    {% endif %}
Pierre-Yves Chibon c92cdd
Pierre-Yves Chibon c92cdd
Pierre-Yves Chibon c92cdd
<section id="depends"></section>
Pierre-Yves Chibon c92cdd
    Depends on:
Pierre-Yves Chibon c92cdd
    {% if issue.children %}
Pierre-Yves Chibon c92cdd
    {% for ticket in issue.children %}
Pierre-Yves Chibon c92cdd
        
Pierre-Yves Chibon c92cdd
                  repo=repo.name, issueid=ticket.id) }}">
Pierre-Yves Chibon c92cdd
        {{ ticket.id }}
Pierre-Yves Chibon c92cdd
    {% endfor %}
Pierre-Yves Chibon c92cdd
    {% endif %}
Pierre-Yves Chibon c92cdd
Pierre-Yves Chibon ea16af
    {% if authenticated %}
Pierre-Yves Chibon c92cdd
        
Pierre-Yves Chibon 3ea0f3
            placeholder="issue depending" name="depends"
Pierre-Yves Chibon 3ea0f3
            value="{{ issue.depends_text | join(',') }}">
Pierre-Yves Chibon c92cdd
    {% endif %}
Pierre-Yves Chibon c92cdd
Pierre-Yves Chibon c92cdd
Pierre-Yves Chibon 3d3baf
{{ show_comment(issue.user, issue.date_created, issue.content) }}
Pierre-Yves Chibon ceda80
Pierre-Yves Chibon 008224
{% if issue.comments %}
Pierre-Yves Chibon ceda80
  {% for comment in issue.comments %}
Johan Cwiklinski bc00dc
    {{ show_comment(comment.user, comment.date_created, comment.comment) }}
Pierre-Yves Chibon ceda80
  {% endfor %}
Pierre-Yves Chibon 008224
{% endif %}
Pierre-Yves Chibon 008224
Johan Cwiklinski bc00dc
<section class="issue_comment add_comment"></section>
Pierre-Yves Chibon ea16af
{% if authenticated and form %}
Pierre-Yves Chibon a76093
  <header></header>
Pierre-Yves Chibon a76093
    <label for="comment">Add new comment</label>
Pierre-Yves Chibon a76093
    (supports the 
Pierre-Yves Chibon a76093
      target="_blank">Markdown syntax)
Pierre-Yves Chibon a76093
  
Pierre-Yves Chibon a76093
  
Pierre-Yves Chibon a76093
    
    Pierre-Yves Chibon a76093
          
  • Comment
  • Pierre-Yves Chibon a76093
          
  • Preview
  • Pierre-Yves Chibon a76093
        
    Pierre-Yves Chibon a76093
        
    Pierre-Yves Chibon ea16af
          
    Pierre-Yves Chibon ea16af
            <textarea id="comment" name="comment" placeholder="Enter your comment here"></textarea>
    Pierre-Yves Chibon ea16af
          
    Pierre-Yves Chibon ea16af
          
    Pierre-Yves Chibon ea16af
            <input class="submit positive button" type="submit" value="Comment">
    Pierre-Yves Chibon ea16af
            <input id="clear_comment" type="button" value="Clear">
    Pierre-Yves Chibon ea16af
          
    Johan Cwiklinski bc00dc
        
    Pierre-Yves Chibon a76093
        
    Pierre-Yves Chibon ceda80
        
    Pierre-Yves Chibon a76093
      
    Pierre-Yves Chibon a37659
    {% else %}
    Johan Cwiklinski bc00dc
      

    Login to comment on this ticket.

    Pierre-Yves Chibon a37659
    {% endif %}
    Johan Cwiklinski bc00dc
    Pierre-Yves Chibon 6e76e1
    Pierre-Yves Chibon ea16af
    {% if authenticated and form %}
    Pierre-Yves Chibon ea16af
      
    Pierre-Yves Chibon ea16af
    {% endif %}
    Pierre-Yves Chibon ea16af
    Pierre-Yves Chibon 6e76e1
    {% endblock %}
    Pierre-Yves Chibon a76093
    Pierre-Yves Chibon a76093
    {% block jscripts %}
    Pierre-Yves Chibon a76093
    {{ super() }}
    Pierre-Yves Chibon a76093
    <script type="text/javascript"></script>
    Pierre-Yves Chibon a76093
    $(function() {
    Pierre-Yves Chibon a76093
      $( "#tabs" ).tabs();
    Pierre-Yves Chibon a76093
    Pierre-Yves Chibon a76093
      $( "#tabs" ).on('tabsactivate',
    Pierre-Yves Chibon a76093
        function(event, ui) {
    Pierre-Yves Chibon a76093
          if (ui.newPanel.selector == '#preview') {
    Pierre-Yves Chibon a76093
            var _text = $( "#comment" ).val();
    Pierre-Yves Chibon a76093
            var _url = "{{ url_for('markdown_preview') }}";
    Pierre-Yves Chibon a76093
              $.ajax({
    Pierre-Yves Chibon a76093
                  url: _url ,
    Pierre-Yves Chibon a76093
                  type: 'POST',
    Pierre-Yves Chibon abee5c
                  data: {
    Pierre-Yves Chibon abee5c
                    content: _text,
    Pierre-Yves Chibon abee5c
                    csrf_token: "{{ form.csrf_token.current_token }}",
    Pierre-Yves Chibon abee5c
                  },
    Pierre-Yves Chibon a76093
                  dataType: 'html',
    Pierre-Yves Chibon a76093
                  success: function(res) {
    Pierre-Yves Chibon a76093
                      $( "#preview" ).html(res);
    Pierre-Yves Chibon a76093
                  },
    Pierre-Yves Chibon a76093
                  error: function() {
    Pierre-Yves Chibon a76093
                      alert('Unable to generate preview!');
    Pierre-Yves Chibon a76093
                  }
    Pierre-Yves Chibon a76093
              });
    Pierre-Yves Chibon a76093
              return false;
    Pierre-Yves Chibon a76093
          }
    Pierre-Yves Chibon a76093
        }
    Pierre-Yves Chibon a76093
      );
    Pierre-Yves Chibon 6df8a0
    Pierre-Yves Chibon 6df8a0
      $( ".reply" ).click(
    Pierre-Yves Chibon 6df8a0
        function() {
    Pierre-Yves Chibon 6df8a0
            var _section = $(this).parent().parent().parent();
    Pierre-Yves Chibon 6df8a0
            var _comment = _section.find('.comment_body');
    Pierre-Yves Chibon 6df8a0
            var _text = _comment.text().split("\n");
    Pierre-Yves Chibon 6df8a0
            var _output = new Array();
    Pierre-Yves Chibon 6df8a0
            for (cnt = 0; cnt < _text.length - 1; cnt ++) {
    Pierre-Yves Chibon 6df8a0
                _output[cnt] = '> ' + jQuery.trim(_text[cnt + 1]);
    Pierre-Yves Chibon 6df8a0
            }
    Pierre-Yves Chibon 6df8a0
            $( "#comment" ).val(_output.join("\n"));
    Pierre-Yves Chibon 6df8a0
        }
    Pierre-Yves Chibon 6df8a0
      );
    Pierre-Yves Chibon 6df8a0
    Pierre-Yves Chibon c9a7e9
      $( "#clear_comment").click(
    Pierre-Yves Chibon c9a7e9
        function() {
    Pierre-Yves Chibon c9a7e9
          $( "#comment" ).val("");
    Pierre-Yves Chibon c9a7e9
        }
    Pierre-Yves Chibon c9a7e9
      );
    Pierre-Yves Chibon c9a7e9
    Pierre-Yves Chibon 9fd82b
      var cache = {};
    Pierre-Yves Chibon 9fd82b
      $( "#tag" ).autocomplete({
    Pierre-Yves Chibon 9fd82b
        source: function( request, response ) {
    Pierre-Yves Chibon 9fd82b
          var pattern = request.term;
    Pierre-Yves Chibon 9fd82b
          if ( pattern in cache ) {
    Pierre-Yves Chibon 9fd82b
            response( cache[ pattern ] );
    Pierre-Yves Chibon 9fd82b
            return;
    Pierre-Yves Chibon 9fd82b
          }
    Pierre-Yves Chibon 9fd82b
    Pierre-Yves Chibon 9fd82b
          $.getJSON(
    Pierre-Yves Chibon 9fd82b
            "{{ url_for('api_ns.api_project_tags', repo=repo.name, username=username) }}", {
    Pierre-Yves Chibon 9fd82b
              pattern: request.term
    Pierre-Yves Chibon 9fd82b
            },
    Pierre-Yves Chibon 9fd82b
            function( data ) {
    Pierre-Yves Chibon 9fd82b
              cache[ pattern ] = data.tags;
    Pierre-Yves Chibon 9fd82b
              response( data.tags );
    Pierre-Yves Chibon 9fd82b
            }
    Pierre-Yves Chibon 9fd82b
          );
    Pierre-Yves Chibon 9fd82b
        },
    Pierre-Yves Chibon 9fd82b
        minLength: 0,
    Pierre-Yves Chibon 9fd82b
        delay: 200,
    Pierre-Yves Chibon 9fd82b
      });
    Pierre-Yves Chibon 9fd82b
    Pierre-Yves Chibon ff9c68
      $('#assignee').autocomplete({
    Pierre-Yves Chibon ff9c68
        source: function( request, response ) {
    Pierre-Yves Chibon ff9c68
          $.getJSON(
    Pierre-Yves Chibon ff9c68
            "{{ url_for('api_ns.api_users') }}", {
    Pierre-Yves Chibon ff9c68
              pattern: request.term
    Pierre-Yves Chibon ff9c68
            },
    Pierre-Yves Chibon ff9c68
            function( data ) {
    Pierre-Yves Chibon ff9c68
              response( data.users );
    Pierre-Yves Chibon ff9c68
            }
    Pierre-Yves Chibon ff9c68
          );
    Pierre-Yves Chibon ff9c68
        },
    Pierre-Yves Chibon ff9c68
        minLength: 2,
    Pierre-Yves Chibon ff9c68
        delay: 200,
    Pierre-Yves Chibon ff9c68
      });
    Pierre-Yves Chibon ff9c68
    Pierre-Yves Chibon a76093
    });
    Pierre-Yves Chibon a76093
    Pierre-Yves Chibon a76093
    {% endblock %}