data-name="{{{ name }}}"
data-bytes="{{ bytes }}"
data-timemodified="{{ timemodified }}"
- data-type="{{{ type }}}">
+ data-type="{{{ type }}}"
+ data-author="{{{ author }}}">
@@ -155,9 +167,12 @@ data-region="contentbank">
{{ size }}
-
+
{{{ type }}}
+
+ {{{ author }}}
+
{{/contents}}
diff --git a/contentbank/tests/behat/sort_content.feature b/contentbank/tests/behat/sort_content.feature
index 6abcf9548c4..242c2279180 100644
--- a/contentbank/tests/behat/sort_content.feature
+++ b/contentbank/tests/behat/sort_content.feature
@@ -5,14 +5,20 @@ Feature: Sort content in the content bank
I need to be able to sort the content bank in various ways
Background:
- Given the following "contentbank content" exist:
- | contextlevel | reference | contenttype | user | contentname |
- | System | | contenttype_h5p | admin | Dragon_santjordi.h5p |
- | System | | contenttype_h5p | admin | mathsbook.h5p |
- | System | | contenttype_h5p | admin | historybook.h5p |
- | System | | contenttype_h5p | admin | santjordi.h5p |
- | System | | contenttype_h5p | admin | santjordi_rose.h5p |
- | System | | contenttype_h5p | admin | SantJordi_book |
+ Given the following "users" exist:
+ | username | firstname | lastname | email |
+ | manager | Max | Manager | man@example.com |
+ And the following "role assigns" exist:
+ | user | role | contextlevel | reference |
+ | manager | manager | System | |
+ And the following "contentbank content" exist:
+ | contextlevel | reference | contenttype | user | contentname |
+ | System | | contenttype_h5p | admin | Dragon_santjordi.h5p |
+ | System | | contenttype_h5p | admin | mathsbook.h5p |
+ | System | | contenttype_h5p | manager | historybook.h5p |
+ | System | | contenttype_h5p | admin | santjordi.h5p |
+ | System | | contenttype_h5p | admin | santjordi_rose.h5p |
+ | System | | contenttype_h5p | admin | SantJordi_book |
Scenario: Admins can order content in the content bank
Given I log in as "admin"
@@ -30,3 +36,18 @@ Feature: Sort content in the content bank
And "historybook.h5p" "text" should appear before "Dragon_santjordi.h5p" "text"
And "mathsbook.h5p" "text" should appear before "historybook.h5p" "text"
Then "santjordi_rose.h5p" "text" should appear before "SantJordi_book" "text"
+
+ Scenario: Admins can order content depending on the author
+ Given I log in as "admin"
+ And I am on site homepage
+ And I turn editing mode on
+ And I add the "Navigation" block if not present
+ And I expand "Site pages" node
+ And I click on "Content bank" "link"
+ When I click on "Display content bank with file details" "button"
+ Then I click on "Sort by Author ascending" "button"
+ And "Dragon_santjordi.h5p" "text" should appear before "historybook.h5p" "text"
+ And "santjordi_rose.h5p" "text" should appear before "historybook" "text"
+ And I click on "Sort by Author descending" "button"
+ And "historybook.h5p" "text" should appear before "Dragon_santjordi.h5p" "text"
+ And "historybook.h5p" "text" should appear before "santjordi_rose" "text"
diff --git a/theme/boost/scss/moodle/contentbank.scss b/theme/boost/scss/moodle/contentbank.scss
index a7bfc641d35..8bed4e2a49a 100644
--- a/theme/boost/scss/moodle/contentbank.scss
+++ b/theme/boost/scss/moodle/contentbank.scss
@@ -47,7 +47,8 @@
.cb-heading,
.cb-date,
.cb-size,
- .cb-type {
+ .cb-type,
+ .cb-author {
display: none;
}
}
@@ -94,13 +95,14 @@
z-index: 1;
}
- .cb-file,
- .cb-date {
- flex: 0 0 35%;
- max-width: 35%;
+ .cb-file {
+ flex: 0 0 40%;
+ max-width: 40%;
}
+ .cb-date,
.cb-size,
- .cb-type {
+ .cb-type,
+ .cb-author {
flex: 0 0 15%;
max-width: 15%;
}
diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css
index cbdfb38144d..f760244f59b 100644
--- a/theme/boost/style/moodle.css
+++ b/theme/boost/style/moodle.css
@@ -13048,7 +13048,8 @@ table.calendartable caption {
.content-bank-container.view-grid .cb-heading,
.content-bank-container.view-grid .cb-date,
.content-bank-container.view-grid .cb-size,
-.content-bank-container.view-grid .cb-type {
+.content-bank-container.view-grid .cb-type,
+.content-bank-container.view-grid .cb-author {
display: none; }
.content-bank-container.view-list .cb-content-wrapper {
@@ -13083,12 +13084,13 @@ table.calendartable caption {
position: sticky;
top: 0;
z-index: 1; }
- .content-bank-container.view-list .cb-file,
- .content-bank-container.view-list .cb-date {
- flex: 0 0 35%;
- max-width: 35%; }
+ .content-bank-container.view-list .cb-file {
+ flex: 0 0 40%;
+ max-width: 40%; }
+ .content-bank-container.view-list .cb-date,
.content-bank-container.view-list .cb-size,
- .content-bank-container.view-list .cb-type {
+ .content-bank-container.view-list .cb-type,
+ .content-bank-container.view-list .cb-author {
flex: 0 0 15%;
max-width: 15%; }
.content-bank-container.view-list .cb-column.last {
diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css
index d673dfc990c..ecdabf340e8 100644
--- a/theme/classic/style/moodle.css
+++ b/theme/classic/style/moodle.css
@@ -13262,7 +13262,8 @@ table.calendartable caption {
.content-bank-container.view-grid .cb-heading,
.content-bank-container.view-grid .cb-date,
.content-bank-container.view-grid .cb-size,
-.content-bank-container.view-grid .cb-type {
+.content-bank-container.view-grid .cb-type,
+.content-bank-container.view-grid .cb-author {
display: none; }
.content-bank-container.view-list .cb-content-wrapper {
@@ -13297,12 +13298,13 @@ table.calendartable caption {
position: sticky;
top: 0;
z-index: 1; }
- .content-bank-container.view-list .cb-file,
- .content-bank-container.view-list .cb-date {
- flex: 0 0 35%;
- max-width: 35%; }
+ .content-bank-container.view-list .cb-file {
+ flex: 0 0 40%;
+ max-width: 40%; }
+ .content-bank-container.view-list .cb-date,
.content-bank-container.view-list .cb-size,
- .content-bank-container.view-list .cb-type {
+ .content-bank-container.view-list .cb-type,
+ .content-bank-container.view-list .cb-author {
flex: 0 0 15%;
max-width: 15%; }
.content-bank-container.view-list .cb-column.last {