mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +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);
|
unset($exportedpost->author);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$exportedpost->firstpost = false;
|
||||||
$exportedpost->readonly = $readonly;
|
$exportedpost->readonly = $readonly;
|
||||||
$exportedpost->hasreplies = false;
|
$exportedpost->hasreplies = false;
|
||||||
$exportedpost->replies = [];
|
$exportedpost->replies = [];
|
||||||
|
@ -228,6 +229,11 @@ class renderer {
|
||||||
$exportedposts = [$exportedfirstpost];
|
$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;
|
return $exportedposts;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -31,7 +31,11 @@
|
||||||
}}
|
}}
|
||||||
<article id="p{{id}}" class="relativelink mb-2" tabindex="-1" data-post-id="{{id}}">
|
<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}}
|
{{#isfirstunread}}<a id="unread"></a>{{/isfirstunread}}
|
||||||
<div style="width: 45px;">
|
<div style="width: 45px;">
|
||||||
{{^isdeleted}}
|
{{^isdeleted}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue