OSDN Git Service

t#32472:add select on profiles
[pettanr/pettanr.git] / app / controllers / license_groups_controller.rb
1 class LicenseGroupsController < ApplicationController
2   layout 'test' if MagicNumber['test_layout']
3   before_filter :authenticate_admin!, :only => [:list, :browse]
4   
5   def index
6     @license_groups = LicenseGroup.list()
7
8     respond_to do |format|
9       format.html {
10         render :template => 'system/filer', :locals => {
11           :items => @license_groups, :model => LicenseGroup, 
12           :roles => [@user, @admin], :pager => nil
13         }
14       }
15       format.json { render json: @license_groups.to_json(LicenseGroup.list_json_opt) }
16     end
17   end
18
19   def show
20     @item = LicenseGroup.show(params[:id])
21     respond_to do |format|
22       format.html {
23         @license_group = @item
24       }
25       format_prof format
26       format.json { render json: @item.to_json(LicenseGroup.show_json_opt) }
27     end
28   end
29
30   def list
31     @license_groups = LicenseGroup.all
32
33     respond_to do |format|
34       format.html { render layout: 'system' }
35     end
36   end
37
38   def browse
39     @license_group = LicenseGroup.find(params[:id])
40
41     respond_to do |format|
42       format.html { render layout: 'system' }
43     end
44   end
45 end