From: yasushiito Date: Thu, 9 Oct 2014 23:24:20 +0000 (+0900) Subject: redraw page title X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=commitdiff_plain;h=32af7a076b4244f157cb560d156e86d183a148e3 redraw page title --- diff --git a/app/assets/javascripts/controllers/artists.js.coffee b/app/assets/javascripts/controllers/artists.js.coffee index d6e869ca..769a3d63 100644 --- a/app/assets/javascripts/controllers/artists.js.coffee +++ b/app/assets/javascripts/controllers/artists.js.coffee @@ -1,15 +1,19 @@ class Pettanr.ArtistsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.Artist.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('title')) + view = new Pettanr.Views.Artist.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -22,9 +26,11 @@ class Pettanr.ArtistsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/authors.js.coffee b/app/assets/javascripts/controllers/authors.js.coffee index fbdfedb3..94cf3179 100644 --- a/app/assets/javascripts/controllers/authors.js.coffee +++ b/app/assets/javascripts/controllers/authors.js.coffee @@ -1,15 +1,19 @@ class Pettanr.AuthorsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.Author.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('name')) + view = new Pettanr.Views.Author.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -22,9 +26,11 @@ class Pettanr.AuthorsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/balloons.js.coffee b/app/assets/javascripts/controllers/balloons.js.coffee index 847b42ad..0731262e 100644 --- a/app/assets/javascripts/controllers/balloons.js.coffee +++ b/app/assets/javascripts/controllers/balloons.js.coffee @@ -1,15 +1,19 @@ class Pettanr.BalloonsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_speech_balloon: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) _this = this @item.fetch({cache: true}).done -> view = new Pettanr.Views.Balloon.Show({ diff --git a/app/assets/javascripts/controllers/comic_stories.js.coffee b/app/assets/javascripts/controllers/comic_stories.js.coffee index bae8ec8d..f1686b93 100644 --- a/app/assets/javascripts/controllers/comic_stories.js.coffee +++ b/app/assets/javascripts/controllers/comic_stories.js.coffee @@ -1,18 +1,31 @@ class Pettanr.ComicStoriesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_comic: () -> + @redraw_title(@params) @filer_list() by_story: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) + _this = this + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.ComicStory.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -25,9 +38,11 @@ class Pettanr.ComicStoriesController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/comics.js.coffee b/app/assets/javascripts/controllers/comics.js.coffee index a0e3c601..4db24e99 100644 --- a/app/assets/javascripts/controllers/comics.js.coffee +++ b/app/assets/javascripts/controllers/comics.js.coffee @@ -1,17 +1,21 @@ class Pettanr.ComicsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_story: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('title')) view = new Pettanr.Views.Comic.Show({ el: "#pettanr", item: _this.item, @@ -30,9 +34,11 @@ class Pettanr.ComicsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/folders.js.coffee b/app/assets/javascripts/controllers/folders.js.coffee index 57f5cb73..ddafdb2f 100644 --- a/app/assets/javascripts/controllers/folders.js.coffee +++ b/app/assets/javascripts/controllers/folders.js.coffee @@ -1,9 +1,11 @@ class Pettanr.FoldersController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() root: () -> + @redraw_title(@params) @set_model() @item = new Pettanr.Folder.Root() _this = this @@ -13,6 +15,7 @@ class Pettanr.FoldersController extends Pettanr.AppController show_html_format: (format) -> children_html: () -> + @redraw_title(@params, @item.get('name')) collection = new Pettanr.Folder.Children({id: @item.get('id')}) collection.fetch({cache: true}).done -> f = new Locmare.Filer({ @@ -25,12 +28,12 @@ class Pettanr.FoldersController extends Pettanr.AppController show: () -> console.log(@params) - id = @params['id'] if @params['format'] == 'prof' @set_show() + @item = new Pettanr.FolderWatch({id: @params['id']}) # replace refference item @show_prof() else - @item = new Pettanr.FolderWatch({id: id}) + @item = new Pettanr.FolderWatch({id: @params['id']}) _this = this @item.fetch({cache: true}).done () -> if _this.item.is_remote() @@ -46,8 +49,10 @@ class Pettanr.FoldersController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() diff --git a/app/assets/javascripts/controllers/ground_colors.js.coffee b/app/assets/javascripts/controllers/ground_colors.js.coffee index ec50f36f..daaf9436 100644 --- a/app/assets/javascripts/controllers/ground_colors.js.coffee +++ b/app/assets/javascripts/controllers/ground_colors.js.coffee @@ -1,17 +1,21 @@ class Pettanr.GroundColorsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) view = new Pettanr.Views.GroundColor.Show({ el: "#pettanr", item: _this.item, diff --git a/app/assets/javascripts/controllers/ground_pictures.js.coffee b/app/assets/javascripts/controllers/ground_pictures.js.coffee index 365c8cb8..53e311b0 100644 --- a/app/assets/javascripts/controllers/ground_pictures.js.coffee +++ b/app/assets/javascripts/controllers/ground_pictures.js.coffee @@ -1,17 +1,22 @@ class Pettanr.GroundPicturesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) view = new Pettanr.Views.GroundPicture.Show({ el: "#pettanr", item: _this.item, diff --git a/app/assets/javascripts/controllers/home.js.coffee b/app/assets/javascripts/controllers/home.js.coffee index 7cb466fd..9a8aeea8 100644 --- a/app/assets/javascripts/controllers/home.js.coffee +++ b/app/assets/javascripts/controllers/home.js.coffee @@ -9,51 +9,67 @@ class Pettanr.HomeController extends Pettanr.AppController view.render() scrolls: () -> + @redraw_title(@params) @filer_list() scroll_panels: () -> + @redraw_title(@params) @filer_list() comics: () -> + @redraw_title(@params) @filer_list() comic_stories: () -> + @redraw_title(@params) @filer_list() stories: () -> + @redraw_title(@params) @filer_list() story_sheets: () -> + @redraw_title(@params) @filer_list() sheets: () -> + @redraw_title(@params) @filer_list() sheet_panels: () -> + @redraw_title(@params) @filer_list() panels: () -> + @redraw_title(@params) @filer_list() panel_pictures: () -> + @redraw_title(@params) @filer_list() speech_balloons: () -> + @redraw_title(@params) @filer_list() balloons: () -> + @redraw_title(@params) @filer_list() speeches: () -> + @redraw_title(@params) @filer_list() ground_pictures: () -> + @redraw_title(@params) @filer_list() ground_colors: () -> + @redraw_title(@params) @filer_list() resource_pictures: () -> + @redraw_title(@params) @filer_list() scrolls_count: () -> diff --git a/app/assets/javascripts/controllers/license_groups.js.coffee b/app/assets/javascripts/controllers/license_groups.js.coffee index 470fe917..2794e6f2 100644 --- a/app/assets/javascripts/controllers/license_groups.js.coffee +++ b/app/assets/javascripts/controllers/license_groups.js.coffee @@ -1,15 +1,19 @@ class Pettanr.LicenseGroupsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.LicenseGroup.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) + view = new Pettanr.Views.LicenseGroup.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -22,9 +26,11 @@ class Pettanr.LicenseGroupsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/licenses.js.coffee b/app/assets/javascripts/controllers/licenses.js.coffee index 0a343e25..032dccab 100644 --- a/app/assets/javascripts/controllers/licenses.js.coffee +++ b/app/assets/javascripts/controllers/licenses.js.coffee @@ -1,21 +1,27 @@ class Pettanr.LicensesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_icense_group: () -> + @redraw_title(@params) @filer_list() by_system_picture: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.License.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) + view = new Pettanr.Views.License.Show({ + el: "#pettanr", + item: @item, + operators: @operators + }) + view.render() show: () -> @set_show() @@ -28,9 +34,11 @@ class Pettanr.LicensesController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/original_picture_license_groups.js.coffee b/app/assets/javascripts/controllers/original_picture_license_groups.js.coffee index 64f71e54..96ab7944 100644 --- a/app/assets/javascripts/controllers/original_picture_license_groups.js.coffee +++ b/app/assets/javascripts/controllers/original_picture_license_groups.js.coffee @@ -1,5 +1,6 @@ class Pettanr.OriginalPictureLicenseGroupsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() diff --git a/app/assets/javascripts/controllers/original_picture_licenses.js.coffee b/app/assets/javascripts/controllers/original_picture_licenses.js.coffee index f2e4a2db..0845c9d0 100644 --- a/app/assets/javascripts/controllers/original_picture_licenses.js.coffee +++ b/app/assets/javascripts/controllers/original_picture_licenses.js.coffee @@ -1,5 +1,6 @@ class Pettanr.OriginalPictureLicensesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() diff --git a/app/assets/javascripts/controllers/original_pictures.js.coffee b/app/assets/javascripts/controllers/original_pictures.js.coffee index ebb48fc4..5648e68f 100644 --- a/app/assets/javascripts/controllers/original_pictures.js.coffee +++ b/app/assets/javascripts/controllers/original_pictures.js.coffee @@ -1,17 +1,22 @@ class Pettanr.OriginalPicturesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() history: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.OriginalPicture.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) + _this = this + @redraw_title(@params) + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.OriginalPicture.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) view.render() show: () -> diff --git a/app/assets/javascripts/controllers/panel_pictures.js.coffee b/app/assets/javascripts/controllers/panel_pictures.js.coffee index d2f9332e..d20aec96 100644 --- a/app/assets/javascripts/controllers/panel_pictures.js.coffee +++ b/app/assets/javascripts/controllers/panel_pictures.js.coffee @@ -1,17 +1,21 @@ class Pettanr.PanelPicturesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) view = new Pettanr.Views.PanelPicture.Show({ el: "#pettanr", item: _this.item, diff --git a/app/assets/javascripts/controllers/panels.js.coffee b/app/assets/javascripts/controllers/panels.js.coffee index 906723be..e3527551 100644 --- a/app/assets/javascripts/controllers/panels.js.coffee +++ b/app/assets/javascripts/controllers/panels.js.coffee @@ -1,24 +1,30 @@ class Pettanr.PanelsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_scroll: () -> + @redraw_title(@params) @filer_list() by_sheet: () -> + @redraw_title(@params) @filer_list() by_speech_balloon_template: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item = new Pettanr.Panel({id: @item.get('id')}, {with_elements: true}) # retake panel for 'with_elements' mode @item.fetch({cache: false}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) view = new Pettanr.Views.Panel.Show({ el: "#pettanr", panel: _this.item, @@ -39,9 +45,11 @@ class Pettanr.PanelsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/pictures.js.coffee b/app/assets/javascripts/controllers/pictures.js.coffee index 2b397b3a..6aade7f9 100644 --- a/app/assets/javascripts/controllers/pictures.js.coffee +++ b/app/assets/javascripts/controllers/pictures.js.coffee @@ -1,18 +1,23 @@ class Pettanr.PicturesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_artist: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.Picture.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + @redraw_title(@params) + _this = this + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.Picture.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() diff --git a/app/assets/javascripts/controllers/resource_pictures.js.coffee b/app/assets/javascripts/controllers/resource_pictures.js.coffee index 55871e46..f8c8dd01 100644 --- a/app/assets/javascripts/controllers/resource_pictures.js.coffee +++ b/app/assets/javascripts/controllers/resource_pictures.js.coffee @@ -1,24 +1,31 @@ class Pettanr.ResourcePicturesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_artist: () -> + @redraw_title(@params) @filer_list() by_license_group: () -> + @redraw_title(@params) @filer_list() by_license: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.ResourcePicture.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + @redraw_title(@params) + _this = this + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.ResourcePicture.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() diff --git a/app/assets/javascripts/controllers/scroll_panels.js.coffee b/app/assets/javascripts/controllers/scroll_panels.js.coffee index 2efc6cf1..cac28e60 100644 --- a/app/assets/javascripts/controllers/scroll_panels.js.coffee +++ b/app/assets/javascripts/controllers/scroll_panels.js.coffee @@ -1,18 +1,31 @@ class Pettanr.ScrollPanelsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_scroll: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) + _this = this + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.ScrollPanel.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -22,12 +35,18 @@ class Pettanr.ScrollPanelsController extends Pettanr.AppController when 'html' @show_html() + play: () -> + @set_play() + @play_list() + count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/scrolls.js.coffee b/app/assets/javascripts/controllers/scrolls.js.coffee index 3e634fc3..5d556857 100644 --- a/app/assets/javascripts/controllers/scrolls.js.coffee +++ b/app/assets/javascripts/controllers/scrolls.js.coffee @@ -1,17 +1,21 @@ class Pettanr.ScrollsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('title')) view = new Pettanr.Views.Scroll.Show({ el: "#pettanr", item: _this.item, @@ -27,12 +31,18 @@ class Pettanr.ScrollsController extends Pettanr.AppController when 'html' @show_html() + play: () -> + @set_play() + @play_list() + count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/sheet_panels.js.coffee b/app/assets/javascripts/controllers/sheet_panels.js.coffee index 8ba848ea..3c0eb383 100644 --- a/app/assets/javascripts/controllers/sheet_panels.js.coffee +++ b/app/assets/javascripts/controllers/sheet_panels.js.coffee @@ -1,18 +1,31 @@ class Pettanr.SheetPanelsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_sheet: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) + _this = this + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.SheetPanel.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -25,9 +38,11 @@ class Pettanr.SheetPanelsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/sheets.js.coffee b/app/assets/javascripts/controllers/sheets.js.coffee index c086fa8d..530f6f83 100644 --- a/app/assets/javascripts/controllers/sheets.js.coffee +++ b/app/assets/javascripts/controllers/sheets.js.coffee @@ -1,20 +1,25 @@ class Pettanr.SheetsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_story: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) view = new Pettanr.Views.Sheet.Show({ el: "#pettanr", item: _this.item, @@ -33,9 +38,11 @@ class Pettanr.SheetsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/speech_balloon_templates.js.coffee b/app/assets/javascripts/controllers/speech_balloon_templates.js.coffee index ce6fd020..9fadbe1d 100644 --- a/app/assets/javascripts/controllers/speech_balloon_templates.js.coffee +++ b/app/assets/javascripts/controllers/speech_balloon_templates.js.coffee @@ -1,21 +1,27 @@ class Pettanr.SpeechBalloonTemplatesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() by_system_picture: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.SpeechBalloonTemplate.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) + view = new Pettanr.Views.SpeechBalloonTemplate.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -28,9 +34,11 @@ class Pettanr.SpeechBalloonTemplatesController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/speech_balloons.js.coffee b/app/assets/javascripts/controllers/speech_balloons.js.coffee index 90c210ed..40b34e77 100644 --- a/app/assets/javascripts/controllers/speech_balloons.js.coffee +++ b/app/assets/javascripts/controllers/speech_balloons.js.coffee @@ -1,20 +1,25 @@ class Pettanr.SpeechBalloonsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_panel: () -> + @redraw_title(@params) @filer_list() by_speech_balloon_template: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) view = new Pettanr.Views.SpeechBalloon.Show({ el: "#pettanr", item: _this.item, diff --git a/app/assets/javascripts/controllers/speeches.js.coffee b/app/assets/javascripts/controllers/speeches.js.coffee index a8c257c5..7895a58a 100644 --- a/app/assets/javascripts/controllers/speeches.js.coffee +++ b/app/assets/javascripts/controllers/speeches.js.coffee @@ -1,15 +1,19 @@ class Pettanr.SpeechesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_speech_balloon: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) _this = this @item.fetch({cache: true}).done -> view = new Pettanr.Views.Speech.Show({ diff --git a/app/assets/javascripts/controllers/stories.js.coffee b/app/assets/javascripts/controllers/stories.js.coffee index c6cda6ff..bbaf39c4 100644 --- a/app/assets/javascripts/controllers/stories.js.coffee +++ b/app/assets/javascripts/controllers/stories.js.coffee @@ -1,20 +1,25 @@ class Pettanr.StoriesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_comic: () -> + @redraw_title(@params) @filer_list() by_sheet: () -> + @redraw_title(@params) @filer_list() show_html: () -> _this = this @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('title')) view = new Pettanr.Views.Story.Show({ el: "#pettanr", item: _this.item, @@ -33,9 +38,11 @@ class Pettanr.StoriesController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/story_sheets.js.coffee b/app/assets/javascripts/controllers/story_sheets.js.coffee index 3911c960..c8564812 100644 --- a/app/assets/javascripts/controllers/story_sheets.js.coffee +++ b/app/assets/javascripts/controllers/story_sheets.js.coffee @@ -1,18 +1,31 @@ class Pettanr.StorySheetsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_author: () -> + @redraw_title(@params) @filer_list() by_story: () -> + @redraw_title(@params) @filer_list() by_sheet: () -> + @redraw_title(@params) @filer_list() show_html: () -> + @redraw_title(@params) + _this = this + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.StorySheet.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -25,9 +38,11 @@ class Pettanr.StorySheetsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/controllers/system_pictures.js.coffee b/app/assets/javascripts/controllers/system_pictures.js.coffee index f1d0c9a8..a323e490 100644 --- a/app/assets/javascripts/controllers/system_pictures.js.coffee +++ b/app/assets/javascripts/controllers/system_pictures.js.coffee @@ -1,15 +1,19 @@ class Pettanr.SystemPicturesController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.SystemPicture.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @redraw_title(@params) + @item.fetch({cache: true}).done -> + view = new Pettanr.Views.SystemPicture.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() diff --git a/app/assets/javascripts/controllers/writing_formats.js.coffee b/app/assets/javascripts/controllers/writing_formats.js.coffee index 2027da20..f33bc553 100644 --- a/app/assets/javascripts/controllers/writing_formats.js.coffee +++ b/app/assets/javascripts/controllers/writing_formats.js.coffee @@ -1,18 +1,23 @@ class Pettanr.WritingFormatsController extends Pettanr.AppController index: () -> + @redraw_title(@params) @filer_list() by_system_picture: () -> + @redraw_title(@params) @filer_list() show_html: () -> - view = new Pettanr.Views.WritingFormat.Show({ - el: "#pettanr", - item: @item, - operators: @operators - }) - view.render() + _this = this + @item.fetch({cache: true}).done -> + _this.redraw_title(_this.params, _this.item.get('caption')) + view = new Pettanr.Views.WritingFormat.Show({ + el: "#pettanr", + item: _this.item, + operators: _this.operators + }) + view.render() show: () -> @set_show() @@ -25,9 +30,11 @@ class Pettanr.WritingFormatsController extends Pettanr.AppController count: () -> new: () -> + @redraw_title(@params) @form_new() edit: () -> + @redraw_title(@params) @form_edit() create: () -> diff --git a/app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/link/action.js.coffee b/app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/link/action.js.coffee index f7ed6a63..22868ebb 100644 --- a/app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/link/action.js.coffee +++ b/app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/link/action.js.coffee @@ -9,9 +9,6 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemCo this.$el.html(@default_caption.face.render().el) this - js_url: () -> - "javascript:void(0)" - url: () -> controller = Manifest.manifest().controllers[@item.table_name()] action = controller.actions[@my_manifest.action_name] diff --git a/app/assets/javascripts/locmare/filer/body/file_body/file_item/symbol/default/link/action.js.coffee b/app/assets/javascripts/locmare/filer/body/file_body/file_item/symbol/default/link/action.js.coffee index e3c8c52c..81e42b39 100644 --- a/app/assets/javascripts/locmare/filer/body/file_body/file_item/symbol/default/link/action.js.coffee +++ b/app/assets/javascripts/locmare/filer/body/file_body/file_item/symbol/default/link/action.js.coffee @@ -9,9 +9,6 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol this.$el.html(@default_symbol.face.render().el) this - js_url: () -> - "javascript:void(0)" - url: () -> controller = Manifest.manifest().controllers[@item.table_name()] action = controller.actions[@my_manifest.action_name] diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index ba88f213..b8b207fd 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -3,10 +3,11 @@ $ -> interpolate: /\<\&\=(.+?)\&\>/g, evaluate: /\<\&(.+?)\&\>/g } - I18n.defaultLocale = 'ja' - I18n.locale = 'ja' + locale = $("html").attr('lang') + I18n.defaultLocale = locale + I18n.locale = locale I18n.fallbacks = true - jQuery.timeago.settings.lang = 'ja' + jQuery.timeago.settings.lang = locale Backbone.fetchCache.localStorage = false loaded_manifest = null loaded_local_manifest = null diff --git a/app/assets/javascripts/manifest/controller/action/base.js.coffee b/app/assets/javascripts/manifest/controller/action/base.js.coffee index 4c6886fd..8dc8be20 100644 --- a/app/assets/javascripts/manifest/controller/action/base.js.coffee +++ b/app/assets/javascripts/manifest/controller/action/base.js.coffee @@ -20,7 +20,7 @@ class Manifest.ControllerModule.ActionModule.Base extends ManifestBase.TypeNameA '' encode_url: (action_name, params) -> - c = @parent.name + c = Manifest.manifest().models[@item_name].table_name a = if action_name == 'index' or action_name == 'show' or action_name == 'destroy' '' else diff --git a/app/assets/javascripts/pettanr.js.coffee b/app/assets/javascripts/pettanr.js.coffee index 0ad5f445..966bcb5d 100644 --- a/app/assets/javascripts/pettanr.js.coffee +++ b/app/assets/javascripts/pettanr.js.coffee @@ -143,6 +143,28 @@ class Pettanr ) false + set_play: () -> + @set_list() + @binder_controller = Manifest.manifest().controllers[@params['controller']] + @binder_model = Manifest.manifest().models[@binder_controller.item_name] + @binder_model_class = @binder_model.classify() + @item = new @binder_model_class({id: @params['id']}) + + play_list: () -> + _this = this + opt = { + id: @params['id'], + offset: @params['offset'], + count: @params['count'], + page: @params['page'], + page_size: @params['page_size'] + } + @item.fetch({cache: true}).done -> + _this.list.open(_this.operators, opt, _this.my_action, {}, (page_status) -> + console.log _this.list.models + ) + false + show_prof: () -> _this = this @item.fetch({cache: true}).done -> @@ -153,6 +175,7 @@ class Pettanr operators: _this.operators }) $("#pettanr").html(profiler.render().el) + _this.redraw_title(_this.params) set_new: () -> @set_model() @@ -187,6 +210,11 @@ class Pettanr form_edit: () -> @set_edit() + redraw_title: (params, str = null) -> + t = str || I18n.t(params['controller'] + '.' + params['action'] + '.title') + site_caption = Manifest.manifest().magic_numbers.profile.users.caption + $(document).attr('title', t + ' - ' + site_caption) + class Pettanr.FilerRender constructor: (item_name, list_result, pager_type, operators) -> @item_name = item_name diff --git a/app/assets/javascripts/work/controllers.js.coffee.erb b/app/assets/javascripts/work/controllers.js.coffee.erb index 77638f7d..7754d280 100644 --- a/app/assets/javascripts/work/controllers.js.coffee.erb +++ b/app/assets/javascripts/work/controllers.js.coffee.erb @@ -62,7 +62,9 @@ type: 'list', args: { item_name: 'scroll_panel', - list_name: 'play', + list_name: 'by_scroll', + order: 't', + direction: 'asc' }, }, show: { @@ -125,6 +127,11 @@ param_id: 'suffix', }, }, + play: { + type: 'list', + args: { + }, + }, show: { type: 'show', }, @@ -143,6 +150,9 @@ count_by_author: { type: 'count', }, + count_play: { + type: 'count', + }, new: { type: 'new', }, diff --git a/app/controllers/scroll_panels_controller.rb b/app/controllers/scroll_panels_controller.rb index 68a3c6d4..dc94d9bb 100644 --- a/app/controllers/scroll_panels_controller.rb +++ b/app/controllers/scroll_panels_controller.rb @@ -4,7 +4,7 @@ class ScrollPanelsController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_scroll, :by_author, :count, :count_by_panel, :count_by_scroll, :count_by_author + :index, :show, :by_panel, :by_scroll, :by_author, :play, :count, :count_by_panel, :count_by_scroll, :count_by_author, :play ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -30,6 +30,10 @@ class ScrollPanelsController < ApplicationController filer_list end + def play + filer_list + end + def show set_show respond_to do |format| @@ -54,6 +58,10 @@ class ScrollPanelsController < ApplicationController list_count end + def count_play + list_count + end + def new form_new end diff --git a/app/controllers/scrolls_controller.rb b/app/controllers/scrolls_controller.rb index 62dd4b3c..6e459b74 100644 --- a/app/controllers/scrolls_controller.rb +++ b/app/controllers/scrolls_controller.rb @@ -70,6 +70,10 @@ class ScrollsController < ApplicationController list_count end + def count_play + list_count + end + def new form_new end diff --git a/app/controllers/top_controller.rb b/app/controllers/top_controller.rb index f7b646c3..37b4adad 100644 --- a/app/controllers/top_controller.rb +++ b/app/controllers/top_controller.rb @@ -10,7 +10,7 @@ class TopController < ApplicationController def index respond_to do |format| - format.html { render layout: 'application' } + format.html { render layout: 'ap' } end end diff --git a/app/views/layouts/ap.html.erb b/app/views/layouts/ap.html.erb index 8f929776..27b7e5c1 100644 --- a/app/views/layouts/ap.html.erb +++ b/app/views/layouts/ap.html.erb @@ -1,11 +1,10 @@ - + ap - <%= h(manifest.magic_numbers['profile']['users']['caption']) %> <%= stylesheet_link_tag "test" %> - <%= javascript_include_tag "application" %> <%= javascript_include_tag "ap" %> <%# raw panel_editor_javascript_include_tags %> <%= csrf_meta_tags %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0cb2c2a5..ffac6e30 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,5 +1,5 @@ - + <% if @page_title %> @@ -10,7 +10,7 @@ - <%= h(manifest.magic_numbers['profile']['users']['caption']) %> <%= stylesheet_link_tag "test" %> - <%= javascript_include_tag "ap" %> + <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> diff --git a/config/routes.rb b/config/routes.rb index 0bbf07d0..dcca394b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,6 +45,7 @@ Pettanr::Application.routes.draw do get :by_panel get :count_by_author get :count_by_panel + get :count_play get :play get :edit put :update @@ -66,9 +67,11 @@ Pettanr::Application.routes.draw do get :by_panel get :by_scroll get :by_author + get :play get :count_by_panel get :count_by_scroll get :count_by_author + get :count_play get :edit put :update delete :destroy diff --git a/public/manifest.json b/public/manifest.json index 9bc5eb91..2aeb8452 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -286,6 +286,9 @@ "count_by_panel": { "type": "count" }, + "count_play": { + "type": "count" + }, "new": { "type": "new" }, @@ -331,6 +334,11 @@ "param_id": "suffix" } }, + "play": { + "type": "list", + "args": { + } + }, "show": { "type": "show" }, @@ -349,6 +357,9 @@ "count_by_author": { "type": "count" }, + "count_play": { + "type": "count" + }, "new": { "type": "new" },