Skip to content

Commit

Permalink
Merge pull request #22353 from code-dot-org/backlink-course-version
Browse files Browse the repository at this point in the history
Show course title in script overview backlink
  • Loading branch information
davidsbailey committed May 11, 2018
2 parents 508fd44 + 15523c3 commit 10b7310
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dashboard/app/models/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,10 @@ def course_link(section_id = nil)
path
end

def course_title
course.try(:localized_title)
end

# If there is an alternate version of this script which the user should be on
# due to existing progress or a course experiment, return that script. Otherwise,
# return nil.
Expand Down
3 changes: 2 additions & 1 deletion dashboard/app/views/scripts/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
- else
- course_link = @script.course_link(params[:section_id])
- if course_link
- course_title = @script.course_title || I18n.t('view_all_units')
#script-breadcrumb
%a{href: course_link}
%i.fa.fa-chevron-left
%span
= I18n.t('view_all_units')
= course_title
#landingpage
#notification
-# This div ends up being owned by ScriptOverviewHeader in react
Expand Down
2 changes: 1 addition & 1 deletion dashboard/test/ui/features/teacher_homepage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Feature: Using the teacher homepage sections feature
And the href of selector ".uitest-script-next-banner" contains the section id
And the href of selector ".uitest-ProgressPill:first" contains the section id
And the href of selector ".uitest-ProgressBubble:first" contains the section id
And the href of selector "a:contains(View all units)" contains the section id
And the href of selector "a:contains(Computer Science Principles)" contains the section id

# navigate to a script level
When I click selector ".uitest-script-next-banner" to load a new page
Expand Down

0 comments on commit 10b7310

Please sign in to comment.