mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-64820 forum: add classes to first post to fix behat
This commit is contained in:
parent
96a49734ac
commit
57ad9a0ce7
2 changed files with 11 additions and 1 deletions
|
@ -194,6 +194,7 @@ class renderer {
|
|||
unset($exportedpost->author);
|
||||
}
|
||||
|
||||
$exportedpost->firstpost = false;
|
||||
$exportedpost->readonly = $readonly;
|
||||
$exportedpost->hasreplies = false;
|
||||
$exportedpost->replies = [];
|
||||
|
@ -228,6 +229,11 @@ class renderer {
|
|||
$exportedposts = [$exportedfirstpost];
|
||||
}
|
||||
|
||||
if (!empty($exportedposts)) {
|
||||
// Need to identify the first post so that we can use it in behat tests.
|
||||
$exportedposts[0]->firstpost = true;
|
||||
}
|
||||
|
||||
return $exportedposts;
|
||||
}
|
||||
);
|
||||
|
|
|
@ -31,7 +31,11 @@
|
|||
}}
|
||||
<article id="p{{id}}" class="relativelink mb-2" tabindex="-1" data-post-id="{{id}}">
|
||||
|
||||
<div class="d-flex border p-2 mb-2 forumpost {{#unread}}unread{{/unread}}">
|
||||
<!-- The firstpost and starter classes below aren't used for anything other than to identify the first post in behat -->
|
||||
<div
|
||||
class="d-flex border p-2 mb-2 forumpost {{#unread}}unread{{/unread}} {{#firstpost}}firstpost starter{{/firstpost}}"
|
||||
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
|
||||
>
|
||||
{{#isfirstunread}}<a id="unread"></a>{{/isfirstunread}}
|
||||
<div style="width: 45px;">
|
||||
{{^isdeleted}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue