Merge branch 'rubenvereecken-versions_modal'

This commit is contained in:
Nick Winter 2014-03-12 08:30:02 -07:00
commit da762fbc4f
21 changed files with 187 additions and 140 deletions

View file

@ -250,6 +250,8 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
level_components_title: "Back to All Thangs"
level_components_type: "Type"
level_component_edit_title: "Edit Component"
level_component_config_schema: "Config Schema"
level_component_settings: "Settings"
level_system_edit_title: "Edit System"
create_system_title: "Create New System"
new_component_title: "Create New Component"
@ -271,6 +273,7 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
body: "Body"
version: "Version"
commit_msg: "Commit Message"
history: "History"
version_history_for: "Version History for: "
results: "Results"
description: "Description"
@ -278,6 +281,7 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
email: "Email"
password: "Password"
message: "Message"
code: "Code"
about:
who_is_codecombat: "Who is CodeCombat?"

View file

@ -244,6 +244,8 @@ module.exports = nativeDescription: "Nederlands", englishDescription: "Dutch", t
level_components_title: "Terug naar Alle Elementen"
level_components_type: "Type"
level_component_edit_title: "Wijzig Component"
level_component_config_schema: "Schema"
level_component_settings: "Instellingen"
level_system_edit_title: "Wijzig Systeem"
create_system_title: "Maak een nieuw Systeem aan"
new_component_title: "Maak een nieuw Component aan"
@ -265,12 +267,14 @@ module.exports = nativeDescription: "Nederlands", englishDescription: "Dutch", t
body: "Inhoud"
version: "Versie"
commit_msg: "Commit Bericht"
history: "Geschiedenis"
version_history_for: "Versie geschiedenis voor: "
results: "Resultaten"
description: "Beschrijving"
or: "of"
email: "Email"
message: "Bericht"
code: "Code"
about:
who_is_codecombat: "Wie is CodeCombat?"

View file

@ -10,6 +10,7 @@ block content
li.active
| #{article.attributes.name}
button(data-i18n="general.history").btn.btn-primary#history-button History
button(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert", disabled=authorized === true ? undefined : "true").btn.btn-primary#revert-button Revert
button(data-i18n="article.edit_btn_preview", disabled=authorized === true ? undefined : "true").btn.btn-primary#preview-button Preview
button(data-toggle="coco-modal", data-target="modal/save_version", data-i18n="common.save", disabled=authorized === true ? undefined : "true").btn.btn-primary#save-button Save

View file

@ -1,21 +1,21 @@
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/article/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/article/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
td #{data.version.major}.#{data.version.minor}

View file

@ -1,21 +1,21 @@
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/component/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/component/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
td #{data.version.major}.#{data.version.minor}

View file

@ -9,11 +9,13 @@ nav.navbar.navbar-default(role='navigation')
.collapse.navbar-collapse
ul.nav.navbar-nav.nav-tabs
li.active
a(href="#component-code" data-toggle="tab") Code
a(href="#component-code" data-toggle="tab" data-i18n="general.code") Code
li
a(href="#component-config-schema" data-toggle="tab") Config Schema
a(href="#component-config-schema" data-toggle="tab" data-i18n="editor.level_component_config_schema") Config Schema
li
a(href="#component-settings" data-toggle="tab") Settings
a(href="#component-settings" data-toggle="tab" data-i18n="editor.level_component_settings") Settings
ul.nav.navbar-nav.navbar-left
li(data-i18n="general.history").btn.btn-primary.navbar-btn#history-button History
ul.nav.navbar-nav.navbar-right
li(data-i18n="editor.level_component_btn_new").btn.btn-primary.navbar-btn#create-new-component-button Create New Component

View file

@ -38,9 +38,11 @@ block outer_content
li.dropdown
a.dropdown-toggle(href='#', data-toggle='dropdown')
| Help
| 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') Wiki
li

View file

@ -1,21 +1,21 @@
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/level/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/level/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
td #{data.version.major}.#{data.version.minor}

View file

@ -12,6 +12,7 @@ block content
img#portrait.img-thumbnail
button.btn.btn-secondary#history-button(data-i18n="general.history") History
button.btn.btn-primary#save-button(data-toggle="coco-modal", data-target="modal/save_version", disabled=authorized === true ? undefined : "true") Save
button.btn.btn-primary#revert-button(data-toggle="coco-modal", data-target="modal/revert", data-i18n="editor.revert", disabled=authorized === true ? undefined : "true") Revert

View file

@ -1,25 +1,25 @@
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th#portrait-col
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
- path = '/file/db/thang.type/'+data.original+'/portrait.png'
img(title="Add " + data.name, src=path, alt="").portrait
td
a(href="/editor/thang/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th#portrait-col
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
- path = '/file/db/thang.type/'+data.original+'/portrait.png'
img(title="Add " + data.name, src=path, alt="").portrait
td
a(href="/editor/thang/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
td #{data.version.major}.#{data.version.minor}

View file

@ -1,21 +1,21 @@
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/#{page}/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
table.table
tr
th(colspan=3)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
td
a(href="/editor/#{page}/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
td #{data.version.major}.#{data.version.minor}

View file

@ -1,19 +1,24 @@
extends /templates/base
block content
if dataList
h3(data-i18n="general.version_history_for") Version History for: "#{dataList[0].name}"
table.table
tr
th(data-i18n="general.name") Name
th(data-i18n="general.version") Version
th(data-i18n="general.commit_msg") Commit Message
for data in dataList
tr
td
a(href="/editor/#{page}/#{data.slug || data._id}")
| #{data.name}
td #{data.version.major}.#{data.version.minor}
td #{data.commitMessage}
extends /templates/modal/modal_base
block modal-header-content
if dataList
h3
span(data-i18n="general.version_history_for") Version History for:
|"#{dataList[0].name}"
block modal-body-content
if dataList
table.table
tr
th(data-i18n="general.name") Name
th(data-i18n="general.version") Version
th(data-i18n="general.commit_msg") Commit Message
for data in dataList
tr
td
a(href="/editor/#{page}/#{data.slug || data._id}")
| #{data.name}
td #{data.version.major}.#{data.version.minor}
td #{data.commitMessage}
block modal-footer-content

View file

@ -1,4 +1,5 @@
View = require 'views/kinds/RootView'
VersionHistoryView = require './versions_view'
template = require 'templates/editor/article/edit'
Article = require 'models/Article'
@ -9,6 +10,7 @@ module.exports = class ArticleEditView extends View
events:
'click #preview-button': 'openPreview'
'click #history-button': 'showVersionHistory'
subscriptions:
'save-new-version': 'saveNewArticle'
@ -84,3 +86,8 @@ module.exports = class ArticleEditView extends View
modal.modal('hide')
url = "/editor/article/#{newArticle.get('slug') or newArticle.id}"
document.location.href = url
showVersionHistory: (e) ->
versionHistoryView = new VersionHistoryView article:@article, @articleID
@openModalView versionHistoryView
Backbone.Mediator.publish 'level:view-switched', e

View file

@ -1,6 +1,6 @@
VersionsView = require 'views/kinds/VersionsView'
VersionsModalView = require 'views/modal/versions_modal'
module.exports = class SuperVersionsView extends VersionsView
module.exports = class ArticleVersionsView extends VersionsModalView
id: "editor-article-versions-view"
url: "/db/article/"
page: "article"

View file

@ -1,6 +1,6 @@
VersionsView = require 'views/kinds/VersionsView'
VersionsModalView = require 'views/modal/versions_modal'
module.exports = class SuperVersionsView extends VersionsView
module.exports = class ComponentVersionsView extends VersionsModalView
id: "editor-component-versions-view"
url: "/db/level.component/"
page: "component"

View file

@ -1,4 +1,5 @@
View = require 'views/kinds/CocoView'
VersionHistoryView = require 'views/editor/component/versions_view'
template = require 'templates/editor/level/component/edit'
LevelComponent = require 'models/LevelComponent'
@ -9,6 +10,7 @@ module.exports = class LevelComponentEditView extends View
events:
'click #done-editing-component-button': 'endEditing'
'click #history-button': 'showVersionHistory'
'click .nav a': (e) -> $(e.target).tab('show')
constructor: (options) ->
@ -91,3 +93,8 @@ module.exports = class LevelComponentEditView extends View
destroy: ->
@editor?.destroy()
super()
showVersionHistory: (e) ->
versionHistoryView = new VersionHistoryView component:@levelComponent, @levelComponent.id
@openModalView versionHistoryView
Backbone.Mediator.publish 'level:view-switched', e

View file

@ -12,6 +12,7 @@ ComponentsTabView = require './components_tab_view'
SystemsTabView = require './systems_tab_view'
LevelSaveView = require './save_view'
LevelForkView = require './fork_view'
VersionHistoryView = require './versions_view'
module.exports = class EditorLevelView extends View
id: "editor-level-view"
@ -23,6 +24,7 @@ module.exports = class EditorLevelView extends View
'click #play-button': 'onPlayLevel'
'click #commit-level-start-button': 'startCommittingLevel'
'click #fork-level-start-button': 'startForkingLevel'
'click #history-button': 'showVersionHistory'
constructor: (options, @levelID) ->
super options
@ -102,3 +104,8 @@ module.exports = class EditorLevelView extends View
levelForkView = new LevelForkView level: @level
@openModalView levelForkView
Backbone.Mediator.publish 'level:view-switched', e
showVersionHistory: (e) ->
versionHistoryView = new VersionHistoryView level:@level, @levelID
@openModalView versionHistoryView
Backbone.Mediator.publish 'level:view-switched', e

View file

@ -1,6 +1,6 @@
VersionsView = require 'views/kinds/VersionsView'
VersionsModalView = require 'views/modal/versions_modal'
module.exports = class SuperVersionsView extends VersionsView
module.exports = class LevelVersionsView extends VersionsModalView
id: "editor-level-versions-view"
url: "/db/level/"
page: "level"

View file

@ -6,6 +6,7 @@ SpriteBuilder = require 'lib/sprites/SpriteBuilder'
CocoSprite = require 'lib/surface/CocoSprite'
Camera = require 'lib/surface/Camera'
ThangComponentEditView = require 'views/editor/components/main'
VersionHistoryView = require './versions_view'
DocumentFiles = require 'collections/DocumentFiles'
ColorsTabView = require './colors_tab_view'
@ -30,6 +31,7 @@ module.exports = class ThangTypeEditView extends View
'change #animations-select': 'showAnimation'
'click #marker-button': 'toggleDots'
'click #end-button': 'endAnimation'
'click #history-button': 'showVersionHistory'
subscriptions:
'save-new-version': 'saveNewThangType'
@ -383,3 +385,8 @@ module.exports = class ThangTypeEditView extends View
destroy: ->
@camera?.destroy()
super()
showVersionHistory: (e) ->
versionHistoryView = new VersionHistoryView thangType:@thangType, @thangTypeID
@openModalView versionHistoryView
Backbone.Mediator.publish 'level:view-switched', e

View file

@ -1,6 +1,6 @@
VersionsView = require 'views/kinds/VersionsView'
VersionsModalView = require 'views/modal/versions_modal'
module.exports = class SuperVersionsView extends VersionsView
module.exports = class ComponentVersionsView extends VersionsModalView
id: "editor-thang-versions-view"
url: "/db/thang.type/"
page: "thang"

View file

@ -1,5 +1,5 @@
View = require 'views/kinds/RootView'
template = require 'templates/kinds/versions'
ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/versions'
tableTemplate = require 'templates/kinds/table'
class VersionsViewCollection extends Backbone.Collection
@ -10,14 +10,14 @@ class VersionsViewCollection extends Backbone.Collection
@url = url + levelID + '/versions'
@model = model
module.exports = class SuperVersionsView extends View
module.exports = class VersionsModalView extends ModalView
template: template
startsLoading: true
# needs to be overwritten by child
id: ""
url = ""
page = ""
url: ""
page: ""
constructor: (options, @ID, @model) ->
super options