@item[@method_name()]()\r
\r
render: () ->\r
- this.$el.html(@item.caption_text)\r
+ if Pettanr.is_blank(@item.caption_text)\r
+ this.$el.html('empty')\r
+ else\r
+ this.$el.html(@item.caption_text)\r
this\r
\r
method_name: () ->\r
picture: this\r
})\r
\r
- symbol_option: (cb) ->\r
+ symbol_option: () ->\r
@fetch({cache: true}).done =>\r
@symbol_picture = @tmb_opt_img_tag()\r
@trigger('ready:symbol')\r
\r
+ filer_caption: () ->\r
+ history = @history()\r
+ history.fetch({cache: true}).done =>\r
+ @caption_text = if _.isEmpty(history.models)\r
+ 'unpublished'\r
+ else\r
+ head = _.first(history.models)\r
+ Pettanr.to_s(head.get('revision'))\r
+ @trigger('ready:caption')\r
+ \r
revision: () ->\r
new Pettanr.OriginalPicture.Head({original_picture: this})\r
\r
url: '/original_pictures/'\r
\r
initialize: (options) ->\r
+ @original_picture = options.original_picture\r
@model = Pettanr.Picture\r
- @url = @url + options.id + '/history'\r
+ @url = @url + @original_picture.get('id') + '/history'\r
\r
class Pettanr.OriginalPicture.Head extends Backbone.View\r
tagName: 'span'\r
@symbol_picture = sp.tmb_opt_img_tag()\r
@trigger('ready:symbol')\r
\r
+ filer_caption: () ->\r
+ @fetch({cache: true}).done =>\r
+ @caption_text = @get('caption')\r
+ @trigger('ready:caption')\r
+ \r
plain_scenario: () ->\r
@get('caption')\r
\r
face: {\r
type: 'method',\r
args: {\r
- method_name: 'plain_scenario',\r
+ method_name: 'filer_caption',\r
},\r
},\r
link: {\r
face: {\r
type: 'method',\r
args: {\r
- method_name: 'revision',\r
+ method_name: 'filer_caption',\r
},\r
},\r
link: {\r
name.gsub(/\/$/, '').split('/').last
end
+ def filer_caption
+ self.caption
+ end
+
def remote_name
'/' + self.controller_name.to_s + '/' + self.action_name.to_s
end
self.tmb_opt_img_tag
end
+ def filer_caption
+ self.revision
+ end
+
def revision
head = self.history.first
head ? head.revision : 'unpublished'
self.speech_balloon_template.symbol_option
end
+ def filer_caption
+ self.plain_scenario
+ end
+
def self.public_list_where list
'panels.publish > 0'
end
}\r
},\r
"play": {\r
- "type": "public"\r
+ "type": "play",\r
+ "args": {\r
+ "filter_item_name": "comic",\r
+ "wheres": [\r
+ "index",\r
+ "play"\r
+ ]\r
+ }\r
}\r
}\r
},\r
"type": "filter"\r
},\r
"play": {\r
- "type": "public"\r
+ "type": "play",\r
+ "args": {\r
+ "filter_item_name": "story",\r
+ "wheres": [\r
+ "index",\r
+ "play"\r
+ ]\r
+ }\r
}\r
}\r
},\r
"face": {\r
"type": "method",\r
"args": {\r
- "method_name": "plain_scenario"\r
+ "method_name": "filer_caption"\r
}\r
},\r
"link": {\r
"face": {\r
"type": "method",\r
"args": {\r
- "method_name": "revision"\r
+ "method_name": "filer_caption"\r
}\r
},\r
"link": {\r