\r
show_html: () -> \r
@trigger('title', @params, @item.get('name'))\r
- show = new Pettanr.Views.Artist.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Artist.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('name'))\r
- show = new Pettanr.Views.Author.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Author.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.Balloon.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Balloon.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.ComicStory.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.ComicStory.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('title'))\r
- show = new Pettanr.Views.Comic.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Comic.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.GroundColor.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.GroundColor.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.GroundPicture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.GroundPicture.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.LicenseGroup.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.LicenseGroup.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.License.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.License.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.OriginalPicture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.OriginalPicture.Show(@item, {\r
})\r
@listenTo(show, 'click:license', @click_license)\r
@listenTo(show, 'success', @publish)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.PanelPicture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.PanelPicture.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
@item.fetch({cache: false}).done =>\r
@item.attributes = @item.replaced_attributes()\r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.Panel.Show({\r
- panel: @item,\r
+ show = new Pettanr.Views.Panel.Show(@item, {\r
spot: null\r
})\r
show.render()\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.Picture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Picture.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.ResourcePicturePicture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.ResourcePicturePicture.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.ResourcePicture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.ResourcePicture.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.ScrollPanel.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.ScrollPanel.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('title'))\r
- show = new Pettanr.Views.Scroll.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Scroll.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.SheetPanel.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.SheetPanel.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.Sheet.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Sheet.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.SpeechBalloonTemplate.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.SpeechBalloonTemplate.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.SpeechBalloon.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.SpeechBalloon.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.Speech.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Speech.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('title'))\r
- show = new Pettanr.Views.Story.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.Story.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.StorySheet.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.StorySheet.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params)\r
- show = new Pettanr.Views.SystemPicture.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.SystemPicture.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
\r
show_html: () -> \r
@trigger('title', @params, @item.get('caption'))\r
- show = new Pettanr.Views.WritingFormat.Show({\r
- item: @item,\r
+ show = new Pettanr.Views.WritingFormat.Show(@item, {\r
})\r
show.render()\r
@trigger('ready', show)\r
spot: null\r
})\r
@dock = new Editor.PanelEditor.Dock({parent: this})\r
- @credits = new Pettanr.Views.Common.Credits(parent: this)\r
+ @credits = new Pettanr.View.Credits(parent: this)\r
\r
@body.on('panel:resize', @panel_resize)\r
@listenTo(@dock, 'http_post', @http_post)\r
this.$el.html(template(args))\r
this\r
\r
- url: () ->\r
- controller = Manifest.manifest().controllers[@item.table_name()]\r
- action = controller.actions['show']\r
- params = {\r
- controller: controller,\r
- action: action,\r
- id: @item.get('id'),\r
- format: 'prof'\r
- }\r
- action.url(params)\r
- \r
- click: () ->\r
- @trigger('click:prof', @url())\r
- \r
filer: () ->\r
@file_item.filer()\r
\r
item_name: () ->\r
@filer().item_name\r
\r
- column_template_dir: () ->\r
- @filer().template_dir + 'item_column-'\r
- \r
- column_template_file_name: () ->\r
- raise "undefined column_template_file_name\n"\r
- \r
- column_template_name: () ->\r
- @column_template_dir() + @column_template_file_name()\r
- \r
- item_template_dir: () ->\r
- @filer().template_dir + 'icon-'\r
- \r
- item_template_file_name: () ->\r
- raise "undefined item_template_file_name\n"\r
- \r
- item_template_name: () ->\r
- @item_template_dir() + @item_template_file_name()\r
- \r
super(options)\r
\r
render: () ->\r
- icon = new Pettanr.Image.SymbolImg({\r
+ prof_button = @item.prof_button({\r
class_name: 'face', \r
- attr: {\r
- src: @icon_file_name()\r
- }\r
+ context: this, \r
+ click: () ->\r
+ @trigger('click:prof', @item.prof_url())\r
})\r
- a = new Tag.A({\r
- attr: {href: '/' + @url()}, \r
- content: icon.render().el\r
- })\r
- this.$el.html(a.render().el)\r
- @listenTo(a, 'click', @click)\r
+ this.$el.html(prof_button.render().el)\r
this\r
\r
- icon_file_name: () ->\r
- '/images/prof.gif'\r
- \r
is_visible: () ->\r
true\r
\r
@face.render()\r
this\r
\r
- ready_symbol: (symbol) ->\r
+ ready_symbol: (symbol_file) ->\r
view = if @has_link()\r
- linked_symbol = new Tag.A({\r
- attr: {href: '/' + @link.url()}, \r
- content: symbol.render().el\r
+ Pettanr.View.face_button(@item, symbol_file, {\r
+ context: this,\r
+ click: () =>\r
+ @trigger('click:symbol')\r
+ @trigger('http_get', @link.url())\r
})\r
- @listenTo(linked_symbol, 'click', @click)\r
- linked_symbol\r
else\r
- symbol\r
+ new Pettanr.View.Icon(symbol_file)\r
this.$el.html(view.render().el)\r
\r
- click: () ->\r
- @trigger('click:symbol')\r
- @trigger('http_get', @link.url())\r
- false\r
- \r
mdl: () ->\r
Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemColumnModule.DefaultModule\r
\r
# not render\r
# get symbol data and send message\r
render: () ->\r
- picture = new Pettanr.Image.SymbolImg({\r
- attr: {\r
- src: @url()\r
- }\r
- })\r
+ picture = @item.face_file()\r
@trigger('ready:symbol', picture)\r
\r
url: () ->\r
@has_picture: () ->\r
true\r
\r
- tmb_opt_img_tag: (picture) ->\r
- new Pettanr.Image.SymbolPicture({\r
- attr: {\r
- src: picture.r_url(), \r
- alt: @escape('caption')\r
- },\r
- picture: picture\r
- })\r
- \r
repeat_text: () ->\r
Pettanr.GroundPicture.repeat_texts()[@get('repeat')]\r
\r
element_face: () ->\r
new Pettanr.Views.GroundPicture.ElementFace({element: this})\r
\r
- picture_file: () ->\r
- new Pettanr.PictureFile(this)\r
- \r
initialize: (attr, options) ->\r
super(attr, options)\r
\r
license_url: () ->\r
'/original_picture_license_groups/new/' + @get('id')\r
\r
- opt_img_tag: () ->\r
- {src: @r_url(), width: @get('width'), height: @get('height')}\r
- \r
- tmb_opt_img_tag: () ->\r
- new Pettanr.Image.SymbolPicture({\r
- attr: {\r
- src: @r_url()\r
- },\r
- picture: this\r
- })\r
- \r
symbol_option: (context, options) ->\r
@retrieve(this, {\r
success: (symbol_item) => \r
- options.success.call(context, symbol_item.to_symbol())\r
+ options.success.call(context, symbol_item.symbol_file())\r
})\r
\r
filer_caption: (context, options) ->\r
r_url: (picture) ->\r
'/pictures/' + @filename(picture)\r
\r
- tmb_opt_img_tag: (picture) ->\r
- new Pettanr.Image.SymbolPicture({\r
- attr: {\r
- src: picture.r_url(), \r
- alt: @escape('caption')\r
- },\r
- picture: picture\r
- })\r
- \r
element_face: () ->\r
new Pettanr.Views.PanelPicture.ElementFace({element: this})\r
\r
- picture_file: () ->\r
- new Pettanr.PictureFile(this, @flip())\r
- \r
initialize: (attr, options) ->\r
super(attr, options)\r
\r
}\r
\r
opt_img_tag: () ->\r
- {src: @r_url(), width: @get('width'), height: @get('height')}\r
+ @picture_file()\r
\r
tmb_opt_img_tag: () ->\r
@symbol_file()\r
history_view: () ->\r
new Pettanr.Views.Picture.History({item: this})\r
\r
- credit_icon_view: () ->\r
- new Pettanr.Views.Picture.CreditIcon({item: this})\r
- \r
- credit_view: (with_icon = true) ->\r
- new Pettanr.Views.Picture.Credit({item: this, with_icon: with_icon})\r
- \r
- picture_file: (subdir = null) ->\r
- new Pettanr.PictureFile(this, subdir)\r
- \r
- fetch: (options) ->\r
- if @id\r
- @credit_icon = @credit_icon_view()\r
- @credit = null\r
- f = (data, status) =>\r
- @credit = data\r
- @trigger('ready')\r
- $.get(@url + '/credit', null, f, 'html')\r
- super(options)\r
- \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
\r
mime_type: () ->\r
'image/' + @get('ext')\r
\r
- full_src: () ->\r
- @src('full')\r
- \r
- src: (subdir = null) ->\r
+ r_url: (subdir = null) ->\r
opt = if _.isEmpty(subdir)\r
''\r
else\r
'?subdir=' + Pettanr.to_s(subdir)\r
'/resource_pictures/' + @filename() + opt\r
\r
- tmb_opt_img_tag: () ->\r
- klass = if true # thumbnail\r
- Pettanr.Image.SymbolPicture\r
- new klass({\r
- attr: {\r
- src: @src()\r
- },\r
- picture: this\r
- })\r
+ symbol_file: () ->\r
+ subdir = if @no_resize()\r
+ 'full'\r
+ else\r
+ null\r
+ super(subdir)\r
\r
- opt_img_tag: () ->\r
- {src: @url('full'), width: @get('width'), height: @get('height')}\r
+ no_resize: () ->\r
+ false\r
\r
alt_name: () ->\r
lgn = Pettanr.to_s(@license().license_group().get('caption'))\r
symbol_option: (context, options) ->\r
@retrieve(this, {\r
success: (symbol_item) => \r
- options.success.call(context, symbol_item.to_symbol())\r
+ options.success.call(context, symbol_item.symbol_file())\r
})\r
\r
- credit_icon_view: () ->\r
- new Pettanr.Views.ResourcePicture.CreditIcon({item: this})\r
- \r
- credit_view: (with_icon = true) ->\r
- new Pettanr.Views.ResourcePicture.Credit({item: this, with_icon: with_icon})\r
- \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
\r
label: (shorten_length) ->\r
@_label('title', shorten_length)\r
\r
+ # item is root, but binder like\r
+ play_url: () ->\r
+ Pettanr.url(@table_name(), 'play', {id: @get('id')})\r
+ \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
\r
r_url: () ->\r
'/system_pictures/' + @filename()\r
\r
- opt_img_tag: () ->\r
- {src: @r_url(), width: @get('width'), height: @get('height')}\r
- \r
- tmb_opt_img_tag: () ->\r
- new Pettanr.Image.SymbolPicture({\r
- attr: {\r
- src: @r_url()\r
- },\r
- picture: this\r
- })\r
- \r
symbol_option: (context, options) ->\r
@retrieve(this, {\r
success: (symbol_item) => \r
- options.success.call(context, symbol_item.to_symbol())\r
+ options.success.call(context, symbol_item.symbol_file())\r
})\r
\r
- picture_file: () ->\r
- new Pettanr.PictureFile(this)\r
- \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
\r
operator = @my_class().operator(operators)\r
return false if not operator\r
@owner_model().get(@my_class().owner_column()) == operator.id\r
-\r
+ \r
+ authored_by: (options) ->\r
+ new Pettanr.View.Show.AuthoredBy(this, options)\r
+ \r
@test: () ->\r
super()\r
console.log(@is_content())\r
symbol_option: (context, options) ->\r
@trace_to('symbol', this, {\r
success: (symbol_item) => \r
- options.success.call(context, symbol_item.to_symbol())\r
+ options.success.call(context, symbol_item.symbol_file())\r
})\r
\r
- to_symbol: () ->\r
- @tmb_opt_img_tag()\r
- \r
- icon_view: (half) ->\r
- new Pettanr.Views[@my_class().singular()].Icon({item: this, half: half})\r
- \r
face_file: () ->\r
new Pettanr.ImageFile('/images/' + @item_name() + '.gif')\r
\r
- symbol_file: () ->\r
- new Pettanr.PictureFile(this)\r
+ # thumbnail size picture\r
+ symbol_file: (subdir) ->\r
+ new Pettanr.PictureFile(this, subdir)\r
+ \r
+ # real size picture\r
+ picture_file: (subdir = null) ->\r
+ new Pettanr.PictureFile(this, subdir)\r
\r
+ real_picture: (subdir = null) ->\r
+ new Pettanr.View.RealIcon(@picture_file(subdir))\r
+ \r
+ # item.face_button({\r
+ # context: this, \r
+ # click: () ->\r
+ # # ...\r
+ # })\r
face_button: (options) ->\r
Pettanr.View.face_button(this, @face_file(), options)\r
\r
new Pettanr.View.FacedLabel(this, options)\r
\r
mini_faced_label: (options) ->\r
- new Pettanr.View.FacedLabel(this, options)\r
+ new Pettanr.View.MiniFacedLabel(this, options)\r
\r
@index_url: () ->\r
Pettanr.url(@table_name(), 'index', {id: null})\r
height: () ->
null
- size: () ->
+ real_size: () ->
[@width(), @height()]
has_size: () ->
@width() and @height()
+ tag_options: () ->
+ {}
+
thumbnail_size: () ->
if @has_size()
Pettanr.View.Image.to_thumbnail_size(@width(), @height())
class Pettanr.PictureFile extends Pettanr.ImageFile
constructor: (@item, subdir = null) ->
- @filename = @item.r_url()
- @filename += ('?subdir=' + subdir) if !_.isEmpty(subdir)
+ @filename = @item.r_url(subdir)
width: () ->
Math.abs(@item.get('width'))
height: () ->
Math.abs(@item.get('height'))
+ tag_options: () ->
+ {}
+
new Tag.Div(options)\r
\r
@face_button: (item, image, options = {}) ->\r
- icon = new Pettanr.View.Icon(image, image.tag_option)\r
+ icon = new Pettanr.View.Icon(image)\r
new Pettanr.View.Button(item.show_url(), icon.render().el, options)\r
\r
@mini_face_button: (item, image, options = {}) ->\r
- icon = new Pettanr.View.Minicon(image, image.tag_option)\r
+ icon = new Pettanr.View.Minicon(image)\r
new Pettanr.View.Button(item.show_url(), icon.render().el, options)\r
\r
@prof_button: (url, options = {}) ->\r
file = Pettanr.View.Image.icon_prof_file()\r
- icon = new Pettanr.View.Icon(file, {})\r
+ icon = new Pettanr.View.Icon(file)\r
new Pettanr.View.Button(url, icon.render().el, options)\r
\r
@mini_prof_button: (url, options = {}) ->\r
file = Pettanr.View.Image.icon_prof_file()\r
- icon = new Pettanr.View.Minicon(file, {})\r
+ icon = new Pettanr.View.Minicon(file)\r
new Pettanr.View.Button(url, icon.render().el, options)\r
\r
class Pettanr.View.Button extends Tag.A\r
\r
- initialize: (@url, @content, options) ->\r
+ constructor: (@url, @content, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
@context = options.context || this\r
@class_name = options.class_name\r
@click_func = options.click\r
- el = if _.isFunction(content)\r
+ el = if _.isFunction(@content)\r
content.call(@context)\r
else\r
- content\r
+ @content\r
@url = '/' + @url if @url[0] != '/'\r
super({\r
attr: {href: @url}, \r
class Pettanr.View.Button.ItemAction extends Pettanr.View.Button\r
\r
- initialize: (item, action_name, dic_name, options) ->\r
+ constructor: (@item, action_name, dic_name, options) ->\r
if !options\r
options = dic_name\r
- dic_name = I18n.t('link.' + action_name)\r
- url = item[action_name + '_url']()\r
- super(url, dic_name, options)\r
+ dic_name = options.dic_name || 'link.' + action_name\r
+ url = options.url || @item[action_name + '_url']()\r
+ super(url, I18n.t(dic_name), options)\r
+ \r
+ initialize: (options) ->\r
+ super(options)\r
\r
class Pettanr.View.ShortableCaption extends Pettanr.View.Button\r
\r
- initialize: (item, column_name, options) ->\r
- content = item.short(column_name, options.length)\r
- super(item.show_url(), content, options)\r
+ constructor: (@item, @column_name, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ content = @item.short(@column_name, options.length)\r
+ super(@item.show_url(), content, options)\r
\r
--- /dev/null
+class Pettanr.View.Credit extends Pettanr.View\r
+ tagName: 'div'\r
+ className: 'credit'\r
+ \r
+ constructor: (@item, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options = {icon: true}) ->\r
+ @icon_options = options.icon\r
+ @data_options = options.data\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ if @icon_options\r
+ icon = new Pettanr.View.Credit.Icon(@item)\r
+ @listenTo(icon, 'click:icon', @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
+ this\r
+ \r
+ click_icon: () ->\r
+ @trigger('click:icon', @item)\r
+ \r
+class Pettanr.View.Credit.Data extends Pettanr.View\r
+ tagName: 'div'\r
+ className: 'credit-data'\r
+ \r
+ constructor: (@item, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ @credit_api_url = @item.url + '/credit'\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ if @item.credit_data\r
+ @append_credit_data()\r
+ else\r
+ f = (data, status) =>\r
+ @item.credit_data = data\r
+ @append_credit_data()\r
+ $.get(@credit_api_url, null, f, 'html')\r
+ this\r
+ \r
+ append_credit_data: () ->\r
+ this.$el.append(@item.credit_data)\r
+ @rb()\r
+ \r
+class Pettanr.View.Credit.Icon extends Pettanr.View\r
+ tagName: 'span'\r
+ className: 'credit-icon'\r
+ \r
+ constructor: (@item, options) ->\r
+ super(options)\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ symbol_button = @item.symbol_button({\r
+ context: this,\r
+ click: () =>\r
+ @trigger('click')\r
+ })\r
+ this.$el.append(symbol_button.render().el)\r
+ this\r
+ \r
--- /dev/null
+class Pettanr.View.Credits extends Pettanr.View\r
+ tagName: 'div'\r
+ className: 'credits'\r
+ \r
+ constructor: (@parent, options) ->\r
+ super(options)\r
+ \r
+ initialize: (@options) ->\r
+ @licensed_pictures = {}\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ this\r
+ \r
+ push: (retrievers) ->\r
+ _.each retrievers, (retriever, pid) =>\r
+ Pettanr.Picture.retrieve(pid, this, {\r
+ success: (picture) =>\r
+ pid = picture.get('id')\r
+ return if @licensed_pictures[pid]\r
+ @licensed_pictures[pid] = picture\r
+ credit = new Pettanr.View.Credit(picture, @options)\r
+ @listenTo(credit, 'click:icon', @click_credit_icon)\r
+ this.$el.append(credit.render().el)\r
+ })\r
+ \r
+ click_credit_icon: (item) ->\r
+ @trigger('click:credit:icon', item)\r
+ \r
class Pettanr.View.FacedLabel extends Pettanr.View\r
tagName: 'span'\r
\r
- initialize: (@item, options) ->\r
- @face_button_method_name ||= 'face_button'\r
- @face_button = @item[@face_button_method_name](options)\r
+ constructor: (@item, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ @face_button = @item[@face_button_method_name()](options)\r
@label_button = @item.label_button(options)\r
\r
render: () ->\r
this.$el.append(@label_button.render().el)\r
this\r
\r
-class Pettanr.View.FacedLabel extends Pettanr.View.FacedLabel\r
+ face_button_method_name: () ->\r
+ 'face_button'\r
+ \r
+class Pettanr.View.MiniFacedLabel extends Pettanr.View.FacedLabel\r
\r
- initialize: (@item, options) ->\r
- @face_button_method_name = 'mini_face_button'\r
- super(@item, options)\r
+ face_button_method_name: () ->\r
+ 'mini_face_button'\r
\r
# image: picture item or image file\r
class Pettanr.View.Icon extends Tag.Img\r
\r
- initialize: (@image, options = {}) ->\r
+ constructor: (@image, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ options ||= @image.tag_options()\r
attr = {}\r
attr['src'] = @image.src()\r
size = @get_size()\r
\r
class Pettanr.View.Minicon extends Pettanr.View.Icon\r
\r
- initialize: (@image, options = {}) ->\r
- super(@image, options)\r
- \r
get_size: () ->\r
@image.minicon_size()\r
\r
+class Pettanr.View.RealIcon extends Pettanr.View.Icon\r
+ \r
+ get_size: () ->\r
+ @image.real_size()\r
+ \r
class Pettanr.View.Show extends Pettanr.View\r
+ tagName: 'div'\r
+ className: 'show'\r
+ \r
+ constructor: (@item, options) ->\r
+ super(options)\r
+ \r
+ default_header_options: () ->\r
+ {\r
+ face: {\r
+ click: () =>\r
+ @trigger('http_get', @item.show_url())\r
+ },\r
+ label: {\r
+ click: () =>\r
+ @trigger('http_get', @item.show_url())\r
+ },\r
+ prof: {\r
+ click: () =>\r
+ @trigger('http_get', @item.prof_url())\r
+ },\r
+ }\r
+ \r
+ binder_header_options: () ->\r
+ {\r
+ face: {\r
+ click: () =>\r
+ @trigger('http_get', @item.show_url())\r
+ },\r
+ label: {\r
+ url: @item.play_url(),\r
+ click: () =>\r
+ @trigger('http_get', @item.play_url())\r
+ },\r
+ prof: {\r
+ click: () =>\r
+ @trigger('http_get', @item.prof_url())\r
+ },\r
+ }\r
+ \r
+ default_footer_options: () ->\r
+ {\r
+ actions: {\r
+ edit: {\r
+ click: () =>\r
+ @trigger('http_get', @item.edit_url())\r
+ }, \r
+ destroy: {\r
+ click: () =>\r
+ redirect = (url) =>\r
+ @trigger('http_get', url)\r
+ Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
+ }, \r
+ }, \r
+ }\r
+ \r
+ add_credits: (options = {icon: true}) ->\r
+ @credits = new Pettanr.View.Credits(this, options)\r
+ @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
+ this.$el.append(@credits.render().el)\r
+ @credits.push(@panel.licensed_pictures())\r
+ \r
+ click_authored_by: (author) ->\r
+ @trigger('http_get', author.show_url())\r
+ \r
+ click_credit_icon: (item) ->\r
+ @trigger('http_get', item.show_url())\r
+ \r
class Pettanr.View.Show.Footer extends Pettanr.View\r
tagName: 'div'\r
\r
- initialize: (options) ->\r
+ constructor: (@item, @context, options) ->\r
super(options)\r
- @item = options.item\r
+ \r
+ initialize: (options = {}) ->\r
@header = options.header || new Tag.H3({\r
class_name: 'owner-header',\r
content: I18n.t('editor')\r
})\r
- @footer = options.footer || new Pettanr.View.Show.Footer.Footer(@item)\r
- @listenTo(@footer, 'click:edit', @click_edit)\r
- @listenTo(@footer, 'click:destroy', @click_destroy)\r
+ @footer = options.footer || new Pettanr.View.Show.Footer.Footer(\r
+ @item, @context, options.actions\r
+ )\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@footer.render().el)\r
this\r
\r
- click_edit: () ->\r
- @trigger('click:footer:edit')\r
- @trigger('click:edit')\r
- \r
- click_destroy: () ->\r
- @trigger('click:footer:destroy')\r
- @trigger('click:destroy')\r
- \r
+#\r
+# new Footer.Footer(item, this, {\r
+# edit: {\r
+# click: () =>\r
+# ...\r
+# }\r
+# })\r
+#\r
+#\r
+# new Footer.Footer(null, this, {\r
+# edit: {\r
+# item: item1,\r
+# dic_name: 'translation.key',\r
+# click: () =>\r
+# ...\r
+# }\r
+# })\r
class Pettanr.View.Show.Footer.Footer extends Pettanr.View\r
tagName: 'div'\r
className: 'show-owner-footer'\r
\r
- initialize: (item, options) ->\r
+ constructor: (@item, @context, options) ->\r
super(options)\r
- @edit = new Pettanr.View.Button.ItemAction(\r
- item, 'edit', {\r
- context: this,\r
- click: () =>\r
- @trigger('click:edit')\r
- }\r
- )\r
- @destroy = new Pettanr.View.Button.ItemAction(\r
- item, 'destroy', {\r
- context: this,\r
- click: () =>\r
- @trigger('click:destroy')\r
- }\r
- )\r
+ \r
+ initialize: (options) ->\r
+ @buttons = []\r
+ _.each options, (setting, action) =>\r
+ setting.context ||= @context\r
+ i = @item || setting.item\r
+ @buttons.push(new Pettanr.View.Button.ItemAction(i, action, setting))\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(@edit.render().el)\r
- this.$el.append(@destroy.render().el)\r
+ _.each @buttons, (button) =>\r
+ this.$el.append(button.render().el)\r
this\r
\r
tagName: 'h1'\r
className: 'show-header'\r
\r
- initialize: (@item, options) ->\r
+ constructor: (@item, @context, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
@face_options = options.face\r
@label_options = options.label\r
@prof_options = options.prof\r
\r
+ @face_options.context ||= @context\r
+ @face_options.class_name ||= 'face'\r
+ @face_options.click ||= () =>\r
+ @trigger('click:face')\r
+ \r
+ @label_options.context ||= @context\r
+ @label_options.class_name ||= 'label'\r
+ @label_options.click ||= () =>\r
+ @trigger('click:label')\r
+ \r
+ @prof_options.context ||= @context\r
+ @prof_options.class_name ||= 'prof'\r
+ @prof_options.click ||= () =>\r
+ @trigger('click:prof')\r
+ \r
@pick = null\r
- @face_button = @item.mini_face_button({\r
- context: this,\r
- class_name: 'icon',\r
- click: () =>\r
- @trigger('click:icon')\r
- })\r
- @label_button = @item.label_button({\r
- url: @label_options.url,\r
- context: this,\r
- class_name: 'caption',\r
- click: () =>\r
- @trigger('click:caption')\r
- })\r
- @prof_button = @item.mini_prof_button({\r
- context: this,\r
- class_name: 'prof',\r
- click: () =>\r
- @trigger('click:prof')\r
- })\r
+ @face_button = @item.mini_face_button(@face_options)\r
+ @label_button = @item.label_button(@label_options)\r
+ @prof_button = @item.mini_prof_button(@prof_options)\r
\r
render: () ->\r
this.$el.html('')\r
class Pettanr.View.Show.AuthoredBy extends Pettanr.View\r
tagName: 'div'\r
\r
- initialize: (options) ->\r
- @item = options.item\r
- @item.get_parent(@item.my_class().owner_type(), this, {\r
- success: (author) => # author or artist\r
- @linked_author = new Pettanr.View.ShortableCaption(author, 'name', {\r
- click: () ->\r
- @trigger('click:author')\r
- })\r
- @listenTo(@linked_author, 'click', @click)\r
- @render()\r
- })\r
+ constructor: (@content, options) ->\r
+ super(options)\r
+ \r
+ initialize: (@options = {}) ->\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(Pettanr.AppHelper.t_a(@item.item_name(), 'author_id'))\r
- this.$el.append(@linked_author.render().el)\r
+ author_item_name = @content.my_class().owner_type()\r
+ @content.get_parent(author_item_name, this, {\r
+ success: (author) => # author or artist\r
+ label_button = author.label_button({\r
+ context: this,\r
+ click: () =>\r
+ @trigger('click', author)\r
+ })\r
+ this.$el.append(Pettanr.AppHelper.t_a(@content.item_name(), @content.my_class().owner_column()))\r
+ this.$el.append(label_button.render().el)\r
+ })\r
this\r
\r
- \r
--- /dev/null
+class Pettanr.View.Summary extends Pettanr.View\r
+ \r
+ constructor: (options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ @clear()\r
+ @listenTo(this, 'ready', @render)\r
+ \r
+ clear: () ->\r
+ icon = new Pettanr.Views.Common.LoadIcon()\r
+ this.$el.html(icon.render().el)\r
+ this\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ this\r
+ \r
--- /dev/null
+class Pettanr.View.Summary.Binder extends Pettanr.View\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
+ @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_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
+ @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @trigger('ready')\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
--- /dev/null
+class Pettanr.View.Summary.Leaf extends Pettanr.View\r
+ \r
+ initialize: (options) ->\r
+ super(options)\r
+ @item = options.item\r
+ @binder_item_name = options.binder_item_name\r
+ @destination_item_name = options.destination_item_name\r
+ @binder_view = new Tag.Span({})\r
+ @destination_view = new Tag.Span({})\r
+ @load()\r
+ \r
+ load: () ->\r
+ @listenTo(this, 'load_binder', @load_destination)\r
+ @listenTo(this, 'load_destination', @ready)\r
+ @load_binder()\r
+ \r
+ ready: () ->\r
+ @trigger('ready')\r
+ \r
+ load_binder: () ->\r
+ @item.get_parent(@binder_item_name, this, {\r
+ success: (@binder) =>\r
+ @binder_icon = @binder.icon_view(true)\r
+ @listenTo(@binder_icon, 'click', @binder_click)\r
+ @binder.get_parent('author', this, {\r
+ success: (@binder_author) =>\r
+ @binder_author_icon_with_caption = @binder_author.icon_with_caption_view(true, 'name', 12)\r
+ @listenTo(@binder_author_icon_with_caption, 'click', @binder_author_click)\r
+ @binder_view.$el.append(@binder_icon.render().el)\r
+ @binder_view.$el.append(@binder_author_icon_with_caption.render().el)\r
+ @trigger('load_binder')\r
+ })\r
+ })\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_icon_with_caption = @destination_author.icon_with_caption_view(true, 'name', 12)\r
+ @listenTo(@destination_author_icon_with_caption, 'click', @destination_author_click)\r
+ @destination_view.$el.append(@destination_icon.render().el)\r
+ @destination_view.$el.append(@destination_author_icon_with_caption.render().el)\r
+ @trigger('load_destination')\r
+ })\r
+ })\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ this.$el.append(@binder_view.render().el)\r
+ this.$el.append(@destination_view.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
+ \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
http_get: (url) ->\r
@trigger('http_get', url)\r
\r
-class Pettanr.Views.Artist.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.Artist.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- @item = options.item\r
- @header = new Pettanr.Views.Artist.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('name'), \r
- icon_url: @item.show_url(),\r
- caption_url: @item.show_url(),\r
- prof_url: @item.prof_url()\r
- })\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
@body = new Pettanr.Views.Artist.ShowModule.Body({\r
item: @item, \r
})\r
-class Pettanr.Views.Artist.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Artist.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.Author.ShowModule\r
-class Pettanr.Views.Author.ShowModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
+class Pettanr.Views.Author.ShowModule extends Pettanr.View.Show\r
class Pettanr.Views.Author.ShowModule.Scrolls extends Pettanr.View\r
\r
initialize: (options) ->\r
super(options)\r
@item = options.item\r
@panels_body = new Pettanr.Views.Author.ShowModule.PanelsBody({item: @item})\r
- @credits = new Pettanr.Views.Common.Credits({parent: this})\r
+ @credits = new Pettanr.View.Credits({parent: this})\r
\r
render: () ->\r
@listenTo(@panels_body, 'ready', @ready)\r
http_get: (url) ->\r
@trigger('http_get', url)\r
\r
-class Pettanr.Views.Author.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.Author.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- @item = options.item\r
- @header = new Pettanr.Views.Author.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('name'), \r
- icon_url: @item.show_url(),\r
- caption_url: @item.show_url(),\r
- prof_url: @item.prof_url()\r
- })\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
@body = new Pettanr.Views.Author.ShowModule.Body({\r
item: @item, \r
})\r
-class Pettanr.Views.Author.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Author.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.Balloon.ShowModule\r
-class Pettanr.Views.Balloon.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.Balloon.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
\r
-class Pettanr.Views.Balloon.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = icon_url\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Balloon.ShowModule.Header({\r
- item: @item, \r
- caption: '', \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @listenTo(this, 'ready', @ready)\r
+ render: () ->\r
+ this.$el.html('')\r
@item.get_parent('speech_balloon', this, {\r
success: (@speech_balloon) =>\r
@speech_balloon.get_parent('panel', this, {\r
@panel = item.with_elements()\r
@panel.fetch().done =>\r
@panel.attributes = @panel.replaced_attributes()\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @authored_by = @panel.authored_by()\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @item\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
- @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
- @trigger('ready')\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
+ this.$el.append(@header.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
+ this.$el.append(@body.render().el)\r
+ @add_credits()\r
})\r
})\r
- \r
- render: () ->\r
- this.$el.html('')\r
this\r
\r
- ready: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
- this.$el.append(@body.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
- \r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.Balloon.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Balloon.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.ComicStory.Summary extends Pettanr.Views.Common.Leaf.Summary\r
+class Pettanr.Views.ComicStory.Summary extends Pettanr.View.Summary.Leaf\r
\r
initialize: (options) ->\r
options['binder_item_name'] = 'comic'\r
-class Pettanr.Views.Comic.ShowModule\r
-class Pettanr.Views.Comic.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.Comic.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Comic.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Comic.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = Pettanr.url(@item.table_name(), 'play', {id: @item.get('id')})\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Scroll.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('title'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @item})\r
- @owner = new Pettanr.Views.Comic.ShowModule.Owner({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
+ @owner = new Pettanr.View.Show.Footer(@item, this, @default_footer_options())\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\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(@author.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@owner.render().el) if @item.is_own()\r
this\r
\r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_edit: () ->\r
- @trigger('http_get', @item.edit_url())\r
- \r
- click_destroy: () ->\r
- redirect = (url) =>\r
- @trigger('http_get', url)\r
- Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.Comic.Summary extends Pettanr.Views.Common.Binder.Summary\r
+class Pettanr.Views.Comic.Summary extends Pettanr.View.Summary.Binder\r
\r
initialize: (options) ->\r
options['visible_t'] = 'comic_visible_items'\r
-class Pettanr.Views.Folder.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Folder.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.GroundColor.ShowModule\r
-class Pettanr.Views.GroundColor.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.GroundColor.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
\r
-class Pettanr.Views.GroundColor.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = icon_url\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.GroundColor.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('caption'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @listenTo(this, 'ready', @ready)\r
+ render: () ->\r
+ this.$el.html('')\r
@item.get_parent('panel', this, {\r
success: (item) =>\r
@panel = item.with_elements()\r
@panel.fetch().done =>\r
@panel.attributes = @panel.replaced_attributes()\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @authored_by = @panel.authored_by()\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @item\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
- @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
- @trigger('ready')\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
+ this.$el.append(@header.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
+ this.$el.append(@body.render().el)\r
+ @add_credits()\r
})\r
- \r
- render: () ->\r
- this.$el.html('')\r
this\r
\r
- ready: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
- this.$el.append(@body.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
- \r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.GroundColor.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.GroundColor.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
top: '0px', \r
left: '0px',\r
'z-index': @element.get('z'), \r
- 'background-image': 'url(' + @picture.picture_file.src() + ')', \r
+ 'background-image': 'url(' + @picture.picture_file().src() + ')', \r
'background-repeat': @element.repeat_text(), \r
'background-position': Pettanr.to_s(@element.get('x')) + 'px ' + Pettanr.to_s(@element.get('y')) + 'px'\r
}\r
-class Pettanr.Views.GroundPicture.ShowModule\r
-class Pettanr.Views.GroundPicture.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.GroundPicture.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
\r
-class Pettanr.Views.GroundPicture.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = icon_url\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.GroundPicture.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('caption'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @listenTo(this, 'ready', @ready)\r
+ render: () ->\r
+ this.$el.html('')\r
@item.get_parent('panel', this, {\r
success: (item) =>\r
@panel = item.with_elements()\r
@panel.fetch().done =>\r
@panel.attributes = @panel.replaced_attributes()\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @authored_by = @panel.authored_by()\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @item\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
- @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
- @trigger('ready')\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
+ this.$el.append(@header.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
+ this.$el.append(@body.render().el)\r
+ @add_credits()\r
})\r
- \r
- render: () ->\r
- this.$el.html('')\r
this\r
\r
- ready: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
- this.$el.append(@body.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
- \r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.GroundPicture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.GroundPicture.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
@item = options.item\r
@item.get_parent('picture', this, {\r
success: (@picture) =>\r
- @credit = @picture.credit_view(false)\r
+ @credit = new Pettanr.View.Credit(@picture, {})\r
@item.get_parent('panel', this, {\r
success: (@panel) =>\r
@panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
-class Pettanr.Views.LicenseGroup.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.LicenseGroup.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
\r
render: () ->\r
this.$el.html('')\r
+ this.$el.append(@header.render().el)\r
this\r
\r
-class Pettanr.Views.LicenseGroup.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.LicenseGroup.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.License.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.License.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
\r
render: () ->\r
this.$el.html('')\r
+ this.$el.append(@header.render().el)\r
this\r
\r
-class Pettanr.Views.License.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.License.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
@item = options.item\r
@item.get_parent('system_picture', this, {\r
success: (@system_picture) =>\r
- @img = new Tag.Img({\r
- attr: {\r
- src: @system_picture.src()\r
- }\r
- })\r
+ @img = new Pettanr.View.Icon(@system_picture.symbol_file())\r
@trigger('ready')\r
})\r
\r
class Pettanr.Views.OriginalPicture.ShowModule\r
-class Pettanr.Views.OriginalPicture.ShowModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.OriginalPicture.ShowModule.LinkedLicenseButton extends Tag.A\r
\r
initialize: (options) ->\r
tagName: 'div'\r
className: 'show-owner-footer'\r
\r
- initialize: (options) ->\r
- super(options)\r
- @item = options.item\r
+ initialize: (@item, options) ->\r
@license = new Pettanr.Views.OriginalPicture.ShowModule.LinkedLicenseButton({item: @item})\r
@edit = new Pettanr.Views.OriginalPicture.ShowModule.LinkedReplaceButton({item: @item})\r
@destroy = new Pettanr.Views.OriginalPicture.ShowModule.LinkedDropButton({item: @item})\r
http_get: (url) ->\r
@trigger('http_get', url)\r
\r
-class Pettanr.Views.OriginalPicture.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- @item = options.item\r
- @header = new Pettanr.Views.OriginalPicture.ShowModule.Header({\r
- item: @item, \r
- icon_url: @item.show_url(),\r
- prof_url: @item.prof_url()\r
- })\r
- @artist = new Pettanr.Views.Show.HeaderArtist({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
@img = new Pettanr.Views.OriginalPicture.Img({item: @item})\r
- @owner = new Pettanr.Views.OriginalPicture.ShowModule.Owner({item: @item})\r
+ @owner = new Pettanr.View.Show.Footer(@item, this, {\r
+ actions: {\r
+ license: {\r
+ dic_name: 'original_pictures.show.select', \r
+ click: () =>\r
+ @create_dialog()\r
+ @trigger('click:license', @dialog)\r
+ }, \r
+ edit: {\r
+ dic_name: 'original_pictures.show.replace', \r
+ click: () =>\r
+ @trigger('http_get', @item.edit_url())\r
+ }, \r
+ destroy: {\r
+ click: () =>\r
+ redirect = (url) =>\r
+ @trigger('http_get', url)\r
+ Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
+ }, \r
+ }, \r
+ })\r
@history = new Pettanr.Views.OriginalPicture.ShowModule.History({item: @item})\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@artist, 'click:artist', @click_artist)\r
- @listenTo(@owner, 'click:license', @click_license)\r
- @listenTo(@owner, 'click:edit', @click_edit)\r
- @listenTo(@owner, 'click:destroy', @click_destroy)\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
@listenTo(@history, 'http_get', @http_get)\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@header.render().el)\r
- this.$el.append(@artist.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@img.render().el)\r
this.$el.append(@owner.render().el)\r
this.$el.append(@history.render().el)\r
this\r
\r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_artist: () ->\r
- @trigger('http_get', @item.artist().show_url())\r
- \r
click_license: () ->\r
@create_dialog()\r
@trigger('click:license', @dialog)\r
-class Pettanr.Views.OriginalPicture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.OriginalPicture.Summary extends Pettanr.View.Summary\r
className: 'op-smy'\r
\r
initialize: (options) ->\r
@item.get_child('resource_picture', this, {\r
success: (@resource_picture) =>\r
if @resource_picture\r
- @credit = @resource_picture.credit_view(true)\r
- @listenTo(@credit, 'click:icon', @resource_picture_click)\r
- this.$el.append(@credit.render().el)\r
+ @item.get_parent('picture', this, {\r
+ success: (@picture) =>\r
+ @credit = new Pettanr.View.Credit(@picture, {icon: true})\r
+ @listenTo(@credit, 'click:icon', @picture_click)\r
+ this.$el.append(@credit.render().el)\r
+ })\r
})\r
@rb()\r
this\r
\r
# in credit\r
- resource_picture_click: (resource_picture) ->\r
- @trigger('http_get', resource_picture.show_url())\r
+ picture_click: (picture) ->\r
+ @trigger('http_get', picture.show_url())\r
\r
@element.merge_opacity(style, opacity)\r
{\r
vPicture: @element.get('id'), \r
- src: @picture.picture_file(@element.flip()).src(@picture), \r
+ src: @picture.picture_file(@element.flip()).src(), \r
width: Pettanr.to_s(Math.abs(@element.get('width'))) + 'px', \r
height: Pettanr.to_s(Math.abs(@element.get('height'))) + 'px', \r
alt: @element.get('caption'), \r
-class Pettanr.Views.PanelPicture.ShowModule\r
-class Pettanr.Views.PanelPicture.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.PanelPicture.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
\r
-class Pettanr.Views.PanelPicture.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = icon_url\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.PanelPicture.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('caption'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @listenTo(this, 'ready', @ready)\r
+ render: () ->\r
+ this.$el.html('')\r
@item.get_parent('panel', this, {\r
success: (item) =>\r
@panel = item.with_elements()\r
@panel.fetch().done =>\r
@panel.attributes = @panel.replaced_attributes()\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @authored_by = @panel.authored_by()\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @item\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
- @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
- @trigger('ready')\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
+ this.$el.append(@header.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
+ this.$el.append(@body.render().el)\r
+ @add_credits()\r
})\r
- \r
- render: () ->\r
- this.$el.html('')\r
this\r
\r
- ready: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
- this.$el.append(@body.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
- \r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.PanelPicture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.PanelPicture.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
@item = options.item\r
@item.get_parent('picture', this, {\r
success: (@picture) =>\r
- @credit = @picture.credit_view(false)\r
+ @credit = new Pettanr.View.Credit(@picture, {})\r
@item.get_parent('panel', this, {\r
success: (@panel) =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @listenTo(@panel_icon, 'click', @panel_click)\r
+ @mini_face_button =@panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @panel.show_url())\r
+ })\r
@trigger('ready')\r
})\r
})\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@credit.render().el)\r
- this.$el.append(@panel_icon.render().el)\r
+ this.$el.append(@mini_face_button.render().el)\r
this\r
\r
- panel_click: () ->\r
- @trigger('http_get', @panel_icon.url())\r
- \r
-class Pettanr.Views.Panel.ShowModule\r
-class Pettanr.Views.Panel.ShowModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Panel.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
# panel: panel item\r
# spot: no opacity element\r
class Pettanr.Views.Panel.Show extends Pettanr.View\r
- tagName: 'div'\r
\r
- initialize: (options) ->\r
- @panel = options.panel\r
+ initialize: (@panel, options) ->\r
@spot = options.spot\r
\r
- @header = new Pettanr.Views.Panel.ShowModule.Header({\r
- item: @panel, \r
- caption: @panel.get('caption'), \r
- icon_url: @panel.show_url(),\r
- caption_url: @panel.show_url(),\r
- prof_url: @panel.prof_url()\r
- })\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @spot\r
@footer = new Pettanr.Views.Panel.Footer({\r
panel: @panel,\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
@owner = new Pettanr.Views.Panel.ShowModule.Owner({item: @panel})\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\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(@credits, 'click:credit:icon', @click_credit_icon)\r
@listenTo(@owner, 'click:edit', @click_edit)\r
@listenTo(@owner, 'click:destroy', @click_destroy)\r
\r
this.$el.append(@header.render().el)\r
this.$el.append(@body.render().el)\r
this.$el.append(@footer.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
+ @add_credits()\r
this.$el.append(@owner.render().el)\r
this\r
\r
- click_show: () ->\r
- @trigger('http_get', @panel.show_url())\r
- \r
click_author: () ->\r
@trigger('http_get', @panel.author().show_url())\r
\r
@listenTo(inspire, 'inspire', @inspire)\r
inspire.inspire()\r
\r
- click_prof: () ->\r
- @trigger('http_get', @panel.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.Panel.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Panel.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
+++ /dev/null
-class Pettanr.Views.Picture.Credit extends Pettanr.View\r
- tagName: 'div'\r
- className: 'credit'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @with_icon = options.with_icon\r
- @url = @item.url + '/credit'\r
- \r
- render: () ->\r
- this.$el.html('')\r
- if @with_icon\r
- p = @item.credit_icon_view()\r
- @listenTo(p, 'click', @click)\r
- this.$el.append(p.render().el)\r
- f = (data, status) =>\r
- this.$el.append(data)\r
- @rb()\r
- $.get(@url, null, f, 'html')\r
- this\r
- \r
- click: () ->\r
- @trigger('click:icon', @item)\r
- \r
+++ /dev/null
-class Pettanr.Views.Picture.CreditIcon extends Pettanr.View\r
- tagName: 'span'\r
- className: 'credit-icon'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- \r
- render: () ->\r
- this.$el.html('')\r
- symbol_button = @item.symbol_button({\r
- context: this,\r
- click: () =>\r
- @trigger('click')\r
- })\r
- this.$el.append(symbol_button.render().el)\r
- this\r
- \r
-class Pettanr.Views.Picture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Picture.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.ResourcePicturePicture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.ResourcePicturePicture.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
load: () ->\r
@item.get_parent('picture', this, {\r
success: (@picture) =>\r
- @credit = @picture.credit_view(false)\r
+ @credit = new Pettanr.View.Credit(@picture, {})\r
@trigger('ready')\r
})\r
\r
+++ /dev/null
-class Pettanr.Views.ResourcePicture.Credit extends Pettanr.View\r
- tagName: 'div'\r
- className: 'credit'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @with_icon = options.with_icon\r
- @url = @item.url + '/credit'\r
- \r
- render: () ->\r
- this.$el.html('')\r
- if @with_icon\r
- p = @item.credit_icon_view()\r
- @listenTo(p, 'click', @click)\r
- this.$el.append(p.render().el)\r
- f = (data, status) =>\r
- this.$el.append(data)\r
- @rb()\r
- $.get(@url, null, f, 'html')\r
- this\r
- \r
- click: () ->\r
- @trigger('click:icon', @item)\r
- \r
+++ /dev/null
-class Pettanr.Views.ResourcePicture.CreditIcon extends Pettanr.View\r
- tagName: 'span'\r
- className: 'credit-icon'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @url = @item.url + '/credit'\r
- \r
- render: () ->\r
- this.$el.html('')\r
- resource_picture = @item.tmb_opt_img_tag()\r
- linked_resource_picture = new Tag.A({\r
- attr: {href: @item.url},\r
- content: resource_picture.render().el\r
- })\r
- @listenTo(linked_resource_picture, 'click', @click)\r
- this.$el.append(linked_resource_picture.render().el)\r
- this\r
- \r
- click: () ->\r
- @trigger('click')\r
- \r
-class Pettanr.Views.ResourcePicture.ShowModule\r
-class Pettanr.Views.ResourcePicture.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.ResourcePicture.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.ResourcePicture.ShowModule.LinkedReplaceButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- op = new Pettanr.OriginalPicture({id: item.get('original_picture_id')})\r
- super({\r
- attr: {href: '/' + op.edit_url()}, \r
- content: I18n.t('original_pictures.show.replace')\r
- })\r
- \r
-class Pettanr.Views.ResourcePicture.ShowModule.LinkedSourceButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- op = new Pettanr.OriginalPicture({id: item.get('original_picture_id')})\r
- super({\r
- attr: {href: '/' + op.show_url()}, \r
- content: I18n.t('original_pictures.show.title')\r
- })\r
- \r
-class Pettanr.Views.ResourcePicture.ShowModule.LinkedStopButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- super({\r
- attr: {href: '/' + item.destroy_url()}, \r
- content: I18n.t('original_pictures.index.stop')\r
- })\r
- \r
-class Pettanr.Views.ResourcePicture.ShowModule.OwnerFooter extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show-owner-footer'\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @item = options.item\r
- @replace = new Pettanr.Views.ResourcePicture.ShowModule.LinkedReplaceButton({item: @item})\r
- @source = new Pettanr.Views.ResourcePicture.ShowModule.LinkedSourceButton({item: @item})\r
- @stop = new Pettanr.Views.ResourcePicture.ShowModule.LinkedStopButton({item: @item})\r
- @listenTo(@replace, 'click', @click_replace)\r
- @listenTo(@source, 'click', @click_source)\r
- @listenTo(@stop, 'click', @click_stop)\r
- \r
- render: () ->\r
- super()\r
- this.$el.append(@replace.render().el)\r
- this.$el.append(@source.render().el)\r
- this.$el.append(@stop.render().el)\r
- this\r
- \r
- click_replace: () ->\r
- @trigger('click:replace')\r
- \r
- click_source: () ->\r
- @trigger('click:source')\r
- \r
- click_stop: () ->\r
- @trigger('click:stop')\r
- \r
-class Pettanr.Views.ResourcePicture.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @listenTo(@footer, 'click:replace', @click_replace)\r
- @listenTo(@footer, 'click:source', @click_source)\r
- @listenTo(@footer, 'click:stop', @click_stop)\r
- \r
- click_replace: () ->\r
- @trigger('click:replace')\r
- \r
- click_source: () ->\r
- @trigger('click:source')\r
- \r
- click_stop: () ->\r
- @trigger('click:stop')\r
- \r
- footer_class: () ->\r
- Pettanr.Views.ResourcePicture.ShowModule.OwnerFooter\r
- \r
-class Pettanr.Views.ResourcePicture.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @header = new Pettanr.Views.ResourcePicture.ShowModule.Header({\r
- item: @item, \r
- icon_url: @item.show_url(),\r
- caption_url: @item.show_url(),\r
- prof_url: @item.prof_url()\r
- })\r
- @artist = new Pettanr.Views.Show.HeaderArtist({item: @item})\r
- @img = new Pettanr.Views.ResourcePicture.Img({item: @item})\r
- @credit = @item.credit_view(false)\r
- @owner = new Pettanr.Views.ResourcePicture.ShowModule.Owner({item: @item, original_picture: @original_picture})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
+ @authored_by = @item.authored_by()\r
+ @img = @item.real_picture('full')\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@artist, 'click:artist', @click_artist)\r
- @listenTo(@owner, 'click:replace', @click_replace)\r
- @listenTo(@owner, 'click:source', @click_source)\r
- @listenTo(@owner, 'click:stop', @click_stop)\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(@artist.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@img.render().el)\r
- this.$el.append(@credit.render().el)\r
- this.$el.append(@owner.render().el)\r
+ @item.get_parent('original_picture', this, {\r
+ success: (@original_picture) =>\r
+ @owner = new Pettanr.View.Show.Footer(null, this, {\r
+ actions: {\r
+ replace: {\r
+ item: @original_picture,\r
+ url: @original_picture.edit_url(),\r
+ dic_name: 'original_pictures.show.replace',\r
+ click: () =>\r
+ @trigger('http_get', @original_picture.edit_url())\r
+ }, \r
+ source: {\r
+ item: @original_picture,\r
+ url: @original_picture.show_url(),\r
+ dic_name: 'original_pictures.show.title',\r
+ click: () =>\r
+ @trigger('http_get', @original_picture.show_url())\r
+ }, \r
+ stop: {\r
+ item: @item,\r
+ url: @item.destroy_url(),\r
+ dic_name: 'original_pictures.index.stop',\r
+ click: () =>\r
+ redirect = (url) =>\r
+ @trigger('http_get', url)\r
+ Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
+ }, \r
+ }, \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
+ this.$el.append(@owner.render().el)\r
+ })\r
+ })\r
this\r
\r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_artist: () ->\r
- @trigger('http_get', @item.artist().show_url())\r
- \r
- click_replace: () ->\r
- op = new Pettanr.OriginalPicture({id: @item.get('original_picture_id')})\r
- @trigger('http_get', op.edit_url())\r
- \r
- click_source: () ->\r
- op = new Pettanr.OriginalPicture({id: @item.get('original_picture_id')})\r
- @trigger('http_get', op.show_url())\r
- \r
- click_stop: () ->\r
- redirect = (url) =>\r
- @trigger('http_get', url)\r
- Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.ResourcePicture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.ResourcePicture.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
@item = options.item\r
@item.get_parent('picture', this, {\r
success: (@picture) =>\r
- @credit = @picture.credit_view(false)\r
+ @credit = new Pettanr.View.Credit(@picture, {})\r
@trigger('ready')\r
})\r
\r
-class Pettanr.Views.ScrollPanel.Summary extends Pettanr.Views.Common.Leaf.Summary\r
+class Pettanr.Views.ScrollPanel.Summary extends Pettanr.View.Summary.Leaf\r
\r
initialize: (options) ->\r
options['binder_item_name'] = 'scroll'\r
else\r
this.$el.html('')\r
# paginate(@pager)\r
- credits = new Pettanr.Views.Common.Credits({parent: this})\r
+ credits = new Pettanr.View.Credits({parent: this})\r
@panels = new Pettanr.Views.Scroll.PlayModule.Panels({\r
parent: this,\r
binder: @binder,\r
@appender.enable()\r
})\r
\r
-class Pettanr.Views.Scroll.Play extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
+class Pettanr.Views.Scroll.Play extends Pettanr.View.Show\r
\r
- initialize: (options) ->\r
- @item = options.item\r
+ initialize: (@item, options) ->\r
@list = options.list\r
@pager = options.pager\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = Pettanr.url(@item.table_name(), 'play', {id: @item.get('id')})\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Scroll.PlayModule.Header({\r
- item: @item, \r
- caption: @item.get('title'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
@body = new Pettanr.Views.Scroll.PlayModule.Body({\r
parent: this,\r
binder: @item,\r
})\r
# @owner = new Pettanr.Views.Scroll.PlayModule.Owner({item: @item})\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_play)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
@listenTo(@body, 'http_get', @http_get)\r
@listenTo(@body, 'click:insert', @click_insert)\r
@listenTo(@body, 'click:move', @click_move)\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@body.render().el)\r
# this.$el.append(@owner.render().el) if @item.is_own()\r
this\r
\r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_play: () ->\r
- @trigger('http_get', @item.play_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @author.author.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.Scroll.ShowModule\r
-class Pettanr.Views.Scroll.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.Scroll.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Scroll.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Scroll.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @header = new Pettanr.View.Show.Header(@item, {\r
- label: {\r
- url: @item.play_url(),\r
- }\r
- })\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @item})\r
- @owner = new Pettanr.Views.Scroll.ShowModule.Owner({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
+ @owner = new Pettanr.View.Show.Footer(@item, this, @default_footer_options())\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_play)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\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(@author.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@owner.render().el) if @item.is_own()\r
this\r
\r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_play: () ->\r
- @trigger('http_get', @item.play_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @item.author().show_url())\r
- \r
- click_edit: () ->\r
- @trigger('http_get', @item.edit_url())\r
- \r
- click_destroy: () ->\r
- redirect = (url) =>\r
- @trigger('http_get', url)\r
- Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.Scroll.Summary extends Pettanr.Views.Common.Binder.Summary\r
+class Pettanr.Views.Scroll.Summary extends Pettanr.View.Summary.Binder\r
\r
initialize: (options) ->\r
options['visible_t'] = 'scroll_visible_items'\r
-class Pettanr.Views.SheetPanel.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.SheetPanel.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
render: () ->\r
this.$el.html('')\r
# paginate(@pager)\r
- credits = new Pettanr.Views.Common.Credits({parent: this})\r
+ credits = new Pettanr.View.Credits({parent: this})\r
panels = new Pettanr.Views.Sheet.PlayModule.Panels({\r
parent: this,\r
items: @items,\r
# paginate(@pager)\r
this\r
\r
-class Pettanr.Views.Sheet.Play extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
+class Pettanr.Views.Sheet.Play extends Pettanr.View.Show\r
\r
- initialize: (options) ->\r
- @item = options.item\r
+ initialize: (@item, options) ->\r
@list = options.list\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = Pettanr.url(@item.table_name(), 'play', {id: @item.get('id')})\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Sheet.PlayModule.Header({\r
- item: @item, \r
- caption: @item.get('caption'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
@body = new Pettanr.Views.Sheet.PlayModule.Body({\r
parent: this,\r
list: @list, \r
})\r
@owner = new Pettanr.Views.Sheet.PlayModule.Owner({item: @item})\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(@author.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@body.render().el)\r
this.$el.append(@owner.render().el) if @item.is_own()\r
this\r
-class Pettanr.Views.Sheet.ShowModule\r
-class Pettanr.Views.Sheet.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.Sheet.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Sheet.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Sheet.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = Pettanr.url(@item.table_name(), 'play', {id: @item.get('id')})\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Sheet.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('caption'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @item})\r
- @owner = new Pettanr.Views.Sheet.ShowModule.Owner({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
+ @owner = new Pettanr.View.Show.Footer(@item, this, @default_footer_options())\r
@listenTo(@header, 'click:pick', @click_pick)\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(@author.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@owner.render().el) if @item.is_own()\r
this\r
\r
-class Pettanr.Views.Sheet.Summary extends Pettanr.Views.Common.Binder.Summary\r
+class Pettanr.Views.Sheet.Summary extends Pettanr.View.Summary.Binder\r
\r
initialize: (options) ->\r
options['visible_t'] = 'sheet_visible_items'\r
-class Pettanr.Views.SpeechBalloonTemplate.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.SpeechBalloonTemplate.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @listenTo(@header, 'click:pick', @click_pick)\r
\r
render: () ->\r
this.$el.html('')\r
+ this.$el.append(@header.render().el)\r
this\r
\r
+ click_pick: () ->\r
+ @trigger('pick', @item)\r
+ \r
+ is_pickable: () ->\r
+ true\r
+ \r
+ add_pick: (target_model) ->\r
+ @header.add_pick(target_model)\r
+ \r
-class Pettanr.Views.SpeechBalloonTemplate.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.SpeechBalloonTemplate.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.SpeechBalloon.ShowModule\r
-class Pettanr.Views.SpeechBalloon.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.SpeechBalloon.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
\r
-class Pettanr.Views.SpeechBalloon.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = icon_url\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.SpeechBalloon.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('caption'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @listenTo(this, 'ready', @ready)\r
+ render: () ->\r
+ this.$el.html('')\r
@item.get_parent('panel', this, {\r
success: (item) =>\r
@panel = item.with_elements()\r
@panel.fetch().done =>\r
@panel.attributes = @panel.replaced_attributes()\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @authored_by = @panel.authored_by()\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @item\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
- @listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
- @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
- @trigger('ready')\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
+ this.$el.append(@header.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
+ this.$el.append(@body.render().el)\r
+ @add_credits()\r
})\r
- \r
- render: () ->\r
- this.$el.html('')\r
this\r
\r
- ready: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
- this.$el.append(@body.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
- \r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.Speech.ShowModule\r
-class Pettanr.Views.Speech.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.Speech.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
\r
-class Pettanr.Views.Speech.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = icon_url\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Speech.ShowModule.Header({\r
- item: @item, \r
- caption: '', \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @listenTo(this, 'ready', @ready)\r
+ render: () ->\r
+ this.$el.html('')\r
@item.get_parent('speech_balloon', this, {\r
success: (@speech_balloon) =>\r
@speech_balloon.get_parent('panel', this, {\r
@panel = item.with_elements()\r
@panel.fetch().done =>\r
@panel.attributes = @panel.replaced_attributes()\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @authored_by = @panel.authored_by()\r
@body = new Pettanr.Views.Panel.Body({\r
panel: @panel,\r
spot: @item\r
})\r
- @credits = new Pettanr.Views.Common.Credits({\r
- parent: this\r
- })\r
@listenTo(@header, 'click:pick', @click_pick)\r
- @listenTo(@header, 'click:icon', @click_show)\r
- @listenTo(@header, 'click:caption', @click_show)\r
- @listenTo(@header, 'click:prof', @click_prof)\r
- @listenTo(@author, 'click:author', @click_author)\r
- @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
- @trigger('ready')\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
+ this.$el.append(@header.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
+ this.$el.append(@body.render().el)\r
+ @add_credits()\r
})\r
})\r
- \r
- render: () ->\r
- this.$el.html('')\r
this\r
\r
- ready: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@author.render().el)\r
- this.$el.append(@body.render().el)\r
- this.$el.append(@credits.render().el)\r
- @credits.clear()\r
- @credits.push(@panel.licensed_pictures())\r
- @rb()\r
- \r
- click_show: () ->\r
- @trigger('http_get', @item.show_url())\r
- \r
- click_author: () ->\r
- @trigger('http_get', @panel.author().show_url())\r
- \r
- click_prof: () ->\r
- @trigger('http_get', @item.prof_url())\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('http_get', item.show_url())\r
- \r
click_pick: () ->\r
@trigger('pick', @item)\r
\r
-class Pettanr.Views.Speech.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.Speech.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.Story.ShowModule\r
-class Pettanr.Views.Story.ShowModule.Header extends Pettanr.Views.Show.Header\r
+class Pettanr.Views.Story.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Story.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Story.Show extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- caption_url = Pettanr.url(@item.table_name(), 'play', {id: @item.get('id')})\r
- prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})\r
- @header = new Pettanr.Views.Story.ShowModule.Header({\r
- item: @item, \r
- caption: @item.get('title'), \r
- icon_url: icon_url,\r
- caption_url: caption_url,\r
- prof_url: prof_url\r
- })\r
- @author = new Pettanr.Views.Show.HeaderAuthor({item: @item})\r
- @owner = new Pettanr.Views.Story.ShowModule.Owner({item: @item})\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @authored_by = @item.authored_by()\r
+ @owner = new Pettanr.View.Show.Footer(@item, this, @default_footer_options())\r
@listenTo(@header, 'click:pick', @click_pick)\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(@author.render().el)\r
+ this.$el.append(@authored_by.render().el)\r
this.$el.append(@owner.render().el) if @item.is_own()\r
this\r
\r
-class Pettanr.Views.Story.Summary extends Pettanr.Views.Common.Binder.Summary\r
+class Pettanr.Views.Story.Summary extends Pettanr.View.Summary.Binder\r
\r
initialize: (options) ->\r
options['visible_t'] = 'story_visible_items'\r
-class Pettanr.Views.StorySheet.Summary extends Pettanr.Views.Common.Leaf.Summary\r
+class Pettanr.Views.StorySheet.Summary extends Pettanr.View.Summary.Leaf\r
\r
initialize: (options) ->\r
options['binder_item_name'] = 'story'\r
-class Pettanr.Views.SystemPicture.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.SystemPicture.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
\r
render: () ->\r
this.$el.html('')\r
+ this.$el.append(@header.render().el)\r
this\r
\r
-class Pettanr.Views.SystemPicture.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.SystemPicture.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
-class Pettanr.Views.WritingFormat.Show extends Pettanr.View\r
- tagName: 'div'\r
+class Pettanr.Views.WritingFormat.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
+ @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
\r
render: () ->\r
this.$el.html('')\r
+ this.$el.append(@header.render().el)\r
this\r
\r
-class Pettanr.Views.WritingFormat.Summary extends Pettanr.Views.Common.Summary\r
+class Pettanr.Views.WritingFormat.Summary extends Pettanr.View.Summary\r
\r
initialize: (options) ->\r
super(options)\r
//= require_directory ./view
//= require_directory ./view/button
//= require_directory ./view/show
+//= require_directory ./view/show/header
+//= require_directory ./view/show/footer
//= require_directory ./view/play
+//= require_directory ./view/summary
//= require_directory ./views
//= require_directory ./views/folders
//= require_directory ./views/artists