mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 01:14:46 -04:00
Course details mock UI edit dialogs
This commit is contained in:
parent
2baf18ef56
commit
c5efdb97e1
3 changed files with 62 additions and 17 deletions
app
styles/courses/mock1
templates/courses/mock1
views/courses/mock1
|
@ -1,5 +1,18 @@
|
||||||
#course-details-view
|
#course-details-view
|
||||||
|
|
||||||
|
#editDescriptionModal .modal-dialog
|
||||||
|
background-color: white
|
||||||
|
|
||||||
|
#editNameModal .modal-dialog
|
||||||
|
background-color: white
|
||||||
|
max-width: 400px
|
||||||
|
|
||||||
|
.edit-description-input
|
||||||
|
width: 100%
|
||||||
|
|
||||||
|
.edit-name-input
|
||||||
|
width: 100%
|
||||||
|
|
||||||
.member-header
|
.member-header
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
display: inline-block
|
display: inline-block
|
||||||
|
|
|
@ -7,7 +7,6 @@ block content
|
||||||
div TODO: fix ugly tabs
|
div TODO: fix ugly tabs
|
||||||
div TODO: aggregate student progress
|
div TODO: aggregate student progress
|
||||||
div TODO: student level progress popups
|
div TODO: student level progress popups
|
||||||
div TODO: edit popup dialogs
|
|
||||||
div
|
div
|
||||||
span *UNDER CONSTRUCTION, send feedback to
|
span *UNDER CONSTRUCTION, send feedback to
|
||||||
a.spl(href='mailto:team@codecombat.com') team@codecombat.com
|
a.spl(href='mailto:team@codecombat.com') team@codecombat.com
|
||||||
|
@ -16,34 +15,56 @@ block content
|
||||||
span.spl Student view
|
span.spl Student view
|
||||||
div(style='border-bottom: 1px solid black;')
|
div(style='border-bottom: 1px solid black;')
|
||||||
|
|
||||||
|
.modal#editNameModal
|
||||||
|
.modal-dialog
|
||||||
|
.modal-header
|
||||||
|
button.close(data-dismiss='modal')
|
||||||
|
span ×
|
||||||
|
h3.modal-title Edit Class Name
|
||||||
|
.modal-body
|
||||||
|
p This title will be displayed to everyone enrolled in this class.
|
||||||
|
input.edit-name-input(type='text', value="#{instance.name}")
|
||||||
|
.modal-footer
|
||||||
|
button.btn.edit-name-save-btn(data-i18n="common.save_changes")
|
||||||
|
|
||||||
|
.modal#editDescriptionModal
|
||||||
|
.modal-dialog
|
||||||
|
.modal-header
|
||||||
|
button.close(data-dismiss='modal')
|
||||||
|
span ×
|
||||||
|
h3.modal-title Edit Class Description
|
||||||
|
.modal-body
|
||||||
|
p This description will be displayed to everyone enrolled in this class.
|
||||||
|
textarea.edit-description-input(rows=2)= instance.description
|
||||||
|
.modal-footer
|
||||||
|
button.btn.edit-description-save-btn(data-i18n="common.save_changes")
|
||||||
|
|
||||||
h1= course.title
|
h1= course.title
|
||||||
p= course.description
|
p= course.description
|
||||||
//- p
|
|
||||||
//- strong Concepts:
|
|
||||||
//- ul
|
|
||||||
//- each concept in courseConcepts
|
|
||||||
//- li(data-i18n="concepts." + concept)
|
|
||||||
//- strong= course.duration
|
|
||||||
|
|
||||||
if !studentMode
|
if !studentMode
|
||||||
p
|
p
|
||||||
.form-group
|
.form-group
|
||||||
span.spr Select your class
|
span.spr Select your class
|
||||||
select.form-control.select-session
|
select.form-control.select-session
|
||||||
each instance in instances
|
each inst in instances
|
||||||
option= instance.name
|
if instance.name === inst.name
|
||||||
|
option(selected)= inst.name
|
||||||
|
else
|
||||||
|
option= inst.name
|
||||||
|
|
||||||
h3= instance.name
|
h3= instance.name
|
||||||
if !studentMode
|
if !studentMode
|
||||||
span.spl
|
span.spl
|
||||||
button.btn.btn-xs.edit-class-name-btn edit class name
|
button.btn.btn-xs.edit-class-name-btn(data-toggle='modal', data-target='#editNameModal') edit class name
|
||||||
|
|
||||||
p
|
p
|
||||||
if instance.description
|
if instance.description
|
||||||
span= instance.description
|
each line in instance.description.split('\n')
|
||||||
if !studentMode
|
div= line
|
||||||
span.spl
|
if !studentMode
|
||||||
button.btn.btn-xs.edit-description-btn edit class description
|
span.spl
|
||||||
|
button.btn.btn-xs.edit-description-btn(data-toggle='modal', data-target='#editDescriptionModal') edit class description
|
||||||
else if !studentMode
|
else if !studentMode
|
||||||
div
|
div
|
||||||
button.btn.btn-xs.edit-description-btn add class description
|
button.btn.btn-xs.edit-description-btn add class description
|
||||||
|
|
|
@ -13,8 +13,8 @@ module.exports = class CourseDetailsView extends RootView
|
||||||
'change .select-session': 'onChangeSession'
|
'change .select-session': 'onChangeSession'
|
||||||
'change .student-mode-checkbox': 'onChangeStudent'
|
'change .student-mode-checkbox': 'onChangeStudent'
|
||||||
'click .btn-play-level': 'onClickPlayLevel'
|
'click .btn-play-level': 'onClickPlayLevel'
|
||||||
'click .edit-class-name-btn': 'onClickEditClassName'
|
'click .edit-description-save-btn': 'onEditDescriptionSave'
|
||||||
'click .edit-description-btn': 'onClickEditClassDescription'
|
'click .edit-name-save-btn': 'onEditNameSave'
|
||||||
'click .member-header': 'onClickMemberHeader'
|
'click .member-header': 'onClickMemberHeader'
|
||||||
'click .progress-header': 'onClickProgressHeader'
|
'click .progress-header': 'onClickProgressHeader'
|
||||||
|
|
||||||
|
@ -141,7 +141,6 @@ module.exports = class CourseDetailsView extends RootView
|
||||||
@currentInstanceIndex = index
|
@currentInstanceIndex = index
|
||||||
@updateLevelMaps()
|
@updateLevelMaps()
|
||||||
@onCampaignSync()
|
@onCampaignSync()
|
||||||
@render?()
|
|
||||||
|
|
||||||
onExpandedProgressCheckbox: (e) ->
|
onExpandedProgressCheckbox: (e) ->
|
||||||
@showExpandedProgress = $('.expand-progress-checkbox').prop('checked')
|
@showExpandedProgress = $('.expand-progress-checkbox').prop('checked')
|
||||||
|
@ -173,3 +172,15 @@ module.exports = class CourseDetailsView extends RootView
|
||||||
viewClass: 'views/play/level/PlayLevelView'
|
viewClass: 'views/play/level/PlayLevelView'
|
||||||
viewArgs: [{}, levelSlug]
|
viewArgs: [{}, levelSlug]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onEditDescriptionSave: (e) ->
|
||||||
|
description = $('.edit-description-input').val()
|
||||||
|
@instances[@currentInstanceIndex].description = description
|
||||||
|
$('#editDescriptionModal').modal('hide')
|
||||||
|
@render?()
|
||||||
|
|
||||||
|
onEditNameSave: (e) ->
|
||||||
|
if name = $('.edit-name-input').val()
|
||||||
|
@instances[@currentInstanceIndex].name = name
|
||||||
|
$('#editNameModal').modal('hide')
|
||||||
|
@render?()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue