Sha256: 3102219ffbbe29aad2174d57b4277df35d82ada257fd90ef843f5644bf7f6915

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

class TokyoMetro::App::Renderer::SideMenu::Problems < TokyoMetro::Factory::Decorate::MetaClass

  def render
    h.render inline: <<-HAML , type: :haml , locals: h_locals
%div{ id: :problems }
  = ::TokyoMetro::App::Renderer::SideMenu::Problems::Header.new( request ).render
  %ul{ class: [ :info_text , :problems ] }
    - contents_ja.each do | info |
      %li{ class: :text_ja }<
        = info
    %li{ class: [ :to_do , :text_en ] }<
      - if open_another_window
        = link_to( "" , link_to_list_of_tasks_to_do , target: :_blank )
      - else
        = link_to( "" , link_to_list_of_tasks_to_do )
      = "To Do"
    HAML
  end

  private

  def h_locals
    super().merge({
      contents_ja: contents_ja ,
      contents_en: contents_en ,
      link_to_list_of_tasks_to_do: link_to_list_of_tasks_to_do ,
      open_another_window: open_another_window?
    })
  end

  def contents_ja
    [
      "リアルタイム情報の更新ボタンが動作しない" ,
      "駅時刻表ページ(重大なバグが見つかったため公開を停止しています)"
    ]
  end

  def contents_en
    nil
  end

  def link_to_list_of_tasks_to_do
    url_helpers.url_for( controller: :document , action: :index , anchor: :to_do , only_path: true )
  end

  def on_the_same_controller?
    current_controller == :document
  end

  def open_another_window?
    !( on_the_same_controller? )
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/app/renderer/side_menu/problems.rb