Class: UzuUzu::Controller::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/uzuuzu-cms/controller/index.rb

Instance Method Summary collapse

Instance Method Details

#css(id) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/uzuuzu-cms/controller/index.rb', line 12

def css(id)
  UzuUzu::repository do
    @resource = Css.first(:id => id)
  end
  if @resource.blank?
    not_found
  end
  response["Content-Type"] = mime_type(:css)
  @resource.body
end

#file(id) ⇒ Object



40
41
42
43
44
45
46
47
48
49
# File 'lib/uzuuzu-cms/controller/index.rb', line 40

def file(id)
  UzuUzu::repository do
    @resource = File.first(:id => id)
  end
  if @resource.blank?
    not_found
  end
  response["Content-Type"] = mime_type(@resource.content_type)
  @resource.body
end

#image(id) ⇒ Object



54
55
56
57
58
59
60
61
62
63
# File 'lib/uzuuzu-cms/controller/index.rb', line 54

def image(id)
  UzuUzu::repository do
    @resource = Image.first(:id => id)
  end
  if @resource.blank?
    not_found
  end
  response["Content-Type"] = mime_type(@resource.content_type)
  @resource.body
end

#indexObject



7
8
9
10
# File 'lib/uzuuzu-cms/controller/index.rb', line 7

def index
  redirect(rf(Initialize)) unless info.initialize?
  respond(render_full(Page, :top_page))
end

#javascript(id) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/uzuuzu-cms/controller/index.rb', line 26

def javascript(id)
  UzuUzu::repository do
    @resource = Javascript.first(:id => id)
  end
  if @resource.blank?
    not_found
  end
  response["Content-Type"] = mime_type(:js)
  @resource.body
end

#movie(id) ⇒ Object



68
69
70
71
72
73
74
75
76
77
# File 'lib/uzuuzu-cms/controller/index.rb', line 68

def movie(id)
  UzuUzu::repository do
    @resource = Movie.first(:id => id)
  end
  if @resource.blank?
    not_found
  end
  response["Content-Type"] = mime_type(@resource.content_type)
  @resource.body
end

#sitemapObject



79
80
81
82
83
84
85
86
87
88
# File 'lib/uzuuzu-cms/controller/index.rb', line 79

def sitemap
  respond_to do |wish|
    case(wish)
    when :xml
      "<test>a</test>"
    else
      ""
    end
  end
end

#spinupObject



93
94
95
# File 'lib/uzuuzu-cms/controller/index.rb', line 93

def spinup
  'spinup'
end