OSDN Git Service

fix: views
authoryasushiito <yas@pen-chan.jp>
Mon, 27 Jul 2015 05:06:21 +0000 (14:06 +0900)
committeryasushiito <yas@pen-chan.jp>
Mon, 27 Jul 2015 05:06:21 +0000 (14:06 +0900)
47 files changed:
app/assets/javascripts/editor.js.coffee
app/assets/javascripts/editor/panel_editor.js.coffee
app/assets/javascripts/editor/panel_editor/dialog.js.coffee
app/assets/javascripts/editor/panel_editor/scenario/element.js.coffee
app/assets/javascripts/editor/picture_publisher/dialog.js.coffee
app/assets/javascripts/locmare/filer/body.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/summary/template.js.coffee
app/assets/javascripts/locmare/form/field/helper/color.js.coffee
app/assets/javascripts/locmare/list_group/lib/pager.js.coffee
app/assets/javascripts/locmare/list_group/lib/play_pager.js.coffee
app/assets/javascripts/models/resource_picture.js.coffee
app/assets/javascripts/peta/item.js.coffee
app/assets/javascripts/peta/leaf.js.coffee
app/assets/javascripts/pettanr/inspire.js.coffee
app/assets/javascripts/view.js.coffee
app/assets/javascripts/view/credit.js.coffee
app/assets/javascripts/view/layout.js.coffee
app/assets/javascripts/view/show.js.coffee
app/assets/javascripts/view/summary.js.coffee
app/assets/javascripts/view/summary/binder.js.coffee
app/assets/javascripts/view/summary/leaf.js.coffee
app/assets/javascripts/views/authors/summary.js.coffee
app/assets/javascripts/views/balloons/summary.js.coffee
app/assets/javascripts/views/folders/summary.js.coffee
app/assets/javascripts/views/ground_colors/summary.js.coffee
app/assets/javascripts/views/ground_pictures/summary.js.coffee
app/assets/javascripts/views/history.js.coffee
app/assets/javascripts/views/licenses/summary.js.coffee
app/assets/javascripts/views/original_pictures/show.js.coffee
app/assets/javascripts/views/original_pictures/summary.js.coffee
app/assets/javascripts/views/panel_pictures/summary.js.coffee
app/assets/javascripts/views/panels/body.js.coffee
app/assets/javascripts/views/panels/show.js.coffee
app/assets/javascripts/views/panels/summary.js.coffee
app/assets/javascripts/views/pictures/history.js.coffee
app/assets/javascripts/views/resource_pictures/show.js.coffee
app/assets/javascripts/views/resource_pictures/summary.js.coffee
app/assets/javascripts/views/scrolls/play.js.coffee
app/assets/javascripts/views/sheets/play.js.coffee
app/assets/javascripts/views/speech_balloons/element_face.js.coffee
app/assets/javascripts/views/speech_balloons/summary.js.coffee
app/assets/javascripts/views/speeches/summary.js.coffee
app/assets/javascripts/views/users/account.js.coffee
app/assets/javascripts/work/models.js.coffee.erb
app/assets/stylesheets/test.css.scss
app/controllers/speech_balloon_templates_controller.rb
public/manifest.json

index da3b08f..3aed291 100644 (file)
@@ -71,7 +71,7 @@ class Editor.EditorModule.DockModule.BoardBay extends Editor.EditorModule.DockMo
   render: () ->\r
     this.$el.html('')\r
     @el.className = @body.dom_class()\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
   dom_labels_class: () ->\r
index ff26b0f..d22fec9 100644 (file)
@@ -49,7 +49,7 @@ class Editor.PanelEditor extends Pettanr.View
     this.$el.append(@body.render().el)\r
     this.$el.append(@dock.render().el)\r
     this.$el.append(@credits.render().el)\r
-    @rb()\r
+    @append_rb()\r
     @dock.init_tabs()\r
     @dock.$el.tabs()\r
     this\r
index 65ffd9b..f984f47 100644 (file)
@@ -14,7 +14,7 @@ class Editor.PanelEditor.Dialog extends Editor.Dialog
   refresh: (view) ->\r
     this.$el.html('')\r
     this.$el.append(@history.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this.$el.append(view.el)\r
   \r
   getter_proxy: () ->\r
index 75925c0..381c325 100644 (file)
@@ -18,7 +18,7 @@ class Editor.EditorModule.DockModule.ScenarioBay.Element extends Pettanr.View
     })\r
     this.$el.append(@label.render().$el)\r
     this.$el.append(@body.render().$el)\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
   refresh: () ->\r
index 593321a..fbe10f8 100644 (file)
@@ -29,7 +29,7 @@ class Editor.PicturePublisher.Dialog extends Editor.Dialog
   \r
   next: (opl) ->\r
     @title({controller: 'original_picture_licenses', action: 'new'})\r
-    @rb()\r
+    @append_rb()\r
     @form = Locmare.Form.factory({\r
       form_name: opl.item_name(), \r
       use_name: 'default', \r
index 18faa76..b882982 100644 (file)
@@ -15,7 +15,7 @@ class Locmare.FilerModule.Body extends Pettanr.View
   render: () ->\r
     this.$el.append(@file_header.render().el)\r
     this.$el.append(@file_body.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
   manifest: () ->\r
index 4f1ed3f..a5d2869 100644 (file)
@@ -4,10 +4,10 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SummaryItemCo
     super(options)\r
   \r
   render: () ->\r
-    view = Pettanr.Views[@item.singular()]\r
-    summary = new view[view.summary()]({item: @item})\r
+    summary = @item.summary(this, {\r
+    })\r
     @listenTo(summary, 'http_get', @http_get)\r
-    this.$el.html(summary.el)\r
+    this.$el.html(summary.render().el)\r
     this\r
   \r
   http_get: (url) ->\r
index 042736c..12534bc 100644 (file)
@@ -19,7 +19,7 @@ class Locmare.FormModule.FieldModule.HelperModule.Color extends Locmare.FormModu
     this.$el.append(@picker.render().el)\r
     this.$el.append(@swatch.render().el)\r
     this.$el.append(@status.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
   refresh: () ->\r
index 2b706e4..fc58dfb 100644 (file)
@@ -77,7 +77,7 @@ class Locmare.ListGroupModule.LibModule.PagerModule.Default extends Pettanr.View
       @listenTo(view, 'navigate', @navigate)\r
       @listenTo(view, 'page', @click)\r
       this.$el.append(view.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
   range: () ->\r
index 4709e11..a62d5b8 100644 (file)
@@ -20,7 +20,7 @@ class Locmare.ListGroupModule.LibModule.PlayPagerModule.Default extends Locmare.
       @listenTo(view, 'navigate', @navigate)\r
       @listenTo(view, 'page', @click)\r
       this.$el.append(view.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
 class Locmare.ListGroupModule.LibModule.PlayPagerModule.NextPage extends Locmare.ListGroupModule.LibModule.PagerModule.Part\r
index 6a82a51..7ca045e 100644 (file)
@@ -10,6 +10,11 @@ class Pettanr.ResourcePicture extends Peta.Content
     id: null\r
   } \r
   \r
+  @trace_routes: () ->\r
+    {\r
+      picture: ['resource_picture_picture', 'picture']\r
+    }\r
+  \r
   is_visible: (operators = Pettanr.cache.operators) ->\r
     @is_user_visible(operators)\r
   \r
index c3e1084..84f5a57 100644 (file)
@@ -346,6 +346,10 @@ class Peta.Item extends Backbone.Model
   mini_faced_label: (options) ->\r
     new Pettanr.View.MiniFacedLabel(this, options)\r
   \r
+  summary: (context, options) ->\r
+    klass = Pettanr.Views[@singular()].Summary\r
+    new klass(this, context, options)\r
+  \r
   @index_url: () ->\r
     Pettanr.url(@table_name(), 'index', {id: null})\r
   \r
index a9bf487..89b2ae3 100644 (file)
@@ -1,17 +1,17 @@
 class Peta.Leaf extends Peta.Content\r
   \r
-  parent_model: () ->\r
-    Manifest.manifest().models[@my_class().my_peta().parent_item_name].classify()\r
+  @parent_model: () ->\r
+    Manifest.manifest().models[@my_peta().parent_item_name].classify()\r
   \r
-  binder_model: () ->\r
+  @binder_model: () ->\r
     @parent_model()\r
   \r
-  destination_model: () ->\r
-    Manifest.manifest().models[@my_class().my_peta().destination_item_name].classify()\r
+  @destination_model: () ->\r
+    Manifest.manifest().models[@my_peta().destination_item_name].classify()\r
   \r
-  binder_key: () ->\r
+  @binder_key: () ->\r
     @my_class().my_peta().parent_item_name + '_id'\r
   \r
-  destination_key: () ->\r
+  @destination_key: () ->\r
     @my_class().my_peta().destination_item_name + '_id'\r
   \r
index d967e0a..1943085 100644 (file)
@@ -1,10 +1,9 @@
 class Pettanr.Inspire\r
   \r
-  constructor: (options) ->\r
+  constructor: (@item) ->\r
     _.extend(this, Backbone.Events)\r
-    @item = options.item\r
   \r
-  inspire: () -> \r
+  go: (context, options) -> \r
     @item = @item.with_elements() # retake panel for 'with_elements' mode\r
     @item.fetch({cache: false}).done =>\r
       @item.attributes = @item.replaced_attributes()\r
@@ -12,7 +11,7 @@ class Pettanr.Inspire
       @item.overwrite({})\r
       @set_root()\r
       @set_elements()\r
-      @save()\r
+      @save(context, options)\r
   \r
   set_root: () ->\r
     @root_form = Locmare.Form.factory({\r
@@ -34,14 +33,18 @@ class Pettanr.Inspire
       form.add_elements()\r
       form\r
   \r
-  save: () ->\r
+  save: (context, options) ->\r
     # merge panel and elements\r
     attrs = @root_form.save_data()\r
     delete attrs['id']\r
     _.extend(attrs, @elements_save_data())\r
     # save json data by panel form\r
-    @listenTo(@root_form, 'success', @post_success)\r
-    @listenTo(@root_form, 'fail', @post_fail)\r
+    success = (model, response) ->\r
+      options.success.call(context, model)\r
+    fail = (model, response) ->\r
+      options.fail.call(context, response)\r
+    @listenTo(@root_form, 'success', success)\r
+    @listenTo(@root_form, 'fail', fail)\r
     @root_form.save(attrs)\r
   \r
   elements_save_data: () ->\r
@@ -65,9 +68,3 @@ class Pettanr.Inspire
         attrs[name].push(d)\r
     attrs\r
   \r
-  post_success: (model, response) ->\r
-    @trigger('inspire', model)\r
-  \r
-  post_fail: (model, response) ->\r
-    @trigger('fail', response)\r
-  \r
index df7de31..ff1557e 100644 (file)
@@ -1,18 +1,27 @@
 class Pettanr.View extends Backbone.View\r
   \r
+  render: () ->\r
+    this.$el.html('')\r
+    icon = new Pettanr.View.Minicon(Pettanr.View.Image.icon_loading_file())\r
+    this.$el.html(icon.render().el)\r
+    this\r
+  \r
   @rb: (options = null) ->\r
-    rb = new Tag.RowBreak(options).render().el\r
+    new Tag.RowBreak(options).render().el\r
   \r
   rb: (options = null) ->\r
     @constructor.rb(options)\r
   \r
+  append_rb: (options = null) ->\r
+    this.$el.append(@rb())\r
+  \r
   div: (content, options = {}) ->\r
     options.content = content\r
-    new Tag.Span(options)\r
+    new Tag.Div(options)\r
   \r
   span: (content, options = {}) ->\r
     options.content = content\r
-    new Tag.Div(options)\r
+    new Tag.Span(options)\r
   \r
   @replace_empty: (caption) ->\r
     if Pettanr.is_blank(caption)\r
index 8558a79..dd83880 100644 (file)
@@ -13,7 +13,7 @@ class Pettanr.View.Credit extends Pettanr.View
     this.$el.html('')\r
     if @icon_options\r
       icon = new Pettanr.View.Credit.Icon(@item)\r
-      @listenTo(icon, 'click:icon', @click_icon)\r
+      @listenTo(icon, 'click', @click_icon)\r
       this.$el.append(icon.render().el)\r
     data = new Pettanr.View.Credit.Data(@item, @data_options)\r
     this.$el.append(data.render().el)\r
@@ -33,7 +33,7 @@ class Pettanr.View.Credit.Data extends Pettanr.View
     @credit_api_url = @item.url + '/credit'\r
   \r
   render: () ->\r
-    this.$el.html('')\r
+    super()\r
     if @item.credit_data\r
       @append_credit_data()\r
     else\r
@@ -44,11 +44,12 @@ class Pettanr.View.Credit.Data extends Pettanr.View
     this\r
   \r
   append_credit_data: () ->\r
+    this.$el.html('')\r
     this.$el.append(@item.credit_data)\r
-    @rb()\r
+    @append_rb()\r
   \r
 class Pettanr.View.Credit.Icon extends Pettanr.View\r
-  tagName: 'span'\r
+  tagName: 'div'\r
   className: 'credit-icon'\r
   \r
   constructor: (@item, options) ->\r
index 6f58ac4..33052a5 100644 (file)
@@ -19,7 +19,7 @@ class Pettanr.View.Layout.Sns extends Pettanr.View.Layout.Base
     this.$el.html('')\r
     this.$el.append(@header.render().el)\r
     this.$el.append(@history.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this.$el.append(@body.render().el)\r
     this.$el.append(@footer.render().el)\r
     this\r
index af08756..bc1fe49 100644 (file)
@@ -58,8 +58,15 @@ class Pettanr.View.Show extends Pettanr.View
     @credits = new Pettanr.View.Credits(this, options)\r
     @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
     this.$el.append(@credits.render().el)\r
+    @append_rb()\r
     @credits.push(@panel.licensed_pictures())\r
   \r
+  add_credit: (picture, options = {icon: true}) ->\r
+    credit = new Pettanr.View.Credit(picture, options)\r
+    this.$el.append(credit.render().el)\r
+    @listenTo(credit, 'click:icon', @click_credit_icon)\r
+    @append_rb()\r
+  \r
   click_authored_by: (author) ->\r
     @trigger('http_get', author.show_url())\r
   \r
index 16dba53..fae4ca3 100644 (file)
@@ -1,18 +1,8 @@
 class Pettanr.View.Summary extends Pettanr.View\r
   \r
-  constructor: (options) ->\r
+  constructor: (@item, @context, options) ->\r
     super(options)\r
   \r
   initialize: (options) ->\r
-    @clear()\r
-    @listenTo(this, 'ready', @render)\r
-  \r
-  clear: () ->\r
-    icon = new Pettanr.View.Minicon(Pettanr.View.Image.icon_loading_file())\r
-    this.$el.html(icon.render().el)\r
-    this\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this\r
+    super(options)\r
   \r
index 291ac05..0956877 100644 (file)
@@ -1,33 +1,25 @@
-class Pettanr.View.Summary.Binder extends Pettanr.View\r
+class Pettanr.View.Summary.Binder extends Pettanr.View.Summary\r
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
     @visible_t = options.visible_t\r
     @visible_column_name = options.visible_column_name\r
-    @load()\r
   \r
-  load: () ->\r
+  render: () ->\r
+    super()\r
     @visible = new Tag.Div({\r
       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
     })\r
     @item.get_parent('author', this, {\r
       success: (@author) =>\r
         @author_mini_faced_label = @author.mini_faced_label({\r
-          context: this,\r
+          context: @context,\r
           click: () =>\r
             @trigger('http_get', @author.show_url())\r
         })\r
+        this.$el.html('')\r
+        this.$el.append(@visible.render().el)\r
         this.$el.append(@author_mini_faced_label.render().el)\r
-        @trigger('ready')\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@visible.render().el)\r
-    this.$el.append(@author_mini_faced_label.render().el)\r
     this\r
   \r
-  author_click: () ->\r
-    @trigger('http_get', @author_icon_with_caption.url())\r
-  \r
index 7adf4ed..c5488ad 100644 (file)
@@ -1,76 +1,83 @@
-class Pettanr.View.Summary.Leaf extends Pettanr.View\r
+class Pettanr.View.Summary.Leaf extends Pettanr.View.Summary\r
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
-    @binder = new Pettanr.View.Summary.Leaf.Binder(@item, {})\r
-    @destination = new Pettanr.View.Summary.Leaf.Binder(@item, options.destination_item_name, {})\r
-    @load()\r
+    @binder = new Pettanr.View.Summary.Leaf.Binder(@item, @context)\r
+    @destination = new Pettanr.View.Summary.Leaf.Destination(@item, @context)\r
   \r
-  load: () ->\r
-    @listenTo(this, 'load_binder', @load_destination)\r
-    @listenTo(this, 'load_destination', @ready)\r
-    @load_binder()\r
+  render: () ->\r
+    super()\r
+    this.$el.html('')\r
+    this.$el.append(@binder.render().el)\r
+    this.$el.append(@destination.render().el)\r
+    this\r
   \r
-  ready: () ->\r
-    @trigger('ready')\r
+  http_get: (url) ->\r
+    @trigger('http_get', url)\r
   \r
-  load_binder: () ->\r
+class Pettanr.View.Summary.Leaf.Binder extends Pettanr.View\r
+  tagName: 'span'\r
   \r
-  load_destination: () ->\r
-    @item.get_parent(@destination_item_name, this, {\r
-      success: (@destination) =>\r
-        @destination_icon = @destination.icon_view(true)\r
-        @listenTo(@destination_icon, 'click', @destination_click)\r
-        @destination.get_parent('author', this, {\r
-          success: (@destination_author) =>\r
-            @destination_author_mini_faced_label = @destination_author.mini_faced_label({\r
-              context: this,\r
+  constructor: (@item, @context, options) ->\r
+    @binder_model = @item.my_class().binder_model()\r
+    super(options)\r
+  \r
+  initialize: (options) ->\r
+    super(options)\r
+  \r
+  render: () ->\r
+    super()\r
+    @item.get_parent(@binder_model.item_name(), this, {\r
+      success: (@binder) =>\r
+        @face_button = @binder.mini_face_button({\r
+          context: @context,\r
+          click: () =>\r
+            @trigger('http_get', @binder.show_url())\r
+        })\r
+        @binder.get_parent('author', this, {\r
+          success: (@author) =>\r
+            @author_mini_faced_label = @author.mini_faced_label({\r
+              context: @context,\r
               click: () =>\r
-                @trigger('http_get', @destination_author.show_url())\r
+                @trigger('http_get', @author.show_url())\r
             })\r
-            this.$el.append(@destination_author_mini_faced_label.render().el)\r
-            @trigger('load_destination')\r
+            this.$el.html('')\r
+            this.$el.append(@face_button.render().el)\r
+            this.$el.append(@author_mini_faced_label.render().el)\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@binder_author_mini_faced_label.render().el)\r
-    this.$el.append(@destination_author_mini_faced_label.render().el)\r
     this\r
   \r
-  binder_click: () ->\r
-    @trigger('http_get', @binder_icon.url())\r
-  \r
-  destination_click: () ->\r
-    @trigger('http_get', @destination_icon.url())\r
+class Pettanr.View.Summary.Leaf.Destination extends Pettanr.View\r
+  tagName: 'span'\r
   \r
-  binder_author_click: () ->\r
-    @trigger('http_get', @binder_author_icon_with_caption.url())\r
-  \r
-  destination_author_click: () ->\r
-    @trigger('http_get', @destination_author_icon_with_caption.url())\r
-  \r
-class Pettanr.View.Summary.Leaf.Binder extends Tag.Span\r
-  \r
-  constructor: (@item, @binder_item_name, options) ->\r
+  constructor: (@item, @context, options) ->\r
+    @destination_model = @item.my_class().destination_model()\r
     super(options)\r
-    @binder_model = @item.my_class().binder_model()\r
   \r
   initialize: (options) ->\r
-    @item.get_parent(@binder_model.item_name(), this, {\r
-      success: (@binder) =>\r
-        @face_button = @binder.mini_face_button(true)\r
-        @binder.get_parent('author', this, {\r
+    super(options)\r
+  \r
+  render: () ->\r
+    super()\r
+    @item.get_parent(@destination_model.item_name(), this, {\r
+      success: (@destination) =>\r
+        @face_button = @destination.mini_face_button({\r
+          context: @context,\r
+          click: () =>\r
+            @trigger('http_get', @binder.show_url())\r
+        })\r
+        @destination.get_parent('author', this, {\r
           success: (@author) =>\r
             @author_mini_faced_label = @author.mini_faced_label({\r
-              context: this,\r
+              context: @context,\r
               click: () =>\r
                 @trigger('http_get', @author.show_url())\r
             })\r
+            this.$el.html('')\r
+            this.$el.append(@face_button.render().el)\r
             this.$el.append(@author_mini_faced_label.render().el)\r
-            @trigger('load_binder')\r
         })\r
     })\r
+    this\r
   \r
index c8a97ec..f251a90 100644 (file)
@@ -2,9 +2,9 @@ class Pettanr.Views.Author.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @trigger('ready')\r
   \r
   render: () ->\r
+    super()\r
     this.$el.html('')\r
     this.$el.append('-')\r
     this\r
index c83ab0a..dd089a5 100644 (file)
@@ -2,31 +2,30 @@ class Pettanr.Views.Balloon.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('speech_balloon', this, {\r
       success: (@speech_balloon) =>\r
         @speech_balloon.get_parent('panel', this, {\r
           success: (@panel) =>\r
             @panel_face_button = @panel.mini_face_button({\r
               context: this, \r
-              click: () ->\r
+              click: () =>\r
                 @trigger('http_get', @panel.show_url())\r
             })\r
             @panel.get_parent('author', this, {\r
               success: (@author) =>\r
                 @author_faced_label = @author.mini_faced_label({\r
                   context: this, \r
-                  click: () ->\r
+                  click: () =>\r
                     @trigger('http_get', @author.show_url())\r
-                })\r
-                @trigger('ready')\r
+                    })\r
+                this.$el.html('')\r
+                this.$el.append(@panel_face_button.render().el)\r
+                this.$el.append(@author_faced_label.render().el)\r
             })\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@panel_face_button.render().el)\r
-    this.$el.append(@author_faced_label.render().el)\r
     this\r
   \r
index 0c0c705..105de4e 100644 (file)
@@ -5,6 +5,7 @@ class Pettanr.Views.Folder.Summary extends Pettanr.View.Summary
     @trigger('ready')\r
   \r
   render: () ->\r
+    super()\r
     this.$el.html('')\r
     this.$el.append('-')\r
     this\r
index 4793d03..3462eb5 100644 (file)
@@ -2,28 +2,27 @@ class Pettanr.Views.GroundColor.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('panel', this, {\r
       success: (@panel) =>\r
         @panel_face_button = @panel.mini_face_button({\r
-          context: this\r
-          click: () ->\r
+          context: @context\r
+          click: () =>\r
             @trigger('http_get', @panel.show_url())\r
         })\r
         @panel.get_parent('author', this, {\r
           success: (@author) =>\r
             @author_faced_label = @author.mini_faced_label({\r
               context: this, \r
-              click: () ->\r
+              click: () =>\r
                 @trigger('http_get', @author.show_url())\r
             })\r
-            @trigger('ready')\r
+            this.$el.html('')\r
+            this.$el.append(@panel_face_button.render().el)\r
+            this.$el.append(@author_faced_label.render().el)\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@panel_face_button.render().el)\r
-    this.$el.append(@author_faced_label.render().el)\r
     this\r
   \r
index ff79981..c858b3d 100644 (file)
@@ -2,24 +2,23 @@ class Pettanr.Views.GroundPicture.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('picture', this, {\r
       success: (@picture) =>\r
-        @credit = new Pettanr.View.Credit(@picture, {})\r
+        @credit = new Pettanr.View.Credit(@picture, {icon: false})\r
         @item.get_parent('panel', this, {\r
           success: (@panel) =>\r
             @panel_face_button = @panel.mini_face_button({\r
               context: this, \r
-              click: () ->\r
+              click: () =>\r
                 @trigger('http_get', @panel.show_url())\r
             })\r
-            @trigger('ready')\r
+            this.$el.html('')\r
+            this.$el.append(@credit.render().el)\r
+            this.$el.append(@panel_face_button.render().el)\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@credit.render().el)\r
-    this.$el.append(@panel_face_button.render().el)\r
     this\r
   \r
index 843c93e..7e31579 100644 (file)
@@ -116,8 +116,7 @@ class Pettanr.Views.History.Root extends Pettanr.View
   tagName: 'div'\r
   \r
   initialize: (options) ->\r
-    image = new Pettanr.ImageFile(Pettanr.View.Image.icon_root_file())\r
-    icon = new Pettanr.View.Icon(image)\r
+    icon = new Pettanr.View.Minicon(Pettanr.View.Image.icon_root_file())\r
     @button = new Pettanr.View.Button('/', icon.render().el, {\r
       context: this,\r
       click: () =>\r
index 53140ca..d2c7f6a 100644 (file)
@@ -2,15 +2,14 @@ class Pettanr.Views.License.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('system_picture', this, {\r
       success: (@system_picture) =>\r
-        @img = new Pettanr.View.Icon(@system_picture.symbol_file())\r
-        @trigger('ready')\r
+        this.$el.html('')\r
+        @img = @system_picture.real_picture()\r
+        this.$el.html(@img.render().el)\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.html(@img.render().el)\r
     this\r
   \r
index 2e04f4d..4b2bbca 100644 (file)
@@ -1,46 +1,47 @@
-class Pettanr.Views.OriginalPicture.ShowModule\r
-class Pettanr.Views.OriginalPicture.ShowModule.History extends Pettanr.View\r
+class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show\r
   \r
   initialize: (options) ->\r
-    super(options)\r
-    @item = options.item\r
-    @list = @item.history()\r
+    @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
+    @authored_by = @item.authored_by()\r
+    @listenTo(@header, 'click:pick', @click_pick)\r
+    @listenTo(@authored_by, 'click', @click_authored_by)\r
+    @body = new Pettanr.Views.OriginalPicture.Show.Body(@item, {})\r
+    @history = new Pettanr.Views.OriginalPicture.Show.History(@item, {})\r
+    @listenTo(@history, 'http_get', @http_get)\r
   \r
   render: () ->\r
     this.$el.html('')\r
-    h = new Tag.H2({\r
-      content: I18n.t('original_pictures.show.history')\r
-    })\r
-    this.$el.append(h.render().el)\r
-    @list.fetch().done =>\r
-      _.each @list.models, (picture) =>\r
-        view = picture.history_view()\r
-        @listenTo(view, 'http_get', @http_get)\r
-        this.$el.append(view.render().el)\r
+    this.$el.append(@header.render().el)\r
+    this.$el.append(@authored_by.render().el)\r
+    this.$el.append(@body.render().el)\r
+    this.$el.append(@history.render().el)\r
     this\r
   \r
   http_get: (url) ->\r
     @trigger('http_get', url)\r
   \r
-class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show\r
+  is_pickable: () ->\r
+    false\r
+  \r
+class Pettanr.Views.OriginalPicture.Show.Body extends Pettanr.View\r
+  className: 'op-body'\r
+  \r
+  constructor: (@item, options) ->\r
+    super(options)\r
   \r
   initialize: (options) ->\r
-    @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
-    @authored_by = @item.authored_by()\r
     @img = @item.real_picture()\r
-    @listenTo(@header, 'click:pick', @click_pick)\r
-    @listenTo(@authored_by, 'click', @click_authored_by)\r
     @owner = new Pettanr.View.Show.Footer(@item, this, {\r
       actions: {\r
         select: {\r
-          url: @original_picture.license_url(),\r
+          url: @item.license_url(),\r
           dic_name: 'original_pictures.show.select', \r
           click: () =>\r
             @create_dialog()\r
             @trigger('click:license', @dialog)\r
         }, \r
         replace: {\r
-          url: @original_picture.edit_url(),\r
+          url: @item.edit_url(),\r
           dic_name: 'original_pictures.show.replace', \r
           click: () =>\r
             @trigger('http_get', @item.edit_url())\r
@@ -54,31 +55,17 @@ class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show
         }, \r
       }, \r
     })\r
-    @history = new Pettanr.Views.OriginalPicture.ShowModule.History({item: @item})\r
-    @listenTo(@history, 'http_get', @http_get)\r
+    @summary = @item.summary(this, {})\r
+    @listenTo(@summary, 'http_get', @http_get)\r
   \r
   render: () ->\r
     this.$el.html('')\r
-    this.$el.append(@header.render().el)\r
-    this.$el.append(@authored_by.render().el)\r
     this.$el.append(@img.render().el)\r
-    @item.get_parent('picture', this, {\r
-      success: (@picture) =>\r
-        @credit = new Pettanr.View.Credit(@picture, {\r
-          icon: {\r
-            click: () =>\r
-              @trigger('http_get', @picture.show_url())\r
-          }\r
-        })\r
-        this.$el.append(@credit.render().el)\r
-        this.$el.append(@owner.render().el)\r
-    })\r
-    this.$el.append(@history.render().el)\r
+    this.$el.append(@summary.render().el)\r
+    @append_rb()\r
+    this.$el.append(@owner.render().el)\r
     this\r
   \r
-  http_get: (url) ->\r
-    @trigger('http_get', url)\r
-  \r
   create_dialog: () ->\r
     @dialog = new Editor.PicturePublisher.Dialog({\r
       parent: this\r
@@ -99,9 +86,6 @@ class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show
     @dialog.start(params, null)\r
     @dialog\r
   \r
-  is_pickable: () ->\r
-    false\r
-  \r
   success: (resource_picture) ->\r
     #Pettanr.cache.fix(@item)\r
     @trigger('success', @params, @dialog)\r
@@ -112,3 +96,33 @@ class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show
     #Pettanr.cache.release(@item)\r
     @trigger('click:close', @dialog)\r
   \r
+class Pettanr.Views.OriginalPicture.Show.History extends Pettanr.View\r
+  className: 'op-history'\r
+  \r
+  constructor: (@item, options) ->\r
+    super(options)\r
+  \r
+  initialize: (options) ->\r
+    super(options)\r
+    controller = Manifest.manifest().controllers['original_pictures']\r
+    action = controller.actions['history']\r
+    @list = action.find(id: @item.get('id'))\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    h = new Tag.H2({\r
+      content: I18n.t('original_pictures.show.history')\r
+    })\r
+    this.$el.append(h.render().el)\r
+    @list.open(this, {\r
+      success: (pictures) => \r
+        _.each pictures, (picture) =>\r
+          history = new Pettanr.Views.Picture.History(picture)\r
+          @listenTo(history, 'http_get', @http_get)\r
+          this.$el.append(history.render().el)\r
+    })\r
+    this\r
+  \r
+  http_get: (url) ->\r
+    @trigger('http_get', url)\r
+  \r
index 2979ef0..9a911cc 100644 (file)
@@ -3,33 +3,24 @@ class Pettanr.Views.OriginalPicture.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
-    @load()\r
-  \r
-  load: () ->\r
-    @trigger('ready')\r
   \r
   render: () ->\r
-    this.$el.html('')\r
+    super()\r
     @visible = new Tag.Span({\r
       class_name: 'state',\r
       content: I18n.t('original_pictures.' + @item.state())\r
     })\r
+    this.$el.html('')\r
     this.$el.append(@visible.render().el)\r
     @item.get_child('resource_picture', this, {\r
       success: (@resource_picture) =>\r
         if @resource_picture\r
-          @item.get_parent('picture', this, {\r
+          @resource_picture.get_parent('picture', this, {\r
             success: (@picture) =>\r
-              @credit = new Pettanr.View.Credit(@picture, {icon: true})\r
-              @listenTo(@credit, 'click:icon', @picture_click)\r
+              @credit = new Pettanr.View.Credit(@picture, {icon: false})\r
               this.$el.append(@credit.render().el)\r
+              @append_rb()\r
           })\r
     })\r
-    @rb()\r
     this\r
   \r
-  # in credit\r
-  picture_click: (picture) ->\r
-    @trigger('http_get', picture.show_url())\r
-  \r
index b8bf194..5bc9871 100644 (file)
@@ -2,24 +2,23 @@ class Pettanr.Views.PanelPicture.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('picture', this, {\r
       success: (@picture) =>\r
-        @credit = new Pettanr.View.Credit(@picture, {})\r
+        @credit = new Pettanr.View.Credit(@picture, {icon: false})\r
         @item.get_parent('panel', this, {\r
           success: (@panel) =>\r
-            @panel_face_button =@panel.mini_face_button({\r
+            @panel_face_button = @panel.mini_face_button({\r
               context: this, \r
-              click: () ->\r
+              click: () =>\r
                 @trigger('http_get', @panel.show_url())\r
             })\r
-            @trigger('ready')\r
+            this.$el.html('')\r
+            this.$el.append(@credit.render().el)\r
+            this.$el.append(@panel_face_button.render().el)\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@credit.render().el)\r
-    this.$el.append(@panel_face_button.render().el)\r
     this\r
   \r
index d458d4f..48f79b6 100644 (file)
@@ -112,50 +112,3 @@ class Pettanr.Views.Panel.Body.Edit extends Pettanr.Views.Panel.Body
   element_class: (element) ->\r
     Pettanr.Views[element.singular()].Element.Edit\r
   \r
-class Pettanr.Views.Panel.Footer extends Pettanr.View\r
-  tagName: 'table'\r
-  className: 'no-border'\r
-  \r
-  initialize: (options) ->\r
-    @panel = options.panel\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    @panel.get_parent('author', this, {\r
-      success: (@author) =>\r
-        panel_face_button = @panel.mini_face_button({\r
-          context: this, \r
-          click: () ->\r
-            @trigger('click:panel')\r
-        })\r
-        author_face_button = @author.mini_face_button({\r
-          context: this, \r
-          click: () ->\r
-            @trigger('click:author')\r
-        })\r
-        this.$el.append(panel_face_button.render().el)\r
-        this.$el.append(author_face_button.render().el)\r
-        this.$el.append(\r
-          Pettanr.AppHelper.distance_of_time_in_words_to_now(@panel.get('updated_at'))\r
-        )\r
-        if Pettanr.cache.operators.is_author()\r
-          inspire_button = Pettanr.View.mini_face_button(\r
-            @panel, \r
-            Pettanr.View.Image.icon_inspire_file(), \r
-            {\r
-              context: this, \r
-              click: () =>\r
-                @trigger('click:inspire')\r
-            }\r
-          )\r
-          this.$el.append(inspire_icon.render().el)\r
-        if @panel.is_own()\r
-          edit_button = new Pettanr.View.Button.ItemAction(@panel, 'edit', {\r
-            context: this, \r
-            click: () =>\r
-              @trigger('click:edit')\r
-          })\r
-          this.$el.append(edit_button.render().el)\r
-        })\r
-    this\r
-  \r
index 3c06ee9..34cb406 100644 (file)
@@ -1,52 +1,35 @@
 # panel: panel item\r
 # spot: no opacity element\r
-class Pettanr.Views.Panel.Show extends Pettanr.View\r
+class Pettanr.Views.Panel.Show extends Pettanr.View.Show\r
   \r
-  initialize: (@panel, options) ->\r
+  initialize: (options) ->\r
+    @panel = @item\r
     @spot = options.spot\r
     \r
     @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
+    @authored_by = @item.authored_by()\r
     @body = new Pettanr.Views.Panel.Body({\r
       panel: @panel,\r
       spot: @spot\r
     })\r
-    @footer = new Pettanr.Views.Panel.Footer({\r
-      panel: @panel,\r
+    inspire = new Pettanr.Inspire(@panel, this, )\r
+    @footer = new Pettanr.Views.Panel.Show.Footer(@panel, {\r
+      inspire: inspire\r
     })\r
-    @owner = new Pettanr.Views.Panel.ShowModule.Owner({item: @panel})\r
+    @owner = new Pettanr.View.Show.Footer(@item, this, @default_footer_options())\r
     @listenTo(@header, 'click:pick', @click_pick)\r
-    @listenTo(@footer, 'click:panel', @click_show)\r
-    @listenTo(@footer, 'click:author', @click_author)\r
-    @listenTo(@footer, 'click:edit', @click_edit)\r
-    @listenTo(@footer, 'click:inspire', @click_inspire)\r
-    @listenTo(@owner, 'click:edit', @click_edit)\r
-    @listenTo(@owner, 'click:destroy', @click_destroy)\r
+    @listenTo(@authored_by, 'click', @click_authored_by)\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@header.render().el)\r
+    this.$el.append(@authored_by.render().el)\r
     this.$el.append(@body.render().el)\r
     this.$el.append(@footer.render().el)\r
     @add_credits()\r
-    this.$el.append(@owner.render().el)\r
+    this.$el.append(@owner.render().el) if @item.is_own()\r
     this\r
   \r
-  click_author: () ->\r
-    @trigger('http_get', @panel.author().show_url())\r
-  \r
-  click_edit: () ->\r
-    @trigger('http_get', @panel.edit_url())\r
-  \r
-  click_destroy: () ->\r
-    redirect = (url) =>\r
-      @trigger('http_get', url)\r
-    Pettanr.Proxy.destroy(@panel, {redirect: redirect})\r
-  \r
-  click_inspire: () ->\r
-    inspire = new Pettanr.Inspire({item: @panel})\r
-    @listenTo(inspire, 'inspire', @inspire)\r
-    inspire.inspire()\r
-  \r
   click_pick: () ->\r
     @trigger('pick', @item)\r
   \r
@@ -56,6 +39,35 @@ class Pettanr.Views.Panel.Show extends Pettanr.View
   add_pick: (target_model) ->\r
     @header.add_pick(target_model)\r
   \r
-  inspire: (item) ->\r
-    @trigger('http_get', item.show_url())\r
+class Pettanr.Views.Panel.Show.Footer extends Pettanr.View\r
+  tagName: 'ul'\r
+  \r
+  constructor: (@panel, options) ->\r
+    super(options)\r
+  \r
+  initialize: (options) ->\r
+    @inspire = options.inspire\r
+  \r
+  render: () ->\r
+    super()\r
+    this.$el.html('')\r
+    this.$el.append(\r
+      Pettanr.AppHelper.distance_of_time_in_words_to_now(@panel.get('updated_at'))\r
+    )\r
+    if Pettanr.cache.operators.is_author()\r
+      inspire_button = Pettanr.View.mini_face_button(\r
+        @panel, \r
+        Pettanr.View.Image.icon_inspire_file(), {\r
+          context: this,\r
+          click: () =>\r
+            @inspire.go(@inspire.context, {\r
+              success: (item) ->\r
+                @trigger('http_get', item.show_url())\r
+              fail: (response) ->\r
+                console.log(response)\r
+            })\r
+        }\r
+      )\r
+      this.$el.append(inspire_button.render().el)\r
+    this\r
   \r
index 8153d4a..df70600 100644 (file)
@@ -2,27 +2,26 @@ class Pettanr.Views.Panel.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
     options['visible_t'] = 'panel_publish_items'\r
     options['visible_column_name'] = 'publish'\r
     @visible_t = options.visible_t\r
     @visible_column_name = options.visible_column_name\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('author', this, {\r
       success: (@author) =>\r
         @visible = new Tag.Div({\r
           content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
         })\r
-        @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
-        @listenTo(@author_icon_with_caption, 'click', @author_click)\r
-        @trigger('ready')\r
+        @author_mini_faced_label = @author.mini_faced_label({\r
+          context: @context,\r
+          click: () =>\r
+            @trigger('http_get', @author.show_url())\r
+        })\r
+        this.$el.html('')\r
+        this.$el.append(@visible.render().el)\r
+        this.$el.append(@author_mini_faced_label.render().el)\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@visible.render().el)\r
-    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
-  author_click: () ->\r
-    @trigger('http_get', @author_icon_with_caption.url())\r
-  \r
index 16b6c9a..58e4fc4 100644 (file)
@@ -6,28 +6,29 @@ class Pettanr.Views.Picture.History extends Pettanr.View
   \r
   render: () ->\r
     this.$el.html('')\r
-    r = new Tag.A({\r
-      attr: {href: '/' + @item.show_url()},\r
-      content: @item.get('revision')\r
+    r = new Pettanr.View.Button(@item.show_url(), @item.get('revision'), {\r
+      context: this, \r
+      click: () =>\r
+        @trigger('http_get', @item.show_url())\r
     })\r
-    @listenTo(r, 'click', @click_show)\r
     h = new Tag.H3({\r
       content: Pettanr.AppHelper.t_m('Picture.revision') + ':'\r
     })\r
     d = new Tag.Div({\r
       content: Pettanr.AppHelper.t_m('Picture.created_at') + ':' + @item.get('created_at')\r
     })\r
-    credit = @item.credit_view()\r
-    @listenTo(credit, 'click:icon', @click_icon)\r
     this.$el.append(h.render().el)\r
     h.$el.append(r.render().el)\r
     this.$el.append(d.render().el)\r
-    this.$el.append(credit.render().el)\r
+    @add_credit(@item)\r
     this\r
   \r
-  click_show: () ->\r
+  click_credit_icon: () ->\r
     @trigger('http_get', @item.show_url())\r
   \r
-  click_icon: () ->\r
-    @trigger('http_get', @item.show_url())\r
+  add_credit: (picture, options = {icon: true}) ->\r
+    credit = new Pettanr.View.Credit(picture, options)\r
+    this.$el.append(credit.render().el)\r
+    @listenTo(credit, 'click:icon', @click_credit_icon)\r
+    @append_rb()\r
   \r
index 905d8de..4d3fe3d 100644 (file)
@@ -42,14 +42,8 @@ class Pettanr.Views.ResourcePicture.Show extends Pettanr.View.Show
           }, \r
         })\r
         @item.get_parent('picture', this, {\r
-          success: (@picture) =>\r
-            @credit = new Pettanr.View.Credit(@picture, {\r
-              icon: {\r
-                click: () =>\r
-                  @trigger('http_get', @picture.show_url())\r
-              }\r
-            })\r
-            this.$el.append(@credit.render().el)\r
+          success: (picture) =>\r
+            @add_credit(picture)\r
             this.$el.append(@owner.render().el)\r
         })\r
     })\r
index 5ae01e9..4ffdbb4 100644 (file)
@@ -2,15 +2,14 @@ class Pettanr.Views.ResourcePicture.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('picture', this, {\r
       success: (@picture) =>\r
-        @credit = new Pettanr.View.Credit(@picture, {})\r
-        @trigger('ready')\r
+        @credit = new Pettanr.View.Credit(@picture, {icon: false})\r
+        this.$el.html('')\r
+        this.$el.append(@credit.render().el)\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@credit.render().el)\r
     this\r
   \r
index 87d5625..9ebf743 100644 (file)
@@ -83,9 +83,9 @@ class Pettanr.Views.Scroll.PlayModule.Footer extends Pettanr.View
         this.$el.append(l2.render().el)\r
         if @scroll.is_own()\r
           this.$el.append(@insert_button.render().el)\r
-          @rb()\r
+          @append_rb()\r
           this.$el.append(@move_button.render().el)\r
-          @rb()\r
+          @append_rb()\r
           this.$el.append(@destroy_button.render().el)\r
     })\r
     this\r
@@ -182,7 +182,7 @@ class Pettanr.Views.Scroll.PlayModule.Panel extends Pettanr.View
       @listenTo(@footer, 'click:edit', @click_edit)\r
       @listenTo(@footer, 'click:destroy', @click_destroy)\r
       this.$el.append(@insert_point.clear().el)\r
-      @rb()\r
+      @append_rb()\r
       this.$el.append(body.render().el)\r
       this.$el.append(@footer_switch.render().el)\r
       this.$el.append(@footer.render().el)\r
@@ -473,7 +473,7 @@ class Pettanr.Views.Scroll.PlayModule.Body extends Pettanr.View
       @listenTo(@panels, 'dialog:close', @close_dialog)\r
       @listenTo(@pager, 'page', @continue)\r
       this.$el.append(@panels.render().el)\r
-      @rb()\r
+      @append_rb()\r
       @appender = new Pettanr.Views.Scroll.PlayModule.Append({\r
       })\r
       @listenTo(@appender, 'click', @click_append)\r
@@ -482,7 +482,7 @@ class Pettanr.Views.Scroll.PlayModule.Body extends Pettanr.View
         @appender.enable()\r
       this.$el.append(@pager.render().el)\r
       this.$el.append(credits.render().el)\r
-      @rb()\r
+      @append_rb()\r
       this\r
   \r
   click_credit_icon: (item) ->\r
index ba8d766..763d754 100644 (file)
@@ -104,7 +104,7 @@ class Pettanr.Views.Sheet.PlayModule.Body extends Pettanr.View
     })\r
     this.$el.append(panels.render().el)\r
     this.$el.append(credits.render().el)\r
-    @rb()\r
+    @append_rb()\r
     # paginate(@pager)\r
     this\r
   \r
index cbf9669..9958886 100644 (file)
@@ -28,6 +28,6 @@ class Pettanr.Views.SpeechBalloon.ElementFace extends Pettanr.View
     this.$el.html('')\r
     symbol = new Pettanr.Views.SpeechBalloon.ElementSymbol({element: @element})\r
     this.$el.append(symbol.render().el)\r
-    @rb()\r
+    @append_rb()\r
     this\r
   \r
index 89948a6..a5323c6 100644 (file)
@@ -2,28 +2,27 @@ class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('panel', this, {\r
       success: (@panel) =>\r
         @panel_face_button = @panel.mini_face_button({\r
           context: this, \r
-          click: () ->\r
+          click: () =>\r
             @trigger('http_get', @panel.show_url())\r
         })\r
         @panel.get_parent('author', this, {\r
           success: (@author) =>\r
             @author_faced_label = @author.mini_faced_label({\r
               context: this, \r
-              click: () ->\r
+              click: () =>\r
                 @trigger('http_get', @author.show_url())\r
             })\r
-            @trigger('ready')\r
+            this.$el.html('')\r
+            this.$el.append(@panel_face_button.render().el)\r
+            this.$el.append(@author_faced_label.render().el)\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@panel_face_button.render().el)\r
-    this.$el.append(@author_faced_label.render().el)\r
     this\r
   \r
index aab236a..eb6aa3e 100644 (file)
@@ -2,31 +2,30 @@ class Pettanr.Views.Speech.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('speech_balloon', this, {\r
       success: (@speech_balloon) =>\r
         @speech_balloon.get_parent('panel', this, {\r
           success: (@panel) =>\r
             @panel_face_button = @panel.mini_face_button({\r
               context: this, \r
-              click: () ->\r
+              click: () =>\r
                 @trigger('http_get', @panel.show_url())\r
             })\r
             @panel.get_parent('author', this, {\r
               success: (@author) =>\r
                 @author_faced_label = @author.mini_faced_label({\r
                   context: this, \r
-                  click: () ->\r
+                  click: () =>\r
                     @trigger('http_get', @author.show_url())\r
                 })\r
-                @trigger('ready')\r
+                this.$el.html('')\r
+                this.$el.append(@panel_face_button.render().el)\r
+                this.$el.append(@author_faced_label.render().el)\r
             })\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@panel_face_button.render().el)\r
-    this.$el.append(@author_faced_label.render().el)\r
     this\r
   \r
index 5f20f46..a8ec80c 100644 (file)
@@ -10,7 +10,7 @@ class Pettanr.Views.User.Account extends Pettanr.View
     this.$el.html('')\r
     @logo = new Pettanr.View.Layout.Logo({\r
       context: this, \r
-      click: () ->\r
+      click: () =>\r
         @trigger('http_get', '')\r
     })\r
     this.$el.append(@logo.render().el)\r
index ef01e4c..5c51e4a 100644 (file)
         }, \r
         artist: {\r
         }, \r
+        original_picture: {\r
+        }, \r
         system_picture: {\r
         }, \r
       },\r
       belongs_to: {\r
         original_picture: {\r
         }, \r
+        picture: {\r
+        }, \r
         license_group: {\r
         }, \r
         license: {\r
index 6a610bf..95ee688 100644 (file)
@@ -748,7 +748,7 @@ ul.pagination li {
   float: left;
 }
 
-.credit .credit-icon {
+.credit div {
   float: left;
 }
 
@@ -764,3 +764,11 @@ ul.pagination li {
   float: left;
 }
 
+.op-body {
+  float: left;
+}
+
+.op-history {
+  float: left;
+}
+
index 2b38a27..574bb5a 100644 (file)
@@ -14,11 +14,11 @@ class SpeechBalloonTemplatesController < ApplicationController
   end
   
   def by_panel
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_system_picture
-    filer_list
+    filer_list param: params[:id]
   end
   
   def show_html_format format
index ed9e2d2..b29c187 100644 (file)
         "belongs_to": {\r
           "license": {},\r
           "artist": {},\r
+          "original_picture": {},\r
           "system_picture": {}\r
         },\r
         "has_many": {\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
+          "picture": {},\r
           "license_group": {},\r
           "license": {},\r
           "artist": {},\r