From 78c06a660b03ace5b988d3d46f5a01e9aff0fdc0 Mon Sep 17 00:00:00 2001 From: Bas Brands Date: Mon, 5 Nov 2018 15:44:14 +0100 Subject: [PATCH] MDL-63830 block_myoverview: star icon updates Change the star icon from being in a button and allow it to be inline using spans instead of divs. Add the option to passes css classed to the template. --- .../myoverview/templates/view-cards.mustache | 4 +-- .../myoverview/templates/view-list.mustache | 4 +-- .../templates/view-summary.mustache | 16 +++++----- .../behat/block_myoverview_favourite.feature | 3 -- .../templates/view-cards.mustache | 2 +- .../templates/view-cards.mustache | 4 +-- course/templates/favouriteicon.mustache | 29 ++++++------------ lang/en/course.php | 1 - pix/i/star.png | Bin 392 -> 390 bytes pix/i/star.svg | 4 +-- theme/boost/scss/moodle/blocks.scss | 3 ++ theme/boost/style/moodle.css | 3 ++ theme/bootstrapbase/less/moodle/blocks.less | 3 ++ theme/bootstrapbase/style/moodle.css | 4 +++ 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/blocks/myoverview/templates/view-cards.mustache b/blocks/myoverview/templates/view-cards.mustache index ba119b4fd37..ed99b6ae208 100644 --- a/blocks/myoverview/templates/view-cards.mustache +++ b/blocks/myoverview/templates/view-cards.mustache @@ -42,13 +42,13 @@
{{#str}}aria:courseimage, core_course{{/str}} - {{> core_course/favouriteicon }}
- + {{> core_course/favouriteicon }} + {{#str}}aria:coursename, core_course{{/str}} {{#shortentext}}40, {{{fullname}}} {{/shortentext}} diff --git a/blocks/myoverview/templates/view-list.mustache b/blocks/myoverview/templates/view-list.mustache index 05e1c529295..41b17a7b5de 100644 --- a/blocks/myoverview/templates/view-list.mustache +++ b/blocks/myoverview/templates/view-list.mustache @@ -40,8 +40,8 @@ data-region="course-content" data-course-id="{{{id}}}">
-
-
+
+
{{> core_course/favouriteicon }} {{#str}}aria:coursename, core_course{{/str}} diff --git a/blocks/myoverview/templates/view-summary.mustache b/blocks/myoverview/templates/view-summary.mustache index 061aac47dbe..15010b21a77 100644 --- a/blocks/myoverview/templates/view-summary.mustache +++ b/blocks/myoverview/templates/view-summary.mustache @@ -41,19 +41,19 @@ data-course-id="{{{id}}}">
-
- {{> core_course/favouriteicon }} -
{{#str}}aria:courseimage, core_course{{/str}}
-
- - {{#str}}aria:coursename, core_course{{/str}} -

{{{fullname}}}

-
+
+ {{> block_myoverview/course-action-menu }}
diff --git a/blocks/myoverview/tests/behat/block_myoverview_favourite.feature b/blocks/myoverview/tests/behat/block_myoverview_favourite.feature index 08527be51d5..40a2442cdf0 100644 --- a/blocks/myoverview/tests/behat/block_myoverview_favourite.feature +++ b/blocks/myoverview/tests/behat/block_myoverview_favourite.feature @@ -30,7 +30,6 @@ Feature: The my overview block allows users to favourite their courses And I reload the page Then "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist And "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist - And "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='not-favourite' and @aria-hidden='true']" "xpath_element" should exist And "//div[@class='card dashboard-card' and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist And "//div[@class='card dashboard-card' and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist And I log out @@ -45,7 +44,6 @@ Feature: The my overview block allows users to favourite their courses And I reload the page Then "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist - And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='not-favourite' and @aria-hidden='true']" "xpath_element" should exist And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist And I log out @@ -60,7 +58,6 @@ Feature: The my overview block allows users to favourite their courses And I reload the page Then "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist - And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='not-favourite' and @aria-hidden='true']" "xpath_element" should exist And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist And I log out diff --git a/blocks/recentlyaccessedcourses/templates/view-cards.mustache b/blocks/recentlyaccessedcourses/templates/view-cards.mustache index 57dba61e45c..9e223da6bae 100644 --- a/blocks/recentlyaccessedcourses/templates/view-cards.mustache +++ b/blocks/recentlyaccessedcourses/templates/view-cards.mustache @@ -39,11 +39,11 @@
{{#str}}aria:courseimage, core_course{{/str}} - {{>core_course/favouriteicon }}
+ {{> core_course/favouriteicon }} {{{fullname}}}
diff --git a/blocks/starredcourses/templates/view-cards.mustache b/blocks/starredcourses/templates/view-cards.mustache index 05d672a2485..bb44b0535f5 100644 --- a/blocks/starredcourses/templates/view-cards.mustache +++ b/blocks/starredcourses/templates/view-cards.mustache @@ -32,13 +32,13 @@
{{#str}}aria:courseimage, core_course{{/str}} - {{>core_course/favouriteicon }}
- + {{>core_course/favouriteicon }} + {{#str}}aria:coursename, core_course{{/str}} {{#shortentext}}40, {{{fullname}}} {{/shortentext}} diff --git a/course/templates/favouriteicon.mustache b/course/templates/favouriteicon.mustache index 3b4831666e5..8aa8e6e7d5c 100644 --- a/course/templates/favouriteicon.mustache +++ b/course/templates/favouriteicon.mustache @@ -25,25 +25,16 @@ "isfavourite": true } }} -
- -
+ + {{#pix}} i/star, core, {{#str}} favourite, core_course {{/str}} {{/pix}} + {{#str}} aria:favourite, core_course {{/str}} + + diff --git a/lang/en/course.php b/lang/en/course.php index 511efd8cc96..bf8d76e62d0 100644 --- a/lang/en/course.php +++ b/lang/en/course.php @@ -26,7 +26,6 @@ $string['aria:courseimage'] = 'Course image:'; $string['aria:coursename'] = 'Course name:'; $string['aria:favourite'] = 'Course is starred'; $string['favourite'] = 'Starred course'; -$string['notfavourite'] = 'Not starred'; $string['privacy:perpage'] = 'The number of courses to show per page.'; $string['privacy:completionpath'] = 'Course completion'; $string['privacy:metadata:completionsummary'] = 'The course contains completion information about the user.'; diff --git a/pix/i/star.png b/pix/i/star.png index f5058acbabb864b44fa524e09be7460d650fb74b..3ba7acbbbba047ff0abddd1bc9f62e44973df948 100644 GIT binary patch delta 345 zcmV-f0jBfD<1DbAU*~8YuwgKtQPvl$ipm!CGGF z1|>7Vn-$R3JD4K73%BhEEv@>KAQ!-pWw-%S#9O>-6*@o0o4*E*dc1xZ9{vpoG;SRi zmF_M@0rH`H?Na9iQZmsSuza2Xl0XBcD)j3VpLz_D4WJGrSw9&FkHk6viDn!n+i2Nm rXQ>wIR9HJZ=F2J59PG0M{3m?_WjaxE6!8fXv@j%s5}(3C4O;0dOvp6W zf`wZN0UIr3mtd2puo6K;pFj(3)1~p+Bs0e*fi+|oEW`r?GyjbGbi3U}@BOARrmm_r zU=>)K(mn!DBJvVKcvjUb=UjgdzUhRt+fx3>cCoi8$#Fy-g3+zA%q=k?ezrsQH*o$4v2FCE}U~WX<$~fD_L$; ztxsdK0vf6NU{rhn5RvuVfFwyuKo$59kq%HBjYi9=dI-D%)n2c+koL@_AH`y^I2;a7 tRQ0UYY7J6UCrOe^;J|x7pY_H6nQ!#OZO7OhpWOfe002ovPDHLkV1iABn;ifE diff --git a/pix/i/star.svg b/pix/i/star.svg index 8b389575764..70f566da5e2 100644 --- a/pix/i/star.svg +++ b/pix/i/star.svg @@ -1,6 +1,6 @@ - + - + diff --git a/theme/boost/scss/moodle/blocks.scss b/theme/boost/scss/moodle/blocks.scss index dcbdfe4a7ad..4b54d75d9dd 100644 --- a/theme/boost/scss/moodle/blocks.scss +++ b/theme/boost/scss/moodle/blocks.scss @@ -97,6 +97,9 @@ $card-gutter : $card-deck-margin * 2; } .icon { margin-right: 0; + &.fa-star { + color: $blue; + } } a, .btn-link { diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 46703787944..b7e764085fb 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -11164,6 +11164,9 @@ div.editor_atto_toolbar button .icon { .block_recentlyaccesseditems .icon, .block_recentlyaccessedcourses .icon { margin-right: 0; } + .block_myoverview .icon.fa-star, + .block_starredcourses .icon.fa-star { + color: #1177d1; } .block_myoverview a, .block_myoverview .btn-link, diff --git a/theme/bootstrapbase/less/moodle/blocks.less b/theme/bootstrapbase/less/moodle/blocks.less index d1b521f9840..71e95ec10ec 100644 --- a/theme/bootstrapbase/less/moodle/blocks.less +++ b/theme/bootstrapbase/less/moodle/blocks.less @@ -289,6 +289,9 @@ .summary img { max-width: 100%; } + img.icon { + padding: 0; + } @media (max-width: 576px) { .summaryimage { diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index 66ed6211a79..3f6e64a9846 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -16249,6 +16249,10 @@ body { .block_myoverview .summary img { max-width: 100%; } +.block_starredcourses img.icon, +.block_myoverview img.icon { + padding: 0; +} @media (max-width: 576px) { .block_starredcourses .summaryimage, .block_recentlyaccesseditems .summaryimage,