OSDN Git Service

fix router and render
[pettanr/pettanr.git] / app / assets / javascripts / controllers / license_groups.js.coffee
index a1ab464..a7e98f9 100644 (file)
@@ -1,6 +1,40 @@
 class Pettanr.LicenseGroupsController extends Pettanr.AppController\r
   \r
   index: () ->\r
-    list_result = new Pettanr.LicenseGroup.Collection({})\r
-    new Pettanr.FilerRender('license_group', list_result, 'default', window.operators)\r
+    @trigger('retitle', @params)\r
+    @filer_list()\r
   \r
+  show_html: () -> \r
+    @item.fetch({cache: true}).done =>\r
+      @trigger('retitle', @params, @item.get('caption'))\r
+      show = new Pettanr.Views.LicenseGroup.Show({\r
+        item: @item,\r
+        operators: @operators\r
+      })\r
+      show.render()\r
+      @trigger('ready', show)\r
+  \r
+  show: () ->\r
+    @set_show()\r
+    switch @params['format']\r
+      when 'prof'\r
+        @show_prof()\r
+      when 'html'\r
+        @show_html()\r
+  \r
+  count: () ->\r
+  \r
+  new: () ->\r
+    @trigger('retitle', @params)\r
+    @form_new()\r
+  \r
+  edit: () ->\r
+    @trigger('retitle', @params)\r
+    @form_edit()\r
+  \r
+  create: () ->\r
+  \r
+  update: () ->\r
+  \r
+  destroy: () ->\r
+    \r