makeup
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
class Admin::ApplicationController < ApplicationController
|
module Admin
|
||||||
http_basic_authenticate_with name: 'admin', password: ENV['ADMIN_PASSWORD'] unless Rails.env.development?
|
class ApplicationController < ApplicationController
|
||||||
|
http_basic_authenticate_with name: 'admin', password: ENV['ADMIN_PASSWORD'] unless Rails.env.development?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class Admin::PagesController < Admin::ApplicationController
|
module Admin
|
||||||
def map
|
class PagesController < Admin::ApplicationController
|
||||||
@supporters = Supporter.where(:coordinates.ne => nil).only(:coordinates, :support)
|
def map
|
||||||
|
@supporters = Supporter.where(:coordinates.ne => nil).only(:coordinates, :support)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class Admin::SupportersController < Admin::ApplicationController
|
module Admin
|
||||||
def index
|
class SupportersController < Admin::ApplicationController
|
||||||
@supporters = Supporter.desc(:created_at)
|
def index
|
||||||
|
@supporters = Supporter.desc(:created_at)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
|
|||||||
# Prevent CSRF attacks by raising an exception.
|
# Prevent CSRF attacks by raising an exception.
|
||||||
# For APIs, you may want to use :null_session instead.
|
# For APIs, you may want to use :null_session instead.
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
before_action :set_locale
|
before_action :set_locale
|
||||||
|
|
||||||
INPUT_TIMEOUT = 2.seconds # We estimate that a user needs more then x seconds to enter some informations
|
INPUT_TIMEOUT = 2.seconds # We estimate that a user needs more then x seconds to enter some informations
|
||||||
@@ -18,11 +18,11 @@ class ApplicationController < ActionController::Base
|
|||||||
def set_form_timestamp
|
def set_form_timestamp
|
||||||
session[:form_timestamp] = Time.now
|
session[:form_timestamp] = Time.now
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_locale
|
def set_locale
|
||||||
I18n.locale = params[:locale] || I18n.default_locale
|
I18n.locale = params[:locale] || I18n.default_locale
|
||||||
end
|
end
|
||||||
|
|
||||||
# I18n set default language in url
|
# I18n set default language in url
|
||||||
def default_url_options(options = {})
|
def default_url_options(options = {})
|
||||||
options.merge locale: I18n.locale
|
options.merge locale: I18n.locale
|
||||||
|
|||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
root 'supporters#new'
|
root 'supporters#new'
|
||||||
scope "/:locale" do
|
scope '/:locale' do
|
||||||
get '/', to: 'supporters#new'
|
get '/', to: 'supporters#new'
|
||||||
resources :supporters
|
resources :supporters
|
||||||
|
|
||||||
get '/thanks', to: 'pages#thanks', as: :thanks
|
get '/thanks', to: 'pages#thanks', as: :thanks
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/cities_autocomplete', to: 'cities_autocomplete#index', as: :cities_autocomplete
|
get '/cities_autocomplete', to: 'cities_autocomplete#index', as: :cities_autocomplete
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
|
|||||||
Reference in New Issue
Block a user