mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Reworked the nav bars in the level editor.
This commit is contained in:
parent
02a7381fa9
commit
8859405e18
12 changed files with 198 additions and 142 deletions
|
@ -17,6 +17,7 @@
|
||||||
retry: "Retry"
|
retry: "Retry"
|
||||||
watch: "Watch"
|
watch: "Watch"
|
||||||
unwatch: "Unwatch"
|
unwatch: "Unwatch"
|
||||||
|
submit_patch: "Submit Patch"
|
||||||
|
|
||||||
units:
|
units:
|
||||||
second: "second"
|
second: "second"
|
||||||
|
|
|
@ -14,9 +14,6 @@
|
||||||
left: 0
|
left: 0
|
||||||
right: 0
|
right: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
top: 50px
|
top: 35px
|
||||||
border: 2px solid black
|
border: 2px solid black
|
||||||
border-top: none
|
border-top: none
|
||||||
|
|
||||||
.active > a, .active > a:hover, .active > a:focus
|
|
||||||
background-color: white !important
|
|
|
@ -1,4 +1,6 @@
|
||||||
#editor-level-components-tab-view
|
#editor-level-components-tab-view
|
||||||
|
h3
|
||||||
|
margin-top: 0
|
||||||
|
|
||||||
.components-container
|
.components-container
|
||||||
position: absolute
|
position: absolute
|
||||||
|
@ -7,7 +9,7 @@
|
||||||
|
|
||||||
.treema-root
|
.treema-root
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 50px
|
top: 35px
|
||||||
bottom: 0
|
bottom: 0
|
||||||
width: 250px
|
width: 250px
|
||||||
overflow: scroll
|
overflow: scroll
|
||||||
|
@ -25,13 +27,13 @@
|
||||||
|
|
||||||
.treema-root
|
.treema-root
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 50px
|
top: 35px
|
||||||
right: 0
|
right: 0
|
||||||
left: 0px
|
left: 0px
|
||||||
bottom: 0
|
bottom: 0
|
||||||
overflow: scroll
|
overflow: scroll
|
||||||
|
|
||||||
#create-new-component-button
|
#create-new-component-button-no-select
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
right: 0
|
right: 0
|
||||||
|
|
|
@ -12,17 +12,45 @@
|
||||||
bottom: 0px
|
bottom: 0px
|
||||||
|
|
||||||
$BG: rgba(228, 207, 140, 1.0)
|
$BG: rgba(228, 207, 140, 1.0)
|
||||||
|
$NAVBG: #2f261d
|
||||||
|
|
||||||
li.navbar-btn
|
li.navbar-btn
|
||||||
margin-right: 5px
|
margin-right: 5px
|
||||||
|
|
||||||
#level-editor-top-nav
|
// custom navbar height rules
|
||||||
.nav-tabs
|
.navbar-nav > li > a
|
||||||
border-bottom: 0 !important
|
padding: 7px 8px 8px
|
||||||
.active > a, .active > a:hover, .active > a:focus
|
&:hover
|
||||||
background-color: $BG !important
|
background-color: lighten($NAVBG, 10%)
|
||||||
border-color: darken($BG, 50%)
|
.navbar
|
||||||
border-bottom: 0
|
min-height: 0px
|
||||||
|
border-radius: 0
|
||||||
|
.navbar-right // not sure why bootstrap puts a big negative margin in, but this overrides it
|
||||||
|
margin-right: 10px
|
||||||
|
|
||||||
|
// custom navbar styling
|
||||||
|
.navbar-brand
|
||||||
|
padding-top: 7px
|
||||||
|
padding-bottom: 7px
|
||||||
|
color: lighten(gold, 30%)
|
||||||
|
.navbar-header
|
||||||
|
border-left: 2px solid lighten($NAVBG, 20%)
|
||||||
|
border-right: 2px solid lighten($NAVBG, 20%)
|
||||||
|
background: lighten($NAVBG, 10%)
|
||||||
|
margin-left: 20px
|
||||||
|
.nav-tabs
|
||||||
|
margin-left: 5px
|
||||||
|
border-bottom: 0 !important
|
||||||
|
.active > a, .active > a:hover, .active > a:focus
|
||||||
|
background-color: $BG !important
|
||||||
|
border-color: darken($BG, 50%)
|
||||||
|
border-bottom: 0
|
||||||
|
a
|
||||||
|
padding: 7px 5px !important
|
||||||
|
.dropdown-menu a
|
||||||
|
cursor: pointer
|
||||||
|
&:hover
|
||||||
|
background-color: #d3d3d3
|
||||||
|
|
||||||
.outer-content
|
.outer-content
|
||||||
background-color: $BG
|
background-color: $BG
|
||||||
|
@ -47,7 +75,7 @@
|
||||||
position: absolute
|
position: absolute
|
||||||
left: 20px
|
left: 20px
|
||||||
right: 20px
|
right: 20px
|
||||||
top: 66px
|
top: 46px
|
||||||
bottom: 20px
|
bottom: 20px
|
||||||
|
|
||||||
.treema-root
|
.treema-root
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
left: 0
|
left: 0
|
||||||
right: 0
|
right: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
top: 50px
|
top: 35px
|
||||||
border: 2px solid black
|
border: 2px solid black
|
||||||
border-top: none
|
border-top: none
|
||||||
|
|
||||||
.active > a, .active > a:hover, .active > a:focus
|
|
||||||
background-color: white !important
|
|
|
@ -1,4 +1,6 @@
|
||||||
#editor-level-systems-tab-view
|
#editor-level-systems-tab-view
|
||||||
|
h3
|
||||||
|
margin-top: 0
|
||||||
|
|
||||||
.systems-container
|
.systems-container
|
||||||
position: absolute
|
position: absolute
|
||||||
|
@ -7,7 +9,7 @@
|
||||||
|
|
||||||
.treema-root
|
.treema-root
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 50px
|
top: 35px
|
||||||
bottom: 0
|
bottom: 0
|
||||||
width: 250px
|
width: 250px
|
||||||
overflow: scroll
|
overflow: scroll
|
||||||
|
@ -30,7 +32,7 @@
|
||||||
|
|
||||||
.treema-root
|
.treema-root
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 50px
|
top: 35px
|
||||||
right: 0
|
right: 0
|
||||||
left: 0px
|
left: 0px
|
||||||
bottom: 0
|
bottom: 0
|
||||||
|
|
|
@ -1,32 +1,44 @@
|
||||||
nav.navbar.navbar-default(role='navigation')
|
nav.navbar.navbar-default(role='navigation')
|
||||||
.container-fluid
|
ul.nav.navbar-nav.nav-tabs
|
||||||
.navbar-header
|
li.active
|
||||||
span.navbar-brand
|
a(href="#component-code" data-toggle="tab" data-i18n="general.code") Code
|
||||||
span(data-i18n="editor.level_component_edit_title")
|
li
|
||||||
| Edit Component
|
a(href="#component-config-schema" data-toggle="tab" data-i18n="editor.level_component_config_schema") Config Schema
|
||||||
span :
|
li
|
||||||
| "#{editTitle}"
|
a(href="#component-settings" data-toggle="tab" data-i18n="editor.level_component_settings") Settings
|
||||||
.collapse.navbar-collapse
|
li
|
||||||
ul.nav.navbar-nav.nav-tabs
|
a(href="#component-patches" data-toggle="tab" data-i18n="resources.patches")#component-patches-tab Patches
|
||||||
li.active
|
|
||||||
a(href="#component-code" data-toggle="tab" data-i18n="general.code") Code
|
.navbar-header
|
||||||
li
|
span.navbar-brand= editTitle
|
||||||
a(href="#component-config-schema" data-toggle="tab" data-i18n="editor.level_component_config_schema") Config Schema
|
|
||||||
li
|
ul.nav.navbar-nav.navbar-right
|
||||||
a(href="#component-settings" data-toggle="tab" data-i18n="editor.level_component_settings") Settings
|
li.dropdown
|
||||||
li
|
a(data-toggle='dropdown')
|
||||||
a(href="#component-patches" data-toggle="tab" data-i18n="resources.patches")#component-patches-tab Patches
|
span.glyphicon-chevron-down.glyphicon
|
||||||
ul.nav.navbar-nav.navbar-left
|
|
||||||
li(data-i18n="general.version_history").btn.btn-primary.navbar-btn#history-button Version History
|
ul.dropdown-menu
|
||||||
li(data-i18n="editor.level_component_btn_new").btn.btn-primary.navbar-btn#create-new-component-button Create New Component
|
li.dropdown-header Actions
|
||||||
li.btn.btn-primary.navbar-btn#patch-component-button Patch
|
li#watch-component-button
|
||||||
li#watch-component-button.btn.btn-primary.navbar-btn
|
a
|
||||||
span.watch
|
span.watch
|
||||||
span.spr Watch
|
span.glyphicon.glyphicon-eye-open
|
||||||
span.glyphicon.glyphicon-eye-open
|
span.spl Watch
|
||||||
span.unwatch.secret
|
span.unwatch.secret
|
||||||
span.spr Unwatch
|
span.glyphicon.glyphicon-eye-close
|
||||||
span.glyphicon.glyphicon-eye-close
|
span.spl Unwatch
|
||||||
|
|
||||||
|
li#patch-component-button
|
||||||
|
a(data-i18n="common.submit_patch") Submit Patch
|
||||||
|
|
||||||
|
li#create-new-component-button
|
||||||
|
a(data-i18n="editor.level_component_btn_new") Create New Component
|
||||||
|
|
||||||
|
li.divider
|
||||||
|
li.dropdown-header Info
|
||||||
|
|
||||||
|
li#history-button
|
||||||
|
a(data-i18n="general.version_history") Version History
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active#component-code
|
.tab-pane.active#component-code
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
|
|
||||||
.edit-component-container
|
.edit-component-container
|
||||||
if me.isAdmin()
|
if me.isAdmin()
|
||||||
button(data-i18n="editor.level_component_btn_new").btn.btn-primary#create-new-component-button Create New Component
|
button(data-i18n="editor.level_component_btn_new").btn.btn-primary#create-new-component-button-no-select Create New Component
|
||||||
|
|
||||||
#editor-level-component-edit-view
|
#editor-level-component-edit-view
|
||||||
|
|
|
@ -3,89 +3,87 @@ extends /templates/base
|
||||||
block outer_content
|
block outer_content
|
||||||
.outer-content
|
.outer-content
|
||||||
|
|
||||||
if level.loading
|
if false
|
||||||
nav.navbar.navbar-default(role='navigation')#level-editor-top-nav
|
nav.navbar.navbar-default(role='navigation')#level-editor-top-nav
|
||||||
.container-fluid
|
.container-fluid
|
||||||
ul.nav.navbar-nav
|
ul.nav.navbar-nav
|
||||||
li
|
li
|
||||||
a(href="/editor/level", data-i18n="editor.back") Back
|
a(href="/editor/level")
|
||||||
|
span.glyphicon-home.glyphicon
|
||||||
|
|
||||||
else
|
else
|
||||||
nav.navbar.navbar-default(role='navigation')#level-editor-top-nav
|
nav.navbar.navbar-default(role='navigation')#level-editor-top-nav
|
||||||
.container-fluid
|
ul.nav.navbar-nav
|
||||||
ul.nav.navbar-nav
|
li
|
||||||
|
a(href="/editor/level")
|
||||||
|
span.glyphicon-home.glyphicon
|
||||||
|
ul.nav.navbar-nav.nav-tabs
|
||||||
|
|
||||||
|
li.active
|
||||||
|
a(href="#editor-level-thangs-tab-view", data-toggle="tab", data-i18n="editor.level_tab_thangs") Thangs
|
||||||
|
li
|
||||||
|
a(href="#editor-level-scripts-tab-view", data-toggle="tab", data-i18n="editor.level_tab_scripts") Scripts
|
||||||
|
li
|
||||||
|
a(href="#editor-level-settings-tab-view", data-toggle="tab", data-i18n="editor.level_tab_settings") Settings
|
||||||
|
li
|
||||||
|
a(href="#editor-level-components-tab-view", data-toggle="tab", data-i18n="editor.level_tab_components") Components
|
||||||
|
li
|
||||||
|
a(href="#editor-level-systems-tab-view", data-toggle="tab", data-i18n="editor.level_tab_systems") Systems
|
||||||
|
li
|
||||||
|
a(href="#editor-level-patches", data-toggle="tab")#patches-tab
|
||||||
|
span(data-i18n="resources.patches").spr Patches
|
||||||
|
- var patches = level.get('patches')
|
||||||
|
if patches && patches.length
|
||||||
|
span.badge= patches.length
|
||||||
|
|
||||||
|
.navbar-header
|
||||||
|
span.navbar-brand #{level.attributes.name}
|
||||||
|
|
||||||
|
ul.nav.navbar-nav.navbar-right
|
||||||
|
if authorized
|
||||||
li
|
li
|
||||||
a(href="/editor/level", data-i18n="editor.back") Back
|
a
|
||||||
.navbar-header
|
span.glyphicon-floppy-disk.glyphicon
|
||||||
span.navbar-brand
|
else
|
||||||
span(data-i18n="editor.level_title") Level Editor
|
li
|
||||||
span :
|
a
|
||||||
span.level-title #{level.attributes.name}
|
span.glyphicon-floppy-disk.glyphicon
|
||||||
.collapse.navbar-collapse
|
|
||||||
ul.nav.navbar-nav.nav-tabs
|
|
||||||
|
|
||||||
li.active
|
|
||||||
a(href="#editor-level-thangs-tab-view", data-toggle="tab", data-i18n="editor.level_tab_thangs") Thangs
|
|
||||||
li
|
|
||||||
a(href="#editor-level-scripts-tab-view", data-toggle="tab", data-i18n="editor.level_tab_scripts") Scripts
|
|
||||||
li
|
|
||||||
a(href="#editor-level-settings-tab-view", data-toggle="tab", data-i18n="editor.level_tab_settings") Settings
|
|
||||||
li
|
|
||||||
a(href="#editor-level-components-tab-view", data-toggle="tab", data-i18n="editor.level_tab_components") Components
|
|
||||||
li
|
|
||||||
a(href="#editor-level-systems-tab-view", data-toggle="tab", data-i18n="editor.level_tab_systems") Systems
|
|
||||||
li
|
|
||||||
a(href="#editor-level-patches", data-toggle="tab")#patches-tab
|
|
||||||
span(data-i18n="resources.patches").spr Patches
|
|
||||||
- var patches = level.get('patches')
|
|
||||||
if patches && patches.length
|
|
||||||
span.badge= patches.length
|
|
||||||
|
|
||||||
ul.nav.navbar-nav.navbar-right
|
|
||||||
li#watch-button.btn.btn-primary.navbar-btn
|
|
||||||
span.watch
|
|
||||||
span.spr Watch
|
|
||||||
span.glyphicon.glyphicon-eye-open
|
|
||||||
span.unwatch.secret
|
|
||||||
span.spr Unwatch
|
|
||||||
span.glyphicon.glyphicon-eye-close
|
|
||||||
li(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert", disabled=anonymous ? "true": undefined).btn.btn-primary.navbar-btn#revert-button Revert
|
|
||||||
if authorized
|
|
||||||
li(data-i18n="common.save").btn.btn-primary.navbar-btn#commit-level-start-button Save
|
|
||||||
else
|
|
||||||
li(data-i18n="common.patch").btn.btn-primary.navbar-btn#commit-level-patch-button Patch
|
|
||||||
li(data-i18n="common.fork", disabled=anonymous ? "true": undefined).btn.btn-primary.navbar-btn#fork-level-start-button Fork
|
|
||||||
li(title="⌃↩ or ⌘↩: Play preview of current level", data-i18n="common.play")#play-button.btn.btn-inverse.banner.navbar-btn Play!
|
|
||||||
|
|
||||||
li.divider
|
|
||||||
|
|
||||||
li.dropdown
|
|
||||||
a.dropdown-toggle(href='#', data-toggle='dropdown', data-i18n="editor.more")
|
|
||||||
| More
|
|
||||||
b.caret
|
|
||||||
ul.dropdown-menu
|
|
||||||
li#history-button
|
|
||||||
a(href='#', data-i18n="general.version_history") Version History
|
|
||||||
li
|
|
||||||
a(href='https://github.com/codecombat/codecombat/wiki/Artisan-Home', data-i18n="editor.wiki") Wiki
|
|
||||||
li
|
|
||||||
a(href='http://www.hipchat.com/g3plnOKqa', data-i18n="editor.live_chat") Live Chat
|
|
||||||
li
|
|
||||||
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum") Forum
|
|
||||||
li
|
|
||||||
a(data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Email
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
li(title="⌃↩ or ⌘↩: Play preview of current level")
|
||||||
|
a
|
||||||
|
span.glyphicon-play.glyphicon
|
||||||
|
li.dropdown
|
||||||
|
a(data-toggle='dropdown')
|
||||||
|
span.glyphicon-chevron-down.glyphicon
|
||||||
ul.dropdown-menu
|
ul.dropdown-menu
|
||||||
li
|
li.dropdown-header Actions
|
||||||
span(data-i18n="editor.level_some_options").dropdown-menu-header Some Options?
|
li#watch-button
|
||||||
|
a
|
||||||
|
span.watch
|
||||||
|
span.glyphicon.glyphicon-eye-open
|
||||||
|
span.spl Watch
|
||||||
|
span.unwatch.secret
|
||||||
|
span.glyphicon.glyphicon-eye-close
|
||||||
|
span.spl Unwatch
|
||||||
|
|
||||||
|
li(class=anonymous ? "disabled": "")
|
||||||
|
a(data-i18n="common.fork")#fork-level-start-button Fork
|
||||||
|
li(class=anonymous ? "disabled": "")
|
||||||
|
a(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert")#revert-button Revert
|
||||||
li.divider
|
li.divider
|
||||||
|
li.dropdown-header Info
|
||||||
|
li#history-button
|
||||||
|
a(href='#', data-i18n="general.version_history") Version History
|
||||||
|
li.divider
|
||||||
|
li.dropdown-header Help
|
||||||
li
|
li
|
||||||
a(data-delay="1000", href="#", data-i18n="common.delay_1_sec") 1 second
|
a(href='https://github.com/codecombat/codecombat/wiki/Artisan-Home', data-i18n="editor.wiki", target="_blank") Wiki
|
||||||
a(data-delay="3000", href="#", data-i18n="common.delay_3_sec") 3 seconds
|
li
|
||||||
a(data-delay="5000", href="#", data-i18n="common.delay_5_sec") 5 seconds
|
a(href='http://www.hipchat.com/g3plnOKqa', data-i18n="editor.live_chat", target="_blank") Live Chat
|
||||||
a(data-delay="90019001", href="#", data-i18n="common.manual") Manual
|
li
|
||||||
|
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
||||||
|
li
|
||||||
|
a(data-toggle="coco-modal", data-target="modal/contact", data-i18n="nav.contact") Email
|
||||||
|
|
||||||
div.tab-content#level-editor-tabs
|
div.tab-content#level-editor-tabs
|
||||||
div.tab-pane.active#editor-level-thangs-tab-view
|
div.tab-pane.active#editor-level-thangs-tab-view
|
||||||
|
|
|
@ -1,21 +1,38 @@
|
||||||
nav.navbar.navbar-default(role='navigation')
|
nav.navbar.navbar-default(role='navigation')
|
||||||
.container-fluid
|
|
||||||
.navbar-header
|
ul.nav.navbar-nav.nav-tabs
|
||||||
span.navbar-brand
|
li.active
|
||||||
span(data-i18n="editor.level_system_edit_title")
|
a(href="#system-code" data-toggle="tab") Code
|
||||||
| Edit System
|
li
|
||||||
span :
|
a(href="#system-config-schema" data-toggle="tab") Config Schema
|
||||||
| "#{editTitle}"
|
li
|
||||||
.collapse.navbar-collapse
|
a(href="#system-settings" data-toggle="tab") Settings
|
||||||
ul.nav.navbar-nav.nav-tabs
|
|
||||||
li.active
|
ul.nav.navbar-nav.navbar-right
|
||||||
a(href="#system-code" data-toggle="tab") Code
|
li.dropdown
|
||||||
li
|
a(data-toggle='dropdown')
|
||||||
a(href="#system-config-schema" data-toggle="tab") Config Schema
|
span.glyphicon-chevron-down.glyphicon
|
||||||
li
|
ul.dropdown-menu
|
||||||
a(href="#system-settings" data-toggle="tab") Settings
|
li.dropdown-header Actions
|
||||||
ul.nav.navbar-nav.navbar-right
|
li#watch-component-button
|
||||||
li(data-i18n="editor.level_system_btn_new").btn.btn-primary.navbar-btn#create-new-system-button Create New System
|
a
|
||||||
|
span.watch
|
||||||
|
span.glyphicon.glyphicon-eye-open
|
||||||
|
span.spl Watch
|
||||||
|
span.unwatch.secret
|
||||||
|
span.glyphicon.glyphicon-eye-close
|
||||||
|
span.spl Unwatch
|
||||||
|
li#patch-component-button
|
||||||
|
a(data-i18n="common.submit_patch") Submit Patch
|
||||||
|
li#create-new-system
|
||||||
|
a(data-i18n="editor.level_system_btn_new") Create New System
|
||||||
|
li.divider
|
||||||
|
li.dropdown-header Info
|
||||||
|
li#system-history-button
|
||||||
|
a(data-i18n="general.version_history") Version History
|
||||||
|
|
||||||
|
.navbar-header
|
||||||
|
span.navbar-brand= editTitle
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active#system-code
|
.tab-pane.active#system-code
|
||||||
|
|
|
@ -21,6 +21,7 @@ module.exports = class ComponentsTabView extends View
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'click #create-new-component-button': 'createNewLevelComponent'
|
'click #create-new-component-button': 'createNewLevelComponent'
|
||||||
|
'click #create-new-component-button-no-select': 'createNewLevelComponent'
|
||||||
|
|
||||||
onLevelThangsChanged: (e) ->
|
onLevelThangsChanged: (e) ->
|
||||||
thangsData = e.thangsData
|
thangsData = e.thangsData
|
||||||
|
|
|
@ -23,6 +23,7 @@ module.exports = class SystemsTabView extends View
|
||||||
events:
|
events:
|
||||||
'click #add-system-button': 'addLevelSystem'
|
'click #add-system-button': 'addLevelSystem'
|
||||||
'click #create-new-system-button': 'createNewLevelSystem'
|
'click #create-new-system-button': 'createNewLevelSystem'
|
||||||
|
'click #create-new-system': 'createNewLevelSystem'
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
super options
|
super options
|
||||||
|
|
Loading…
Reference in a new issue