Class: PageController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/page_controller.rb

Instance Method Summary collapse

Instance Method Details

#aboutObject

「このシステムについて」を表示します。



92
93
94
# File 'app/controllers/page_controller.rb', line 92

def about
  @title = t('page.about_this_system')
end

#add_onObject

「アドオン」を表示します。



97
98
99
# File 'app/controllers/page_controller.rb', line 97

def add_on
  @title = t('page.add_on')
end

#advanced_searchObject

詳細検索画面を表示します。



61
62
63
64
# File 'app/controllers/page_controller.rb', line 61

def advanced_search
  get_libraries
  @title = t('page.advanced_search')
end

#configurationObject

システム設定画面を表示します。



72
73
74
# File 'app/controllers/page_controller.rb', line 72

def configuration
  @title = t('page.configuration')
end

#exportObject

エクスポート画面を表示します。



87
88
89
# File 'app/controllers/page_controller.rb', line 87

def export
  @title = t('page.export')
end

#importObject

インポート画面を表示します。



82
83
84
# File 'app/controllers/page_controller.rb', line 82

def import
  @title = t('page.import')
end

#indexObject

トップページを表示します。



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/page_controller.rb', line 9

def index
  if user_signed_in?
    session[:user_return_to] = nil
    #unless current_user.agent
    #  redirect_to new_user_agent_url(current_user); return
    #end
    if defined?(EnjuBookmark)
      @tags = current_user.bookmarks.tag_counts.sort{|a, b|
        a.count <=> b.count
      }.reverse
    end
    if current_user.profile
      @manifestation = Manifestation.pickup(
        current_user.profile.keyword_list.to_s.split.sort_by{rand}.first,
        current_user
      )
    else
      @manifestation = nil
    end
  else
    if defined?(EnjuBookmark)
      # TODO: タグ下限の設定
      #@tags = Tag.all(limit: 50, order: 'taggings_count DESC')
      @tags = Bookmark.tag_counts.sort{|a, b|
        a.count <=> b.count
      }.reverse[0..49]
    end
    @manifestation = Manifestation.pickup rescue nil
  end
  get_top_page_content
  @numdocs = Manifestation.search.total

  respond_to do |format|
    format.html
  end
end

#msie_acceleratorObject

Internet Explorer用のアクセラレータを表示します。



47
48
49
50
51
# File 'app/controllers/page_controller.rb', line 47

def msie_accelerator
  respond_to do |format|
    format.xml { render layout: false }
  end
end

#opensearchObject

OpenSearch Descriptionファイルを表示します。



54
55
56
57
58
# File 'app/controllers/page_controller.rb', line 54

def opensearch
  respond_to do |format|
    format.xml { render layout: false }
  end
end

#routing_errorObject

ルーティングエラー画面を表示します。



102
103
104
# File 'app/controllers/page_controller.rb', line 102

def routing_error
  render_404
end

#statisticsObject

統計画面を表示します。



67
68
69
# File 'app/controllers/page_controller.rb', line 67

def statistics
  @title = t('page.statistics')
end

#system_informationObject

システム情報画面を表示します。



77
78
79
# File 'app/controllers/page_controller.rb', line 77

def system_information
  @specs = Bundler.load.specs.sort!
end