OSDN Git Service

fix profiler link url
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / header.js.coffee
1 class Locmare.FilerModule.Header extends Backbone.View\r
2   tagName: 'div'\r
3   \r
4   initialize: (options) ->\r
5     @filer = options.filer\r
6   \r
7   render: () ->\r
8     this.$el.html('')\r
9     icon = new Pettanr.Picture.Icon({item: @model()})\r
10     caption = Pettanr.AppHelper.t_m(@model().singular())\r
11     url = Pettanr.url(@model().table_name(), 'index', {})\r
12     linked_icon = new Pettanr.Tag.A({href: url, content: icon.render().el})\r
13     linked_caption = new Pettanr.Tag.A({href: url, content: caption})\r
14     this.$el.append(linked_icon)\r
15     this.$el.append(linked_caption)\r
16     this\r
17   \r
18   model: () ->\r
19     @filer.model()\r
20   \r
21   human_name: () ->\r
22     @model.model_name.human\r
23   \r