\r
initialize: (options) ->\r
@body = options.body\r
- @items = @filer().items\r
+ @collection = @filer().list_result\r
+ _this = this\r
+ @collection.fetch().done ->\r
+ _this.render()\r
\r
render: () ->\r
_this = this\r
- _.each @items, (item) ->\r
+ _.each @collection.models, (item) ->\r
c = _this.file_item_class()\r
file_item = new c({'file_body': _this, 'item': item})\r
_this.$el.append(file_item.render().el)\r
@link = m.LinkFactory.factory this, @my_manifest.link, @item\r
\r
render: () ->\r
- this.$el.html(@renderer().render().el)\r
+ this.$el.html(@face.render().el)\r
this\r
\r
show: () ->\r
\r
initialize: (options) ->\r
super(options)\r
+ @picture = new Pettanr.AppHelperImg({src: @url(), size: @icon_size()})\r
\r
render: () ->\r
- i = new Pettanr.AppHelperImg({src: @url(), size: @icon_size()})\r
- this.$el.html(i.render().el)\r
+ if @picture\r
+ this.$el.html(@picture.render().el)\r
this\r
\r
url: () ->\r
@my_manifest.url\r
\r
- tag_opt: () ->\r
- {'src': @url(), 'width': Manifest.manifest().magic_numbers['thumbnail_width'], 'height': Manifest.manifest().magic_numbers['thumbnail_height']}\r
- \r
\r
initialize: (options) ->\r
super(options)\r
+ _this = this\r
+ if i = @item[@method_name()]()\r
+ i.fetch().done ->\r
+ _this.picture = new Pettanr.AppHelperImg({src: i.r_url(), size: _this.icon_size()})\r
+ _this.render()\r
+ else\r
+ @picture = new Pettanr.AppHelperImg({src: '/images/error.png', size: @icon_size()})\r
+ _this.render()\r
\r
render: () ->\r
- i = new Pettanr.AppHelperImg({src: @url(), size: @icon_size()})\r
- this.$el.html(i.render().el)\r
+ if @picture\r
+ this.$el.html(@picture.render().el)\r
this\r
\r
method_name: () ->\r
@my_manifest.method_name\r
\r
- url: () ->\r
- if @item[@method_name()]\r
- @item[@method_name()]().src\r
- else\r
- '/images/error.png'\r
- \r
- tag_opt: () ->\r
- if @item.methods(true).is_include(@method_name())\r
- @item[@method_name()]()\r
- else\r
- {'src': '/images/error.png', 'width': Manifest.manifest().magic_numbers['thumbnail_width'], 'height': Manifest.manifest().magic_numbers['thumbnail_height']}\r
- \r
\r
defaults: {\r
id: null,\r
- artist_id: nil\r
+ artist_id: null\r
} \r
\r
is_visible: (operators) ->\r
class Pettanr.SpeechBalloonTemplate extends Peta.Template\r
- relations: [{\r
- type: Backbone.HasMany,\r
- key: 'speech_balloons',\r
- relatedModel: 'SpeechBalloon',\r
- collectionType: 'SpeechBalloonCollection',\r
- reverseRelation: {\r
- key: 'livesIn',\r
- includeInJSON: 'id'\r
- }\r
- }]\r
+ url: '/speech_balloon_templates/'\r
\r
@singular: () ->\r
'SpeechBalloonTemplate'\r
id: null\r
} \r
\r
- get_system_picture: () ->\r
+ system_picture: () ->\r
new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
\r
symbol_option: () ->\r
- _this = this\r
- r = @get_system_picture()\r
- r.fetch({}).done () ->\r
- _this.system_picture = r\r
- _this.system_picture.tmb_opt_img_tag()\r
+ @system_picture()\r
\r
initialize: () ->\r
if @id\r
@url = @url + @id\r
- @system_picture = null\r
- \r
+ \r
class Pettanr.SpeechBalloonTemplate.Collection extends Backbone.Collection\r
model: Pettanr.SpeechBalloonTemplate\r
url: '/speech_balloon_templates'\r
class Pettanr.SystemPicture extends Peta.SystemResource\r
url: '/system_pictures/'\r
+ \r
@singular: () ->\r
'SystemPicture'\r
\r