Skip to content

Commit

Permalink
Add separator between length and complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
donnapep committed Apr 28, 2021
1 parent 88e3bcd commit b7602c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions assets/blocks/lesson-metadata/lesson-metadata-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ const LessonMetadataEdit = ( props ) => {
</span>
) }

{ !! length && complexity && (
<span className="separator">|</span>
) }

{ complexity && (
<span className="lesson-complexity">
{ __( 'Complexity', 'sensei-lms' ) +
Expand Down
4 changes: 2 additions & 2 deletions assets/blocks/lesson-metadata/lesson-metadata-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
font-size: .9em;
font-style: italic;

.lesson-length {
margin-right: 0.5em;
.separator {
margin: 0 0.5em 0;
}
}
4 changes: 2 additions & 2 deletions assets/css/frontend.scss
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ a.sensei-certificate-link {
font-size: .9em;
font-style: italic;

.lesson-length {
margin-right: 0.5em;
.separator {
margin: 0 0.5em 0;
}
}
.lesson-meta {
Expand Down
4 changes: 4 additions & 0 deletions includes/blocks/class-sensei-lesson-metadata-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public function render( array $attributes, string $content ) : string {
'</span>';
}

if ( $length && $complexity ) {
$content .= '<span class="separator">|</span>';
}

if ( $complexity ) {
$complexities = Sensei()->lesson->lesson_complexities();
$lesson_complexity = $complexities[ $complexity ];
Expand Down

0 comments on commit b7602c5

Please sign in to comment.