-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8274 from michaelchadwick/remove-common-course-re…
…nder-modifiers Remove common Course render modifiers
- Loading branch information
Showing
5 changed files
with
122 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 50 additions & 54 deletions
104
packages/ilios-common/addon/components/course/header.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,50 @@ | ||
<div | ||
class="course-header" | ||
data-test-course-header | ||
{{did-insert (perform this.load)}} | ||
{{did-update this.revertTitleChanges}} | ||
> | ||
{{#unless this.load.isRunning}} | ||
<span class="title" data-test-title> | ||
{{#if @editable}} | ||
<EditableField | ||
@value={{this.courseTitle}} | ||
@save={{perform this.changeTitle}} | ||
@close={{this.revertTitleChanges}} | ||
@saveOnEnter={{true}} | ||
@onEditingStatusChange={{set this "isEditingTitle"}} | ||
@closeOnEscape={{true}} as |isSaving| | ||
> | ||
<input | ||
aria-label={{t "general.courseTitle"}} | ||
disabled={{isSaving}} | ||
type="text" | ||
value={{this.courseTitle}} | ||
{{on "input" (pick "target.value" (set this "courseTitle"))}} | ||
{{on "keypress" (fn this.addErrorDisplayFor "courseTitle")}} | ||
> | ||
<ValidationError @validatable={{this}} @property="courseTitle" /> | ||
</EditableField> | ||
{{else}} | ||
<h2> | ||
{{#if @course.locked}} | ||
<FaIcon @icon="lock" /> | ||
{{/if}} | ||
{{@course.title}} | ||
</h2> | ||
{{/if}} | ||
{{#unless this.isEditingTitle}} | ||
<h3 class="academic-year" data-test-academic-year> | ||
{{#if this.academicYearCrossesCalendarYearBoundaries}} | ||
{{@course.year}} - {{add @course.year 1}} | ||
{{else}} | ||
{{@course.year}} | ||
{{/if}} | ||
</h3> | ||
{{/unless}} | ||
</span> | ||
<div class="course-publication"> | ||
{{#if @editable}} | ||
<Course::PublicationMenu @course={{@course}} /> | ||
{{else}} | ||
<PublicationStatus @item={{@course}} @showIcon={{true}} @showText={{true}} /> | ||
{{/if}} | ||
</div> | ||
{{/unless}} | ||
</div> | ||
<div class="course-header" data-test-course-header> | ||
<span class="title" data-test-title> | ||
{{#if @editable}} | ||
<EditableField | ||
@value={{this.courseTitle}} | ||
@save={{perform this.changeTitle}} | ||
@close={{this.revertTitleChanges}} | ||
@saveOnEnter={{true}} | ||
@onEditingStatusChange={{set this "isEditingTitle"}} | ||
@closeOnEscape={{true}} | ||
as |isSaving| | ||
> | ||
<input | ||
aria-label={{t "general.courseTitle"}} | ||
disabled={{isSaving}} | ||
type="text" | ||
value={{this.courseTitle}} | ||
{{on "input" (pick "target.value" (set this "courseTitle"))}} | ||
{{on "keypress" (fn this.addErrorDisplayFor "courseTitle")}} | ||
/> | ||
<ValidationError @validatable={{this}} @property="courseTitle" /> | ||
</EditableField> | ||
{{else}} | ||
<h2> | ||
{{#if @course.locked}} | ||
<FaIcon @icon="lock" /> | ||
{{/if}} | ||
{{@course.title}} | ||
</h2> | ||
{{/if}} | ||
{{#unless this.isEditingTitle}} | ||
<h3 class="academic-year" data-test-academic-year> | ||
{{#if this.academicYearCrossesCalendarYearBoundaries}} | ||
{{@course.year}} | ||
- | ||
{{add @course.year 1}} | ||
{{else}} | ||
{{@course.year}} | ||
{{/if}} | ||
</h3> | ||
{{/unless}} | ||
</span> | ||
<div class="course-publication"> | ||
{{#if @editable}} | ||
<Course::PublicationMenu @course={{@course}} /> | ||
{{else}} | ||
<PublicationStatus @item={{@course}} @showIcon={{true}} @showText={{true}} /> | ||
{{/if}} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 36 additions & 42 deletions
78
packages/ilios-common/addon/components/course/objective-list.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,39 @@ | ||
<div | ||
class="course-objective-list" | ||
data-test-course-objective-list | ||
{{did-insert (perform this.load)}} | ||
{{did-update (perform this.load) @course}} | ||
> | ||
{{#if this.isSorting}} | ||
<ObjectiveSortManager | ||
@subject={{@course}} | ||
@close={{set this "isSorting" false}} | ||
/> | ||
{{/if}} | ||
|
||
{{#if (and this.courseObjectiveCount (not this.isSorting))}} | ||
{{#if (and @editable (gt this.courseObjectiveCount 1))}} | ||
<button | ||
class="sort-button" | ||
type="button" | ||
{{on "click" (set this "isSorting" true)}} | ||
data-test-sort | ||
> | ||
{{t "general.sortObjectives"}} | ||
</button> | ||
<div class="course-objective-list" data-test-course-objective-list> | ||
{{#if this.courseSessionsLoaded}} | ||
{{#if this.isSorting}} | ||
<ObjectiveSortManager @subject={{@course}} @close={{set this "isSorting" false}} /> | ||
{{/if}} | ||
<div class="grid-row headers" data-test-headers> | ||
<span class="grid-item" data-test-header>{{t "general.description"}}</span> | ||
<span class="grid-item" data-test-header>{{t "general.parentObjectives"}}</span> | ||
<span class="grid-item" data-test-header>{{t "general.vocabularyTerms"}}</span> | ||
<span class="grid-item" data-test-header>{{t "general.meshTerms"}}</span> | ||
<span class="actions grid-item" data-test-header>{{t "general.actions"}}</span> | ||
</div> | ||
{{#if (and (is-array this.courseObjectives) this.cohortObjectivesLoaded)}} | ||
{{#each this.courseObjectives as |courseObjective|}} | ||
<Course::ObjectiveListItem | ||
@courseObjective={{courseObjective}} | ||
@editable={{@editable}} | ||
@cohortObjectives={{this.cohortObjectives}} | ||
@course={{@course}} | ||
/> | ||
{{/each}} | ||
{{else}} | ||
<Course::ObjectiveListLoading @count={{this.courseObjectiveCount}} /> | ||
|
||
{{#if (and this.courseObjectiveCount (not this.isSorting))}} | ||
{{#if (and @editable (gt this.courseObjectiveCount 1))}} | ||
<button | ||
class="sort-button" | ||
type="button" | ||
{{on "click" (set this "isSorting" true)}} | ||
data-test-sort | ||
> | ||
{{t "general.sortObjectives"}} | ||
</button> | ||
{{/if}} | ||
<div class="grid-row headers" data-test-headers> | ||
<span class="grid-item" data-test-header>{{t "general.description"}}</span> | ||
<span class="grid-item" data-test-header>{{t "general.parentObjectives"}}</span> | ||
<span class="grid-item" data-test-header>{{t "general.vocabularyTerms"}}</span> | ||
<span class="grid-item" data-test-header>{{t "general.meshTerms"}}</span> | ||
<span class="actions grid-item" data-test-header>{{t "general.actions"}}</span> | ||
</div> | ||
{{#if (and (is-array this.courseObjectives) this.cohortObjectivesLoaded)}} | ||
{{#each this.courseObjectives as |courseObjective|}} | ||
<Course::ObjectiveListItem | ||
@courseObjective={{courseObjective}} | ||
@editable={{@editable}} | ||
@cohortObjectives={{this.cohortObjectives}} | ||
@course={{@course}} | ||
/> | ||
{{/each}} | ||
{{else}} | ||
<Course::ObjectiveListLoading @count={{this.courseObjectiveCount}} /> | ||
{{/if}} | ||
{{/if}} | ||
{{/if}} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters