@filer = options.filer\r
\r
render: () ->\r
- args = {'header': this}\r
- template = _.template($("#" + @template_name()).html())\r
- this.$el.html(template(args))\r
+ this.$el.html('')\r
+ icon = new Pettanr.Image.Icon({item: @model(), half: true})\r
+ caption = Pettanr.AppHelper.t_m(@model().singular())\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
@filer.model()\r
\r
- icon_name: () ->\r
- @model().singular()\r
- \r
- icon_size: () ->\r
- Manifest.manifest().magic_numbers['thumbnail_width'] / 2\r
- \r
human_name: () ->\r
@model.model_name.human\r
\r
- template_dir: () ->\r
- @filer.template_dir\r
- \r
- template_file_name: () ->\r
- "header"\r
- \r
- template_name: () ->\r
- @template_dir() + @template_file_name()\r
+ click: () ->\r
+ @trigger('click', @model().index_url())\r
\r