this\r
\r
render: () ->\r
+ if Pettanr.is_blank(@caption())\r
+ empty = new Pettanr.Views.Common.EmptyCaption()\r
+ this.$el.html(empty.render().el)\r
+ else\r
+ this.$el.html(@caption())\r
this\r
\r
filer: () ->\r
super(options)\r
@render()\r
\r
- render: () ->\r
- if Pettanr.is_blank(@face())\r
- this.$el.html('empty')\r
- else\r
- this.$el.html(@face())\r
- this\r
- \r
face: () ->\r
@item.escape(@my_manifest.column_name)\r
\r
+ caption: () ->\r
+ @face()\r
+ \r
if @item[@method_name()]\r
@item[@method_name()]()\r
\r
- render: () ->\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
@my_manifest.method_name\r
\r
+ caption: () ->\r
+ @item.caption_text\r
+ \r
res\r
\r
filename: (picture) ->\r
- picture.filename() + '?subdir=' + @flip()\r
+ q = if _.isEmpty(@flip())\r
+ ''\r
+ else\r
+ '?subdir=' + @flip()\r
+ picture.filename() + q\r
\r
r_url: (picture) ->\r
'/pictures/' + @filename(picture)\r
load: () ->\r
@speech_balloon = @item.speech_balloon()\r
@speech_balloon.fetch({cache: true}).done =>\r
- @panel = @speech_balloon.panel()\r
- @panel.fetch({cache: true}).done =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @trigger('ready')\r
+ panel = @speech_balloon.panel()\r
+ panel.fetch({cache: true}).done =>\r
+ @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ author = panel.author()\r
+ author.fetch({cache: true}).done =>\r
+ @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+ @trigger('ready')\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@panel_icon.render().el)\r
+ this.$el.append(@author_icon_with_caption.render().el)\r
this\r
\r
}\r
super(opt)\r
\r
+class Pettanr.Views.Common.EmptyCaption extends Backbone.View\r
+ tagName: 'div'\r
+ className: 'empty'\r
+ \r
+ render: () ->\r
+ this.$el.html('empty')\r
+ this\r
+ \r
class Pettanr.Views.Common.Icon extends Backbone.View\r
tagName: 'span'\r
\r
panel = @item.panel()\r
panel.fetch({cache: true}).done =>\r
@panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- @trigger('ready')\r
+ author = panel.author()\r
+ author.fetch({cache: true}).done =>\r
+ @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+ @trigger('ready')\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@panel_icon.render().el)\r
+ this.$el.append(@author_icon_with_caption.render().el)\r
this\r
\r
class Pettanr.Views.License.Summary extends Pettanr.Views.Common.Summary\r
\r
initialize: (options) ->\r
+ super(options)\r
@item = options.item\r
@load()\r
\r
this.$el.html('')\r
symbol = new Pettanr.Views.PanelPicture.ElementSymbol({element: @element})\r
this.$el.append(symbol.render().el)\r
- name = Pettanr.truncate(@element.get('caption'), 15)\r
+ if name = @element.get('caption')\r
+ content = _.escape(Pettanr.truncate(@element.get('caption'), 15))\r
+ else\r
+ empty = new Pettanr.Views.Common.EmptyCaption()\r
+ content = empty.render().el\r
caption = new Tag.Span({\r
class_name: 'elements-tab-face-caption', \r
- content: _.escape(name)\r
+ content: content\r
})\r
this.$el.append(caption.render().el)\r
fe = new Tag.Div({class_name: 'elements-tab-face-end'})\r
class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary\r
\r
initialize: (options) ->\r
+ super(options)\r
@item = options.item\r
@load()\r
\r
panel = @item.panel()\r
panel.fetch({cache: true}).done =>\r
@panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- @trigger('ready')\r
+ author = panel.author()\r
+ author.fetch({cache: true}).done =>\r
+ @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+ @trigger('ready')\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@panel_icon.render().el)\r
+ this.$el.append(@author_icon_with_caption.render().el)\r
this\r
\r
panel = @speech_balloon.panel()\r
panel.fetch({cache: true}).done =>\r
@panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- @trigger('ready')\r
+ author = panel.author()\r
+ author.fetch({cache: true}).done =>\r
+ @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+ @trigger('ready')\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@panel_icon.render().el)\r
+ this.$el.append(@author_icon_with_caption.render().el)\r
this\r
\r
text-align: left;
}
+div.empty {
+ color: #aaaaaa;
+}
+
input.error {
border-width: 3px;
border-style: solid;
end
def filename
- self.picture.filename + '?subdir=' + self.flip
+ q = self.flip.empty? ? '' : '?subdir=' + self.flip
+ self.picture.filename + q
end
def url