name_view: (length = null) ->\r
new Pettanr.Views.Author.Name({item: this, length: length})\r
\r
+ icon_with_caption_view: (half, column_name, length) ->\r
+ new Pettanr.Views.Common.IconWithCaption({item: this, half: half, column_name: column_name, length: length})\r
+ \r
initialize: () ->\r
if @id\r
@url = @url + @id\r
t: null\r
} \r
\r
+ comic: () ->\r
+ new Pettanr.Comic({id: @get('comic_id')})\r
+ \r
+ story: () ->\r
+ new Pettanr.Story({id: @get('story_id')})\r
+ \r
disp_t: () ->\r
@get('t') + 1\r
\r
credit_icon_view: () ->\r
new Pettanr.Views.Picture.CreditIcon({item: this})\r
\r
- credit_view: () ->\r
- new Pettanr.Views.Picture.Credit({item: this})\r
+ credit_view: (with_icon = true) ->\r
+ new Pettanr.Views.Picture.Credit({item: this, with_icon: with_icon})\r
\r
initialize: () ->\r
if @id\r
id: null\r
} \r
\r
+ picture: () ->\r
+ new Pettanr.Picture({id: @get('picture_id')})\r
+ \r
is_visible: (operators) ->\r
@is_user_visible(operators)\r
\r
t: null\r
} \r
\r
+ sheet: () ->\r
+ new Pettanr.Sheet({id: @get('sheet_id')})\r
+ \r
+ panel: () ->\r
+ new Pettanr.Panel({id: @get('panel_id')})\r
+ \r
initialize: () ->\r
if @id\r
@url = @url + @id\r
t: null\r
} \r
\r
+ story: () ->\r
+ new Pettanr.Story({id: @get('story_id')})\r
+ \r
+ sheet: () ->\r
+ new Pettanr.Sheet({id: @get('sheet_id')})\r
+ \r
initialize: () ->\r
if @id\r
@url = @url + @id\r
id: null\r
} \r
\r
+ picture: () ->\r
+ new Pettanr.Picture({id: @get('picture_id')})\r
+ \r
filename: () ->\r
@get('id') + '.' + @get('ext')\r
\r
class Pettanr.Views.Balloon.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
+ @speech_balloon = @item.speech_balloon()\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ @speech_balloon.fetch().done ->\r
+ panel = _this.speech_balloon.panel()\r
+ panel.fetch().done ->\r
+ panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ _this.$el.append(panel_icon.render().el)\r
this\r
\r
-class Pettanr.Views.ComicStory.Summary extends Backbone.View\r
+class Pettanr.Views.ComicStory.Summary extends Pettanr.Views.Common.Leaf.Summary\r
\r
initialize: (options) ->\r
+ options['binder_item_name'] = 'comic'\r
+ options['destination_item_name'] = 'story'\r
super(options)\r
\r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append('-')\r
- this\r
- \r
--- /dev/null
+class Pettanr.Views.Comic.Icon extends Pettanr.Views.Common.Icon\r
+ \r
+ initialize: (options) ->\r
+ super(options)\r
+ \r
-class Pettanr.Views.Comic.Summary extends Backbone.View\r
+class Pettanr.Views.Comic.Summary extends Pettanr.Views.Common.Binder.Summary\r
\r
initialize: (options) ->\r
- @item = options.item\r
- @visible = new Tag.Span({\r
- content: Pettanr.AppHelper.t_selected_item('comic_visible_items', @item.get('visible'))\r
- })\r
- @stories_count = I18n.t('comics.comic_stories_count', {c: 0})\r
- _this = this\r
- @author = @item.author()\r
- @author.fetch({cache: true}).done ->\r
- _this.author_icon = _this.author.icon_view(true)\r
- _this.author_name = _this.author.name_view(12)\r
- _this.render()\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@visible.render().el)\r
- this.$el.append(@stories_count)\r
- if @author_icon\r
- this.$el.append(@author_icon.render().el)\r
- this.$el.append(@author_name.render().el)\r
- this\r
+ options['visible_t'] = 'comic_visible_items'\r
+ options['visible_column_name'] = 'visible'\r
+ super(options)\r
\r
\r
initialize: (options) ->\r
@item = options.item\r
+ @column_name = options.column_name\r
@length = options.length\r
- @name = Pettanr.truncate(@item.get('name'), @length)\r
+ @name = Pettanr.truncate(@item.get(@column_name), @length)\r
@url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
@linked_name = new Tag.A({\r
attr: {href: '/' + @url}, \r
\r
initialize: (options) ->\r
@item = options.item\r
- @column = options.column\r
+ @half = options.half\r
+ @column_name = options.column_name\r
+ @length = options.length\r
@icon = new Pettanr.Views.Common.Icon({item: @item, half: @half})\r
- @caption = new Pettanr.Views.Common.Caption({item: @item, column: @column, length: @length})\r
+ @caption = new Pettanr.Views.Common.Caption({item: @item, column_name: @column_name, length: @length})\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@caption.render().el)\r
this\r
\r
+class Pettanr.Views.Common.Binder\r
+class Pettanr.Views.Common.Binder.Summary extends Backbone.View\r
+ \r
+ initialize: (options) ->\r
+ @item = options.item\r
+ @visible_t = options.visible_t\r
+ @visible_column_name = options.visible_column_name\r
+ @visible = new Tag.Div({\r
+ content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
+ })\r
+ _this = this\r
+ @author = @item.author()\r
+ @author.fetch({cache: true}).done ->\r
+ _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12)\r
+ _this.render()\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ this.$el.append(@visible.render().el)\r
+ if @author_icon_with_caption\r
+ this.$el.append(@author_icon_with_caption.render().el)\r
+ this\r
+ \r
+class Pettanr.Views.Common.Leaf\r
+class Pettanr.Views.Common.Leaf.Summary extends Backbone.View\r
+ \r
+ initialize: (options) ->\r
+ @item = options.item\r
+ @binder_item_name = options.binder_item_name\r
+ @destination_item_name = options.destination_item_name\r
+ _this = this\r
+ @binder = @item[@binder_item_name]()\r
+ @binder.fetch({cache: true}).done ->\r
+ _this.binder_icon = _this.binder.icon_view(true)\r
+ _this.binder_author = _this.binder.author()\r
+ _this.binder_author.fetch({cache: true}).done ->\r
+ _this.binder_author_icon_with_caption = _this.binder_author.icon_with_caption_view(true, 'name', 12)\r
+ _this.render()\r
+ @destination = @item[@destination_item_name]()\r
+ @destination.fetch({cache: true}).done ->\r
+ _this.destination_icon = _this.destination.icon_view(true)\r
+ _this.destination_author = _this.destination.author()\r
+ _this.destination_author.fetch({cache: true}).done ->\r
+ _this.destination_author_icon_with_caption = _this.destination_author.icon_with_caption_view(true, 'name', 12)\r
+ _this.render()\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ if @binder_author_icon_with_caption and @destination_author_icon_with_caption\r
+ this.$el.append(@binder_icon.render().el)\r
+ this.$el.append(@binder_author_icon_with_caption.render().el)\r
+ this.$el.append(@destination_icon.render().el)\r
+ this.$el.append(@destination_author_icon_with_caption.render().el)\r
+ this\r
+ \r
class Pettanr.Views.GroundColor.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ panel = @item.panel()\r
+ panel.fetch().done ->\r
+ panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ _this.$el.append(panel_icon.render().el)\r
this\r
\r
class Pettanr.Views.GroundPicture.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
+ @picture = @item.picture()\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ @picture.fetch().done ->\r
+ credit = _this.picture.credit_view(false)\r
+ _this.$el.append(credit.render().el)\r
+ panel = _this.item.panel()\r
+ panel.fetch().done ->\r
+ panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ _this.$el.append(panel_icon.render().el)\r
this\r
\r
class Pettanr.Views.License.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ @system_picture = @item.system_picture()\r
+ @system_picture.fetch({cache: true}).done ->\r
+ img = new Tag.Img({\r
+ attr: {\r
+ src: _this.system_picture.r_url()\r
+ }\r
+ })\r
+ _this.$el.html(img.render().el)\r
this\r
\r
class Pettanr.Views.PanelPicture.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
+ @picture = @item.picture()\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ @picture.fetch().done ->\r
+ credit = _this.picture.credit_view(false)\r
+ _this.$el.append(credit.render().el)\r
+ panel = _this.item.panel()\r
+ panel.fetch().done ->\r
+ panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ _this.$el.append(panel_icon.render().el)\r
this\r
\r
class Pettanr.Views.Panel.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
+ @visible = new Tag.Div({\r
+ content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
+ })\r
+ _this = this\r
+ @author = @item.author()\r
+ @author.fetch({cache: true}).done ->\r
+ _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12)\r
+ _this.render()\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ this.$el.append(@visible.render().el)\r
+ if @author_icon_with_caption\r
+ this.$el.append(@author_icon_with_caption.render().el)\r
this\r
\r
\r
initialize: (options) ->\r
@item = options.item\r
+ @with_icon = options.with_icon\r
@url = @item.url + '/credit'\r
\r
render: () ->\r
this.$el.html('')\r
- p = @item.credit_icon_view()\r
- this.$el.append(p.render().el)\r
+ if @with_icon\r
+ p = @item.credit_icon_view()\r
+ this.$el.append(p.render().el)\r
_this = this\r
f = (data, status) ->\r
_this.$el.append(data)\r
class Pettanr.Views.ResourcePicture.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
+ @picture = @item.picture()\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ @picture.fetch().done ->\r
+ credit = _this.picture.credit_view(false)\r
+ _this.$el.append(credit.render().el)\r
this\r
\r
-class Pettanr.Views.ScrollPanel.Summary extends Backbone.View\r
+class Pettanr.Views.ScrollPanel.Summary extends Pettanr.Views.Common.Leaf.Summary\r
\r
initialize: (options) ->\r
- @item = options.item\r
- _this = this\r
- @scroll = @item.scroll()\r
- @scroll.fetch({cache: true}).done ->\r
- _this.scroll_icon = _this.scroll.icon_view(true)\r
- _this.panel = _this.item.panel()\r
- _this.panel.fetch({cache: true}).done ->\r
- _this.panel_icon = _this.panel.icon_view(true)\r
- _this.author = _this.scroll.author()\r
- _this.author.fetch({cache: true}).done ->\r
- _this.author_name = _this.author.name_view(12)\r
- _this.render()\r
- \r
- render: () ->\r
- this.$el.html('')\r
- if @author_name\r
- this.$el.append(@scroll_icon.render().el)\r
- this.$el.append(@panel_icon.render().el)\r
- this.$el.append(@author_name.render().el)\r
- this\r
+ options['binder_item_name'] = 'scroll'\r
+ options['destination_item_name'] = 'panel'\r
+ super(options)\r
\r
-class Pettanr.Views.Scroll.Summary extends Backbone.View\r
+class Pettanr.Views.Scroll.Summary extends Pettanr.Views.Common.Binder.Summary\r
\r
initialize: (options) ->\r
- @item = options.item\r
- @visible = new Tag.Div({\r
- content: Pettanr.AppHelper.t_selected_item('scroll_visible_items', @item.get('visible'))\r
- })\r
- _this = this\r
- @author = @item.author()\r
- @author.fetch({cache: true}).done ->\r
- _this.author_icon = _this.author.icon_view(true)\r
- _this.author_name = _this.author.name_view(12)\r
- _this.render()\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@visible.render().el)\r
- if @author_icon\r
- this.$el.append(@author_icon.render().el)\r
- this.$el.append(@author_name.render().el)\r
- this\r
+ options['visible_t'] = 'scroll_visible_items'\r
+ options['visible_column_name'] = 'visible'\r
+ super(options)\r
\r
--- /dev/null
+class Pettanr.Views.Sheet.Icon extends Pettanr.Views.Common.Icon\r
+ \r
+ initialize: (options) ->\r
+ super(options)\r
+ \r
-class Pettanr.Views.Sheet.Summary extends Backbone.View\r
+class Pettanr.Views.Sheet.Summary extends Pettanr.Views.Common.Binder.Summary\r
\r
initialize: (options) ->\r
+ options['visible_t'] = 'sheet_visible_items'\r
+ options['visible_column_name'] = 'visible'\r
super(options)\r
\r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append('-')\r
- this\r
- \r
class Pettanr.Views.SpeechBalloon.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ panel = @item.panel()\r
+ panel.fetch().done ->\r
+ panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ _this.$el.append(panel_icon.render().el)\r
this\r
\r
class Pettanr.Views.Speech.Summary extends Backbone.View\r
\r
initialize: (options) ->\r
- super(options)\r
+ @item = options.item\r
+ @speech_balloon = @item.speech_balloon()\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append('-')\r
+ _this = this\r
+ @speech_balloon.fetch().done ->\r
+ panel = _this.speech_balloon.panel()\r
+ panel.fetch().done ->\r
+ panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+ _this.$el.append(panel_icon.render().el)\r
this\r
\r
--- /dev/null
+class Pettanr.Views.Story.Icon extends Pettanr.Views.Common.Icon\r
+ \r
+ initialize: (options) ->\r
+ super(options)\r
+ \r
-class Pettanr.Views.Story.Summary extends Backbone.View\r
+class Pettanr.Views.Story.Summary extends Pettanr.Views.Common.Binder.Summary\r
\r
initialize: (options) ->\r
+ options['visible_t'] = 'story_visible_items'\r
+ options['visible_column_name'] = 'visible'\r
super(options)\r
\r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append('-')\r
- this\r
- \r
-class Pettanr.Views.StorySheet.Summary extends Backbone.View\r
+class Pettanr.Views.StorySheet.Summary extends Pettanr.Views.Common.Leaf.Summary\r
\r
initialize: (options) ->\r
+ options['binder_item_name'] = 'story'\r
+ options['destination_item_name'] = 'sheet'\r
super(options)\r
\r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append('-')\r
- this\r
- \r
</tr>\r
</table>\r
</div>\r
+<div width="100%" style="background-color: #ddfadd; padding: 5px;">\r
+ <%= link_to t_m('Folder'), main_app.root_folders_path() %>\r
+ :\r
+ <%= link_to t('tab.reader.title'), '/' %>\r
+ <%= link_to t_m('Scroll'), main_app.scrolls_path %>\r
+ <%= link_to t_m('Panel'), main_app.panels_path %>\r
+ <%= link_to t_m('ResourcePicture'), main_app.resource_pictures_path %>\r
+ :\r
+ <%= link_to t('tab.creator.home'), '/home' %>\r
+ <% if @operators.author %>\r
+ <%= link_to t('tab.creator.scroll'), '/home/scrolls' %>\r
+ <%= link_to t('*'), main_app.new_scroll_path %>\r
+ <%= link_to t('tab.creator.panel'), '/home/panels' %>\r
+ <%= link_to t('*'), main_app.new_panel_path %>\r
+ <% end -%>\r
+ <% if @operators.artist %>\r
+ <%= link_to t('tab.creator.original_picture'), main_app.original_pictures_path %>\r
+ <%= link_to t('*'), main_app.new_original_picture_path %>\r
+ <%= link_to t('tab.creator.resource_picture'), '/home/resource_pictures' %>\r
+ <% end %>\r
+</div>\r
<%= yield %>\r
<div width="100%" style="background-color: #faddfa; padding: 5px;">\r
<%= link_to t('tab.demander.title'), main_app.demanders_path %>\r