From: dsc Date: Thu, 12 Apr 2012 22:49:16 +0000 (-0700) Subject: Merge branch 'master' of less.ly:kraken-ui into dataset-ui X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=032602b8595c511c6002f9f1db0360bf83c3cceb;p=kraken-ui.git Merge branch 'master' of less.ly:kraken-ui into dataset-ui Conflicts: lib/base.co lib/graph/graph-model.co --- 032602b8595c511c6002f9f1db0360bf83c3cceb diff --cc lib/graph/graph-model.co index a6914cd,0a8dc31..aa92406 --- a/lib/graph/graph-model.co +++ b/lib/graph/graph-model.co @@@ -281,6 -275,20 +281,19 @@@ Graph = exports.Graph = BaseModel.exten path = _.compact [ @urlRoot, slug, action ] .join '/' "#path?#{@toKV { keepSlug: !!slug }}" + /** + * @returns {String} Path portion of slug URL, e.g. /graphs/:slug + */ + toLink: -> + "#{@urlRoot}/#{@get('slug')}" + + /** + * @returns {String} Permalinked URI, e.g. http://reportcard.wmflabs.org/:slug + */ + toPermalink: -> - "#{window.location.protocol}//#{window.location.host}#{@toLink()}" ++ "#{root.location.protocol}//#{window.location.host}#{@toLink()}" ++ + - - toString: -> "#{@ctorName}(id=#{@id}, cid=#{@cid})" # }}} @@@ -288,14 -296,15 +301,14 @@@ GraphList = exports.GraphList = BaseLis urlRoot : '/graphs' model : Graph -- initialize : -> -- BaseList::initialize ... ++ constructor : function GraphList then BaseList ... ++ initialize : -> BaseList::initialize ... toString: -> -- modelIds = _.pluck @models, 'id' -- .map -> "\"#it\"" ++ modelIds = @models ++ .map -> "\"#{it.id ? it.cid}\"" .join ', ' - "#{@..name or @..displayName}(#modelIds)" - "#{@ctorName}(#modelIds)" ++ "#{@getClassName()}(#modelIds)" # }}}