OSDN Git Service

fix summary
authoryasushiito <yas@pen-chan.jp>
Fri, 19 Dec 2014 01:47:23 +0000 (10:47 +0900)
committeryasushiito <yas@pen-chan.jp>
Fri, 19 Dec 2014 01:47:23 +0000 (10:47 +0900)
13 files changed:
app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/face/base.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/face/column.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/face/method.js.coffee
app/assets/javascripts/models/panel_picture.js.coffee
app/assets/javascripts/views/balloons/summary.js.coffee
app/assets/javascripts/views/common.js.coffee
app/assets/javascripts/views/ground_colors/summary.js.coffee
app/assets/javascripts/views/licenses/summary.js.coffee
app/assets/javascripts/views/panel_pictures/element_face.js.coffee
app/assets/javascripts/views/speech_balloons/summary.js.coffee
app/assets/javascripts/views/speeches/summary.js.coffee
app/assets/stylesheets/test.css.scss
app/models/panel_picture.rb

index d7d0f50..7c555c9 100644 (file)
@@ -15,6 +15,11 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemCo
     this\r
   \r
   render: () ->\r
     this\r
   \r
   render: () ->\r
+    if Pettanr.is_blank(@caption())\r
+      empty = new Pettanr.Views.Common.EmptyCaption()\r
+      this.$el.html(empty.render().el)\r
+    else\r
+      this.$el.html(@caption())\r
     this\r
   \r
   filer: () ->\r
     this\r
   \r
   filer: () ->\r
index e148555..a6f815c 100644 (file)
@@ -4,13 +4,9 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemCo
     super(options)\r
     @render()\r
   \r
     super(options)\r
     @render()\r
   \r
-  render: () ->\r
-    if Pettanr.is_blank(@face())\r
-      this.$el.html('empty')\r
-    else\r
-      this.$el.html(@face())\r
-    this\r
-  \r
   face: () ->\r
     @item.escape(@my_manifest.column_name)\r
   \r
   face: () ->\r
     @item.escape(@my_manifest.column_name)\r
   \r
+  caption: () ->\r
+    @face()\r
+  \r
index e1f01a7..6277d79 100644 (file)
@@ -5,13 +5,9 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemCo
     if @item[@method_name()]\r
       @item[@method_name()]()\r
   \r
     if @item[@method_name()]\r
       @item[@method_name()]()\r
   \r
-  render: () ->\r
-    if Pettanr.is_blank(@item.caption_text)\r
-      this.$el.html('empty')\r
-    else\r
-      this.$el.html(@item.caption_text)\r
-    this\r
-  \r
   method_name: () ->\r
     @my_manifest.method_name\r
   \r
   method_name: () ->\r
     @my_manifest.method_name\r
   \r
+  caption: () ->\r
+    @item.caption_text\r
+  \r
index 57ecedc..609d046 100644 (file)
@@ -35,7 +35,11 @@ class Pettanr.PanelPicture extends Peta.Element
     res\r
   \r
   filename: (picture) ->\r
     res\r
   \r
   filename: (picture) ->\r
-    picture.filename() + '?subdir=' + @flip()\r
+    q = if _.isEmpty(@flip())\r
+      ''\r
+    else\r
+      '?subdir=' + @flip()\r
+    picture.filename() + q\r
   \r
   r_url: (picture) ->\r
     '/pictures/' + @filename(picture)\r
   \r
   r_url: (picture) ->\r
     '/pictures/' + @filename(picture)\r
index 087fff9..f594975 100644 (file)
@@ -8,13 +8,17 @@ class Pettanr.Views.Balloon.Summary extends Pettanr.Views.Common.Summary
   load: () ->\r
     @speech_balloon = @item.speech_balloon()\r
     @speech_balloon.fetch({cache: true}).done =>\r
   load: () ->\r
     @speech_balloon = @item.speech_balloon()\r
     @speech_balloon.fetch({cache: true}).done =>\r
-      @panel = @speech_balloon.panel()\r
-      @panel.fetch({cache: true}).done =>\r
-        @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
-        @trigger('ready')\r
+      panel = @speech_balloon.panel()\r
+      panel.fetch({cache: true}).done =>\r
+        @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+        author = panel.author()\r
+        author.fetch({cache: true}).done =>\r
+          @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+          @trigger('ready')\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
+    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
     this\r
   \r
index a283bdf..6e6b1cb 100644 (file)
@@ -17,6 +17,14 @@ class Pettanr.Views.Common.LoadIcon extends Tag.Img
     }\r
     super(opt)\r
 \r
     }\r
     super(opt)\r
 \r
+class Pettanr.Views.Common.EmptyCaption extends Backbone.View\r
+  tagName: 'div'\r
+  className: 'empty'\r
+  \r
+  render: () ->\r
+    this.$el.html('empty')\r
+    this\r
+  \r
 class Pettanr.Views.Common.Icon extends Backbone.View\r
   tagName: 'span'\r
   \r
 class Pettanr.Views.Common.Icon extends Backbone.View\r
   tagName: 'span'\r
   \r
index e0632e2..faee4dd 100644 (file)
@@ -9,10 +9,14 @@ class Pettanr.Views.GroundColor.Summary extends Pettanr.Views.Common.Summary
     panel = @item.panel()\r
     panel.fetch({cache: true}).done =>\r
       @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
     panel = @item.panel()\r
     panel.fetch({cache: true}).done =>\r
       @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
-      @trigger('ready')\r
+      author = panel.author()\r
+      author.fetch({cache: true}).done =>\r
+        @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+        @trigger('ready')\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
+    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
     this\r
   \r
index 09c718a..c3b42f5 100644 (file)
@@ -1,6 +1,7 @@
 class Pettanr.Views.License.Summary extends Pettanr.Views.Common.Summary\r
   \r
   initialize: (options) ->\r
 class Pettanr.Views.License.Summary extends Pettanr.Views.Common.Summary\r
   \r
   initialize: (options) ->\r
+    super(options)\r
     @item = options.item\r
     @load()\r
   \r
     @item = options.item\r
     @load()\r
   \r
index 1776ec2..b6edaf6 100644 (file)
@@ -23,10 +23,14 @@ class Pettanr.Views.PanelPicture.ElementFace extends Backbone.View
     this.$el.html('')\r
     symbol = new Pettanr.Views.PanelPicture.ElementSymbol({element: @element})\r
     this.$el.append(symbol.render().el)\r
     this.$el.html('')\r
     symbol = new Pettanr.Views.PanelPicture.ElementSymbol({element: @element})\r
     this.$el.append(symbol.render().el)\r
-    name = Pettanr.truncate(@element.get('caption'), 15)\r
+    if name = @element.get('caption')\r
+      content = _.escape(Pettanr.truncate(@element.get('caption'), 15))\r
+    else\r
+      empty = new Pettanr.Views.Common.EmptyCaption()\r
+      content = empty.render().el\r
     caption = new Tag.Span({\r
       class_name: 'elements-tab-face-caption', \r
     caption = new Tag.Span({\r
       class_name: 'elements-tab-face-caption', \r
-      content: _.escape(name)\r
+      content: content\r
     })\r
     this.$el.append(caption.render().el)\r
     fe = new Tag.Div({class_name: 'elements-tab-face-end'})\r
     })\r
     this.$el.append(caption.render().el)\r
     fe = new Tag.Div({class_name: 'elements-tab-face-end'})\r
index 3891082..f23d763 100644 (file)
@@ -1,6 +1,7 @@
 class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary\r
   \r
   initialize: (options) ->\r
 class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary\r
   \r
   initialize: (options) ->\r
+    super(options)\r
     @item = options.item\r
     @load()\r
   \r
     @item = options.item\r
     @load()\r
   \r
@@ -8,10 +9,14 @@ class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary
     panel = @item.panel()\r
     panel.fetch({cache: true}).done =>\r
       @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
     panel = @item.panel()\r
     panel.fetch({cache: true}).done =>\r
       @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
-      @trigger('ready')\r
+      author = panel.author()\r
+      author.fetch({cache: true}).done =>\r
+        @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+        @trigger('ready')\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
+    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
     this\r
   \r
index 8c1eccd..d35d201 100644 (file)
@@ -11,10 +11,14 @@ class Pettanr.Views.Speech.Summary extends Pettanr.Views.Common.Summary
       panel = @speech_balloon.panel()\r
       panel.fetch({cache: true}).done =>\r
         @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
       panel = @speech_balloon.panel()\r
       panel.fetch({cache: true}).done =>\r
         @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
-        @trigger('ready')\r
+        author = panel.author()\r
+        author.fetch({cache: true}).done =>\r
+          @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+          @trigger('ready')\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this.$el.append(@panel_icon.render().el)\r
+    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
     this\r
   \r
index 768a1ee..4231d73 100644 (file)
@@ -23,6 +23,10 @@ div.md5 {
   text-align: left;
 }
 
   text-align: left;
 }
 
+div.empty {
+  color:   #aaaaaa;
+}
+
 input.error {
   border-width: 3px;
   border-style:  solid;
 input.error {
   border-width: 3px;
   border-style:  solid;
index 1c9ce40..80cf323 100644 (file)
@@ -67,7 +67,8 @@ class PanelPicture < Peta::Element
   end
   
   def filename
   end
   
   def filename
-    self.picture.filename + '?subdir=' + self.flip
+    q = self.flip.empty? ? '' : '?subdir=' + self.flip
+    self.picture.filename + q
   end
   
   def url
   end
   
   def url