Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions lms/templates/courseware/courseware.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,29 @@
<span class="nav-item nav-item-course">
<a href="${course_url}">${course_home_page_title(course)}</a>
</span>
<span class="icon fa fa-angle-right" aria-hidden="true"></span>
% if chapter or section or sequence_title:
<span class="icon fa fa-angle-right" aria-hidden="true"></span>
% endif
Comment on lines +184 to +186

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbasaglia, what's the point of having these checks? Why don't we just move these arrows to the next items, like I've suggested to you before?

We'll also need to move the fa-angle-right arrows to be displayed before the text to avoid having a trailing arrow when the unit's name is unavailable.

Instead of duplicating conditions, we could simply do something like:

% if sequence_title:
    <span class="icon fa fa-angle-right" aria-hidden="true"></span>
    <span class="nav-item nav-item-sequence">${sequence_title}</span>
% endif</span>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's to also avoid extra leading icons, since you can't assume you have a previous item

@Agrendalath Agrendalath Jun 13, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbasaglia, in this case, we can completely remove these spans and rely on the CSS instead of adding extra logic to templates.
We can remove this and add the following as the last rule of the .nav-item class:

&:not(:last-child)::after {
    content: '\f105';
    font-family: FontAwesome;

    @include margin-left($baseline/4);

    display: inline-block;
    color: $body-color;

    @include rtl {
      @include transform(rotateY(180deg));
    }
}

Note: I've intentionally skipped media-breakpoint-down here, as it's broken on mobile resolutions.

% endif
% if chapter:
<span class="nav-item nav-item-chapter" data-course-position="${course.position}" data-chapter-position="${chapter.position}">
<a href="${course_url}#${six.text_type(chapter.location)}">${chapter.display_name_with_default}</a>
</span>
<span class="icon fa fa-angle-right" aria-hidden="true"></span>
% if section or sequence_title:
<span class="icon fa fa-angle-right" aria-hidden="true"></span>
% endif
% endif
% if section:
<span class="nav-item nav-item-section">
<a href="${course_url}#${six.text_type(section.location)}">${section.display_name_with_default}</a>
</span>
<span class="icon fa fa-angle-right" aria-hidden="true"></span>
% if sequence_title:
<span class="icon fa fa-angle-right" aria-hidden="true"></span>
% endif
% endif
% if sequence_title:
<span class="nav-item nav-item-sequence">${sequence_title}</span>
% endif
<span class="nav-item nav-item-sequence">${sequence_title}</span>
</div>
</div>
</nav>
Expand Down