Blame pagure/templates/_render_pullrequests.html

Ryan Lerch 0c654b
{% from "_projectstring.html" import projectstring, projecticon %}
Ryan Lerch 0c654b
Ryan Lerch a56157
{% macro render_pullrequest_row(request, repo, username, subtitle=True, class="", showproject=False, filterstatus=None) %}
Ryan Lerch 81c3a2
    {% if request.status|lower == 'open' %}
Ryan Lerch 81c3a2
        {% set status_color = "success" %}
Ryan Lerch 81c3a2
    {% elif request.status|lower == 'merged' %}
Ryan Lerch 81c3a2
        {% set status_color = "info" %}
Ryan Lerch 81c3a2
    {% else %}
Ryan Lerch 81c3a2
        {% set status_color = "danger" %}
Ryan Lerch 81c3a2
    {% endif %}
Ryan Lerch 81c3a2
Ryan Lerch ca8575
Ryan Lerch 81c3a2
        
Ryan Lerch 81c3a2
            
Ryan Lerch ca8575
            
Ryan Lerch ca8575
            
Ryan Lerch 81c3a2
                
Ryan Lerch 81c3a2
                    #{{request.id}}
Ryan Lerch 81c3a2
                    
Ryan Lerch 81c3a2
                        
Ryan Lerch 81c3a2
                            'ui_ns.request_pull',
Ryan Lerch 81c3a2
                            repo=repo.name,
Pierre-Yves Chibon 88c04c
                            username=repo.user.user if repo.is_fork else None,
Ryan Lerch 81c3a2
                            namespace=repo.namespace,
Ryan Lerch 81c3a2
                            requestid=request.id) }}">
Ryan Lerch 81c3a2
                        {{request.title}}
Ryan Lerch 81c3a2
                        
Ryan Lerch 81c3a2
                    
Ryan Lerch 81c3a2
                
Ryan Lerch ca8575
                
Ryan Lerch ca8575
Ryan Lerch ca8575
                        {% if request.assignee %}
Ryan Lerch 28ccf5
                        
Ryan Lerch ca8575
                            
Ryan Lerch a56157
                            {% if filterstatus %}
Ryan Lerch a56157
                            
Ryan Lerch a56157
                                repo=repo.name,
Pierre-Yves Chibon 88c04c
                                username=repo.user.user if repo.is_fork else None,
Ryan Lerch a56157
                                namespace=repo.namespace,
Ryan Lerch a56157
                                status=filterstatus,
Ryan Lerch a56157
                                assignee=request.assignee.username) }}" class="notblue">
Ryan Lerch a56157
                            {% endif %}
Ryan Lerch ca8575
                            {{ request.assignee.username | avatar(size=20) | safe}}
Ryan Lerch a56157
                            {% if filterstatus %}
Ryan Lerch a56157
                            
Ryan Lerch a56157
                            {% endif %}
Ryan Lerch ca8575
                        
Ryan Lerch ca8575
                        {% endif %}
Michael Watters 803d72
Ryan Lerch 28ccf5
                        
Ryan Lerch ca8575
                            
Ryan Lerch ca8575
                              {{request.branch}}
Ryan Lerch ca8575
                          
Michael Watters 803d72
Ryan Lerch 28ccf5
                        
Ryan Lerch ca8575
                          
Ryan Lerch ca8575
                            {{request.user_comments|count}}
Ryan Lerch ca8575
                        
Michael Watters 803d72
Ryan Lerch ca8575
                
Ryan Lerch ca8575
            
Ryan Lerch 336cd6
                {% if subtitle %}
Ryan Lerch ca8575
                
Ryan Lerch 81c3a2
                    {% if request.status|lower == 'merged'%}
Ryan Lerch 81c3a2
                        <small></small>
Ryan Lerch 81c3a2
                            Merged
Ryan Lerch 81c3a2
                            
Ryan Lerch 81c3a2
                            request.closed_at | format_datetime
Ryan Lerch 81c3a2
                          }}">{{ request.closed_at | humanize}}.
Ryan Lerch 81c3a2
Ryan Lerch 81c3a2
                          Opened 
Ryan Lerch 81c3a2
                            request.date_created | format_datetime
Ryan Lerch 81c3a2
                          }}">{{ request.date_created | humanize}} by 
Ryan Lerch 81c3a2
                          request.user.html_title }}">{{ request.user.user }}.
Ryan Lerch 81c3a2
Ryan Lerch 81c3a2
                        
Ryan Lerch 81c3a2
                    {% elif request.status|lower == 'closed' %}
Ryan Lerch 81c3a2
                        <small></small>
Ryan Lerch 81c3a2
                            Cancelled
Ryan Lerch 81c3a2
                            
Ryan Lerch 81c3a2
                            request.closed_at | format_datetime
Ryan Lerch 81c3a2
                          }}">{{ request.closed_at | humanize}}.
Ryan Lerch 81c3a2
                          Opened 
Ryan Lerch 81c3a2
                            request.date_created | format_datetime
Ryan Lerch 81c3a2
                          }}">{{ request.date_created | humanize}} by 
Ryan Lerch 81c3a2
                          request.user.html_title }}">{{ request.user.user }}.
Ryan Lerch 81c3a2
                        
Ryan Lerch 81c3a2
                    {% else %}
Ryan Lerch 81c3a2
                    <small></small>
Michael Watters 803d72
                        Opened
Ryan Lerch 81c3a2
                        
Ryan Lerch 81c3a2
                        request.date_created | format_datetime
Ryan Lerch 81c3a2
                      }}">{{ request.date_created | humanize}} by 
Ryan Lerch 81c3a2
                      request.user.html_title }}">{{ request.user.user }}.
Ryan Lerch 81c3a2
                      Modified 
Pierre-Yves Chibon 828527
                        request.updated_on | format_datetime
Pierre-Yves Chibon 828527
                      }}">{{ request.updated_on | humanize}}
Ryan Lerch 81c3a2
                      
Ryan Lerch 81c3a2
                    {% endif %}
Ryan Lerch ca8575
                    {% if showproject %}
Ryan Lerch ca8575
                      <small class="ml-auto mt-1"></small>
Ryan Lerch ca8575
                            {% if repo.is_fork -%}
Ryan Lerch ca8575
                             
Ryan Lerch ca8575
                            {%- else -%}
Ryan Lerch 0c654b
                              
Ryan Lerch ca8575
                            {%- endif -%}
Ryan Lerch ca8575
                          {% if repo.is_fork %}
Ryan Lerch ca8575
                          
Ryan Lerch ca8575
                              'ui_ns.view_user', username=repo.user.user)
Ryan Lerch ca8575
                              }}">{{ repo.user.user }} / 
Ryan Lerch ca8575
                          {% endif %}
Ryan Lerch ca8575
                          {% if repo.namespace %}
Ryan Lerch ca8575
                              
Ryan Lerch ca8575
                                  'ui_ns.view_projects', namespace=repo.namespace, pattern='*')
Ryan Lerch ca8575
                              }}">{{ repo.namespace }}/
Ryan Lerch ca8575
                          {% endif %}
Ryan Lerch ca8575
                          {% if repo.is_fork %}
Ryan Lerch ca8575
                          
Ryan Lerch ca8575
                              repo=repo.name,
Pierre-Yves Chibon 88c04c
                              username=repo.user.user if repo.is_fork else None,
Ryan Lerch ca8575
                              namespace=repo.namespace)
Ryan Lerch ca8575
                              }}">
Ryan Lerch ca8575
                        {% else %}
Ryan Lerch ca8575
                        
Ryan Lerch ca8575
                        repo=repo.name,
Ryan Lerch ca8575
                        username=None,
Ryan Lerch ca8575
                        namespace=repo.namespace)
Ryan Lerch ca8575
                        }}">
Ryan Lerch ca8575
                        {% endif %}
Ryan Lerch ca8575
                            {{ repo.name }}
Ryan Lerch ca8575
                        
Ryan Lerch ca8575
                      {% endif %}
Ryan Lerch 81c3a2
                
Ryan Lerch 81c3a2
                
Michael Watters 803d72
                  {% for tag in request.tags %}
Michael Watters 803d72
                      
Pierre-Yves Chibon 3ff704
                            data-bg-color="{{ tag.tag_color}}"
Pierre-Yves Chibon 64a548
                            class="badge badge-secondary font-90p">
Michael Watters 803d72
                          {{ tag.tag }}
Michael Watters 803d72
                      
Michael Watters 803d72
                  {% endfor %}
Ryan Lerch 81c3a2
                
Michael Watters 803d72
Michael Watters 803d72
                {% if request.flags %}
Michael Watters 803d72
                  
Michael Watters 803d72
                    {% set flags_stats = request.flags_stats %}
Michael Watters 803d72
                    {% if flags_stats | length == 1 %}
Michael Watters 803d72
                      {% for status in flags_stats %}
Michael Watters 803d72
                        

{{ flags_stats[status][0].username }}:

Michael Watters 803d72
                          
Michael Watters 803d72
                            flags_stats[status][0] | flag2label }} font-size-09">
Michael Watters 803d72
                              {{ flags_stats[status][0].status }}
Michael Watters 803d72
                          
Michael Watters 803d72
                        

Michael Watters 803d72
                      {% endfor %}
Michael Watters 803d72
                    {% else %}
Michael Watters 803d72
                      

Flags:

Michael Watters 803d72
                      {% for status in flags_stats %}
Michael Watters 803d72
                        
Michael Watters 803d72
                          flags_stats[status][0] | flag2label }} font-size-09"
Michael Watters 803d72
                          title="{% for f in flags_stats[status] %}{{
Michael Watters 803d72
                          f.username}}{% if not loop.last %}, {% endif %}{% endfor %}">
Michael Watters 803d72
                            {{ flags_stats[status] | length }} {{ status }}
Michael Watters 803d72
                        
Michael Watters 803d72
                      

Michael Watters 803d72
                      {% endfor %}
Michael Watters 803d72
                    {% endif %}
Michael Watters 803d72
                  
Michael Watters 803d72
                {% endif %}
Michael Watters 803d72
Michael Watters 803d72
                
Ryan Lerch ca8575
                {% endif %}
Ryan Lerch 81c3a2
            
Ryan Lerch 81c3a2
        
Ryan Lerch 81c3a2
Ryan Lerch 81c3a2
{% endmacro%}