From 42f367d187922962e73414891f9fdaec91c54432 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Sat, 11 Oct 2014 11:40:44 +0900 Subject: [PATCH] fix summary --- app/assets/javascripts/models/author.js.coffee | 3 + .../javascripts/models/comic_story.js.coffee | 6 ++ app/assets/javascripts/models/picture.js.coffee | 4 +- .../javascripts/models/resource_picture.js.coffee | 3 + .../javascripts/models/sheet_panel.js.coffee | 6 ++ .../javascripts/models/story_sheet.js.coffee | 6 ++ .../javascripts/models/system_picture.js.coffee | 3 + .../javascripts/views/balloons/summary.js.coffee | 10 +++- .../views/comic_stories/summary.js.coffee | 9 +-- app/assets/javascripts/views/comics/icon.js.coffee | 5 ++ .../javascripts/views/comics/summary.js.coffee | 25 ++------- app/assets/javascripts/views/common.js.coffee | 64 +++++++++++++++++++++- .../views/ground_colors/summary.js.coffee | 8 ++- .../views/ground_pictures/summary.js.coffee | 12 +++- .../javascripts/views/licenses/summary.js.coffee | 12 +++- .../views/panel_pictures/summary.js.coffee | 12 +++- .../javascripts/views/panels/summary.js.coffee | 14 ++++- .../javascripts/views/pictures/credit.js.coffee | 6 +- .../views/resource_pictures/summary.js.coffee | 8 ++- .../views/scroll_panels/summary.js.coffee | 25 ++------- .../javascripts/views/scrolls/summary.js.coffee | 23 ++------ app/assets/javascripts/views/sheets/icon.js.coffee | 5 ++ .../javascripts/views/sheets/summary.js.coffee | 9 +-- .../views/speech_balloons/summary.js.coffee | 8 ++- .../javascripts/views/speeches/summary.js.coffee | 10 +++- .../javascripts/views/stories/icon.js.coffee | 5 ++ .../javascripts/views/stories/summary.js.coffee | 9 +-- .../views/story_sheets/summary.js.coffee | 9 +-- app/views/layouts/application.html.erb | 21 +++++++ 29 files changed, 230 insertions(+), 110 deletions(-) create mode 100644 app/assets/javascripts/views/comics/icon.js.coffee create mode 100644 app/assets/javascripts/views/sheets/icon.js.coffee create mode 100644 app/assets/javascripts/views/stories/icon.js.coffee diff --git a/app/assets/javascripts/models/author.js.coffee b/app/assets/javascripts/models/author.js.coffee index 500080c8..acf64127 100644 --- a/app/assets/javascripts/models/author.js.coffee +++ b/app/assets/javascripts/models/author.js.coffee @@ -15,6 +15,9 @@ class Pettanr.Author extends Peta.Owner name_view: (length = null) -> new Pettanr.Views.Author.Name({item: this, length: length}) + icon_with_caption_view: (half, column_name, length) -> + new Pettanr.Views.Common.IconWithCaption({item: this, half: half, column_name: column_name, length: length}) + initialize: () -> if @id @url = @url + @id diff --git a/app/assets/javascripts/models/comic_story.js.coffee b/app/assets/javascripts/models/comic_story.js.coffee index bc504ee3..bc8b0153 100644 --- a/app/assets/javascripts/models/comic_story.js.coffee +++ b/app/assets/javascripts/models/comic_story.js.coffee @@ -14,6 +14,12 @@ class Pettanr.ComicStory extends Peta.Leaf t: null } + comic: () -> + new Pettanr.Comic({id: @get('comic_id')}) + + story: () -> + new Pettanr.Story({id: @get('story_id')}) + disp_t: () -> @get('t') + 1 diff --git a/app/assets/javascripts/models/picture.js.coffee b/app/assets/javascripts/models/picture.js.coffee index 4fe1f71f..c7f0f6d2 100644 --- a/app/assets/javascripts/models/picture.js.coffee +++ b/app/assets/javascripts/models/picture.js.coffee @@ -83,8 +83,8 @@ class Pettanr.Picture extends Peta.Content credit_icon_view: () -> new Pettanr.Views.Picture.CreditIcon({item: this}) - credit_view: () -> - new Pettanr.Views.Picture.Credit({item: this}) + credit_view: (with_icon = true) -> + new Pettanr.Views.Picture.Credit({item: this, with_icon: with_icon}) initialize: () -> if @id diff --git a/app/assets/javascripts/models/resource_picture.js.coffee b/app/assets/javascripts/models/resource_picture.js.coffee index b3f66586..100539ec 100644 --- a/app/assets/javascripts/models/resource_picture.js.coffee +++ b/app/assets/javascripts/models/resource_picture.js.coffee @@ -11,6 +11,9 @@ class Pettanr.ResourcePicture extends Peta.Content id: null } + picture: () -> + new Pettanr.Picture({id: @get('picture_id')}) + is_visible: (operators) -> @is_user_visible(operators) diff --git a/app/assets/javascripts/models/sheet_panel.js.coffee b/app/assets/javascripts/models/sheet_panel.js.coffee index a5204821..b2e689f5 100644 --- a/app/assets/javascripts/models/sheet_panel.js.coffee +++ b/app/assets/javascripts/models/sheet_panel.js.coffee @@ -17,6 +17,12 @@ class Pettanr.SheetPanel extends Peta.Leaf t: null } + sheet: () -> + new Pettanr.Sheet({id: @get('sheet_id')}) + + panel: () -> + new Pettanr.Panel({id: @get('panel_id')}) + initialize: () -> if @id @url = @url + @id diff --git a/app/assets/javascripts/models/story_sheet.js.coffee b/app/assets/javascripts/models/story_sheet.js.coffee index 09f4290e..55d7ee47 100644 --- a/app/assets/javascripts/models/story_sheet.js.coffee +++ b/app/assets/javascripts/models/story_sheet.js.coffee @@ -14,6 +14,12 @@ class Pettanr.StorySheet extends Peta.Leaf t: null } + story: () -> + new Pettanr.Story({id: @get('story_id')}) + + sheet: () -> + new Pettanr.Sheet({id: @get('sheet_id')}) + initialize: () -> if @id @url = @url + @id diff --git a/app/assets/javascripts/models/system_picture.js.coffee b/app/assets/javascripts/models/system_picture.js.coffee index 180e7282..3ec4833a 100644 --- a/app/assets/javascripts/models/system_picture.js.coffee +++ b/app/assets/javascripts/models/system_picture.js.coffee @@ -11,6 +11,9 @@ class Pettanr.SystemPicture extends Peta.SystemResource id: null } + picture: () -> + new Pettanr.Picture({id: @get('picture_id')}) + filename: () -> @get('id') + '.' + @get('ext') diff --git a/app/assets/javascripts/views/balloons/summary.js.coffee b/app/assets/javascripts/views/balloons/summary.js.coffee index 5b54e53b..69abf348 100644 --- a/app/assets/javascripts/views/balloons/summary.js.coffee +++ b/app/assets/javascripts/views/balloons/summary.js.coffee @@ -1,10 +1,16 @@ class Pettanr.Views.Balloon.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item + @speech_balloon = @item.speech_balloon() render: () -> this.$el.html('') - this.$el.append('-') + _this = this + @speech_balloon.fetch().done -> + panel = _this.speech_balloon.panel() + panel.fetch().done -> + panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) + _this.$el.append(panel_icon.render().el) this diff --git a/app/assets/javascripts/views/comic_stories/summary.js.coffee b/app/assets/javascripts/views/comic_stories/summary.js.coffee index 1bf5ae0c..95966030 100644 --- a/app/assets/javascripts/views/comic_stories/summary.js.coffee +++ b/app/assets/javascripts/views/comic_stories/summary.js.coffee @@ -1,10 +1,7 @@ -class Pettanr.Views.ComicStory.Summary extends Backbone.View +class Pettanr.Views.ComicStory.Summary extends Pettanr.Views.Common.Leaf.Summary initialize: (options) -> + options['binder_item_name'] = 'comic' + options['destination_item_name'] = 'story' super(options) - render: () -> - this.$el.html('') - this.$el.append('-') - this - diff --git a/app/assets/javascripts/views/comics/icon.js.coffee b/app/assets/javascripts/views/comics/icon.js.coffee new file mode 100644 index 00000000..e060500c --- /dev/null +++ b/app/assets/javascripts/views/comics/icon.js.coffee @@ -0,0 +1,5 @@ +class Pettanr.Views.Comic.Icon extends Pettanr.Views.Common.Icon + + initialize: (options) -> + super(options) + diff --git a/app/assets/javascripts/views/comics/summary.js.coffee b/app/assets/javascripts/views/comics/summary.js.coffee index 69358feb..a3c89fad 100644 --- a/app/assets/javascripts/views/comics/summary.js.coffee +++ b/app/assets/javascripts/views/comics/summary.js.coffee @@ -1,24 +1,7 @@ -class Pettanr.Views.Comic.Summary extends Backbone.View +class Pettanr.Views.Comic.Summary extends Pettanr.Views.Common.Binder.Summary initialize: (options) -> - @item = options.item - @visible = new Tag.Span({ - content: Pettanr.AppHelper.t_selected_item('comic_visible_items', @item.get('visible')) - }) - @stories_count = I18n.t('comics.comic_stories_count', {c: 0}) - _this = this - @author = @item.author() - @author.fetch({cache: true}).done -> - _this.author_icon = _this.author.icon_view(true) - _this.author_name = _this.author.name_view(12) - _this.render() - - render: () -> - this.$el.html('') - this.$el.append(@visible.render().el) - this.$el.append(@stories_count) - if @author_icon - this.$el.append(@author_icon.render().el) - this.$el.append(@author_name.render().el) - this + options['visible_t'] = 'comic_visible_items' + options['visible_column_name'] = 'visible' + super(options) diff --git a/app/assets/javascripts/views/common.js.coffee b/app/assets/javascripts/views/common.js.coffee index 21a84661..eac45818 100644 --- a/app/assets/javascripts/views/common.js.coffee +++ b/app/assets/javascripts/views/common.js.coffee @@ -23,8 +23,9 @@ class Pettanr.Views.Common.Caption extends Backbone.View initialize: (options) -> @item = options.item + @column_name = options.column_name @length = options.length - @name = Pettanr.truncate(@item.get('name'), @length) + @name = Pettanr.truncate(@item.get(@column_name), @length) @url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')}) @linked_name = new Tag.A({ attr: {href: '/' + @url}, @@ -41,9 +42,11 @@ class Pettanr.Views.Common.IconWithCaption extends Backbone.View initialize: (options) -> @item = options.item - @column = options.column + @half = options.half + @column_name = options.column_name + @length = options.length @icon = new Pettanr.Views.Common.Icon({item: @item, half: @half}) - @caption = new Pettanr.Views.Common.Caption({item: @item, column: @column, length: @length}) + @caption = new Pettanr.Views.Common.Caption({item: @item, column_name: @column_name, length: @length}) render: () -> this.$el.html('') @@ -51,3 +54,58 @@ class Pettanr.Views.Common.IconWithCaption extends Backbone.View this.$el.append(@caption.render().el) this +class Pettanr.Views.Common.Binder +class Pettanr.Views.Common.Binder.Summary extends Backbone.View + + initialize: (options) -> + @item = options.item + @visible_t = options.visible_t + @visible_column_name = options.visible_column_name + @visible = new Tag.Div({ + content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name)) + }) + _this = this + @author = @item.author() + @author.fetch({cache: true}).done -> + _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12) + _this.render() + + render: () -> + this.$el.html('') + this.$el.append(@visible.render().el) + if @author_icon_with_caption + this.$el.append(@author_icon_with_caption.render().el) + this + +class Pettanr.Views.Common.Leaf +class Pettanr.Views.Common.Leaf.Summary extends Backbone.View + + initialize: (options) -> + @item = options.item + @binder_item_name = options.binder_item_name + @destination_item_name = options.destination_item_name + _this = this + @binder = @item[@binder_item_name]() + @binder.fetch({cache: true}).done -> + _this.binder_icon = _this.binder.icon_view(true) + _this.binder_author = _this.binder.author() + _this.binder_author.fetch({cache: true}).done -> + _this.binder_author_icon_with_caption = _this.binder_author.icon_with_caption_view(true, 'name', 12) + _this.render() + @destination = @item[@destination_item_name]() + @destination.fetch({cache: true}).done -> + _this.destination_icon = _this.destination.icon_view(true) + _this.destination_author = _this.destination.author() + _this.destination_author.fetch({cache: true}).done -> + _this.destination_author_icon_with_caption = _this.destination_author.icon_with_caption_view(true, 'name', 12) + _this.render() + + render: () -> + this.$el.html('') + if @binder_author_icon_with_caption and @destination_author_icon_with_caption + this.$el.append(@binder_icon.render().el) + this.$el.append(@binder_author_icon_with_caption.render().el) + this.$el.append(@destination_icon.render().el) + this.$el.append(@destination_author_icon_with_caption.render().el) + this + diff --git a/app/assets/javascripts/views/ground_colors/summary.js.coffee b/app/assets/javascripts/views/ground_colors/summary.js.coffee index 50dbce14..37113937 100644 --- a/app/assets/javascripts/views/ground_colors/summary.js.coffee +++ b/app/assets/javascripts/views/ground_colors/summary.js.coffee @@ -1,10 +1,14 @@ class Pettanr.Views.GroundColor.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item render: () -> this.$el.html('') - this.$el.append('-') + _this = this + panel = @item.panel() + panel.fetch().done -> + panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) + _this.$el.append(panel_icon.render().el) this diff --git a/app/assets/javascripts/views/ground_pictures/summary.js.coffee b/app/assets/javascripts/views/ground_pictures/summary.js.coffee index f3a72e86..e0f89497 100644 --- a/app/assets/javascripts/views/ground_pictures/summary.js.coffee +++ b/app/assets/javascripts/views/ground_pictures/summary.js.coffee @@ -1,10 +1,18 @@ class Pettanr.Views.GroundPicture.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item + @picture = @item.picture() render: () -> this.$el.html('') - this.$el.append('-') + _this = this + @picture.fetch().done -> + credit = _this.picture.credit_view(false) + _this.$el.append(credit.render().el) + panel = _this.item.panel() + panel.fetch().done -> + panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) + _this.$el.append(panel_icon.render().el) this diff --git a/app/assets/javascripts/views/licenses/summary.js.coffee b/app/assets/javascripts/views/licenses/summary.js.coffee index 200eccdf..93c2e1ea 100644 --- a/app/assets/javascripts/views/licenses/summary.js.coffee +++ b/app/assets/javascripts/views/licenses/summary.js.coffee @@ -1,10 +1,18 @@ class Pettanr.Views.License.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item render: () -> this.$el.html('') - this.$el.append('-') + _this = this + @system_picture = @item.system_picture() + @system_picture.fetch({cache: true}).done -> + img = new Tag.Img({ + attr: { + src: _this.system_picture.r_url() + } + }) + _this.$el.html(img.render().el) this diff --git a/app/assets/javascripts/views/panel_pictures/summary.js.coffee b/app/assets/javascripts/views/panel_pictures/summary.js.coffee index e98dd336..978849b6 100644 --- a/app/assets/javascripts/views/panel_pictures/summary.js.coffee +++ b/app/assets/javascripts/views/panel_pictures/summary.js.coffee @@ -1,10 +1,18 @@ class Pettanr.Views.PanelPicture.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item + @picture = @item.picture() render: () -> this.$el.html('') - this.$el.append('-') + _this = this + @picture.fetch().done -> + credit = _this.picture.credit_view(false) + _this.$el.append(credit.render().el) + panel = _this.item.panel() + panel.fetch().done -> + panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) + _this.$el.append(panel_icon.render().el) this diff --git a/app/assets/javascripts/views/panels/summary.js.coffee b/app/assets/javascripts/views/panels/summary.js.coffee index 0ecdd85f..ccc629d4 100644 --- a/app/assets/javascripts/views/panels/summary.js.coffee +++ b/app/assets/javascripts/views/panels/summary.js.coffee @@ -1,10 +1,20 @@ class Pettanr.Views.Panel.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item + @visible = new Tag.Div({ + content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name)) + }) + _this = this + @author = @item.author() + @author.fetch({cache: true}).done -> + _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12) + _this.render() render: () -> this.$el.html('') - this.$el.append('-') + this.$el.append(@visible.render().el) + if @author_icon_with_caption + this.$el.append(@author_icon_with_caption.render().el) this diff --git a/app/assets/javascripts/views/pictures/credit.js.coffee b/app/assets/javascripts/views/pictures/credit.js.coffee index 37a69a85..97aedaf9 100644 --- a/app/assets/javascripts/views/pictures/credit.js.coffee +++ b/app/assets/javascripts/views/pictures/credit.js.coffee @@ -4,12 +4,14 @@ class Pettanr.Views.Picture.Credit extends Backbone.View initialize: (options) -> @item = options.item + @with_icon = options.with_icon @url = @item.url + '/credit' render: () -> this.$el.html('') - p = @item.credit_icon_view() - this.$el.append(p.render().el) + if @with_icon + p = @item.credit_icon_view() + this.$el.append(p.render().el) _this = this f = (data, status) -> _this.$el.append(data) diff --git a/app/assets/javascripts/views/resource_pictures/summary.js.coffee b/app/assets/javascripts/views/resource_pictures/summary.js.coffee index 812199ab..b8e0dedc 100644 --- a/app/assets/javascripts/views/resource_pictures/summary.js.coffee +++ b/app/assets/javascripts/views/resource_pictures/summary.js.coffee @@ -1,10 +1,14 @@ class Pettanr.Views.ResourcePicture.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item + @picture = @item.picture() render: () -> this.$el.html('') - this.$el.append('-') + _this = this + @picture.fetch().done -> + credit = _this.picture.credit_view(false) + _this.$el.append(credit.render().el) this diff --git a/app/assets/javascripts/views/scroll_panels/summary.js.coffee b/app/assets/javascripts/views/scroll_panels/summary.js.coffee index dfac77b1..e2450e06 100644 --- a/app/assets/javascripts/views/scroll_panels/summary.js.coffee +++ b/app/assets/javascripts/views/scroll_panels/summary.js.coffee @@ -1,24 +1,7 @@ -class Pettanr.Views.ScrollPanel.Summary extends Backbone.View +class Pettanr.Views.ScrollPanel.Summary extends Pettanr.Views.Common.Leaf.Summary initialize: (options) -> - @item = options.item - _this = this - @scroll = @item.scroll() - @scroll.fetch({cache: true}).done -> - _this.scroll_icon = _this.scroll.icon_view(true) - _this.panel = _this.item.panel() - _this.panel.fetch({cache: true}).done -> - _this.panel_icon = _this.panel.icon_view(true) - _this.author = _this.scroll.author() - _this.author.fetch({cache: true}).done -> - _this.author_name = _this.author.name_view(12) - _this.render() - - render: () -> - this.$el.html('') - if @author_name - this.$el.append(@scroll_icon.render().el) - this.$el.append(@panel_icon.render().el) - this.$el.append(@author_name.render().el) - this + options['binder_item_name'] = 'scroll' + options['destination_item_name'] = 'panel' + super(options) diff --git a/app/assets/javascripts/views/scrolls/summary.js.coffee b/app/assets/javascripts/views/scrolls/summary.js.coffee index ea5adbea..8759ad8a 100644 --- a/app/assets/javascripts/views/scrolls/summary.js.coffee +++ b/app/assets/javascripts/views/scrolls/summary.js.coffee @@ -1,22 +1,7 @@ -class Pettanr.Views.Scroll.Summary extends Backbone.View +class Pettanr.Views.Scroll.Summary extends Pettanr.Views.Common.Binder.Summary initialize: (options) -> - @item = options.item - @visible = new Tag.Div({ - content: Pettanr.AppHelper.t_selected_item('scroll_visible_items', @item.get('visible')) - }) - _this = this - @author = @item.author() - @author.fetch({cache: true}).done -> - _this.author_icon = _this.author.icon_view(true) - _this.author_name = _this.author.name_view(12) - _this.render() - - render: () -> - this.$el.html('') - this.$el.append(@visible.render().el) - if @author_icon - this.$el.append(@author_icon.render().el) - this.$el.append(@author_name.render().el) - this + options['visible_t'] = 'scroll_visible_items' + options['visible_column_name'] = 'visible' + super(options) diff --git a/app/assets/javascripts/views/sheets/icon.js.coffee b/app/assets/javascripts/views/sheets/icon.js.coffee new file mode 100644 index 00000000..c3271f61 --- /dev/null +++ b/app/assets/javascripts/views/sheets/icon.js.coffee @@ -0,0 +1,5 @@ +class Pettanr.Views.Sheet.Icon extends Pettanr.Views.Common.Icon + + initialize: (options) -> + super(options) + diff --git a/app/assets/javascripts/views/sheets/summary.js.coffee b/app/assets/javascripts/views/sheets/summary.js.coffee index c2f1a3c1..16d87aef 100644 --- a/app/assets/javascripts/views/sheets/summary.js.coffee +++ b/app/assets/javascripts/views/sheets/summary.js.coffee @@ -1,10 +1,7 @@ -class Pettanr.Views.Sheet.Summary extends Backbone.View +class Pettanr.Views.Sheet.Summary extends Pettanr.Views.Common.Binder.Summary initialize: (options) -> + options['visible_t'] = 'sheet_visible_items' + options['visible_column_name'] = 'visible' super(options) - render: () -> - this.$el.html('') - this.$el.append('-') - this - diff --git a/app/assets/javascripts/views/speech_balloons/summary.js.coffee b/app/assets/javascripts/views/speech_balloons/summary.js.coffee index 2367602d..eb8fafda 100644 --- a/app/assets/javascripts/views/speech_balloons/summary.js.coffee +++ b/app/assets/javascripts/views/speech_balloons/summary.js.coffee @@ -1,10 +1,14 @@ class Pettanr.Views.SpeechBalloon.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item render: () -> this.$el.html('') - this.$el.append('-') + _this = this + panel = @item.panel() + panel.fetch().done -> + panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) + _this.$el.append(panel_icon.render().el) this diff --git a/app/assets/javascripts/views/speeches/summary.js.coffee b/app/assets/javascripts/views/speeches/summary.js.coffee index dffd1146..5bb43208 100644 --- a/app/assets/javascripts/views/speeches/summary.js.coffee +++ b/app/assets/javascripts/views/speeches/summary.js.coffee @@ -1,10 +1,16 @@ class Pettanr.Views.Speech.Summary extends Backbone.View initialize: (options) -> - super(options) + @item = options.item + @speech_balloon = @item.speech_balloon() render: () -> this.$el.html('') - this.$el.append('-') + _this = this + @speech_balloon.fetch().done -> + panel = _this.speech_balloon.panel() + panel.fetch().done -> + panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) + _this.$el.append(panel_icon.render().el) this diff --git a/app/assets/javascripts/views/stories/icon.js.coffee b/app/assets/javascripts/views/stories/icon.js.coffee new file mode 100644 index 00000000..dd6260ee --- /dev/null +++ b/app/assets/javascripts/views/stories/icon.js.coffee @@ -0,0 +1,5 @@ +class Pettanr.Views.Story.Icon extends Pettanr.Views.Common.Icon + + initialize: (options) -> + super(options) + diff --git a/app/assets/javascripts/views/stories/summary.js.coffee b/app/assets/javascripts/views/stories/summary.js.coffee index 06b17752..22acf79d 100644 --- a/app/assets/javascripts/views/stories/summary.js.coffee +++ b/app/assets/javascripts/views/stories/summary.js.coffee @@ -1,10 +1,7 @@ -class Pettanr.Views.Story.Summary extends Backbone.View +class Pettanr.Views.Story.Summary extends Pettanr.Views.Common.Binder.Summary initialize: (options) -> + options['visible_t'] = 'story_visible_items' + options['visible_column_name'] = 'visible' super(options) - render: () -> - this.$el.html('') - this.$el.append('-') - this - diff --git a/app/assets/javascripts/views/story_sheets/summary.js.coffee b/app/assets/javascripts/views/story_sheets/summary.js.coffee index 493bb87f..95d86fad 100644 --- a/app/assets/javascripts/views/story_sheets/summary.js.coffee +++ b/app/assets/javascripts/views/story_sheets/summary.js.coffee @@ -1,10 +1,7 @@ -class Pettanr.Views.StorySheet.Summary extends Backbone.View +class Pettanr.Views.StorySheet.Summary extends Pettanr.Views.Common.Leaf.Summary initialize: (options) -> + options['binder_item_name'] = 'story' + options['destination_item_name'] = 'sheet' super(options) - render: () -> - this.$el.html('') - this.$el.append('-') - this - diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ffac6e30..91801bc7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -50,6 +50,27 @@ +
+ <%= link_to t_m('Folder'), main_app.root_folders_path() %> + : + <%= link_to t('tab.reader.title'), '/' %> + <%= link_to t_m('Scroll'), main_app.scrolls_path %> + <%= link_to t_m('Panel'), main_app.panels_path %> + <%= link_to t_m('ResourcePicture'), main_app.resource_pictures_path %> + : + <%= link_to t('tab.creator.home'), '/home' %> + <% if @operators.author %> + <%= link_to t('tab.creator.scroll'), '/home/scrolls' %> + <%= link_to t('*'), main_app.new_scroll_path %> + <%= link_to t('tab.creator.panel'), '/home/panels' %> + <%= link_to t('*'), main_app.new_panel_path %> + <% end -%> + <% if @operators.artist %> + <%= link_to t('tab.creator.original_picture'), main_app.original_pictures_path %> + <%= link_to t('*'), main_app.new_original_picture_path %> + <%= link_to t('tab.creator.resource_picture'), '/home/resource_pictures' %> + <% end %> +
<%= yield %>
<%= link_to t('tab.demander.title'), main_app.demanders_path %> -- 2.11.0