added achievement editor for #2304

This commit is contained in:
Ryan Marren 2015-02-16 17:12:05 -05:00
parent 63fa2f86d4
commit 1a60b004a7
3 changed files with 8 additions and 1 deletions

View file

@ -6,4 +6,5 @@ module.exports = class PatchesCollection extends CocoCollection
initialize: (models, options, forModel, @status='pending') ->
super(arguments...)
@url = "#{forModel.urlRoot}/#{forModel.get('original')}/patches?status=#{@status}"
identifier = if not forModel.get('original') then '_id' else 'original'
@url = "#{forModel.urlRoot}/#{forModel.get(identifier)}/patches?status=#{@status}"

View file

@ -23,6 +23,9 @@ block content
#achievement-view.clearfix
h3(data-i18n="resources.patches") Patches
.patches-view
hr
else

View file

@ -3,6 +3,7 @@ template = require 'templates/editor/achievement/edit'
Achievement = require 'models/Achievement'
AchievementPopup = require 'views/core/AchievementPopup'
ConfirmModal = require 'views/editor/modal/ConfirmModal'
PatchesView = require 'views/editor/PatchesView'
errors = require 'core/errors'
app = require 'core/application'
nodes = require 'views/editor/level/treema_nodes'
@ -57,6 +58,8 @@ module.exports = class AchievementEditView extends RootView
super()
return unless @supermodel.finished()
@pushChangesToPreview()
@patchesView = @insertSubView(new PatchesView(@achievement), @$el.find('.patches-view'))
@patchesView.load()
pushChangesToPreview: =>
return unless @treema