diff --git a/src/components/CourseEditor.vue b/src/components/CourseEditor.vue
index e4d0d80..d8161ee 100644
--- a/src/components/CourseEditor.vue
+++ b/src/components/CourseEditor.vue
@@ -1,236 +1,327 @@
- .CourseEditor
- div
- h2 Change course's title
- WTLField(grouped=true)
- WTLInput.CourseEditor__title(
- v-model="newCourse.title"
- )
- WTLButton(
- @click="patchCourse"
- icon="done"
- type="success"
- ) Update course title
- div
- h2 Change chapter order by dragging them
- .CourseEditor__chapters-container
- ol.CourseEditor__old-chapters
- li.CourseEditor__chapter(v-for="(chapter, index) in course.chapters") {{ index+1 }}. {{ chapter.title }}
- VueDraggable.CourseEditor__chapters(
- v-if="newChapters"
- v-model="newChapters"
- @start="drag=true"
- @end="drag=false"
- )
- .CourseEditor__chapter(
- v-for="chapter in newChapters"
- :key="chapter._id"
- )
- WTLIcon(icon="swap_vertical")
- | {{ chapter.title }}
- div.flex-container.flex-content-end
- h3 Confirm changes?
- WTLButton(
- @click="patchCourseChapters"
- icon="done"
- type="success"
- ) Update chapters order
- div
- h2 Insert new chapter
- WTLField(grouped=true)
- WTLInput.CourseEditor__new-chapter(
- v-model="newChapter.title"
- placeholder="Insert title"
- )
- WTLButton(
- @click="postChapter"
- icon="done"
- type="success"
- ) Add new chapter
+ div
+ .CourseEditor
+ div
+ h2 Change course's title
+ WTLField(grouped=true)
+ WTLInput.CourseEditor__title(
+ v-model="newCourse.title"
+ )
+ WTLButton(
+ @click="patchCourse"
+ icon="done"
+ type="success"
+ ) Update course title
+ div
+ h2 Change chapter order by dragging them
+ .CourseEditor__chapters-container
+ ol.CourseEditor__old-chapters
+ li.CourseEditor__chapter(v-for="(chapter, index) in course.chapters") {{ index+1 }}. {{ chapter.title }}
+ VueDraggable.CourseEditor__chapters(
+ v-if="newChapters"
+ v-model="newChapters"
+ @start="drag=true"
+ @end="drag=false"
+ )
+ .CourseEditor__chapter(
+ v-for="(chapter, index) in newChapters"
+ :key="chapter._id"
+ )
+ WTLIcon(icon="swap_vertical")
+ | {{ chapter.title }}
+ .CourseEditor__chapter-icons
+ WTLIcon(icon="edit", clickable=true, @click.native="editChapter(chapter)")
+ WTLIcon(icon="delete", clickable=true, @click.native="deleteChapterDialog(chapter, index)")
+ div.flex-container.flex-content-end
+ h3 Confirm changes?
+ WTLButton(
+ @click="patchCourseChapters"
+ icon="done"
+ type="success"
+ ) Update chapters order
+ div
+ h2 Insert new chapter
+ WTLField(grouped=true)
+ WTLInput.CourseEditor__new-chapter(
+ v-model="newChapter.title"
+ placeholder="Insert title"
+ )
+ WTLButton(
+ @click="postChapter"
+ icon="done"
+ type="success"
+ ) Add new chapter
+
+ WTLModal(v-if="showModal", ref="modal", @close="showModal = false", title="Edit chapter")
+ template(slot="content")
+ WTLField(grouped=true, label="Chapter title")
+ WTLInput(v-model="chapter.title")
+ template(slot="actions")
+ WTLButton(@click="closeModal", icon="close") Cancel
+ WTLButton(@click="patchChapter", icon="done", type="success") Confirm edit