|
1 | 1 | <?php |
2 | 2 | use PTR\Display; |
3 | 3 |
|
4 | | -echo Display::get_display_css(); ?> |
| 4 | +echo Display::get_display_css(); |
5 | 5 |
|
6 | | -<table> |
| 6 | +foreach ( $revisions as $revision ) : |
| 7 | + |
| 8 | + $rev_id = (int) ltrim( $revision->post_name, 'r' ); |
| 9 | +?> |
| 10 | + |
| 11 | +<div class="ptr-test-reporter-single-revision"> |
| 12 | + <a href="<?php echo esc_url( sprintf( 'https://core.trac.wordpress.org/changeset/%d', $rev_id ) ); ?>"> |
| 13 | + r<?php echo $rev_id; ?> |
| 14 | + </a>: <?php echo esc_attr( apply_filters( 'the_title', $revision->post_title ) ); ?> |
| 15 | +</div> |
| 16 | + |
| 17 | +<table class="ptr-test-reporter-table alignwide"> |
7 | 18 | <thead> |
8 | 19 | <tr> |
9 | | - <th style="width:100px">Revision</th> |
10 | | - <th>Host</th> |
11 | | - <th>PHP Version</th> |
| 20 | + <th style="width:100px">Status</th> |
| 21 | + <th style="width:150px">PHP Version</th> |
12 | 22 | <th>Database Version</th> |
13 | 23 | </tr> |
14 | 24 | </thead> |
15 | 25 | <tbody> |
16 | | - <?php |
17 | | - $total_cols = 5; |
18 | | - foreach ( $revisions as $revision ) : |
19 | | - $rev_id = (int) ltrim( $revision->post_name, 'r' ); |
20 | | - ?> |
21 | | - <tr> |
22 | | - <th colspan="<?php echo (int) $total_cols; ?>"><a href="<?php echo esc_url( sprintf( 'https://core.trac.wordpress.org/changeset/%d', $rev_id ) ); ?>">r<?php echo (int) $rev_id; ?></a>: <?php echo wp_kses_post( apply_filters( 'the_title', $revision->post_title ) ); ?></th> |
23 | | - </tr> |
| 26 | + |
24 | 27 | <?php |
25 | | - $query_args = array( |
| 28 | + $query_args = array( |
26 | 29 | 'posts_per_page' => $posts_per_page, |
| 30 | + 'author' => $post_author ?? null, |
27 | 31 | 'post_type' => 'result', |
28 | 32 | 'post_parent' => $revision->ID, |
29 | | - 'orderby' => 'post_title', |
30 | | - 'order' => 'ASC', |
| 33 | + 'orderby' => [ 'author' => 'ASC', 'env_name_clause' => 'ASC' ], |
| 34 | + 'meta_query' => array( |
| 35 | + 'relation' => 'OR', |
| 36 | + 'env_name_clause' => array( |
| 37 | + 'key' => 'environment_name', |
| 38 | + 'compare' => 'EXISTS', |
| 39 | + ), |
| 40 | + array( |
| 41 | + 'key' => 'environment_name', |
| 42 | + 'compare' => 'NOT EXISTS', |
| 43 | + ) |
| 44 | + ), |
31 | 45 | ); |
32 | 46 | $report_query = new WP_Query( $query_args ); |
33 | 47 | if ( ! empty( $report_query->posts ) ) : |
| 48 | + |
| 49 | + $prev_author = null; |
| 50 | + |
34 | 51 | foreach ( $report_query->posts as $report ) : |
35 | 52 | $status = 'Errored'; |
36 | 53 | $status_title = 'No results found for test.'; |
|
55 | 72 | 'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"', |
56 | 73 | ) |
57 | 74 | ); |
58 | | - if ( ! empty( $user->user_url ) ) { |
59 | | - $host .= '</a>'; |
60 | | - } |
61 | | - if ( ! empty( $user->user_url ) ) { |
62 | | - $host .= '<a target="_blank" rel="nofollow" href="' . esc_url( $user->user_url ) . '">'; |
63 | | - } |
64 | | - $host .= $user->display_name; |
| 75 | + |
| 76 | + $host .= Display::get_display_reporter_name( $report->post_author ); |
| 77 | + |
65 | 78 | if ( ! empty( $user->user_url ) ) { |
66 | 79 | $host .= '</a>'; |
67 | 80 | } |
68 | 81 | } |
69 | 82 | ?> |
| 83 | + <?php if ( $prev_author !== $host ): ?> |
| 84 | + <tr> |
| 85 | + <td colspan="3"> |
| 86 | + <?php echo wp_kses_post( $host ); ?> |
| 87 | + </td> |
| 88 | + </tr> |
| 89 | + |
| 90 | + <?php endif; ?> |
70 | 91 | <tr> |
71 | | - <td><a href="<?php echo esc_url( get_permalink( $report->ID ) ); ?>" title="<?php echo esc_attr( $status_title ); ?>" class="<?php echo esc_attr( 'ptr-status-badge ptr-status-badge-' . strtolower( $status ) ); ?>"><?php echo esc_html( $status ); ?></a></td> |
72 | | - <td><?php echo wp_kses_post( $host ); ?></td> |
| 92 | + <td> |
| 93 | + <a href="<?php echo esc_url( get_permalink( $report->ID ) ); ?>" title="<?php echo esc_attr( $status_title ); ?>" class="<?php echo esc_attr( 'ptr-status-badge ptr-status-badge-' . strtolower( $status ) ); ?>"> |
| 94 | + <?php echo esc_html( $status ); ?> |
| 95 | + </a> |
| 96 | + </td> |
73 | 97 | <td><?php echo esc_html( Display::get_display_php_version( $report->ID ) ); ?></td> |
74 | 98 | <td><?php echo esc_html( Display::get_display_mysql_version( $report->ID ) ); ?></td> |
75 | 99 | </tr> |
76 | 100 | <?php |
| 101 | + $prev_author = $host; |
77 | 102 | endforeach; |
78 | 103 | else : |
79 | 104 | ?> |
80 | 105 | <tr> |
81 | | - <td></td> |
82 | | - <td colspan="<?php echo (int) $total_cols - 1; ?>"> |
| 106 | + <td colspan="3"> |
83 | 107 | No reports for changeset. |
84 | 108 | </td> |
85 | 109 | </tr> |
86 | 110 | <?php endif; ?> |
87 | | - <?php endforeach; ?> |
88 | 111 | </tbody> |
89 | 112 | </table> |
| 113 | +<?php endforeach; |
0 commit comments