#80 Make the pagure PR widget graphically closer to the updates2stable one
Merged 8 years ago by ralph. Opened 8 years ago by pingou.
pingou/fedora-hubs fix_pagure_pr  into  develop

file modified
+46 -64
@@ -9,71 +9,53 @@ 

  pagure_url = "https://pagure.io/api/0"

  

  template = jinja2.Template("""

-   <div class="container">

-     <table id="pagure-pr-list"

-         class="table table-hover table-striped m-b-0">

-       <thead class="thead-default">

-         <tr>

-           <th id="project-title">Project</th>

-           <th id="pr-title">Pull-Request</th>

-           <th class="open_by">Reporter</th>

-           <th class="assigned">Assignee</th>

-         </tr>

-       </thead>

-       <tfoot>

-       </tfoot>

-       <tbody>

-         {% for pr in all_pr %}

-         <tr>

-           <td>

-             {% if pr['pr_project_user'] %}

-             <a href="https://pagure.io/forks/{{

-                 pr['pr_project_user'] }}/{{ pr['pr_project_name'] }}"

-               target="_blank">

-               {{ pr['pr_project_user'] }}/{{ pr['pr_project_name'] }}

-             {% else %}

-             <a href="https://pagure.io/{{

-               pr['pr_project_name'] }}" target="_blank">

-               {{ pr['pr_project_name'] }}

-             {% endif %}

-             </a>

-           </td>

-           <td>

-             <span class="label label-default">#{{ pr['pr_id'] }}</span>

-             <a href="https://pagure.io/{{ repo }}/pull-request/{{

-               pr['pr_id'] }}" target="_blank"

-               title="{{ pr['pr_title_full'] }}">

-               {{ pr['pr_title'] }} ...

-             </a>

-           </td>

-           <td>

-             <a href="https://pagure.io/user/{{ pr['pr_openedby'] }}"

-                 target="_blank">

-               {{ pr['pr_openedby'] }}

-             </a>

-           </td>

-           <td>

-             {% if pr['pr_assignee'] %}

-               <a href="https://pagure.io/user/{{ pr['pr_assignee'] }}"

-                   target="_blank">

-                 {{ pr['pr_assignee'] }}

-               </a>

-             {% else %}

-               <span class="text-muted">unassigned</span>

-             {% endif %}

-           </td>

-         </tr>

-         {% endfor %}

-       </tbody>

-     </table>

-     </div class="row">

-       <center>

-         <a href="https://pagure.io/{{ repo }}/pull-requests" target="_blank">

-           All Pull-Requests

+ <a class="btn btn-success" target="_blank"

+     href="https://pagure.io/{{ repo }}/pull-requests">

+   All Pull-Requests

+ </a>

+ <hr/>

+ 

+ <ul class="media-list">

+   {% for pr in all_pr[:10] %}

+     <li class="media">

+       <div class="media-left">

+         <a  href="https://pagure.io/{{ repo }}/pull-request/{{ pr['pr_id'] }}"

+             target="_blank">

+           {{ pr['pr_project_name'] }}

+         <span class="label label-default">#{{ pr['pr_id'] }}</span>

          </a>

-       <center>

-     </div>

-   </div>

+       </div>

+       <div class="media-body">

+         <h4 class="media-heading">

+           <span title="{{ pr['pr_title_full'] }}">

+             {{ pr['pr_title'] }} {% if

+               pr['pr_title_full'] | length > 45 %} ... {% endif %}

+           </span>

+         </h4>

+         Opened by:

+           <a href="https://pagure.io/user/{{ pr['pr_openedby'] }}"

+               target="_blank">

+             {{ pr['pr_openedby'] }}

+           </a>

+         --

+         {% if pr['pr_assignee'] %}

+           Assigned to:

+           <a href="https://pagure.io/user/{{ pr['pr_assignee'] }}"

+               target="_blank">

+             {{ pr['pr_assignee'] }}

+           </a>

+         {% else %}

+           <span class="text-muted">Unassigned</span>

+         {% endif %}

+       </div>

+     </li>

+   {% endfor %}

+   {% if all_pr | length > 10 %}

+   <li>

+     And {{ all_pr | length - 10 }} more ...

+   </li>

+   {% endif %}

+ </ul>

  """)

  

  

no initial comment

:+1: @pingou. Awesome! (reviewed by five people)

Feel free to merge btw, I don't have commit rights ;-)

Pull-Request has been merged by ralph

8 years ago
Metadata