\r
render: () ->\r
this.$el.html('')\r
- icon = new Pettanr.Picture.Icon({item: @model()})\r
+ icon = new Pettanr.Image.Icon({item: @model(), half: true})\r
caption = Pettanr.AppHelper.t_m(@model().singular())\r
- url = Pettanr.url(@model().table_name(), 'index', {})\r
- linked_icon = new Pettanr.Tag.A({href: url, content: icon.render().el})\r
- linked_caption = new Pettanr.Tag.A({href: url, content: caption})\r
- this.$el.append(linked_icon)\r
- this.$el.append(linked_caption)\r
+ url = @model().index_url()\r
+ linked_icon = new Tag.A({\r
+ attr: {href: '/' + url}, content: icon.render().el\r
+ })\r
+ linked_caption = new Tag.A({\r
+ attr: {href: '/' + url}, content: caption\r
+ })\r
+ @listenTo(linked_icon, 'click', @click)\r
+ @listenTo(linked_caption, 'click', @click)\r
+ this.$el.append(linked_icon.render().el)\r
+ this.$el.append(linked_caption.render().el)\r
this\r
\r
model: () ->\r
human_name: () ->\r
@model.model_name.human\r
\r
+ click: () ->\r
+ @trigger('click', @model().index_url())\r
+ \r