Sha256: ba273963957356c7e68b3d8390de288fb083554e19080beaf3db7fef65bcdc87

Contents?: true

Size: 1.02 KB

Versions: 27

Compression:

Stored size: 1.02 KB

Contents

require_dependency "ishapi/application_controller"
module Ishapi
  class MapsController < ApplicationController

    before_action :soft_check_long_term_token, only: [ :show ]
    
    def index
      authorize! :index, ::Gameui::Map
      @maps = ::Gameui::Map.all
    end

    def show
      @map = ::Gameui::Map.find_by slug: params[:slug]
      @markers = @map.markers.where( is_active: true )

      case @map.ordering_type
      when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
        @markers = @markers.order_by( name: :asc )
      when ::Gameui::Map::ORDERING_TYPE_CUSTOM
        @markers = @markers.order_by( ordering: :asc )
      end

      if city = City.where( cityname: @map.slug ).first
        @newsitems = city.newsitems
        @galleries = city.galleries
        @reports = city.reports
        @videos = city.videos
      end
      authorize! :show, @map
    end

    def show_marker
      @marker = ::Gameui::Marker.find_by slug: params[:slug]
      authorize! :show, @marker
      render json: @marker
    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ishapi-0.1.8.142 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.141 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.140 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.139 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.138 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.137 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.136 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.135 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.134 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.133 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.132 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.131 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.130 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.129 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.128 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.127 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.126 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.125 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.124 app/controllers/ishapi/maps_controller.rb
ishapi-0.1.8.123 app/controllers/ishapi/maps_controller.rb