Skip to content

Commit 2eedc39

Browse files
committed
SpecialInbox: Use a real table with mw-datatable class
1 parent 60d7416 commit 2eedc39

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

includes/Specials/SpecialInbox.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,20 @@ private function showAllEmails( $emailAddress ) {
6969
if ( $emails ) {
7070
$this->getOutput()->addModuleStyles( 'inbox.style' );
7171
$this->getOutput()->addHTML( Html::rawElement(
72-
'div',
73-
[ 'class' => 'email-all' ],
72+
'table',
73+
[ 'class' => 'email-all mw-datatable' ],
74+
'<tr><th>From</th><th>Subject</th><th>Time</th></tr>' .
7475
implode( '', array_map( function ( $email ) {
7576
return Html::rawElement(
76-
'div',
77+
'tr',
7778
[ 'class' => [ !$email->email_read ? 'email-unread' : '', 'email-one' ] ],
7879
Html::element(
79-
'span',
80+
'td',
8081
[ 'class' => 'email-from' ],
8182
$email->email_from
8283
) .
8384
Html::rawElement(
84-
'span',
85+
'td',
8586
[ 'class' => 'email-subject' ],
8687
Html::element(
8788
'a',
@@ -90,7 +91,7 @@ private function showAllEmails( $emailAddress ) {
9091
)
9192
) .
9293
Html::element(
93-
'span',
94+
'td',
9495
[ 'class' => 'email-timestamp' ],
9596
$this->getLanguage()->userTimeAndDate( $email->email_timestamp, $this->getUser() )
9697
)

modules/inbox.less

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
@import 'mediawiki.ui/variables';
22

33
.email-all {
4-
display: table;
54
width: 100%;
65

76
.email-one {
8-
display: table-row;
9-
&:hover {
10-
background-color: @colorGray12;
7+
.email-subject {
8+
width: 50%;
119
}
1210

13-
span {
14-
display: table-cell;
15-
16-
&.email-subject {
17-
width: 50%;
18-
}
19-
}
20-
21-
&.email-unread span {
11+
&.email-unread {
2212
font-weight: bold;
2313
}
2414
}

0 commit comments

Comments
 (0)