diff --git a/common/lib/xmodule/xmodule/vertical_block.py b/common/lib/xmodule/xmodule/vertical_block.py index 91a03863de..74e2ab6e35 100644 --- a/common/lib/xmodule/xmodule/vertical_block.py +++ b/common/lib/xmodule/xmodule/vertical_block.py @@ -65,6 +65,7 @@ class VerticalBlock(SequenceFields, XModuleFields, StudioEditableBlock, XmlParse fragment.add_content(self.system.render_template('vert_module.html', { 'items': contents, 'xblock_context': context, + 'unit_title': self.display_name_with_default, 'show_bookmark_button': True, 'bookmarked': child_context['bookmarked'], 'bookmark_id': "{},{}".format(child_context['username'], unicode(self.location)) diff --git a/common/test/acceptance/pages/lms/courseware.py b/common/test/acceptance/pages/lms/courseware.py index baea4d41d7..d3826372ca 100644 --- a/common/test/acceptance/pages/lms/courseware.py +++ b/common/test/acceptance/pages/lms/courseware.py @@ -267,6 +267,10 @@ class CoursewarePage(CoursePage): """ Return the course tree breadcrumb shown above the sequential bar """ return [part.strip() for part in self.q(css='.path').text[0].split('>')] + def unit_title_visible(self): + """ Check if unit title is visible """ + return self.q(css='.unit-title').visible + def bookmark_button_visible(self): """ Check if bookmark button is visible """ EmptyPromise(lambda: self.q(css='.bookmark-button').visible, "Bookmark button visible").fulfill() diff --git a/lms/static/js/bookmarks/views/bookmark_button.js b/lms/static/js/bookmarks/views/bookmark_button.js index 642e184020..aae521ab3c 100644 --- a/lms/static/js/bookmarks/views/bookmark_button.js +++ b/lms/static/js/bookmarks/views/bookmark_button.js @@ -6,7 +6,9 @@ errorMessage: gettext('An error has occurred. Please try again.'), srAddBookmarkText: gettext('Click to add'), + bookmarkText: gettext('Bookmark this page'), srRemoveBookmarkText: gettext('Click to remove'), + bookmarkedText: gettext('Bookmarked'), events: { 'click': 'toggleBookmark' @@ -85,10 +87,12 @@ if (bookmarked) { this.$el.addClass('bookmarked'); this.$el.attr('aria-pressed', 'true'); + this.$el.find('.bookmark-text').text(this.bookmarkedText); this.$el.find('.bookmark-sr').text(this.srRemoveBookmarkText); } else { this.$el.removeClass('bookmarked'); this.$el.attr('aria-pressed', 'false'); + this.$el.find('.bookmark-text').text(this.bookmarkText); this.$el.find('.bookmark-sr').text(this.srAddBookmarkText); } }, diff --git a/lms/static/js/fixtures/bookmarks/bookmark_button.html b/lms/static/js/fixtures/bookmarks/bookmark_button.html index 31f325f237..7703174c10 100644 --- a/lms/static/js/fixtures/bookmarks/bookmark_button.html +++ b/lms/static/js/fixtures/bookmarks/bookmark_button.html @@ -7,7 +7,7 @@ aria-pressed="false" data-bookmark-id="bilbo,usage_1"> - Bookmark + Bookmark this page diff --git a/lms/static/sass/base/_headings.scss b/lms/static/sass/base/_headings.scss index 08d811c406..6dca5054e0 100644 --- a/lms/static/sass/base/_headings.scss +++ b/lms/static/sass/base/_headings.scss @@ -121,5 +121,12 @@ $headings-base-color: $gray-d2; font-weight: $headings-font-weight-normal; // override external modules and xblocks that use inline CSS text-transform: initial; + + &.unit-title { + margin-bottom: 0; + font-size: 1.5em; + } } } + + diff --git a/lms/static/sass/course/courseware/_courseware.scss b/lms/static/sass/course/courseware/_courseware.scss index 8f55e6a80c..b5f3e4bc05 100644 --- a/lms/static/sass/course/courseware/_courseware.scss +++ b/lms/static/sass/course/courseware/_courseware.scss @@ -22,9 +22,8 @@ html.video-fullscreen { overflow: hidden; &.studio-view { - position: relative; - top: -($baseline/2); margin: 0; + display: inline; } .instructor-info-action { diff --git a/lms/static/sass/views/_bookmarks.scss b/lms/static/sass/views/_bookmarks.scss index faae1eb529..ebac7af244 100644 --- a/lms/static/sass/views/_bookmarks.scss +++ b/lms/static/sass/views/_bookmarks.scss @@ -1,3 +1,6 @@ +$bookmark-icon: "\f097"; // .fa-bookmark-o +$bookmarked-icon: "\f02e"; // .fa-bookmark + // Rules for placing bookmarks and search button side by side .wrapper-course-modes { border-bottom: 1px solid $gray-l3; @@ -25,7 +28,7 @@ padding: ($baseline/4) ($baseline/2); &:before { - content: "\f02e"; + content: $bookmarked-icon; font-family: FontAwesome; } @@ -80,7 +83,7 @@ } .bookmarks-results-list-item:before { - content: "\f02e"; + content: $bookmarked-icon; position: relative; top: -7px; font-family: FontAwesome; @@ -133,42 +136,34 @@ .course-content { .bookmark-icon.bookmarked { + @include left($baseline / 4); top: -3px; position: absolute; - left: ($baseline/4); } // Rules for bookmark button's different styles .bookmark-button-wrapper { - text-align: right; - margin-bottom: 10px; + margin-bottom: ($baseline * 1.5); } .bookmark-button { - @extend %ui-clear-button; - @extend %btn-pl-default-base; - @include font-size(13); - padding: ($baseline/4) ($baseline/2); &:before { - content: "\f02e"; + content: $bookmark-icon; font-family: FontAwesome; } - &.is-active { - background-color: lighten($action-primary-bg,10%); - color: $white; - } - &.bookmarked { - background-color: lighten($action-primary-bg,10%); - color: $white; - &:before { - content: "\f097"; - font-family: FontAwesome; + content: $bookmarked-icon; } } + } + + .bookmark-sr { + @include margin-right($baseline / 4); + } + } diff --git a/lms/templates/bookmark_button.html b/lms/templates/bookmark_button.html index d0d67c5891..7f36bff8f1 100644 --- a/lms/templates/bookmark_button.html +++ b/lms/templates/bookmark_button.html @@ -1,11 +1,11 @@ +<%page expression_filter="h" args="bookmark_id, is_bookmarked" /> <%! from django.utils.translation import ugettext as _ %> -<%page args="bookmark_id, is_bookmarked" />
diff --git a/lms/templates/vert_module.html b/lms/templates/vert_module.html index df882124e1..ca44856ad4 100644 --- a/lms/templates/vert_module.html +++ b/lms/templates/vert_module.html @@ -1,4 +1,8 @@ <%page expression_filter="h"/> +<%! from openedx.core.djangolib.markup import HTML %> +%if unit_title: +