From 129e07e2315ea10fe8bf26aa99d1700b845f3776 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 29 Nov 2014 13:36:41 -0800 Subject: [PATCH] Refactored a bunch of editor stuff to be included in the wads. Fixed a bug with the I18NEditModelView. --- app/styles/modal/{auth.sass => auth-modal.sass} | 0 app/styles/modal/{model.sass => model-modal.sass} | 0 app/styles/modal/{recover.sass => recover-modal.sass} | 0 app/styles/modal/{revert.sass => revert-modal.sass} | 0 .../modal/{save_version.sass => save-version-modal.sass} | 0 app/templates/common/{search.jade => search-view.jade} | 0 .../{ => editor}/docs/components-documentation-view.jade | 0 .../{ => editor}/docs/systems-documentation-view.jade | 0 app/templates/editor/level/modal/new-achievement.jade | 2 +- app/templates/editor/level/save.jade | 2 +- .../{modal/confirm.jade => editor/modal/confirm-modal.jade} | 0 .../new_model.jade => editor/modal/new-model-modal.jade} | 0 .../modal/save-version-modal.jade} | 0 .../versions.jade => editor/modal/versions-modal.jade} | 2 +- app/templates/modal/{revert.jade => revert-modal.jade} | 0 app/views/common/SearchView.coffee | 4 ++-- app/views/editor/achievement/AchievementEditView.coffee | 2 +- app/views/editor/article/ArticleEditView.coffee | 2 +- app/views/editor/article/ArticleVersionsModal.coffee | 2 +- app/views/editor/component/ComponentVersionsModal.coffee | 2 +- .../{ => editor}/docs/ComponentsDocumentationView.coffee | 2 +- app/views/{ => editor}/docs/SystemsDocumentationView.coffee | 2 +- app/views/editor/level/LevelEditView.coffee | 6 +++--- .../editor/level/components/LevelComponentEditView.coffee | 2 +- app/views/editor/level/modals/LevelVersionsModal.coffee | 2 +- app/views/editor/level/modals/NewAchievementModal.coffee | 2 +- app/views/editor/level/modals/SaveLevelModal.coffee | 2 +- app/views/editor/level/systems/LevelSystemEditView.coffee | 2 +- app/views/editor/level/systems/SystemVersionsModal.coffee | 2 +- app/views/{ => editor}/modal/ConfirmModal.coffee | 4 ++-- app/views/{ => editor}/modal/NewModelModal.coffee | 2 +- app/views/{ => editor}/modal/SaveVersionModal.coffee | 2 +- app/views/{ => editor}/modal/VersionsModal.coffee | 2 +- app/views/editor/thang/ThangTypeEditView.coffee | 2 +- app/views/editor/thang/ThangTypeVersionsModal.coffee | 2 +- app/views/i18n/I18NEditModelView.coffee | 2 +- app/views/modal/RevertModal.coffee | 2 +- config.coffee | 2 ++ 38 files changed, 31 insertions(+), 29 deletions(-) rename app/styles/modal/{auth.sass => auth-modal.sass} (100%) rename app/styles/modal/{model.sass => model-modal.sass} (100%) rename app/styles/modal/{recover.sass => recover-modal.sass} (100%) rename app/styles/modal/{revert.sass => revert-modal.sass} (100%) rename app/styles/modal/{save_version.sass => save-version-modal.sass} (100%) rename app/templates/common/{search.jade => search-view.jade} (100%) rename app/templates/{ => editor}/docs/components-documentation-view.jade (100%) rename app/templates/{ => editor}/docs/systems-documentation-view.jade (100%) rename app/templates/{modal/confirm.jade => editor/modal/confirm-modal.jade} (100%) rename app/templates/{modal/new_model.jade => editor/modal/new-model-modal.jade} (100%) rename app/templates/{modal/save_version.jade => editor/modal/save-version-modal.jade} (100%) rename app/templates/{modal/versions.jade => editor/modal/versions-modal.jade} (88%) rename app/templates/modal/{revert.jade => revert-modal.jade} (100%) rename app/views/{ => editor}/docs/ComponentsDocumentationView.coffee (95%) rename app/views/{ => editor}/docs/SystemsDocumentationView.coffee (94%) rename app/views/{ => editor}/modal/ConfirmModal.coffee (83%) rename app/views/{ => editor}/modal/NewModelModal.coffee (96%) rename app/views/{ => editor}/modal/SaveVersionModal.coffee (97%) rename app/views/{ => editor}/modal/VersionsModal.coffee (97%) diff --git a/app/styles/modal/auth.sass b/app/styles/modal/auth-modal.sass similarity index 100% rename from app/styles/modal/auth.sass rename to app/styles/modal/auth-modal.sass diff --git a/app/styles/modal/model.sass b/app/styles/modal/model-modal.sass similarity index 100% rename from app/styles/modal/model.sass rename to app/styles/modal/model-modal.sass diff --git a/app/styles/modal/recover.sass b/app/styles/modal/recover-modal.sass similarity index 100% rename from app/styles/modal/recover.sass rename to app/styles/modal/recover-modal.sass diff --git a/app/styles/modal/revert.sass b/app/styles/modal/revert-modal.sass similarity index 100% rename from app/styles/modal/revert.sass rename to app/styles/modal/revert-modal.sass diff --git a/app/styles/modal/save_version.sass b/app/styles/modal/save-version-modal.sass similarity index 100% rename from app/styles/modal/save_version.sass rename to app/styles/modal/save-version-modal.sass diff --git a/app/templates/common/search.jade b/app/templates/common/search-view.jade similarity index 100% rename from app/templates/common/search.jade rename to app/templates/common/search-view.jade diff --git a/app/templates/docs/components-documentation-view.jade b/app/templates/editor/docs/components-documentation-view.jade similarity index 100% rename from app/templates/docs/components-documentation-view.jade rename to app/templates/editor/docs/components-documentation-view.jade diff --git a/app/templates/docs/systems-documentation-view.jade b/app/templates/editor/docs/systems-documentation-view.jade similarity index 100% rename from app/templates/docs/systems-documentation-view.jade rename to app/templates/editor/docs/systems-documentation-view.jade diff --git a/app/templates/editor/level/modal/new-achievement.jade b/app/templates/editor/level/modal/new-achievement.jade index fef533444..3c083e204 100644 --- a/app/templates/editor/level/modal/new-achievement.jade +++ b/app/templates/editor/level/modal/new-achievement.jade @@ -1,4 +1,4 @@ -extends /templates/modal/new_model +extends /templates/editor/modal/new-model-modal block modal-body-content form.form diff --git a/app/templates/editor/level/save.jade b/app/templates/editor/level/save.jade index ae119168a..ddc03b4c4 100644 --- a/app/templates/editor/level/save.jade +++ b/app/templates/editor/level/save.jade @@ -1,4 +1,4 @@ -extends /templates/modal/save_version +extends /templates/editor/modal/save-version-modal block modal-body-content h3= "Level: " + level.get('name') + " - " + (levelNeedsSave ? "Modified" : "Not Modified") diff --git a/app/templates/modal/confirm.jade b/app/templates/editor/modal/confirm-modal.jade similarity index 100% rename from app/templates/modal/confirm.jade rename to app/templates/editor/modal/confirm-modal.jade diff --git a/app/templates/modal/new_model.jade b/app/templates/editor/modal/new-model-modal.jade similarity index 100% rename from app/templates/modal/new_model.jade rename to app/templates/editor/modal/new-model-modal.jade diff --git a/app/templates/modal/save_version.jade b/app/templates/editor/modal/save-version-modal.jade similarity index 100% rename from app/templates/modal/save_version.jade rename to app/templates/editor/modal/save-version-modal.jade diff --git a/app/templates/modal/versions.jade b/app/templates/editor/modal/versions-modal.jade similarity index 88% rename from app/templates/modal/versions.jade rename to app/templates/editor/modal/versions-modal.jade index 7c9f7cc5c..a8a931477 100755 --- a/app/templates/modal/versions.jade +++ b/app/templates/editor/modal/versions-modal.jade @@ -25,7 +25,7 @@ block modal-body-content td input(type="checkbox", value=data._id).select td - a(href="/editor/#{page}/#{data._id}") #{data.version.major}.#{data.version.minor} + a(href="/editor#{page}/#{data._id}") #{data.version.major}.#{data.version.minor} td= moment(data.created).format('l') td= data.creator td #{data.commitMessage} diff --git a/app/templates/modal/revert.jade b/app/templates/modal/revert-modal.jade similarity index 100% rename from app/templates/modal/revert.jade rename to app/templates/modal/revert-modal.jade diff --git a/app/views/common/SearchView.coffee b/app/views/common/SearchView.coffee index cf8ffbbeb..e4ff9d179 100644 --- a/app/views/common/SearchView.coffee +++ b/app/views/common/SearchView.coffee @@ -1,6 +1,6 @@ RootView = require 'views/core/RootView' -NewModelModal = require 'views/modal/NewModelModal' -template = require 'templates/common/search' +NewModelModal = require 'views/editor/modal/NewModelModal' +template = require 'templates/common/search-view' app = require 'core/application' class SearchCollection extends Backbone.Collection diff --git a/app/views/editor/achievement/AchievementEditView.coffee b/app/views/editor/achievement/AchievementEditView.coffee index ffdb15549..0d5011d14 100644 --- a/app/views/editor/achievement/AchievementEditView.coffee +++ b/app/views/editor/achievement/AchievementEditView.coffee @@ -2,7 +2,7 @@ RootView = require 'views/core/RootView' template = require 'templates/editor/achievement/edit' Achievement = require 'models/Achievement' AchievementPopup = require 'views/core/AchievementPopup' -ConfirmModal = require 'views/modal/ConfirmModal' +ConfirmModal = require 'views/editor/modal/ConfirmModal' errors = require 'core/errors' app = require 'core/application' nodes = require 'views/editor/level/treema_nodes' diff --git a/app/views/editor/article/ArticleEditView.coffee b/app/views/editor/article/ArticleEditView.coffee index 00902228c..f808b5a01 100644 --- a/app/views/editor/article/ArticleEditView.coffee +++ b/app/views/editor/article/ArticleEditView.coffee @@ -2,7 +2,7 @@ RootView = require 'views/core/RootView' VersionHistoryView = require './ArticleVersionsModal' template = require 'templates/editor/article/edit' Article = require 'models/Article' -SaveVersionModal = require 'views/modal/SaveVersionModal' +SaveVersionModal = require 'views/editor/modal/SaveVersionModal' PatchesView = require 'views/editor/PatchesView' require 'views/modal/RevertModal' diff --git a/app/views/editor/article/ArticleVersionsModal.coffee b/app/views/editor/article/ArticleVersionsModal.coffee index 10027ad99..fb3377f8e 100644 --- a/app/views/editor/article/ArticleVersionsModal.coffee +++ b/app/views/editor/article/ArticleVersionsModal.coffee @@ -1,4 +1,4 @@ -VersionsModal = require 'views/modal/VersionsModal' +VersionsModal = require 'views/editor/modal/VersionsModal' module.exports = class ArticleVersionsModal extends VersionsModal id: 'editor-article-versions-view' diff --git a/app/views/editor/component/ComponentVersionsModal.coffee b/app/views/editor/component/ComponentVersionsModal.coffee index fb027826e..bdcc29eea 100755 --- a/app/views/editor/component/ComponentVersionsModal.coffee +++ b/app/views/editor/component/ComponentVersionsModal.coffee @@ -1,4 +1,4 @@ -VersionsModal = require 'views/modal/VersionsModal' +VersionsModal = require 'views/editor/modal/VersionsModal' module.exports = class ComponentVersionsModal extends VersionsModal id: 'editor-component-versions-view' diff --git a/app/views/docs/ComponentsDocumentationView.coffee b/app/views/editor/docs/ComponentsDocumentationView.coffee similarity index 95% rename from app/views/docs/ComponentsDocumentationView.coffee rename to app/views/editor/docs/ComponentsDocumentationView.coffee index 15c2661cd..c74ec3147 100644 --- a/app/views/docs/ComponentsDocumentationView.coffee +++ b/app/views/editor/docs/ComponentsDocumentationView.coffee @@ -1,5 +1,5 @@ CocoView = require 'views/core/CocoView' -template = require 'templates/docs/components-documentation-view' +template = require 'templates/editor/docs/components-documentation-view' CocoCollection = require 'collections/CocoCollection' LevelComponent = require 'models/LevelComponent' diff --git a/app/views/docs/SystemsDocumentationView.coffee b/app/views/editor/docs/SystemsDocumentationView.coffee similarity index 94% rename from app/views/docs/SystemsDocumentationView.coffee rename to app/views/editor/docs/SystemsDocumentationView.coffee index bc0df08ec..4489832fb 100644 --- a/app/views/docs/SystemsDocumentationView.coffee +++ b/app/views/editor/docs/SystemsDocumentationView.coffee @@ -1,5 +1,5 @@ CocoView = require 'views/core/CocoView' -template = require 'templates/docs/systems-documentation-view' +template = require 'templates/editor/docs/systems-documentation-view' CocoCollection = require 'collections/CocoCollection' LevelSystem = require 'models/LevelSystem' diff --git a/app/views/editor/level/LevelEditView.coffee b/app/views/editor/level/LevelEditView.coffee index a50a66bfb..7b848fe13 100644 --- a/app/views/editor/level/LevelEditView.coffee +++ b/app/views/editor/level/LevelEditView.coffee @@ -17,12 +17,12 @@ ComponentsTabView = require './components/ComponentsTabView' SystemsTabView = require './systems/SystemsTabView' SaveLevelModal = require './modals/SaveLevelModal' ForkModal = require 'views/editor/ForkModal' -SaveVersionModal = require 'views/modal/SaveVersionModal' +SaveVersionModal = require 'views/editor/modal/SaveVersionModal' PatchesView = require 'views/editor/PatchesView' RelatedAchievementsView = require 'views/editor/level/RelatedAchievementsView' VersionHistoryView = require './modals/LevelVersionsModal' -ComponentsDocumentationView = require 'views/docs/ComponentsDocumentationView' -SystemsDocumentationView = require 'views/docs/SystemsDocumentationView' +ComponentsDocumentationView = require 'views/editor/docs/ComponentsDocumentationView' +SystemsDocumentationView = require 'views/editor/docs/SystemsDocumentationView' LevelFeedbackView = require 'views/editor/level/LevelFeedbackView' storage = require 'core/storage' diff --git a/app/views/editor/level/components/LevelComponentEditView.coffee b/app/views/editor/level/components/LevelComponentEditView.coffee index 39440d767..fab0f5fc4 100644 --- a/app/views/editor/level/components/LevelComponentEditView.coffee +++ b/app/views/editor/level/components/LevelComponentEditView.coffee @@ -3,7 +3,7 @@ template = require 'templates/editor/level/component/level-component-edit-view' LevelComponent = require 'models/LevelComponent' ComponentVersionsModal = require 'views/editor/component/ComponentVersionsModal' PatchesView = require 'views/editor/PatchesView' -SaveVersionModal = require 'views/modal/SaveVersionModal' +SaveVersionModal = require 'views/editor/modal/SaveVersionModal' module.exports = class LevelComponentEditView extends CocoView id: 'level-component-edit-view' diff --git a/app/views/editor/level/modals/LevelVersionsModal.coffee b/app/views/editor/level/modals/LevelVersionsModal.coffee index 21cb5a125..5194f7127 100644 --- a/app/views/editor/level/modals/LevelVersionsModal.coffee +++ b/app/views/editor/level/modals/LevelVersionsModal.coffee @@ -1,4 +1,4 @@ -VersionsModal = require 'views/modal/VersionsModal' +VersionsModal = require 'views/editor/modal/VersionsModal' module.exports = class LevelVersionsModal extends VersionsModal id: 'editor-level-versions-view' diff --git a/app/views/editor/level/modals/NewAchievementModal.coffee b/app/views/editor/level/modals/NewAchievementModal.coffee index 589f2c573..0978b3300 100644 --- a/app/views/editor/level/modals/NewAchievementModal.coffee +++ b/app/views/editor/level/modals/NewAchievementModal.coffee @@ -1,4 +1,4 @@ -NewModelModal = require 'views/modal/NewModelModal' +NewModelModal = require 'views/editor/modal/NewModelModal' template = require 'templates/editor/level/modal/new-achievement' forms = require 'core/forms' Achievement = require 'models/Achievement' diff --git a/app/views/editor/level/modals/SaveLevelModal.coffee b/app/views/editor/level/modals/SaveLevelModal.coffee index 1aca37a80..1786ad44d 100644 --- a/app/views/editor/level/modals/SaveLevelModal.coffee +++ b/app/views/editor/level/modals/SaveLevelModal.coffee @@ -1,4 +1,4 @@ -SaveVersionModal = require 'views/modal/SaveVersionModal' +SaveVersionModal = require 'views/editor/modal/SaveVersionModal' template = require 'templates/editor/level/save' forms = require 'core/forms' LevelComponent = require 'models/LevelComponent' diff --git a/app/views/editor/level/systems/LevelSystemEditView.coffee b/app/views/editor/level/systems/LevelSystemEditView.coffee index 76353dc3c..1bf4c1098 100644 --- a/app/views/editor/level/systems/LevelSystemEditView.coffee +++ b/app/views/editor/level/systems/LevelSystemEditView.coffee @@ -3,7 +3,7 @@ template = require 'templates/editor/level/system/level-system-edit-view' LevelSystem = require 'models/LevelSystem' SystemVersionsModal = require 'views/editor/level/systems/SystemVersionsModal' PatchesView = require 'views/editor/PatchesView' -SaveVersionModal = require 'views/modal/SaveVersionModal' +SaveVersionModal = require 'views/editor/modal/SaveVersionModal' module.exports = class LevelSystemEditView extends CocoView id: 'level-system-edit-view' diff --git a/app/views/editor/level/systems/SystemVersionsModal.coffee b/app/views/editor/level/systems/SystemVersionsModal.coffee index 75d0a4ba0..8c0e5e8aa 100755 --- a/app/views/editor/level/systems/SystemVersionsModal.coffee +++ b/app/views/editor/level/systems/SystemVersionsModal.coffee @@ -1,4 +1,4 @@ -VersionsModal = require 'views/modal/VersionsModal' +VersionsModal = require 'views/editor/modal/VersionsModal' module.exports = class SystemVersionsModal extends VersionsModal id: 'editor-system-versions-view' diff --git a/app/views/modal/ConfirmModal.coffee b/app/views/editor/modal/ConfirmModal.coffee similarity index 83% rename from app/views/modal/ConfirmModal.coffee rename to app/views/editor/modal/ConfirmModal.coffee index 712325d2c..8017aec21 100644 --- a/app/views/modal/ConfirmModal.coffee +++ b/app/views/editor/modal/ConfirmModal.coffee @@ -1,5 +1,5 @@ -ModalView = require '../core/ModalView' -template = require 'templates/modal/confirm' +ModalView = require '../../core/ModalView' +template = require 'templates/editor/modal/confirm-modal' module.exports = class ConfirmModal extends ModalView id: 'confirm-modal' diff --git a/app/views/modal/NewModelModal.coffee b/app/views/editor/modal/NewModelModal.coffee similarity index 96% rename from app/views/modal/NewModelModal.coffee rename to app/views/editor/modal/NewModelModal.coffee index 1da2680fe..c336028a9 100644 --- a/app/views/modal/NewModelModal.coffee +++ b/app/views/editor/modal/NewModelModal.coffee @@ -1,5 +1,5 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/modal/new_model' +template = require 'templates/editor/modal/new-model-modal' forms = require 'core/forms' module.exports = class NewModelModal extends ModalView diff --git a/app/views/modal/SaveVersionModal.coffee b/app/views/editor/modal/SaveVersionModal.coffee similarity index 97% rename from app/views/modal/SaveVersionModal.coffee rename to app/views/editor/modal/SaveVersionModal.coffee index f99061908..91cd3e997 100644 --- a/app/views/modal/SaveVersionModal.coffee +++ b/app/views/editor/modal/SaveVersionModal.coffee @@ -1,5 +1,5 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/modal/save_version' +template = require 'templates/editor/modal/save-version-modal' DeltaView = require 'views/editor/DeltaView' Patch = require 'models/Patch' forms = require 'core/forms' diff --git a/app/views/modal/VersionsModal.coffee b/app/views/editor/modal/VersionsModal.coffee similarity index 97% rename from app/views/modal/VersionsModal.coffee rename to app/views/editor/modal/VersionsModal.coffee index 4bf9b85a6..fe4b40c77 100755 --- a/app/views/modal/VersionsModal.coffee +++ b/app/views/editor/modal/VersionsModal.coffee @@ -1,5 +1,5 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/modal/versions' +template = require 'templates/editor/modal/versions-modal' DeltaView = require 'views/editor/DeltaView' PatchModal = require 'views/editor/PatchModal' nameLoader = require 'core/NameLoader' diff --git a/app/views/editor/thang/ThangTypeEditView.coffee b/app/views/editor/thang/ThangTypeEditView.coffee index f980becb2..a4cd81969 100644 --- a/app/views/editor/thang/ThangTypeEditView.coffee +++ b/app/views/editor/thang/ThangTypeEditView.coffee @@ -16,7 +16,7 @@ ThangTypeColorsTabView = require './ThangTypeColorsTabView' PatchesView = require 'views/editor/PatchesView' ForkModal = require 'views/editor/ForkModal' VectorIconSetupModal = require 'views/editor/thang/VectorIconSetupModal' -SaveVersionModal = require 'views/modal/SaveVersionModal' +SaveVersionModal = require 'views/editor/modal/SaveVersionModal' template = require 'templates/editor/thang/thang-type-edit-view' storage = require 'core/storage' diff --git a/app/views/editor/thang/ThangTypeVersionsModal.coffee b/app/views/editor/thang/ThangTypeVersionsModal.coffee index 46bda96fc..3e8dce33c 100755 --- a/app/views/editor/thang/ThangTypeVersionsModal.coffee +++ b/app/views/editor/thang/ThangTypeVersionsModal.coffee @@ -1,4 +1,4 @@ -VersionsModal = require 'views/modal/VersionsModal' +VersionsModal = require 'views/editor/modal/VersionsModal' module.exports = class ThangTypeVersionsModal extends VersionsModal id: 'editor-thang-versions-view' diff --git a/app/views/i18n/I18NEditModelView.coffee b/app/views/i18n/I18NEditModelView.coffee index 826bef69b..a3fa8d14b 100644 --- a/app/views/i18n/I18NEditModelView.coffee +++ b/app/views/i18n/I18NEditModelView.coffee @@ -5,7 +5,7 @@ template = require 'templates/i18n/i18n-edit-model-view' deltasLib = require 'core/deltas' # in the template, but need to require to load them -require 'modal/RevertModal' +require 'views/modal/RevertModal' module.exports = class I18NEditModelView extends RootView className: 'editor i18n-edit-model-view' diff --git a/app/views/modal/RevertModal.coffee b/app/views/modal/RevertModal.coffee index d931e9dbf..f6f977c75 100644 --- a/app/views/modal/RevertModal.coffee +++ b/app/views/modal/RevertModal.coffee @@ -1,5 +1,5 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/modal/revert' +template = require 'templates/modal/revert-modal' CocoModel = require 'models/CocoModel' module.exports = class RevertModal extends ModalView diff --git a/config.coffee b/config.coffee index b5d6145d4..ef8ffb25e 100644 --- a/config.coffee +++ b/config.coffee @@ -184,6 +184,7 @@ for file in coffeeFiles inputFile = file.replace('./app', 'app') outputFile = file.replace('.coffee', '.js').replace('./app', 'javascripts/app') exports.config.files.javascripts.joinTo[outputFile] = inputFile + console.log 'output file?', outputFile numBundles = 0 @@ -198,6 +199,7 @@ for file in jadeFiles possibleViewFilePath = outputFile.replace(templateFileName, viewFileName).replace('/templates/', '/views/') if exports.config.files.javascripts.joinTo[possibleViewFilePath] exports.config.files.templates.joinTo[possibleViewFilePath] = inputFile + console.log 'bundling', inputFile, 'to', possibleViewFilePath numBundles += 1 console.log 'Bundled', numBundles, 'templates with their views.' \ No newline at end of file