mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Merge branch 'MDL-67277-master-strongtopics' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
9c18bff160
2
mod/forum/amd/build/discussion_list.min.js
vendored
2
mod/forum/amd/build/discussion_list.min.js
vendored
@ -1,2 +1,2 @@
|
||||
define ("mod_forum/discussion_list",["jquery","core/templates","core/str","core/notification","mod_forum/subscription_toggle","mod_forum/selectors","mod_forum/repository","core/pubsub","mod_forum/forum_events"],function(a,b,c,d,e,f,g,h,i){var j=function(e){h.subscribe(i.SUBSCRIPTION_TOGGLED,function(a){var b=a.discussionId,c=a.subscriptionState,d=e.find(f.discussion.item+"[data-discussionid= "+b+"] "+f.discussion.subscribedLabel);if(c){d.removeAttr("hidden")}else{d.attr("hidden",!0)}});e.on("click",f.favourite.toggle,function(){var b=a(this),c=b.data("forumid"),e=b.data("discussionid"),f=b.data("targetstate");g.setFavouriteDiscussionState(c,e,f).then(function(){return location.reload()}).catch(d.exception)});e.on("click",f.pin.toggle,function(b){b.preventDefault();var c=a(this),e=c.data("forumid"),f=c.data("discussionid"),h=c.data("targetstate");g.setPinDiscussionState(e,f,h).then(function(){return location.reload()}).catch(d.exception)});e.on("click",f.lock.toggle,function(h){var e=a(this),i=e.data("forumid"),j=e.data("discussionid"),k=e.data("state");g.setDiscussionLockState(i,j,k).then(function(a){var b=e.parents(f.summary.actions).find(f.lock.icon),c=e.parents(f.discussion.item).find(f.discussion.lockedLabel);if(a.locked){b.removeClass("hidden");c.removeAttr("hidden")}else{b.addClass("hidden");c.attr("hidden",!0)}return a}).then(function(a){a.forumid=i;return b.render("mod_forum/discussion_lock_toggle",a)}).then(function(a,c){return b.replaceNode(e,a,c)}).then(function(){return c.get_string("lockupdated","forum").done(function(a){return d.addNotification({message:a,type:"info"})})}).catch(d.exception);h.preventDefault()})};return{init:function init(a){e.init(a,!1,function(a,b){var d=a.attr("id"),e=b.userstate.subscribed?0:1;a.data("targetstate",e);var f=b.userstate.subscribed?"unsubscribediscussion":"subscribediscussion";return c.get_string(f,"mod_forum").then(function(b){a.closest("td").find("label[for=\""+d+"\"]").text(b);return b})});j(a)}}});
|
||||
define ("mod_forum/discussion_list",["jquery","core/templates","core/str","core/notification","mod_forum/subscription_toggle","mod_forum/selectors","mod_forum/repository","core/pubsub","mod_forum/forum_events"],function(a,b,c,d,e,f,g,h,i){var j=function(e){h.subscribe(i.SUBSCRIPTION_TOGGLED,function(a){var b=a.discussionId,c=a.subscriptionState,d=e.find(f.discussion.item+"[data-discussionid= "+b+"]"),g=d.find(f.discussion.subscribedLabel);if(c){d.addClass("subscribed");g.removeAttr("hidden")}else{d.removeClass("subscribed");g.attr("hidden",!0)}});e.on("click",f.favourite.toggle,function(){var b=a(this),c=b.data("forumid"),e=b.data("discussionid"),f=b.data("targetstate");g.setFavouriteDiscussionState(c,e,f).then(function(){return location.reload()}).catch(d.exception)});e.on("click",f.pin.toggle,function(b){b.preventDefault();var c=a(this),e=c.data("forumid"),f=c.data("discussionid"),h=c.data("targetstate");g.setPinDiscussionState(e,f,h).then(function(){return location.reload()}).catch(d.exception)});e.on("click",f.lock.toggle,function(h){var e=a(this),i=e.data("forumid"),j=e.data("discussionid"),k=e.data("state");g.setDiscussionLockState(i,j,k).then(function(a){var b=e.parents(f.summary.actions).find(f.lock.icon),c=e.parents(f.discussion.item).find(f.discussion.lockedLabel);if(a.locked){b.removeClass("hidden");c.removeAttr("hidden")}else{b.addClass("hidden");c.attr("hidden",!0)}return a}).then(function(a){a.forumid=i;return b.render("mod_forum/discussion_lock_toggle",a)}).then(function(a,c){return b.replaceNode(e,a,c)}).then(function(){return c.get_string("lockupdated","forum").done(function(a){return d.addNotification({message:a,type:"info"})})}).catch(d.exception);h.preventDefault()})};return{init:function init(a){e.init(a,!1,function(a,b){var d=a.attr("id"),e=b.userstate.subscribed?0:1;a.data("targetstate",e);var f=b.userstate.subscribed?"unsubscribediscussion":"subscribediscussion";return c.get_string(f,"mod_forum").then(function(b){a.closest("td").find("label[for=\""+d+"\"]").text(b);return b})});j(a)}}});
|
||||
//# sourceMappingURL=discussion_list.min.js.map
|
||||
|
File diff suppressed because one or more lines are too long
@ -46,11 +46,13 @@ define([
|
||||
PubSub.subscribe(ForumEvents.SUBSCRIPTION_TOGGLED, function(data) {
|
||||
var discussionId = data.discussionId;
|
||||
var subscribed = data.subscriptionState;
|
||||
var subscribedLabel = root.find(Selectors.discussion.item + '[data-discussionid= ' + discussionId + '] '
|
||||
+ Selectors.discussion.subscribedLabel);
|
||||
var discussionListItem = root.find(Selectors.discussion.item + '[data-discussionid= ' + discussionId + ']');
|
||||
var subscribedLabel = discussionListItem.find(Selectors.discussion.subscribedLabel);
|
||||
if (subscribed) {
|
||||
discussionListItem.addClass('subscribed');
|
||||
subscribedLabel.removeAttr('hidden');
|
||||
} else {
|
||||
discussionListItem.removeClass('subscribed');
|
||||
subscribedLabel.attr('hidden', true);
|
||||
}
|
||||
});
|
||||
|
@ -189,12 +189,17 @@
|
||||
{{$discussion_list_body}}
|
||||
<tbody>
|
||||
{{#summaries}}
|
||||
<!-- The discussion class is only required for behat tests to identify the row -->
|
||||
<tr class="discussion {{#discussion.timed}}{{#istimed}}{{^visible}}dimmed_text{{/visible}}{{/istimed}}{{/discussion.timed}}"
|
||||
{{! The discussion class is only required for behat tests to identify the row. }}
|
||||
<tr class="discussion{{!
|
||||
}}{{#discussion.pinned}} pinned{{/discussion.pinned}}{{!
|
||||
}}{{#discussion.userstate.favourited}} favourited{{/discussion.userstate.favourited}}{{!
|
||||
}}{{#discussion.userstate.subscribed}} subscribed{{/discussion.userstate.subscribed}}{{!
|
||||
}}{{#unread}} hasunread{{/unread}}{{!
|
||||
}}{{#discussion.timed}}{{#istimed}}{{^visible}} dimmed_text{{/visible}}{{/istimed}}{{/discussion.timed}}"
|
||||
data-region="discussion-list-item"
|
||||
data-discussionid="{{id}}"
|
||||
data-forumid="{{forumid}}">
|
||||
<td class="pinned p-0 text-center align-middle icon-no-margin" style="width: 1px;">
|
||||
<td class="p-0 text-center align-middle icon-no-margin" style="width: 1px;">
|
||||
{{#discussion.pinned}}
|
||||
{{#pix}}i/pinned, mod_forum, {{#str}}discussionpinned, mod_forum{{/str}}{{/pix}}
|
||||
{{/discussion.pinned}}
|
||||
|
@ -39,7 +39,7 @@
|
||||
aria-labelledby="post-header-{{id}}"
|
||||
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 -->
|
||||
{{! 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 {{#firstpost}}firstpost starter{{/firstpost}}"
|
||||
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
|
||||
|
@ -39,7 +39,7 @@
|
||||
aria-labelledby="post-header-{{id}}"
|
||||
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 -->
|
||||
{{! 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 focus-target {{#unread}}unread{{/unread}} {{#firstpost}}firstpost starter{{/firstpost}}"
|
||||
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
|
||||
|
@ -33,7 +33,7 @@
|
||||
{{#posts}}
|
||||
{{< mod_forum/forum_discussion_post }}
|
||||
{{$replies}}
|
||||
<!-- The forumthread class is only added for behat -->
|
||||
{{! The forumthread class is only added for behat. }}
|
||||
<div class="indent forumthread post-replies" data-region="replies-container">
|
||||
{{#replies}}
|
||||
{{> mod_forum/forum_discussion_threaded_post }}
|
||||
|
@ -97,6 +97,13 @@ select {
|
||||
}
|
||||
}
|
||||
|
||||
.discussion-list {
|
||||
.topic {
|
||||
// Do not use the default bold style for the table headings.
|
||||
font-weight: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
// Style for the forum subscription mode node.
|
||||
.subscriptionmode {
|
||||
color: $body-color;
|
||||
|
@ -16265,6 +16265,9 @@ select {
|
||||
.path-mod-forum .forumheaderlist .discussion .lastpost {
|
||||
vertical-align: top; }
|
||||
|
||||
.path-mod-forum .discussion-list .topic {
|
||||
font-weight: inherit; }
|
||||
|
||||
.path-mod-forum .subscriptionmode {
|
||||
color: #373a3c; }
|
||||
|
||||
|
@ -16534,6 +16534,9 @@ select {
|
||||
.path-mod-forum .forumheaderlist .discussion .lastpost {
|
||||
vertical-align: top; }
|
||||
|
||||
.path-mod-forum .discussion-list .topic {
|
||||
font-weight: inherit; }
|
||||
|
||||
.path-mod-forum .subscriptionmode {
|
||||
color: #373a3c; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user