AutorÃa | Ultima modificación | Ver Log |
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_forum/forum_discussion_nested_v2_first_post
Template to render a single post from a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#discussionlocked}}
<div>
<span class="badge-sq badge-danger mt-2">
<span class="mr-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><g data-name="Layer 2"><g data-name="lock"><rect width="24" height="24" opacity="0"/><path d="M17 8h-1V6.11a4 4 0 1 0-8 0V8H7a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-8a3 3 0 0 0-3-3zm-7-1.89A2.06 2.06 0 0 1 12 4a2.06 2.06 0 0 1 2 2.11V8h-4zM18 19a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1z"/><path d="M12 12a3 3 0 1 0 3 3 3 3 0 0 0-3-3zm0 4a1 1 0 1 1 1-1 1 1 0 0 1-1 1z"/></g></g></svg></span>
<span>{{#str}} locked, mod_forum {{/str}}</span>
</span>
</div>
{{/discussionlocked}}
<article
id="p{{id}}"
class="forum-post-container {{#discussionlocked}}forumpost-locked rounded{{/discussionlocked}}"
data-post-id="{{id}}"
data-region="post"
data-target="{{id}}-target"
tabindex="0"
aria-labelledby="post-header-{{id}}-{{uniqid}}"
aria-describedby="post-content-{{id}}"
>
{{! The firstpost and starter classes below aren't used for anything other than to identify the first post in behat. }}
<div
class="d-flex focus-target mb-4 forumpost {{#firstpost}}firstpost starter{{/firstpost}}"
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
data-post-id="{{id}}" data-content="forum-post"
>
{{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}
<div class="author-image-container d-inline-block mb-sm-3 mb-md-0 mr-3" style="width: 43px;">
{{^isdeleted}}
{{#author}}
{{#urls.profileimage}}
<img
class="rounded"
style="width: 36px; height: 36px;"
src="{{{.}}}"
alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
aria-hidden="true"
>
{{/urls.profileimage}}
{{/author}}
{{/isdeleted}}
{{#unread}}
<div class="icon-size-4 text-info text-center mt-3 rui-icon-no-margin">
<span
data-toggle="tooltip"
data-placement="boottom"
title="{{#str}} unreadpost, mod_forum {{/str}}"
tabindex="0"
>{{#pix}} i/flagged, core {{/pix}}</span>
</div>
{{/unread}}
</div>
<div class="forum-post-core d-flex flex-column w-100" data-region-content="forum-post-core">
<header id="post-header-{{id}}-{{uniqid}}">
{{^isdeleted}}
<div class="d-flex flex-wrap align-items-center mb-1">
<div class="mr-2" tabindex="-1">
{{#author}}
<h4 class="h6 d-lg-inline-block mb-0 author-header mr-1 small">
{{#parentauthorname}}
{{#isprivatereply}}
<span class="text-danger">
{{#str}}
authorreplyingprivatelytoauthor, mod_forum, {
"respondant":"<a class='author-name' data-region='author-name' href='{{{urls.profile}}}'>{{fullname}}</a>",
"author":"{{parentauthorname}}"
}
{{/str}}
</span>
{{/isprivatereply}}
{{^isprivatereply}}
{{#str}}
authorreplyingtoauthor, mod_forum, {
"respondant":"<a class='author-name' data-region='author-name' href='{{{urls.profile}}}'>{{fullname}}</a>",
"author":"{{parentauthorname}}"
}
{{/str}}
{{/isprivatereply}}
{{/parentauthorname}}
{{^parentauthorname}}
<a class='author-name' data-region='author-name' href="{{{urls.profile}}}">{{fullname}}</a>
{{/parentauthorname}}
</h4>
{{/author}}
{{< core/time_element }}
{{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
{{$elementclass}}badge badge-light{{/elementclass}}
{{$timestampval}}{{timecreated}}{{/timestampval}}
{{$userdateformatval}}{{#str}} strftimerecentfull, core_langconfig {{/str}}{{/userdateformatval}}
{{/core/time_element}}
</div>
<div class="d-flex align-items-center ml-auto">
{{#author.groups}}
{{#urls.image}}
<div class="mr-2">
{{#urls.group}}
<a href="{{urls.group}}" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
<img
class="rounded-circle group-image"
src="{{{urls.image}}}"
alt="{{#str}} pictureof, core, {{name}} {{/str}}"
aria-hidden="true"
title="{{#str}} pictureof, core, {{name}} {{/str}}"
>
</a>
{{/urls.group}}
{{^urls.group}}
<img class="rounded group-image"
src="{{{urls.image}}}"
alt="{{#str}} pictureof, core, {{name}} {{/str}}"
title="{{#str}} pictureof, core, {{name}} {{/str}}"
>
{{/urls.group}}
</div>
{{/urls.image}}
{{/author.groups}}
{{^readonly}}
{{#showactionmenu}}
<div class="dropdown">
<button
class="btn btn-secondary btn-sm"
type="button"
id="post-actions-menu-{{id}}-{{uniqid}}"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
aria-label="{{#str}} actionsforpost, mod_forum {{/str}}"
>
{{#pix}} i/moremenu {{/pix}}
</button>
<!-- inline style to fix RTL placement bug -->
<div class="dropdown-menu dropdown-menu-right rounded-lg shadow border-0" aria-labelledby="post-actions-menu-{{id}}-{{uniqid}}" style="right: auto" role="menubar">
{{#capabilities}}
{{#view}}
<a
href="{{{urls.view}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} permalink, mod_forum {{/str}}
</a>
{{/view}}
{{#controlreadstatus}}
{{#unread}}
<a
href="{{{urls.markasread}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} markread, mod_forum {{/str}}
</a>
{{/unread}}
{{^unread}}
<a
href="{{{urls.markasunread}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} markunread, mod_forum {{/str}}
</a>
{{/unread}}
{{/controlreadstatus}}
{{#urls.viewparent}}
<a
href="{{{.}}}"
class="dropdown-item"
title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} parent, mod_forum {{/str}}
</a>
{{/urls.viewparent}}
{{#edit}}
<a
href="{{{urls.edit}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} edit, mod_forum {{/str}}
</a>
{{/edit}}
{{#split}}
<a
href="{{{urls.split}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} prune, mod_forum {{/str}}
</a>
{{/split}}
{{#delete}}
<a
href="{{{urls.delete}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} delete, mod_forum {{/str}}
</a>
{{/delete}}
{{#export}}
<a
href="{{{urls.export}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} addtoportfolio, core_portfolio {{/str}}
</a>
{{/export}}
{{/capabilities}}
</div>
</div>
{{/showactionmenu}}
{{/readonly}}
</div>
</div>
{{/isdeleted}}
{{$subject}}
<h2
class="h1 post-subject mt-2"
data-region-content="forum-post-core-subject"
data-reply-subject="{{replysubject}}"
>{{{subject}}}</h2>
{{/subject}}
{{#hasreplycount}}
<span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
{{/hasreplycount}}
</header>
<div class="post-message pr-md-5" id="post-content-{{id}}">
{{{message}}}
</div>
{{^isdeleted}}
{{#attachments}}
{{#isimage}}
<div class="attachedimages">
<img
src="{{{url}}}"
alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
style="max-width: 100%"
>
{{#urls.export}}
<a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
{{#pix}} t/portfolioadd, core {{/pix}}
</a>
{{/urls.export}}
{{#html.plagiarism}}
<div>{{{.}}}</div>
{{/html.plagiarism}}
</div>
{{/isimage}}
{{/attachments}}
{{#attachments}}
{{^isimage}}
<div class="mt-3">
<span class="icon-size-6">{{#pix}} {{icon}}, core {{/pix}}</span>
<div class="align-bottom d-inline-block">
<a
href="{{{url}}}"
aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
class="font-weight-bold"
>
{{#str}} attachmentnameandfilesize, mod_forum, {"name": "{{filename}}", "size": "{{filesizeformatted}}"} {{/str}}
</a>
{{#urls.export}}
<a class="rui-icon-no-margin" href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
{{#pix}} t/portfolioadd, core {{/pix}}
</a>
{{/urls.export}}
{{#html.plagiarism}}
<div>{{{.}}}</div>
{{/html.plagiarism}}
</div>
</div>
{{/isimage}}
{{/attachments}}
<div class="d-flex mt-3 align-items-center">
{{^readonly}}
{{#html.rating}}
<div>{{{.}}}</div>
{{/html.rating}}
{{/readonly}}
<div class="ml-auto d-flex flex-column">
{{#haswordcount}}
<span class="ml-auto badge badge-light">
{{#str}} numwords, core, {{wordcount}} {{/str}}
</span>
{{/haswordcount}}
{{#html.taglist}}
<div class="d-inline-block ml-auto {{#haswordcount}}mt-2{{/haswordcount}}">{{{.}}}</div>
{{/html.taglist}}
</div>
</div>
{{/isdeleted}}
{{$footer}}
{{^isdeleted}}
{{^readonly}}
<div class="d-flex mt-3">
{{#capabilities.reply}}
<button
class="btn btn-primary btn-sm"
data-href="{{{urls.reply}}}"
data-post-id="{{id}}"
data-action="create-inpage-reply"
data-can-reply-privately="{{capabilities.canreplyprivately}}"
>
{{#str}} reply, mod_forum {{/str}}
</button>
{{/capabilities.reply}}
{{^capabilities.reply}}
{{#discussionlocked}}
<button class="btn btn-secondary btn-sm disabled" disabled>
{{#str}} reply, mod_forum {{/str}}
</button>
{{/discussionlocked}}
{{/capabilities.reply}}
</div>
{{/readonly}}
{{/isdeleted}}
{{/footer}}
</div>
</div>
{{$replies}}
<div class="indent inline-reply-container" data-region="inpage-reply-container"></div>
<div class="indent replies-container" data-region="replies-container">
{{#hasreplies}}
{{#replies}}
{{> mod_forum/forum_discussion_nested_v2_post_reply }}
{{/replies}}
{{/hasreplies}}
</div>
{{/replies}}
</article>