From 9aa3a11d0ecd3613eeff36d6a36a2d6662a2e5a9 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Thu, 10 Oct 2019 13:08:36 +0800 Subject: [PATCH] MDL-66770 mod_forum: change columns in discussion list table Show the last post user, remove discussion author image, and fix column widths to the size of the content. --- mod/forum/templates/discussion_list.mustache | 63 ++++++++++++-------- theme/boost/scss/moodle/modules.scss | 20 +++++++ theme/boost/style/moodle.css | 12 ++++ theme/classic/style/moodle.css | 12 ++++ 4 files changed, 82 insertions(+), 25 deletions(-) diff --git a/mod/forum/templates/discussion_list.mustache b/mod/forum/templates/discussion_list.mustache index 30bf5791c92..8ae2552a39c 100644 --- a/mod/forum/templates/discussion_list.mustache +++ b/mod/forum/templates/discussion_list.mustache @@ -42,12 +42,13 @@ }}data-gradable-itemtype="forum" {{! }}{{#firstgradeduserid}}data-initialuserid="{{firstgradeduserid}}" {{/firstgradeduserid}}{{! }}> - {{{groupchangemenu}}} {{#notifications}} {{> core/notification}} {{/notifications}} + {{{groupchangemenu}}} + {{#forum.capabilities.create}}
@@ -81,7 +82,7 @@ {{#str}} showingcountoftotaldiscussions, mod_forum, {"count": "{{visiblediscussioncount}}", "total":"{{totaldiscussioncount}}"} {{/str}} @@ -105,7 +106,7 @@ {{/state.sortorder.isdiscussiondesc}} {{#forum.state.groupmode}} - {{/forum.state.groupmode}} - - {{#forum.capabilities.viewdiscussions}} - {{/forum.capabilities.viewdiscussions}} {{#forum.capabilities.subscribe}} - + {{/forum.capabilities.subscribe}} {{#forum.state.groupmode}} - - {{#forum.capabilities.viewdiscussions}} - {{/forum.capabilities.viewdiscussions}} {{#forum.capabilities.subscribe}} -
+ {{#state.sortorder.isgroupdesc}} {{#str}}group{{/str}} {{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}} {{/state.sortorder.isgroupdesc}} @@ -119,7 +120,7 @@ {{/state.sortorder.isgroupdesc}} + {{#state.sortorder.isstarterdesc}} {{#str}}startedby, mod_forum{{/str}} {{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}} {{/state.sortorder.isstarterdesc}} @@ -132,7 +133,7 @@ {{/state.sortorder.isstarterasc}} {{/state.sortorder.isstarterdesc}} + {{#state.sortorder.islastpostdesc}} {{#str}}lastpost, mod_forum{{/str}} {{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}} {{/state.sortorder.islastpostdesc}} @@ -146,7 +147,7 @@ {{/state.sortorder.islastpostdesc}} + {{#state.sortorder.isrepliesdesc}} {{#str}}replies, mod_forum{{/str}} {{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}} {{/state.sortorder.isrepliesdesc}} @@ -164,7 +165,7 @@ {{#str}} subscribed, mod_forum {{/str}}{{#str}} notsubscribed, mod_forum {{/str}} {{#str}}actions{{/str}} @@ -213,7 +214,7 @@ + {{#discussion.group}} {{#str}} pictureof, core, {{name}} {{/str}} {{/forum.state.groupmode}} - + {{#firstpostauthor}} -
+
{{#str}}pictureof, moodle, {{fullname}}{{/str}}
-
-
{{fullname}}
-
- {{#userdate}}{{discussion.times.created}}, {{#str}}strftimedatemonthabbr, langconfig{{/str}}{{/userdate}} +
+
{{fullname}}
+
+ {{#userdate}}{{discussion.times.created}}, {{#str}}strftimedatemonthabbr, langconfig{{/str}}{{/userdate}}
{{/firstpostauthor}}
+ {{! TODO Check q&a, eachuser }} - {{#latestpostid}} - - {{#userdate}} - {{discussion.times.modified}}, {{#str}}strftimedateshortmonthabbr, langconfig{{/str}} - {{/userdate}} - - {{/latestpostid}} + {{#latestpostauthor}} + + {{/latestpostauthor}} + {{replies}} {{#forum.userstate.tracked}} {{#unread}} @@ -275,7 +288,7 @@ + {{#discussion}} {{/forum.capabilities.subscribe}} - + {{#discussion}}
{{#hasanyactions}} diff --git a/theme/boost/scss/moodle/modules.scss b/theme/boost/scss/moodle/modules.scss index 2525dadc461..8fad103429e 100644 --- a/theme/boost/scss/moodle/modules.scss +++ b/theme/boost/scss/moodle/modules.scss @@ -174,6 +174,26 @@ select { margin-bottom: 0; } +#page-mod-forum-view { + table { + .fit-content { + width: 1px; + white-space: nowrap; + } + + .limit-width { + max-width: 200px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + + .author-info { + max-width: calc(100% - 35px - .5rem); + } + } + } +} + #page-mod-forum-discuss .discussioncontrols { width: auto; margin: 0; diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 20aed1df789..8a7532858d7 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -16305,6 +16305,18 @@ select { .forumsearch input[type=text] { margin-bottom: 0; } +#page-mod-forum-view table .fit-content { + width: 1px; + white-space: nowrap; } + +#page-mod-forum-view table .limit-width { + max-width: 200px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } + #page-mod-forum-view table .limit-width .author-info { + max-width: calc(100% - 35px - .5rem); } + #page-mod-forum-discuss .discussioncontrols { width: auto; margin: 0; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 06f6444369d..0a47e472861 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -16577,6 +16577,18 @@ select { .forumsearch input[type=text] { margin-bottom: 0; } +#page-mod-forum-view table .fit-content { + width: 1px; + white-space: nowrap; } + +#page-mod-forum-view table .limit-width { + max-width: 200px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } + #page-mod-forum-view table .limit-width .author-info { + max-width: calc(100% - 35px - .5rem); } + #page-mod-forum-discuss .discussioncontrols { width: auto; margin: 0; }