├── log
└── .gitkeep
├── lib
├── tasks
│ └── .gitkeep
└── assets
│ └── .gitkeep
├── public
├── favicon.ico
├── robots.txt
├── 500.html
├── 422.html
├── 404.html
└── stylesheets
│ └── apitome
│ └── application.css
├── .ruby-version
├── app
├── mailers
│ └── .gitkeep
├── models
│ ├── application_record.rb
│ ├── jwt_token.rb
│ ├── user.rb
│ └── error.rb
├── serializers
│ ├── jwt_token_serializer.rb
│ ├── user_serializer.rb
│ ├── application_serializer.rb
│ └── error_serializer.rb
├── controllers
│ └── v1
│ │ ├── users_controller.rb
│ │ ├── registrations_controller.rb
│ │ ├── tokens_controller.rb
│ │ ├── profiles_controller.rb
│ │ └── base_controller.rb
├── responders
│ └── api_responder.rb
└── interactors
│ └── create_jwt.rb
├── .rspec
├── config
├── locales
│ ├── mailer.en.yml
│ ├── time.en.yml
│ ├── errors.en.yml
│ └── flash.en.yml
├── brakeman.yml
├── initializers
│ ├── active_model_serializer.rb
│ ├── raddocs.rb
│ ├── generators.rb
│ ├── mime_types.rb
│ ├── filter_parameter_logging.rb
│ ├── bullet.rb
│ ├── cookies_serializer.rb
│ ├── strong_parameters.rb
│ ├── backtrace_silencers.rb
│ ├── cors.rb
│ ├── inflections.rb
│ ├── health_check.rb
│ └── rollbar.rb
├── environments
│ ├── staging.rb
│ ├── test.rb
│ ├── development.rb
│ └── production.rb
├── spring.rb
├── environment.rb
├── cable.yml
├── boot.rb
├── secrets.yml
├── routes.rb
├── puma.rb
├── database.yml
├── storage.yml
├── rails_best_practices.yml
└── application.rb
├── db
├── seeds
│ └── development
│ │ └── all.seeds.rb
├── migrate
│ └── 20130319140714_create_users.rb
├── seeds.rb
└── schema.rb
├── bin
├── server
├── ci
├── doc
├── bundle
├── quality
├── rake
├── docker-entrypoint
├── rails
├── foreman
├── rubocop
├── autospec
├── brakeman
├── bundle-audit
├── spring
├── rspec
└── setup
├── spec
├── support
│ ├── factory_bot.rb
│ ├── maintain_test_schema.rb
│ ├── env_stub.rb
│ ├── helpers.rb
│ ├── shared_contexts
│ │ ├── time_is_frozen.rb
│ │ └── api_headers.rb
│ ├── email.rb
│ ├── rspec_api_documentation.rb
│ └── shared_examples
│ │ └── api_endpoint_with_authorization.rb
├── factories
│ ├── sequences.rb
│ ├── users.rb
│ ├── errors.rb
│ └── jwt_tokens.rb
├── models
│ ├── jwt_token_spec.rb
│ └── error_spec.rb
├── spec_helper.rb
├── rails_helper.rb
├── api
│ └── v1
│ │ ├── registrations_spec.rb
│ │ ├── tokens_spec.rb
│ │ ├── users_spec.rb
│ │ └── profiles_spec.rb
├── interactors
│ └── create_jwt_spec.rb
└── serializers
│ └── error_serializer_spec.rb
├── .simplecov
├── config.ru
├── .erdconfig
├── Rakefile
├── heroku.yml
├── .circleci
└── config.yml
├── .gitignore
├── app.json
├── .env.example
├── .dockerignore
├── docker-compose.yml
├── Gemfile
├── doc
├── README_TEMPLATE.md
└── api
│ └── v1
│ ├── profiles
│ ├── delete_profile.json
│ ├── retrieve_profile.json
│ └── update_profile.json
│ ├── users
│ ├── retrieve_user.json
│ └── list_users.json
│ ├── tokens
│ └── create_token.json
│ ├── registration
│ └── create_user.json
│ └── index.json
├── CONTRIBUTING.md
├── Dockerfile
├── .rubocop.yml
├── CHANGELOG.md
├── README.md
└── Gemfile.lock
/log/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.5.1
2 |
--------------------------------------------------------------------------------
/app/mailers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.rspec:
--------------------------------------------------------------------------------
1 | --color
2 | --require spec_helper
3 |
--------------------------------------------------------------------------------
/config/locales/mailer.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | application_mailer:
3 |
--------------------------------------------------------------------------------
/db/seeds/development/all.seeds.rb:
--------------------------------------------------------------------------------
1 | FactoryBot.create :user
2 |
--------------------------------------------------------------------------------
/bin/server:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | docker-compose up
6 |
--------------------------------------------------------------------------------
/config/brakeman.yml:
--------------------------------------------------------------------------------
1 | ---
2 | :quiet: true
3 | :skip_checks:
4 | - CheckForgerySetting
5 |
--------------------------------------------------------------------------------
/config/initializers/active_model_serializer.rb:
--------------------------------------------------------------------------------
1 | ActiveModelSerializers.config.key_transform = :underscore
2 |
--------------------------------------------------------------------------------
/config/initializers/raddocs.rb:
--------------------------------------------------------------------------------
1 | Raddocs.configure do |config|
2 | config.docs_dir = "doc/api/v1"
3 | end
4 |
--------------------------------------------------------------------------------
/spec/support/factory_bot.rb:
--------------------------------------------------------------------------------
1 | RSpec.configure do |config|
2 | config.include FactoryBot::Syntax::Methods
3 | end
4 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | self.abstract_class = true
3 | end
4 |
--------------------------------------------------------------------------------
/spec/support/maintain_test_schema.rb:
--------------------------------------------------------------------------------
1 | ActiveRecord::Migration.maintain_test_schema! if defined?(ActiveRecord::Migration)
2 |
--------------------------------------------------------------------------------
/app/serializers/jwt_token_serializer.rb:
--------------------------------------------------------------------------------
1 | class JwtTokenSerializer < ApplicationSerializer
2 | attributes :token
3 | end
4 |
--------------------------------------------------------------------------------
/app/serializers/user_serializer.rb:
--------------------------------------------------------------------------------
1 | class UserSerializer < ApplicationSerializer
2 | attributes :id, :email, :full_name
3 | end
4 |
--------------------------------------------------------------------------------
/bin/ci:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | docker-compose exec app bin/quality
6 | docker-compose exec app bin/rspec spec
7 |
--------------------------------------------------------------------------------
/bin/doc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | bin/rspec spec/api/ --format RspecApiDocumentation::ApiFormatter
6 | bin/rails erd
7 |
--------------------------------------------------------------------------------
/config/environments/staging.rb:
--------------------------------------------------------------------------------
1 | require_relative "production"
2 |
3 | Rails.application.configure do
4 | config.force_ssl = false
5 | end
6 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/app/models/jwt_token.rb:
--------------------------------------------------------------------------------
1 | class JwtToken < Knock::AuthToken
2 | include ActiveModel::Serialization
3 |
4 | def id
5 | token
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/config/spring.rb:
--------------------------------------------------------------------------------
1 | %w[
2 | .ruby-version
3 | .rbenv-vars
4 | tmp/restart.txt
5 | tmp/caching-dev.txt
6 | ].each { |path| Spring.watch(path) }
7 |
--------------------------------------------------------------------------------
/spec/factories/sequences.rb:
--------------------------------------------------------------------------------
1 | FactoryBot.define do
2 | sequence(:email) { |n| "user#{n}@example.com" }
3 | sequence(:password) { "123456" }
4 | end
5 |
--------------------------------------------------------------------------------
/spec/factories/users.rb:
--------------------------------------------------------------------------------
1 | FactoryBot.define do
2 | factory :user do
3 | full_name { Faker::Name.name }
4 | email
5 | password
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/.simplecov:
--------------------------------------------------------------------------------
1 | SimpleCov.start 'rails' do
2 | add_filter 'examples'
3 | add_filter 'serializers'
4 | add_filter '.bundle'
5 | add_filter 'vendor/bundle'
6 | end
7 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path("../config/environment", __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/bin/quality:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | bin/rubocop
6 | bin/brakeman --quiet --skip-libs --exit-on-warn --no-pager
7 | bin/bundle-audit update
8 | bin/bundle-audit
9 |
--------------------------------------------------------------------------------
/config/initializers/generators.rb:
--------------------------------------------------------------------------------
1 | Rails.application.config.app_generators do |g|
2 | g.fixture_replacement :factroy_bot, dir: "spec/factories"
3 | g.stylesheets false
4 | g.javascripts false
5 | end
6 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/config/locales/time.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | time:
3 | formats:
4 | short_date: '%x'
5 | long_date: '%a, %b %d, %Y'
6 | us: '%m/%d/%Y %I:%M %p'
7 | us_date: '%m/%d/%Y'
8 | us_time: '%I:%M %p'
9 |
--------------------------------------------------------------------------------
/spec/support/env_stub.rb:
--------------------------------------------------------------------------------
1 | RSpec.configure do |config|
2 | config.before do
3 | allow(ENV).to receive(:fetch).with("ACTION_DISPATCH_REQUEST_ID").and_return("4eac02e2-6856-449b-bc28-fbf1b32a20f2")
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/spec/support/helpers.rb:
--------------------------------------------------------------------------------
1 | module ResponseHelpers
2 | def json_response_body
3 | JSON.parse(response_body)
4 | end
5 | end
6 |
7 | RSpec.configure do |config|
8 | config.include ResponseHelpers
9 | end
10 |
--------------------------------------------------------------------------------
/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: async
6 |
7 | production:
8 | adapter: redis
9 | url: redis://localhost:6379/1
10 | channel_prefix: rails_base_api_production
11 |
--------------------------------------------------------------------------------
/spec/support/shared_contexts/time_is_frozen.rb:
--------------------------------------------------------------------------------
1 | shared_context "with frozen time" do
2 | let(:current_time) { Time.current }
3 |
4 | before { Timecop.freeze(current_time) }
5 |
6 | after { Timecop.return }
7 | end
8 |
--------------------------------------------------------------------------------
/app/serializers/application_serializer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationSerializer < ActiveModel::Serializer
2 | def self.decorate_collection(collection)
3 | ActiveModel::Serializer::CollectionSerializer.new(collection)
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-Agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/.erdconfig:
--------------------------------------------------------------------------------
1 | # more about rails-erd config file you can find
2 | # here: https://github.com/voormedia/rails-erd#configuration
3 | # and here: http://voormedia.github.io/rails-erd/customise.html
4 |
5 | filename: doc/entity-relationship
6 | filetype: png
7 |
--------------------------------------------------------------------------------
/config/secrets.yml:
--------------------------------------------------------------------------------
1 | default: &default
2 | secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
3 |
4 | development:
5 | <<: *default
6 |
7 | test:
8 | <<: *default
9 |
10 | staging:
11 | <<: *default
12 |
13 | production:
14 | <<: *default
15 |
--------------------------------------------------------------------------------
/app/models/user.rb:
--------------------------------------------------------------------------------
1 | class User < ApplicationRecord
2 | has_secure_password
3 |
4 | validates :email, presence: true
5 | validates :password, length: { minimum: 6 }
6 | validates :email, uniqueness: true, format: { with: URI::MailTo::EMAIL_REGEXP }
7 | end
8 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | require_relative '../config/boot'
8 | require 'rake'
9 | Rake.application.run
10 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += %i[password token]
5 |
--------------------------------------------------------------------------------
/spec/support/email.rb:
--------------------------------------------------------------------------------
1 | require "email_spec"
2 |
3 | RSpec.configure do |config|
4 | config.include EmailSpec::Helpers
5 | config.include EmailSpec::Matchers
6 |
7 | config.before do
8 | ActionMailer::Base.deliveries.clear
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/bin/docker-entrypoint:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | # Remove a potentially pre-existing server.pid for Rails.
6 | rm -f /app/tmp/pids/server.pid
7 |
8 | # Then exec the container's main process (what's set as CMD in the Dockerfile).
9 | exec "$@"
10 |
--------------------------------------------------------------------------------
/spec/factories/errors.rb:
--------------------------------------------------------------------------------
1 | FactoryBot.define do
2 | factory :error do
3 | code { :custom_error }
4 |
5 | trait :with_validations do
6 | validations do
7 | { email: ["can't be blank", "is invalid"] }
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path("config/application", __dir__)
5 |
6 | RailsBaseApi::Application.load_tasks
7 |
--------------------------------------------------------------------------------
/config/initializers/bullet.rb:
--------------------------------------------------------------------------------
1 | if defined?(Bullet)
2 | Rails.application.config.after_initialize do
3 | Bullet.enable = true
4 | Bullet.bullet_logger = true
5 | Bullet.console = true
6 | Bullet.rails_logger = true
7 | Bullet.add_footer = true
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/serializers/error_serializer.rb:
--------------------------------------------------------------------------------
1 | class ErrorSerializer < ActiveModel::Serializer::ErrorSerializer
2 | attributes :id, :status, :error, :validations
3 | attribute :validations, if: :include_validations?
4 |
5 | def include_validations?
6 | object.validations.present?
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Specify a serializer for the signed and encrypted cookie jars.
4 | # Valid options are :json, :marshal, and :hybrid.
5 | Rails.application.config.action_dispatch.cookies_serializer = :json
6 |
--------------------------------------------------------------------------------
/config/locales/errors.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | errors:
3 | invalid_credentials: Invalid credentials
4 | invalid_record: Invalid record
5 | unauthorized: Authorization required
6 | record_not_found: Record not found
7 | route_not_found: Route not found
8 | custom_error: Custom error message
9 |
--------------------------------------------------------------------------------
/spec/factories/jwt_tokens.rb:
--------------------------------------------------------------------------------
1 | FactoryBot.define do
2 | factory :jwt_token do
3 | transient do
4 | subject { create :user }
5 |
6 | id { subject.id }
7 | end
8 |
9 | payload { { "sub" => id } }
10 |
11 | initialize_with { new(payload: payload) }
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/config/initializers/strong_parameters.rb:
--------------------------------------------------------------------------------
1 | ActiveSupport.on_load(:active_record) do
2 | ActiveRecord::Base.send(:include, ActiveModel::ForbiddenAttributesProtection)
3 | end
4 |
5 | ActiveSupport.on_load(:action_controller) do
6 | ActionController::API.send :include, ActionController::StrongParameters
7 | end
8 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | APP_PATH = File.expand_path('../config/application', __dir__)
8 | require_relative '../config/boot'
9 | require 'rails/commands'
10 |
--------------------------------------------------------------------------------
/heroku.yml:
--------------------------------------------------------------------------------
1 | setup:
2 | addons:
3 | - plan: heroku-postgresql
4 | as: DATABASE
5 | - plan: sendgrid
6 | as: EMAIL
7 |
8 | build:
9 | docker:
10 | web: Dockerfile
11 | config:
12 | BUNDLE_WITHOUT: development test
13 |
14 | run:
15 | web: bundle exec puma -C config/puma.rb
16 |
--------------------------------------------------------------------------------
/spec/models/jwt_token_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | describe JwtToken do
4 | subject(:jwt_token) { described_class.new(payload: { "sub" => "1" }) }
5 |
6 | it "serializable resource" do
7 | expect { ActiveModelSerializers::SerializableResource.new(jwt_token).as_json }.not_to raise_error
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/controllers/v1/users_controller.rb:
--------------------------------------------------------------------------------
1 | module V1
2 | class UsersController < V1::BaseController
3 | expose :user
4 | expose :users, -> { User.all.order(:created_at) }
5 |
6 | def index
7 | respond_with users
8 | end
9 |
10 | def show
11 | respond_with user, location: :v1_user
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | jobs:
4 | build:
5 | machine: true
6 | working_directory: ~/repo
7 | steps:
8 | - setup_remote_docker
9 | - checkout
10 |
11 | - run:
12 | name: Setup
13 | command: bin/setup
14 |
15 | - run:
16 | name: Test
17 | command: bin/ci
18 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | mount Raddocs::App => "/"
3 |
4 | namespace :v1, defaults: { format: :json } do
5 | resources :registrations, only: :create
6 | resources :tokens, only: :create
7 | resource :profile, only: %i[show update destroy]
8 | resources :users, only: %i[index show]
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20130319140714_create_users.rb:
--------------------------------------------------------------------------------
1 | class CreateUsers < ActiveRecord::Migration[5.2]
2 | def change
3 | create_table :users do |t|
4 | t.string :full_name
5 | t.string :email, null: false
6 | t.string :password_digest, null: false
7 | t.timestamps
8 | end
9 |
10 | add_index :users, :email, unique: true
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7 | # Mayor.create(name: 'Emanuel', city: cities.first)
8 |
--------------------------------------------------------------------------------
/app/responders/api_responder.rb:
--------------------------------------------------------------------------------
1 | class ApiResponder < ActionController::Responder
2 | def api_behavior
3 | if post?
4 | display resource, status: :created
5 | else
6 | display resource, status: :ok
7 | end
8 | end
9 |
10 | def json_resource_errors
11 | Error.new(code: :invalid_record, validations: resource.errors.messages)
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | RSpec.configure do |config|
2 | config.backtrace_exclusion_patterns << /\.bundle/
3 |
4 | config.expect_with :rspec do |c|
5 | c.syntax = :expect
6 | end
7 |
8 | config.mock_with :rspec do |mocks|
9 | mocks.syntax = :expect
10 | mocks.verify_partial_doubles = true
11 | mocks.verify_doubled_constant_names = true
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/spec/rails_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] ||= "test"
2 |
3 | require "spec_helper"
4 | require File.expand_path("../config/environment", __dir__)
5 | require "rspec/rails"
6 | require "shoulda/matchers"
7 |
8 | Dir[Rails.root.join("spec", "support", "**", "*.rb")].each { |f| require f }
9 |
10 | RSpec.configure do |config|
11 | config.use_transactional_fixtures = true
12 | config.infer_spec_type_from_file_location!
13 | end
14 |
--------------------------------------------------------------------------------
/bin/foreman:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'foreman' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('foreman', 'foreman')
17 |
--------------------------------------------------------------------------------
/bin/rubocop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'rubocop' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('rubocop', 'rubocop')
17 |
--------------------------------------------------------------------------------
/app/controllers/v1/registrations_controller.rb:
--------------------------------------------------------------------------------
1 | module V1
2 | class RegistrationsController < V1::BaseController
3 | skip_before_action :authenticate_user!
4 |
5 | expose :user
6 |
7 | def create
8 | user.save
9 |
10 | respond_with user, location: :v1_profile
11 | end
12 |
13 | private
14 |
15 | def user_params
16 | params.require(:user).permit(:full_name, :email, :password)
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/bin/autospec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'autospec' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('rspec-core', 'autospec')
17 |
--------------------------------------------------------------------------------
/bin/brakeman:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'brakeman' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('brakeman', 'brakeman')
17 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/bin/bundle-audit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'bundle-audit' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('bundler-audit', 'bundle-audit')
17 |
--------------------------------------------------------------------------------
/config/locales/flash.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | flash:
3 | actions:
4 | create:
5 | notice: "%{resource_name} was successfully created."
6 | alert: "%{resource_name} could not be created."
7 | update:
8 | notice: "%{resource_name} was successfully updated."
9 | alert: "%{resource_name} could not be updated."
10 | destroy:
11 | notice: "%{resource_name} was successfully destroyed."
12 | alert: "%{resource_name} could not be destroyed."
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile ~/.gitignore_global
6 |
7 | /.bundle
8 | /db/*.sqlite3
9 | /log/*.log
10 | /tmp
11 | coverage/*
12 | rerun.txt
13 | vendor/bundle
14 | vendor/cache
15 | vendor/ruby
16 | .sass-cache
17 | ._*
18 | .env
19 | doc/entity-relationship.png
20 |
--------------------------------------------------------------------------------
/app/controllers/v1/tokens_controller.rb:
--------------------------------------------------------------------------------
1 | module V1
2 | class TokensController < V1::BaseController
3 | skip_before_action :authenticate_user!
4 |
5 | def create
6 | result = CreateJwt.call(authentication_params)
7 |
8 | if result.success?
9 | respond_with result.jwt_token
10 | else
11 | respond_with_error result.error
12 | end
13 | end
14 |
15 | private
16 |
17 | def authentication_params
18 | params.require(:authorization).permit(:email, :password)
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/app/interactors/create_jwt.rb:
--------------------------------------------------------------------------------
1 | class CreateJwt
2 | include Interactor
3 |
4 | delegate :email, :password, to: :context
5 |
6 | def call
7 | context.fail!(error: :invalid_credentials) unless authenticated?
8 | context.jwt_token = jwt_token
9 | end
10 |
11 | private
12 |
13 | def authenticated?
14 | user.present? && user.authenticate(password)
15 | end
16 |
17 | def jwt_token
18 | JwtToken.new(payload: { sub: user.id })
19 | end
20 |
21 | def user
22 | @user ||= User.find_by(email: email)
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | workers Integer(ENV["WEB_CONCURRENCY"] || 2)
2 | threads_count = Integer(ENV["RAILS_MAX_THREADS"] || 5)
3 | threads threads_count, threads_count
4 |
5 | preload_app!
6 |
7 | rackup DefaultRackup
8 | port ENV["PORT"] || 3000
9 | environment ENV["RACK_ENV"] || "development"
10 |
11 | on_worker_boot do
12 | # Worker specific setup for Rails 4.1+
13 | # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
14 | ActiveRecord::Base.establish_connection
15 | end
16 |
--------------------------------------------------------------------------------
/app/controllers/v1/profiles_controller.rb:
--------------------------------------------------------------------------------
1 | module V1
2 | class ProfilesController < V1::BaseController
3 | def show
4 | respond_with current_user
5 | end
6 |
7 | def update
8 | current_user.update(user_params)
9 |
10 | respond_with current_user
11 | end
12 |
13 | def destroy
14 | current_user.destroy
15 |
16 | respond_with current_user
17 | end
18 |
19 | private
20 |
21 | def user_params
22 | params.require(:user).permit(:full_name, :email, :password)
23 | end
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Rails Base API",
3 | "description": "Skeleton for new Rails application with REST API",
4 | "stack": "container",
5 | "env": {
6 | "HOST": { "required": true },
7 | "LANG": { "required": true },
8 | "CORS_ORIGINS": { "required": true },
9 | "RACK_ENV": { "required": true },
10 | "RAILS_ENV": { "required": true },
11 | "SECRET_KEY_BASE": { "required": true },
12 | "MAILER_SENDER_ADDRESS": { "required": true }
13 | },
14 | "addons": [
15 | "heroku-postgresql",
16 | "sendgrid"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12 | if spring
13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14 | gem 'spring', spring.version
15 | require 'spring/binstub'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/bin/rspec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | #
8 | # This file was generated by Bundler.
9 | #
10 | # The application 'rspec' is installed as part of a gem, and
11 | # this file is here to facilitate running it.
12 | #
13 |
14 | require 'pathname'
15 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
16 | Pathname.new(__FILE__).realpath)
17 |
18 | require 'rubygems'
19 | require 'bundler/setup'
20 |
21 | load Gem.bin_path('rspec-core', 'rspec')
22 |
--------------------------------------------------------------------------------
/spec/support/shared_contexts/api_headers.rb:
--------------------------------------------------------------------------------
1 | shared_context "with API Headers" do
2 | header "Accept", "application/json"
3 | header "Content-Type", "application/json"
4 | header "Lang", "en"
5 |
6 | let(:raw_post) { params.to_json }
7 | end
8 |
9 | shared_context "with Authorization header" do
10 | include_context "with API Headers"
11 |
12 | let(:current_user) { create(:user) }
13 | let(:jwt_token) { build(:jwt_token, subject: current_user) }
14 | let(:authorization) { "Bearer #{jwt_token.token}" }
15 |
16 | before do
17 | header "Authorization", :authorization
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/config/initializers/cors.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Avoid CORS issues when API is called from the frontend app.
4 | # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
5 |
6 | # Read more: https://github.com/cyu/rack-cors
7 |
8 | if ENV["CORS_ORIGINS"].present?
9 | Rails.application.config.middleware.insert_before 0, Rack::Cors do
10 | allow do
11 | origins(*ENV.fetch("CORS_ORIGINS").split(","))
12 |
13 | resource "*",
14 | headers: :any,
15 | methods: %i[get post put patch delete options head]
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | # Host name with PORT of the application
2 | HOST=0.0.0.0
3 |
4 | # CORS hostnames based on https://github.com/cyu/rack-cors
5 | # CORS_ORIGINS=
6 |
7 | # Current environment
8 | RACK_ENV=development
9 |
10 | # Base secret key
11 | SECRET_KEY_BASE=development_secret
12 |
13 | # Specify assets server host name, eg.: d2oek0c5zwe48d.cloudfront.net
14 | ASSET_HOST=lvh.me:3000
15 |
16 | # Set Rollbar key for the app
17 | # ROLLBAR_ACCESS_TOKEN=your_key_here
18 |
19 | # We send email using this "from" address
20 | MAILER_SENDER_ADDRESS=noreply@example.com
21 |
22 | # Exclude gems that are part of the specified named group
23 | BUNDLE_WITHOUT=
24 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | defaults: &defaults
2 | adapter: postgresql
3 | encoding: unicode
4 | min_messages: warning
5 | timeout: 5000
6 | pool: <%= [ENV.fetch("MAX_THREADS", 5), ENV.fetch("DB_POOL", 5)].max %>
7 | url: <%= ENV.fetch("DATABASE_URL") %>
8 |
9 | development:
10 | database: <%= ENV.fetch("DB_NAME", "#{File.basename(Rails.root)}_dev") %>
11 | <<: *defaults
12 |
13 | test:
14 | database: <%= ENV.fetch("DB_NAME", "#{File.basename(Rails.root)}_test") %>
15 | <<: *defaults
16 |
17 | production: &deploy
18 | database: <%= ENV.fetch("DB_NAME", "#{File.basename(Rails.root)}_production") %>
19 | <<: *defaults
20 |
21 | staging: *deploy
22 |
--------------------------------------------------------------------------------
/spec/support/rspec_api_documentation.rb:
--------------------------------------------------------------------------------
1 | require "rspec_api_documentation"
2 | require "rspec_api_documentation/dsl"
3 |
4 | # rubocop:disable Style/WordArray
5 | RspecApiDocumentation.configure do |config|
6 | config.app = Rails.application
7 | config.format = :JSON
8 | config.docs_dir = Rails.root.join("doc", "api", "v1")
9 | config.request_headers_to_include = ["Accept", "Content-Type", "Authorization"]
10 | config.response_headers_to_include = ["Content-Type"]
11 | config.curl_host = "http://#{ENV.fetch('HOST')}"
12 | config.curl_headers_to_filter = ["Cookie", "Host", "Origin"]
13 | config.keep_source_order = true
14 | end
15 | # rubocop:enable Style/WordArray
16 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | # Setup specific Bundler options if this is CI
6 | if [ "$CI" ]; then
7 | BUNDLER_ARGS="--without development staging production"
8 | RACK_ENV="test"
9 | fi
10 |
11 | # Set up configurable environment variables
12 | if [ ! -f .env ]; then
13 | cp .env.example .env
14 | fi
15 |
16 | # Fix Semaphore bug
17 | if [ "$SEMAPHORE" ]; then
18 | sudo chown 1000:1000 -R ./
19 | fi
20 |
21 | # Build Docker image
22 | docker-compose up --build --detach
23 |
24 | # Set up database and add any development seed data
25 | docker-compose exec app bin/rails db:create db:schema:load
26 |
27 | if [ -z "$CI" ]; then
28 | docker-compose exec app bin/rails db:seed
29 | fi
30 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | # Ignore files not needed when building a Docker image of this project
2 |
3 | # Ignore environment file since there are could be some sensitive credentials
4 | .env
5 |
6 | # Ignore the temporary files:
7 | /tmp/*
8 | /log/*.log
9 |
10 | # Ignore the gems installed by bundler, as they should be installed from zero
11 | # by the Docker image building process:
12 | /vendor/bundle
13 | .bundle
14 |
15 | # Ignore shell & console artifacts, such as bash, byebug and pry history logs:
16 | .bash_history
17 | .byebug_hist
18 | .pry_history
19 |
20 | # Ignore the docker-compose project files:
21 | docker-compose.yml
22 |
23 | # To avoid including the project's dependency cache in Docker's build context
24 | .semaphore-cache
25 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
17 |
18 |
19 |
20 |
21 |
22 |
We're sorry, but something went wrong.
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/spec/support/shared_examples/api_endpoint_with_authorization.rb:
--------------------------------------------------------------------------------
1 | shared_examples "API endpoint with authorization" do
2 | context "without authorization headers" do
3 | before do
4 | header "Authorization", ""
5 | end
6 |
7 | let(:expected_data) do
8 | {
9 | "errors" => [
10 | {
11 | "id" => "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
12 | "status" => 401,
13 | "error" => "Authorization required"
14 | }
15 | ]
16 | }
17 | end
18 |
19 | example "Request without authorization header", document: false do
20 | do_request
21 |
22 | expect(response_status).to eq(401)
23 | expect(json_response_body).to eq(expected_data)
24 | end
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/app/controllers/v1/base_controller.rb:
--------------------------------------------------------------------------------
1 | module V1
2 | class BaseController < ActionController::API
3 | include Knock::Authenticable
4 |
5 | before_action :authenticate_user!
6 |
7 | self.responder = ::ApiResponder
8 | respond_to :json
9 |
10 | rescue_from ActiveRecord::RecordNotFound do |_exception|
11 | respond_with_error(:record_not_found)
12 | end
13 |
14 | private
15 |
16 | def respond_with_error(code)
17 | Error.new(code: code).tap do |error|
18 | render json: error.to_json, status: error.status
19 | end
20 | end
21 |
22 | def authenticate_user!
23 | respond_with_error(:unauthorized) unless current_user
24 | end
25 |
26 | def current_user
27 | @current_user ||= token && authenticate_for(User)
28 | end
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
17 |
18 |
19 |
20 |
21 |
22 |
The change you wanted was rejected.
23 |
Maybe you tried to change something you didn't have access to.
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
17 |
18 |
19 |
20 |
21 |
22 |
The page you were looking for doesn't exist.
23 |
You may have mistyped the address or the page may have moved.
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spec/api/v1/registrations_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | resource "Registration" do
4 | include_context "with API Headers"
5 |
6 | post "/v1/registrations" do
7 | with_options scope: :user do
8 | parameter :full_name, "full name"
9 | parameter :email, "email", required: true
10 | parameter :password, "password", required: true
11 | end
12 |
13 | let(:full_name) { "Example User" }
14 | let(:email) { "user@example.com" }
15 | let(:password) { "123456" }
16 |
17 | let(:expected_data) do
18 | {
19 | "id" => User.last.id,
20 | "email" => "user@example.com",
21 | "full_name" => "Example User"
22 | }
23 | end
24 |
25 | example_request "Create User" do
26 | expect(response_status).to eq(201)
27 | expect(json_response_body).to eq(expected_data)
28 | end
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/spec/interactors/create_jwt_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | describe CreateJwt do
4 | subject(:result) { described_class.call(user_attributes) }
5 |
6 | let(:user_attributes) do
7 | {
8 | email: "john.smith@example.com",
9 | password: "123456"
10 | }
11 | end
12 |
13 | before do
14 | create :user, email: "john.smith@example.com", password: "123456"
15 | end
16 |
17 | it "authenticates user" do
18 | is_expected.to be_success
19 |
20 | expect(result.jwt_token).to be_present
21 | end
22 |
23 | context "when invalid credentials" do
24 | let(:user_attributes) do
25 | {
26 | email: "john.smith@example.com",
27 | password: "invalid password"
28 | }
29 | end
30 |
31 | it "does not authenticate user" do
32 | is_expected.to be_failure
33 |
34 | expect(result.jwt_token).to be_nil
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.4"
2 |
3 | services:
4 | db:
5 | image: postgres:11-alpine
6 | environment:
7 | - POSTGRES_PASSWORD=password
8 | volumes:
9 | - db-data:/var/lib/postgresql/data
10 |
11 | app: &app_base
12 | image: rails_base_api
13 | environment:
14 | - DATABASE_URL=postgres://postgres:password@db
15 | - PORT
16 | - HOST
17 | - SECRET_KEY_BASE
18 | - CORS_ORIGINS
19 | - ASSET_HOST
20 | - RACK_ENV
21 | - ROLLBAR_ACCESS_TOKEN
22 | - MAILER_SENDER_ADDRESS
23 | build:
24 | context: .
25 | args:
26 | - ADDITIONAL_PACKAGES=build-base git
27 | - BUNDLE_WITHOUT="${BUNDLE_WITHOUT}"
28 | ports:
29 | - "3000:3000"
30 | links:
31 | - db
32 | volumes:
33 | - ruby-bundle:/usr/local/bundle
34 | - .:/app
35 |
36 |
37 | volumes:
38 | ruby-bundle:
39 | db-data:
40 |
--------------------------------------------------------------------------------
/app/models/error.rb:
--------------------------------------------------------------------------------
1 | class Error
2 | include ActiveModel::Model
3 | include ActiveModel::Serialization
4 |
5 | CODES_TO_STATUS = {
6 | invalid_credentials: :unprocessable_entity,
7 | invalid_record: :unprocessable_entity,
8 | unauthorized: :unauthorized,
9 | record_not_found: :not_found,
10 | route_not_found: :not_found,
11 | custom_error: :internal_server_error
12 | }.freeze
13 |
14 | attr_accessor :code, :validations
15 |
16 | def attributes
17 | {
18 | id: id,
19 | status: status,
20 | error: error,
21 | validations: validations
22 | }.with_indifferent_access
23 | end
24 |
25 | def status
26 | Rack::Utils.status_code(CODES_TO_STATUS[code])
27 | end
28 |
29 | def to_json
30 | ActiveModelSerializers::SerializableResource.new([self], adapter: :json).to_json
31 | end
32 |
33 | private
34 |
35 | def id
36 | ENV.fetch("ACTION_DISPATCH_REQUEST_ID") { SecureRandom.uuid }
37 | end
38 |
39 | def error
40 | I18n.t("errors.#{code}")
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/spec/serializers/error_serializer_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | describe ErrorSerializer do
4 | describe "#serialize" do
5 | subject { ActiveModelSerializers::SerializableResource.new(error, serializer: described_class).as_json }
6 |
7 | let(:error) { build :error }
8 | let(:expected_attributes) do
9 | {
10 | id: "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
11 | status: 500,
12 | error: "Custom error message"
13 | }
14 | end
15 |
16 | it { is_expected.to eq(expected_attributes) }
17 |
18 | context "with validations" do
19 | let(:error) { build :error, :with_validations }
20 | let(:expected_attributes) do
21 | {
22 | id: "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
23 | status: 500,
24 | error: "Custom error message",
25 | validations: {
26 | email: ["can't be blank", "is invalid"]
27 | }
28 | }
29 | end
30 |
31 | it { is_expected.to eq(expected_attributes) }
32 | end
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/config/initializers/health_check.rb:
--------------------------------------------------------------------------------
1 | HealthCheck.setup do |config|
2 | # Text output upon success
3 | config.success = "success"
4 |
5 | # Timeout in seconds used when checking smtp server
6 | config.smtp_timeout = 30.0
7 |
8 | # http status code used when plain text error message is output
9 | # Set to 200 if you want your want to distinguish between partial (text does not include success) and
10 | # total failure of rails application (http status of 500 etc)
11 | config.http_status_for_error_text = 500
12 |
13 | # http status code used when an error object is output (json or xml)
14 | # Set to 200 if you want your want to distinguish between partial (healthy property == false) and
15 | # total failure of rails application (http status of 500 etc)
16 | config.http_status_for_error_object = 500
17 |
18 | # You can customize which checks happen on a standard health check
19 | config.standard_checks = %w[database migrations site]
20 |
21 | # You can set what tests are run with the 'full' or 'all' parameter
22 | config.full_checks = %w[database migrations site cache]
23 | end
24 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | ruby "2.5.1"
4 |
5 | # the most important stuff
6 | gem "pg"
7 | gem "rails", "5.2.2.1"
8 |
9 | # all other gems
10 | gem "active_model_serializers"
11 | gem "bcrypt"
12 | gem "bootsnap", require: false
13 | gem "decent_exposure"
14 | gem "health_check"
15 | gem "interactor"
16 | gem "kaminari"
17 | gem "knock"
18 | gem "puma"
19 | gem "rack-cors"
20 | gem "raddocs"
21 | gem "responders"
22 | gem "rollbar"
23 | gem "seedbank"
24 |
25 | group :development do
26 | gem "bullet"
27 | gem "letter_opener"
28 | gem "rails-erd"
29 | gem "spring"
30 | gem "spring-commands-rspec"
31 | gem "spring-watcher-listen"
32 | end
33 |
34 | group :development, :test do
35 | gem "brakeman"
36 | gem "bundler-audit"
37 | gem "byebug"
38 | gem "pry-rails"
39 | gem "rspec-rails"
40 | gem "rubocop"
41 | gem "rubocop-rspec"
42 | end
43 |
44 | group :test do
45 | gem "email_spec"
46 | gem "rspec_api_documentation"
47 | gem "shoulda-matchers", require: false
48 | gem "timecop"
49 | gem "webmock", require: false
50 | end
51 |
52 | group :development, :test, :staging do
53 | gem "factory_bot_rails"
54 | gem "faker"
55 | end
56 |
--------------------------------------------------------------------------------
/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket
23 |
24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/doc/README_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Project name
2 |
3 | [](https://semaphoreapp.com/fs/rails-base-api)
4 |
5 | ## Project description
6 |
7 | ## Dependencies
8 |
9 | * Postgresql 11.2
10 | * Ruby 2.5.1
11 | * Rails 5.2.2.1
12 |
13 | ## Quick Start
14 |
15 | 1. Clone this repo `git clone git@github.com:account/repo.git`
16 | 2. Run setup script `bin/setup`
17 | 3. Run specs `bin/ci`
18 | 3. Run server `bin/server`
19 |
20 | ## Scripts
21 |
22 | * `bin/setup` - build Docker image and prepare DB
23 | * `docker-compose up --detach` - to run server locally
24 | * `docker-compose exec app bin/rspec` - runs RSpec tests
25 | * `docker-compose exec app bin/quality` - runs rubocop, brakeman, and bundle-audit
26 | * `docker-compose exec app bin/doc` - generates API documentation
27 |
28 |
29 | ## Documentation & Examples
30 |
31 | Where is documentation and examples (e.g. `./docs`)?
32 |
33 | ## Continuous Integration
34 |
35 | CI service info and status (if available).
36 | Add a link to a project page on [Semaphore](http://semaphoreapp.com).
37 |
38 | ## Staging
39 |
40 | Location and other info about staging servers.
41 |
42 | ## Production
43 |
44 |
--------------------------------------------------------------------------------
/spec/models/error_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | describe Error do
4 | subject(:error) { described_class.new(code: :custom_error, validations: validations) }
5 |
6 | let(:validations) { nil }
7 |
8 | it "serializable resource" do
9 | expect { ActiveModelSerializers::SerializableResource.new(error).to_json }.not_to raise_error
10 | end
11 |
12 | describe "#attributes" do
13 | subject { error.attributes }
14 |
15 | let(:expected_attributes) do
16 | {
17 | "id" => "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
18 | "status" => 500,
19 | "error" => "Custom error message",
20 | "validations" => nil
21 | }
22 | end
23 |
24 | it { is_expected.to eq(expected_attributes) }
25 |
26 | context "with validation errors" do
27 | let(:validations) { { email: ["can't be blank", "is invalid"] } }
28 |
29 | let(:expected_attributes) do
30 | {
31 | "id" => "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
32 | "status" => 500,
33 | "error" => "Custom error message",
34 | "validations" => {
35 | "email" => ["can't be blank", "is invalid"]
36 | }
37 | }
38 | end
39 |
40 | it { is_expected.to eq(expected_attributes) }
41 | end
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # This file is auto-generated from the current state of the database. Instead
2 | # of editing this file, please use the migrations feature of Active Record to
3 | # incrementally modify your database, and then regenerate this schema definition.
4 | #
5 | # Note that this schema.rb definition is the authoritative source for your
6 | # database schema. If you need to create the application database on another
7 | # system, you should be using db:schema:load, not running all the migrations
8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9 | # you'll amass, the slower it'll run and the greater likelihood for issues).
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema.define(version: 2013_03_19_140714) do
14 |
15 | # These are extensions that must be enabled in order to support this database
16 | enable_extension "plpgsql"
17 |
18 | create_table "users", force: :cascade do |t|
19 | t.string "full_name"
20 | t.string "email", null: false
21 | t.string "password_digest", null: false
22 | t.datetime "created_at", null: false
23 | t.datetime "updated_at", null: false
24 | t.index ["email"], name: "index_users_on_email", unique: true
25 | end
26 |
27 | end
28 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | 1. Fork the project.
4 | 2. Setup it on your machine with `bin/setup`.
5 | 3. Make sure the tests pass: `bin/ci`.
6 | 4. Make your change. Add tests for your change when necessary. Make the tests pass: `bin/ci`.
7 | 5. Mention your changes in "Unreleased" section of `CHANGELOG.md`
8 | 6. Push to your fork and [submit a pull request](https://help.github.com/articles/creating-a-pull-request/)
9 | (bonus points for topic branches).
10 |
11 | ## Releases
12 |
13 | We release new versions of Rails Base API fortnightly on Fridays.
14 |
15 | We do not strictly follow [Semantic Versioning](http://semver.org/) as we use only `MAJOR`/`MINOR` increments:
16 |
17 | * Increment the `MAJOR` version when you make incompatible API changes.
18 | For example, upgrading Rails from 3.x to 4.x.
19 | * Increment the `MINOR` version when you make any other changes.
20 | That includes backwards-compatible changes and bug fixes.
21 |
22 | When ready to release:
23 |
24 | 1. Make sure that tests are green.
25 | 2. Update the changelog with the new version and commit it with message "release ".
26 | 3. Tag the release by running `git tag v`. Push the tag: `git push --tags`.
27 | 4. Verify that everything was pushed correctly on the Github: https://github.com/fs/rails-base/releases
28 |
--------------------------------------------------------------------------------
/spec/api/v1/tokens_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | resource "Tokens" do
4 | include_context "with API Headers"
5 |
6 | post "/v1/tokens" do
7 | with_options scope: :authorization do
8 | parameter :email, "email", required: true
9 | parameter :password, "password", required: true
10 | end
11 |
12 | let!(:user) { create :user, email: email, password: "123456" }
13 | let(:email) { "user@example.com" }
14 | let(:password) { "123456" }
15 |
16 | let(:jwt_token) { build(:jwt_token, subject: user) }
17 |
18 | let(:expected_data) { { "token" => jwt_token.token } }
19 |
20 | example_request "Create Token" do
21 | expect(response_status).to eq(201)
22 | expect(json_response_body).to eq(expected_data)
23 | end
24 |
25 | context "with invalid password" do
26 | let(:password) { "invalid" }
27 | let(:expected_data) do
28 | {
29 | "errors" => [
30 | {
31 | "id" => "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
32 | "status" => 422,
33 | "error" => "Invalid credentials"
34 | }
35 | ]
36 | }
37 | end
38 |
39 | example "Create Token with invalid password", document: false do
40 | do_request
41 |
42 | expect(response_status).to eq(422)
43 | expect(json_response_body).to eq(expected_data)
44 | end
45 | end
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/doc/api/v1/profiles/delete_profile.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Profiles",
3 | "resource_explanation": null,
4 | "http_method": "DELETE",
5 | "route": "/v1/profile",
6 | "description": "Delete Profile",
7 | "explanation": null,
8 | "parameters": [
9 |
10 | ],
11 | "response_fields": [
12 |
13 | ],
14 | "requests": [
15 | {
16 | "request_method": "DELETE",
17 | "request_path": "/v1/profile",
18 | "request_body": "{}",
19 | "request_headers": {
20 | "Accept": "application/json",
21 | "Content-Type": "application/json",
22 | "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM3fQ.irEHUzeVNIYh8-oWFjDcuQXeJ1WcDIkvr7kBktrywe4"
23 | },
24 | "request_query_parameters": {
25 | },
26 | "request_content_type": "application/json",
27 | "response_status": 200,
28 | "response_status_text": "OK",
29 | "response_body": "{\n \"id\": 837,\n \"email\": \"john.smith@example.com\",\n \"full_name\": \"John Smith\"\n}",
30 | "response_headers": {
31 | "Content-Type": "application/json; charset=utf-8"
32 | },
33 | "response_content_type": "application/json; charset=utf-8",
34 | "curl": "curl \"http://localhost:5000/v1/profile\" -d '{}' -X DELETE \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\" \\\n\t-H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM3fQ.irEHUzeVNIYh8-oWFjDcuQXeJ1WcDIkvr7kBktrywe4\""
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/doc/api/v1/profiles/retrieve_profile.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Profiles",
3 | "resource_explanation": null,
4 | "http_method": "GET",
5 | "route": "/v1/profile",
6 | "description": "Retrieve Profile",
7 | "explanation": null,
8 | "parameters": [
9 |
10 | ],
11 | "response_fields": [
12 |
13 | ],
14 | "requests": [
15 | {
16 | "request_method": "GET",
17 | "request_path": "/v1/profile",
18 | "request_body": null,
19 | "request_headers": {
20 | "Accept": "application/json",
21 | "Content-Type": "application/json",
22 | "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM0fQ.-NrAGBaudOVe_BZY_HvsLbPVcusVa8WiiJWPz4mz9wI"
23 | },
24 | "request_query_parameters": {
25 | "{}": null
26 | },
27 | "request_content_type": "application/json",
28 | "response_status": 200,
29 | "response_status_text": "OK",
30 | "response_body": "{\n \"id\": 834,\n \"email\": \"john.smith@example.com\",\n \"full_name\": \"John Smith\"\n}",
31 | "response_headers": {
32 | "Content-Type": "application/json; charset=utf-8"
33 | },
34 | "response_content_type": "application/json; charset=utf-8",
35 | "curl": "curl -g \"http://localhost:5000/v1/profile\" -X GET \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\" \\\n\t-H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM0fQ.-NrAGBaudOVe_BZY_HvsLbPVcusVa8WiiJWPz4mz9wI\""
36 | }
37 | ]
38 | }
--------------------------------------------------------------------------------
/doc/api/v1/users/retrieve_user.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Users",
3 | "resource_explanation": null,
4 | "http_method": "GET",
5 | "route": "/v1/users/:id",
6 | "description": "Retrieve User",
7 | "explanation": null,
8 | "parameters": [
9 | {
10 | "required": true,
11 | "name": "id",
12 | "description": "user id"
13 | }
14 | ],
15 | "response_fields": [
16 |
17 | ],
18 | "requests": [
19 | {
20 | "request_method": "GET",
21 | "request_path": "/v1/users/849",
22 | "request_body": null,
23 | "request_headers": {
24 | "Accept": "application/json",
25 | "Content-Type": "application/json",
26 | "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODUwfQ.APj5tSYameNRKzKP_If5gW_vq98VTHhasKRY7eQyLLI"
27 | },
28 | "request_query_parameters": {
29 | "{}": null
30 | },
31 | "request_content_type": "application/json",
32 | "response_status": 200,
33 | "response_status_text": "OK",
34 | "response_body": "{\n \"id\": 849,\n \"email\": \"john.smith@example.com\",\n \"full_name\": \"John Smith\"\n}",
35 | "response_headers": {
36 | "Content-Type": "application/json; charset=utf-8"
37 | },
38 | "response_content_type": "application/json; charset=utf-8",
39 | "curl": "curl -g \"http://localhost:5000/v1/users/849\" -X GET \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\" \\\n\t-H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODUwfQ.APj5tSYameNRKzKP_If5gW_vq98VTHhasKRY7eQyLLI\""
40 | }
41 | ]
42 | }
--------------------------------------------------------------------------------
/config/rails_best_practices.yml:
--------------------------------------------------------------------------------
1 | AddModelVirtualAttributeCheck: { }
2 | AlwaysAddDbIndexCheck: { }
3 | #CheckSaveReturnValueCheck: { }
4 | DefaultScopeIsEvilCheck: { }
5 | DryBundlerInCapistranoCheck: { }
6 | #HashSyntaxCheck: { }
7 | IsolateSeedDataCheck: { }
8 | KeepFindersOnTheirOwnModelCheck: { }
9 | LawOfDemeterCheck: { }
10 | # LongLineCheck: { max_line_length: 100 }
11 | MoveCodeIntoControllerCheck: { }
12 | MoveCodeIntoHelperCheck: { array_count: 3 }
13 | MoveCodeIntoModelCheck: { use_count: 2 }
14 | MoveFinderToNamedScopeCheck: { }
15 | MoveModelLogicIntoModelCheck: { use_count: 4 }
16 | NeedlessDeepNestingCheck: { nested_count: 2 }
17 | NotRescueExceptionCheck: { }
18 | NotUseDefaultRouteCheck: { }
19 | NotUseTimeAgoInWordsCheck: { }
20 | OveruseRouteCustomizationsCheck: { customize_count: 3 }
21 | ProtectMassAssignmentCheck: { }
22 | RemoveEmptyHelpersCheck: { }
23 | #RemoveTabCheck: { }
24 | RemoveTrailingWhitespaceCheck: { }
25 | # RemoveUnusedMethodsInControllersCheck: { except_methods: [] }
26 | RemoveUnusedMethodsInHelpersCheck: { except_methods: [] }
27 | RemoveUnusedMethodsInModelsCheck: { except_methods: [] }
28 | ReplaceComplexCreationWithFactoryMethodCheck: { attribute_assignment_count: 2 }
29 | ReplaceInstanceVariableWithLocalVariableCheck: { }
30 | RestrictAutoGeneratedRoutesCheck: { }
31 | SimplifyRenderInControllersCheck: { }
32 | SimplifyRenderInViewsCheck: { }
33 | #UseBeforeFilterCheck: { customize_count: 2 }
34 | UseModelAssociationCheck: { }
35 | UseMultipartAlternativeAsContentTypeOfEmailCheck: { }
36 | #UseParenthesesInMethodDefCheck: { }
37 | UseObserverCheck: { }
38 | UseQueryAttributeCheck: { }
39 | UseSayWithTimeInMigrationsCheck: { }
40 | UseScopeAccessCheck: { }
41 | #UseTurboSprocketsRails3Check: { }
42 |
--------------------------------------------------------------------------------
/doc/api/v1/tokens/create_token.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Tokens",
3 | "resource_explanation": null,
4 | "http_method": "POST",
5 | "route": "/v1/tokens",
6 | "description": "Create Token",
7 | "explanation": null,
8 | "parameters": [
9 | {
10 | "scope": "authorization",
11 | "required": true,
12 | "name": "email",
13 | "description": "email"
14 | },
15 | {
16 | "scope": "authorization",
17 | "required": true,
18 | "name": "password",
19 | "description": "password"
20 | }
21 | ],
22 | "response_fields": [
23 |
24 | ],
25 | "requests": [
26 | {
27 | "request_method": "POST",
28 | "request_path": "/v1/tokens",
29 | "request_body": "{\"authorization\":{\"email\":\"user@example.com\",\"password\":\"123456\"}}",
30 | "request_headers": {
31 | "Accept": "application/json",
32 | "Content-Type": "application/json"
33 | },
34 | "request_query_parameters": {
35 | },
36 | "request_content_type": "application/json",
37 | "response_status": 201,
38 | "response_status_text": "Created",
39 | "response_body": "{\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM5fQ.NQpJC4J4me9sLI9ov_BguI_twslBrxlHnFra8CJlinQ\"\n}",
40 | "response_headers": {
41 | "Content-Type": "application/json; charset=utf-8"
42 | },
43 | "response_content_type": "application/json; charset=utf-8",
44 | "curl": "curl \"http://localhost:5000/v1/tokens\" -d '{\"authorization\":{\"email\":\"user@example.com\",\"password\":\"123456\"}}' -X POST \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\""
45 | }
46 | ]
47 | }
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ######################
2 | # Stage: Builder
3 | FROM ruby:2.5.1-alpine as Builder
4 |
5 | RUN apk add --update --no-cache \
6 | build-base \
7 | postgresql-dev \
8 | git \
9 | imagemagick \
10 | tzdata
11 |
12 | WORKDIR /app
13 |
14 | # Install gems
15 | ARG BUNDLE_WITHOUT
16 | ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}
17 |
18 | COPY Gemfile* /app/
19 | RUN bundle install -j4 --retry 3 \
20 | # Remove unneeded files (cached *.gem, *.o, *.c)
21 | && rm -rf /usr/local/bundle/cache/*.gem \
22 | && find /usr/local/bundle/gems/ -name "*.c" -delete \
23 | && find /usr/local/bundle/gems/ -name "*.o" -delete
24 |
25 | # Add the Rails app
26 | COPY . /app/
27 |
28 | # Remove folders not needed in resulting image
29 | ARG FOLDERS_TO_REMOVE
30 | RUN rm -rf $FOLDERS_TO_REMOVE
31 |
32 | ###############################
33 | # Stage Final
34 | FROM ruby:2.5.1-alpine
35 | LABEL maintainer="timur.vafin@flatstack.com"
36 |
37 | # Add Alpine packages
38 | ARG ADDITIONAL_PACKAGES
39 | RUN apk add --update --no-cache \
40 | postgresql-client \
41 | imagemagick \
42 | tzdata \
43 | file \
44 | $ADDITIONAL_PACKAGES
45 |
46 | # Add user
47 | RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
48 | USER app
49 |
50 | # Copy app with gems from former build stage
51 | COPY --from=Builder --chown=app:app /usr/local/bundle/ /usr/local/bundle/
52 | COPY --from=Builder --chown=app:app /app/ /app/
53 |
54 | WORKDIR /app
55 |
56 | # Add a script to be executed every time the container starts.
57 | COPY --chown=app:app bin/docker-entrypoint /usr/bin/
58 | RUN chmod +x /usr/bin/docker-entrypoint
59 | ENTRYPOINT ["docker-entrypoint"]
60 |
61 | # Expose Server port
62 | EXPOSE 3000
63 |
64 | # Set Rails env
65 | ENV RAILS_LOG_TO_STDOUT true
66 |
67 | # Start up
68 | CMD ["bundle", "exec", "rails", "server"]
69 |
--------------------------------------------------------------------------------
/doc/api/v1/registration/create_user.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Registration",
3 | "resource_explanation": null,
4 | "http_method": "POST",
5 | "route": "/v1/registrations",
6 | "description": "Create User",
7 | "explanation": null,
8 | "parameters": [
9 | {
10 | "scope": "user",
11 | "name": "full_name",
12 | "description": "full name"
13 | },
14 | {
15 | "scope": "user",
16 | "required": true,
17 | "name": "email",
18 | "description": "email"
19 | },
20 | {
21 | "scope": "user",
22 | "required": true,
23 | "name": "password",
24 | "description": "password"
25 | }
26 | ],
27 | "response_fields": [
28 |
29 | ],
30 | "requests": [
31 | {
32 | "request_method": "POST",
33 | "request_path": "/v1/registrations",
34 | "request_body": "{\"user\":{\"full_name\":\"Example User\",\"email\":\"user@example.com\",\"password\":\"123456\"}}",
35 | "request_headers": {
36 | "Accept": "application/json",
37 | "Content-Type": "application/json"
38 | },
39 | "request_query_parameters": {
40 | },
41 | "request_content_type": "application/json",
42 | "response_status": 201,
43 | "response_status_text": "Created",
44 | "response_body": "{\n \"id\": 838,\n \"email\": \"user@example.com\",\n \"full_name\": \"Example User\"\n}",
45 | "response_headers": {
46 | "Content-Type": "application/json; charset=utf-8"
47 | },
48 | "response_content_type": "application/json; charset=utf-8",
49 | "curl": "curl \"http://localhost:5000/v1/registrations\" -d '{\"user\":{\"full_name\":\"Example User\",\"email\":\"user@example.com\",\"password\":\"123456\"}}' -X POST \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\""
50 | }
51 | ]
52 | }
--------------------------------------------------------------------------------
/doc/api/v1/users/list_users.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Users",
3 | "resource_explanation": null,
4 | "http_method": "GET",
5 | "route": "/v1/users",
6 | "description": "List Users",
7 | "explanation": null,
8 | "parameters": [
9 |
10 | ],
11 | "response_fields": [
12 |
13 | ],
14 | "requests": [
15 | {
16 | "request_method": "GET",
17 | "request_path": "/v1/users",
18 | "request_body": null,
19 | "request_headers": {
20 | "Accept": "application/json",
21 | "Content-Type": "application/json",
22 | "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODQxfQ.kRfB5lh6AbOjsiaVNGtewCC5rDCz2o_H2TEbzPRT-QA"
23 | },
24 | "request_query_parameters": {
25 | "{}": null
26 | },
27 | "request_content_type": "application/json",
28 | "response_status": 200,
29 | "response_status_text": "OK",
30 | "response_body": "[\n {\n \"id\": 841,\n \"email\": \"john.smith@example.com\",\n \"full_name\": \"John Smith\"\n },\n {\n \"id\": 842,\n \"email\": \"michael.jordan@example.com\",\n \"full_name\": \"Michael Jordan\"\n },\n {\n \"id\": 843,\n \"email\": \"brad.pitt@example.com\",\n \"full_name\": \"Brad Pitt\"\n },\n {\n \"id\": 844,\n \"email\": \"steve.jobs@example.com\",\n \"full_name\": \"Steve Jobs\"\n }\n]",
31 | "response_headers": {
32 | "Content-Type": "application/json; charset=utf-8"
33 | },
34 | "response_content_type": "application/json; charset=utf-8",
35 | "curl": "curl -g \"http://localhost:5000/v1/users\" -X GET \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\" \\\n\t-H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODQxfQ.kRfB5lh6AbOjsiaVNGtewCC5rDCz2o_H2TEbzPRT-QA\""
36 | }
37 | ]
38 | }
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure public file server for tests with Cache-Control for performance.
16 | config.public_file_server.enabled = true
17 | config.public_file_server.headers = {
18 | "Cache-Control" => "public, max-age=#{1.hour.to_i}"
19 | }
20 |
21 | # Show full error reports and disable caching.
22 | config.consider_all_requests_local = true
23 | config.action_controller.perform_caching = false
24 |
25 | # Raise exceptions instead of rendering exception templates.
26 | config.action_dispatch.show_exceptions = false
27 |
28 | # Disable request forgery protection in test environment.
29 | config.action_controller.allow_forgery_protection = false
30 |
31 | # Store uploaded files on the local file system in a temporary directory
32 | config.active_storage.service = :test
33 |
34 | config.action_mailer.perform_caching = false
35 |
36 | # Tell Action Mailer not to deliver emails to the real world.
37 | # The :test delivery method accumulates sent emails in the
38 | # ActionMailer::Base.deliveries array.
39 | config.action_mailer.delivery_method = :test
40 |
41 | # Print deprecation notices to the stderr.
42 | config.active_support.deprecation = :stderr
43 |
44 | # Raises error for missing translations
45 | # config.action_view.raise_on_missing_translations = true
46 | end
47 |
--------------------------------------------------------------------------------
/doc/api/v1/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "resources": [
3 | {
4 | "name": "Profiles",
5 | "explanation": null,
6 | "examples": [
7 | {
8 | "description": "Retrieve Profile",
9 | "link": "profiles/retrieve_profile.json",
10 | "groups": "all",
11 | "route": "/v1/profile",
12 | "method": "get"
13 | },
14 | {
15 | "description": "Update Profile",
16 | "link": "profiles/update_profile.json",
17 | "groups": "all",
18 | "route": "/v1/profile",
19 | "method": "patch"
20 | },
21 | {
22 | "description": "Delete Profile",
23 | "link": "profiles/delete_profile.json",
24 | "groups": "all",
25 | "route": "/v1/profile",
26 | "method": "delete"
27 | }
28 | ]
29 | },
30 | {
31 | "name": "Registration",
32 | "explanation": null,
33 | "examples": [
34 | {
35 | "description": "Create User",
36 | "link": "registration/create_user.json",
37 | "groups": "all",
38 | "route": "/v1/registrations",
39 | "method": "post"
40 | }
41 | ]
42 | },
43 | {
44 | "name": "Tokens",
45 | "explanation": null,
46 | "examples": [
47 | {
48 | "description": "Create Token",
49 | "link": "tokens/create_token.json",
50 | "groups": "all",
51 | "route": "/v1/tokens",
52 | "method": "post"
53 | }
54 | ]
55 | },
56 | {
57 | "name": "Users",
58 | "explanation": null,
59 | "examples": [
60 | {
61 | "description": "List Users",
62 | "link": "users/list_users.json",
63 | "groups": "all",
64 | "route": "/v1/users",
65 | "method": "get"
66 | },
67 | {
68 | "description": "Retrieve User",
69 | "link": "users/retrieve_user.json",
70 | "groups": "all",
71 | "route": "/v1/users/:id",
72 | "method": "get"
73 | }
74 | ]
75 | }
76 | ]
77 | }
--------------------------------------------------------------------------------
/doc/api/v1/profiles/update_profile.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "Profiles",
3 | "resource_explanation": null,
4 | "http_method": "PATCH",
5 | "route": "/v1/profile",
6 | "description": "Update Profile",
7 | "explanation": null,
8 | "parameters": [
9 | {
10 | "scope": "user",
11 | "name": "full_name",
12 | "description": "full name"
13 | },
14 | {
15 | "scope": "user",
16 | "name": "email",
17 | "description": "email"
18 | },
19 | {
20 | "scope": "user",
21 | "name": "password",
22 | "description": "password"
23 | }
24 | ],
25 | "response_fields": [
26 |
27 | ],
28 | "requests": [
29 | {
30 | "request_method": "PATCH",
31 | "request_path": "/v1/profile",
32 | "request_body": "{\"user\":{\"full_name\":\"Updated Name\",\"email\":\"user_updated@example.com\",\"password\":\"new_password\"}}",
33 | "request_headers": {
34 | "Accept": "application/json",
35 | "Content-Type": "application/json",
36 | "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM1fQ.FoJR2ry8maw_DxXviAYrjaJF0i8Xh6iZmlsZklbo1Z0"
37 | },
38 | "request_query_parameters": {
39 | },
40 | "request_content_type": "application/json",
41 | "response_status": 200,
42 | "response_status_text": "OK",
43 | "response_body": "{\n \"id\": 835,\n \"email\": \"user_updated@example.com\",\n \"full_name\": \"Updated Name\"\n}",
44 | "response_headers": {
45 | "Content-Type": "application/json; charset=utf-8"
46 | },
47 | "response_content_type": "application/json; charset=utf-8",
48 | "curl": "curl \"http://localhost:5000/v1/profile\" -d '{\"user\":{\"full_name\":\"Updated Name\",\"email\":\"user_updated@example.com\",\"password\":\"new_password\"}}' -X PATCH \\\n\t-H \"Accept: application/json\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Lang: en\" \\\n\t-H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTYyODE1MjgsInN1YiI6ODM1fQ.FoJR2ry8maw_DxXviAYrjaJF0i8Xh6iZmlsZklbo1Z0\""
49 | }
50 | ]
51 | }
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | require: rubocop-rspec
2 |
3 | Rails:
4 | Enabled: true
5 |
6 | AllCops:
7 | TargetRubyVersion: 2.5
8 | DisplayCopNames: true
9 | Exclude:
10 | - bin/**/*
11 | - db/**/*
12 | - vendor/**/*
13 | - node_modules/**/*
14 |
15 | Rails/UnknownEnv:
16 | Environments:
17 | - production
18 | - development
19 | - test
20 | - staging
21 |
22 | Rails/HasManyOrHasOneDependent:
23 | Enabled: true
24 |
25 | Rails/HasAndBelongsToMany:
26 | Enabled: false
27 |
28 | Rails/OutputSafety:
29 | Enabled: false
30 |
31 | RSpec/MultipleExpectations:
32 | Enabled: false
33 |
34 | RSpec/ExampleLength:
35 | Enabled: false
36 |
37 | RSpec/ImplicitSubject:
38 | Enabled: false
39 |
40 | RSpec/RepeatedDescription:
41 | Enabled: false
42 |
43 | Capybara/FeatureMethods:
44 | Enabled: false
45 |
46 | RSpec/MessageSpies:
47 | EnforcedStyle: receive
48 |
49 | RSpec/EmptyExampleGroup:
50 | Exclude:
51 | - spec/api/**/*
52 |
53 | Style/AndOr:
54 | Enabled: false
55 |
56 | Style/Documentation:
57 | Enabled: false
58 |
59 | Style/MethodCalledOnDoEndBlock:
60 | Enabled: true
61 |
62 | Style/CollectionMethods:
63 | Enabled: true
64 |
65 | Style/SymbolArray:
66 | Enabled: true
67 |
68 | Style/StringLiterals:
69 | EnforcedStyle: double_quotes
70 | ConsistentQuotesInMultiline: true
71 |
72 | Style/EmptyMethod:
73 | EnforcedStyle: expanded
74 | SupportedStyles:
75 | - compact
76 | - expanded
77 |
78 | Style/FrozenStringLiteralComment:
79 | Enabled: false
80 |
81 | Style/StringMethods:
82 | Enabled: true
83 |
84 | Layout/MultilineMethodCallIndentation:
85 | EnforcedStyle: indented
86 |
87 | Layout/AlignParameters:
88 | EnforcedStyle: with_fixed_indentation
89 | SupportedStyles:
90 | - with_first_parameter
91 | - with_fixed_indentation
92 |
93 | Metrics/LineLength:
94 | Max: 120
95 |
96 | Metrics/BlockLength:
97 | Enabled: false
98 |
99 | Layout/EndAlignment:
100 | EnforcedStyleAlignWith: variable
101 | SupportedStylesAlignWith:
102 | - keyword
103 | - variable
104 |
105 | Lint/AmbiguousBlockAssociation:
106 | Exclude:
107 | - spec/**/*
108 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports.
13 | config.consider_all_requests_local = true
14 |
15 | # Enable/disable caching. By default caching is disabled.
16 | # Run rails dev:cache to toggle caching.
17 | if Rails.root.join("tmp", "caching-dev.txt").exist?
18 | config.action_controller.perform_caching = true
19 |
20 | config.cache_store = :memory_store
21 | config.public_file_server.headers = {
22 | "Cache-Control" => "public, max-age=#{2.days.to_i}"
23 | }
24 | else
25 | config.action_controller.perform_caching = false
26 |
27 | config.cache_store = :null_store
28 | end
29 |
30 | # Store uploaded files on the local file system (see config/storage.yml for options)
31 | config.active_storage.service = :local
32 |
33 | # Don't care if the mailer can't send.
34 | config.action_mailer.raise_delivery_errors = false
35 | config.action_mailer.perform_caching = false
36 |
37 | # Preview email in the browser instead of sending it.
38 | config.action_mailer.delivery_method = :letter_opener
39 |
40 | # Print deprecation notices to the Rails logger.
41 | config.active_support.deprecation = :log
42 |
43 | # Raise an error on page load if there are pending migrations.
44 | config.active_record.migration_error = :page_load
45 |
46 | # Highlight code that triggered database queries in logs.
47 | config.active_record.verbose_query_logs = true
48 |
49 | # Raises error for missing translations
50 | # config.action_view.raise_on_missing_translations = true
51 |
52 | # Use an evented file watcher to asynchronously detect changes in source code,
53 | # routes, locales, etc. This feature depends on the listen gem.
54 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker
55 | end
56 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails"
4 | # Pick the frameworks you want:
5 | require "active_model/railtie"
6 | require "active_job/railtie"
7 | require "active_record/railtie"
8 | require "active_storage/engine"
9 | require "action_controller/railtie"
10 | require "action_mailer/railtie"
11 | require "action_view/railtie"
12 | # require "action_cable/engine"
13 | # require "sprockets/railtie"
14 |
15 | # Require the gems listed in Gemfile, including any gems
16 | # you've limited to :test, :development, or :production.
17 | Bundler.require(*Rails.groups)
18 |
19 | module RailsBaseApi
20 | class Application < Rails::Application
21 | # Initialize configuration defaults for originally generated Rails version.
22 | config.load_defaults 5.2
23 |
24 | # Settings in config/environments/* take precedence over those specified here.
25 | # Application configuration can go into files in config/initializers
26 | # -- all .rb files in that directory are automatically loaded after loading
27 | # the framework and any gems in your application.
28 |
29 | # Only loads a smaller set of middleware suitable for API only apps.
30 | # Middleware like session, flash, cookies can be added back manually.
31 | # Skip views, helpers and assets when generating a new resource.
32 | config.api_only = true
33 |
34 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
36 | # config.time_zone = "Central Time (US & Canada)"
37 |
38 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39 | config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.{rb,yml}")]
40 | # config.i18n.default_locale = :de
41 |
42 | # Enable deflate / gzip compression of controller-generated responses
43 | config.middleware.use Rack::Deflater
44 |
45 | # Set default From address for all Mailers
46 | config.action_mailer.default_options = { from: ENV.fetch("MAILER_SENDER_ADDRESS") }
47 |
48 | # Set URL options to be able to use url_for helpers
49 | config.action_mailer.default_url_options = { host: ENV.fetch("HOST") }
50 | end
51 | end
52 |
--------------------------------------------------------------------------------
/spec/api/v1/users_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | resource "Users" do
4 | include_context "with Authorization header"
5 |
6 | get "/v1/users" do
7 | let!(:user_1) { create :user, full_name: "Michael Jordan", email: "michael.jordan@example.com" }
8 | let!(:user_2) { create :user, full_name: "Brad Pitt", email: "brad.pitt@example.com" }
9 | let!(:user_3) { create :user, full_name: "Steve Jobs", email: "steve.jobs@example.com" }
10 |
11 | let(:expected_data) do
12 | [
13 | {
14 | "id" => user_1.id,
15 | "email" => "michael.jordan@example.com",
16 | "full_name" => "Michael Jordan"
17 | },
18 | {
19 | "id" => user_2.id,
20 | "email" => "brad.pitt@example.com",
21 | "full_name" => "Brad Pitt"
22 | },
23 | {
24 | "id" => user_3.id,
25 | "email" => "steve.jobs@example.com",
26 | "full_name" => "Steve Jobs"
27 | },
28 | {
29 | "id" => current_user.id,
30 | "email" => current_user.email,
31 | "full_name" => current_user.full_name
32 | }
33 | ]
34 | end
35 |
36 | it_behaves_like "API endpoint with authorization"
37 |
38 | example_request "List Users" do
39 | expect(response_status).to eq(200)
40 | expect(json_response_body).to eq(expected_data)
41 | end
42 | end
43 |
44 | get "/v1/users/:id" do
45 | parameter :id, "user id", required: true
46 |
47 | let(:user) { create :user, full_name: "John Smith", email: "john.smith@example.com" }
48 | let(:id) { user.id }
49 |
50 | let(:expected_data) do
51 | {
52 | "id" => user.id,
53 | "email" => "john.smith@example.com",
54 | "full_name" => "John Smith"
55 | }
56 | end
57 |
58 | it_behaves_like "API endpoint with authorization"
59 |
60 | example_request "Retrieve User" do
61 | expect(response_status).to eq(200)
62 | expect(json_response_body).to eq(expected_data)
63 | end
64 |
65 | context "with invalid id" do
66 | let(:id) { 0 }
67 | let(:expected_data) do
68 | {
69 | "errors" => [
70 | {
71 | "id" => "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
72 | "status" => 404,
73 | "error" => "Record not found"
74 | }
75 | ]
76 | }
77 | end
78 |
79 | example "Retrieve User with invalid id", document: false do
80 | do_request
81 |
82 | expect(response_status).to eq(404)
83 | expect(json_response_body).to eq(expected_data)
84 | end
85 | end
86 | end
87 | end
88 |
--------------------------------------------------------------------------------
/spec/api/v1/profiles_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | resource "Profiles" do
4 | include_context "with Authorization header"
5 |
6 | let(:current_user) { create :user, email: "john.smith@example.com", full_name: "John Smith" }
7 |
8 | get "/v1/profile" do
9 | let(:expected_data) do
10 | {
11 | "id" => current_user.id,
12 | "email" => "john.smith@example.com",
13 | "full_name" => "John Smith"
14 | }
15 | end
16 |
17 | it_behaves_like "API endpoint with authorization"
18 |
19 | example_request "Retrieve Profile" do
20 | expect(response_status).to eq(200)
21 | expect(json_response_body).to eq(expected_data)
22 | end
23 | end
24 |
25 | patch "/v1/profile" do
26 | with_options scope: :user do
27 | parameter :full_name, "full name"
28 | parameter :email, "email"
29 | parameter :password, "password"
30 | end
31 |
32 | let(:id) { current_user.id }
33 | let(:type) { "users" }
34 | let(:full_name) { "Updated Name" }
35 | let(:email) { "user_updated@example.com" }
36 | let(:password) { "new_password" }
37 |
38 | let(:expected_data) do
39 | {
40 | "id" => current_user.id,
41 | "email" => "user_updated@example.com",
42 | "full_name" => "Updated Name"
43 | }
44 | end
45 |
46 | it_behaves_like "API endpoint with authorization"
47 |
48 | example_request "Update Profile" do
49 | expect(response_status).to eq(200)
50 | expect(json_response_body).to eq(expected_data)
51 | end
52 |
53 | context "with invalid data" do
54 | let(:password) { "" }
55 | let(:email) { "invalid" }
56 |
57 | let(:expected_data) do
58 | {
59 | "error" => "Invalid record",
60 | "id" => "4eac02e2-6856-449b-bc28-fbf1b32a20f2",
61 | "status" => 422,
62 | "validations" => {
63 | "email" => ["is invalid"],
64 | "password" => ["is too short (minimum is 6 characters)"]
65 | }
66 | }
67 | end
68 |
69 | example "Update Profile with empty password and invalid email", document: false do
70 | do_request
71 |
72 | expect(response_status).to eq(422)
73 | expect(json_response_body).to eq(expected_data)
74 | end
75 | end
76 | end
77 |
78 | delete "/v1/profile" do
79 | let(:expected_data) do
80 | {
81 | "id" => current_user.id,
82 | "email" => "john.smith@example.com",
83 | "full_name" => "John Smith"
84 | }
85 | end
86 |
87 | it_behaves_like "API endpoint with authorization"
88 |
89 | example_request "Delete Profile" do
90 | expect(response_status).to eq(200)
91 | expect(json_response_body).to eq(expected_data)
92 | end
93 | end
94 | end
95 |
--------------------------------------------------------------------------------
/config/initializers/rollbar.rb:
--------------------------------------------------------------------------------
1 | Rollbar.configure do |config|
2 | config.access_token = ENV["ROLLBAR_ACCESS_TOKEN"]
3 |
4 | # Without configuration, Rollbar is enabled in all environments.
5 | # To disable in specific environments, set config.enabled=false.
6 | # Here we'll disable in 'test':
7 | config.enabled = !(Rails.env.test? || Rails.env.development?)
8 |
9 | # By default, Rollbar will try to call the `current_user` controller method
10 | # to fetch the logged-in user object, and then call that object's `id`,
11 | # `username`, and `email` methods to fetch those properties. To customize:
12 | # config.person_method = "my_current_user"
13 | # config.person_id_method = "my_id"
14 | # config.person_username_method = "my_username"
15 | # config.person_email_method = "my_email"
16 |
17 | # If you want to attach custom data to all exception and message reports,
18 | # provide a lambda like the following. It should return a hash.
19 | # config.custom_data_method = lambda { {:some_key => "some_value" } }
20 |
21 | # Add exception class names to the exception_level_filters hash to
22 | # change the level that exception is reported at. Note that if an exception
23 | # has already been reported and logged the level will need to be changed
24 | # via the rollbar interface.
25 | # Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
26 | # 'ignore' will cause the exception to not be reported at all.
27 | # config.exception_level_filters.merge!('MyCriticalException' => 'critical')
28 |
29 | # Ignoring 404 errors
30 | config.exception_level_filters.merge!(
31 | "ActionController::RoutingError" => "ignore",
32 | "AbstractController::ActionNotFound" => "ignore"
33 | )
34 |
35 | # You can also specify a callable, which will be called with the exception instance.
36 | # config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' })
37 |
38 | # Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
39 | # is not installed)
40 | # config.use_async = true
41 | # Supply your own async handler:
42 | # config.async_handler = Proc.new { |payload|
43 | # Thread.new { Rollbar.process_from_async_handler(payload) }
44 | # }
45 |
46 | # Enable asynchronous reporting (using sucker_punch)
47 | # config.use_sucker_punch
48 |
49 | # Enable delayed reporting (using Sidekiq)
50 | # config.use_sidekiq
51 | # You can supply custom Sidekiq options:
52 | # config.use_sidekiq 'queue' => 'default'
53 |
54 | # If you run your staging application instance in production environment then
55 | # you'll want to override the environment reported by `Rails.env` with an
56 | # environment variable like this: `ROLLBAR_ENV=staging`. This is a recommended
57 | # setup for Heroku. See:
58 | # https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
59 | # config.environment = ENV["ROLLBAR_ENV"] || Rails.env
60 | end
61 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Unreleased
2 |
3 | * Update nokogiri, rack-cors, sprockets to stable versions
4 | ([#226](https://github.com/fs/rails-base-api/pull/226))
5 | * Update Ruby to 2.3.6, update loofah gem
6 | * Update Rails to 4.2.8
7 | * Update Ruby to 2.3.3
8 | * Upgrade [decent exposure](https://github.com/hashrocket/decent_exposure) to 3.0
9 | * Include [rails-api-format](https://github.com/fs/rails-api-format.git) gem from git source.
10 | * Update Faker to 1.6.6
11 | * Update Rollbar to 2.12.0
12 | * Extract authentication_token from UserSerializer
13 | ([#203](https://github.com/fs/rails-base-api/pull/203))
14 | * Add health_check gem for check that rails is up
15 | * Update Rails to 4.2.7.1
16 | * Update Ruby to 2.3.1
17 | * Update Nokogiri gem to get rid of vulnerabilities
18 | * Update Rails to get rid of vulnerabilities
19 | ([#200](https://github.com/fs/rails-base-api/pull/200))
20 | * Update Rails and Devise to get rid of vulnerabilities
21 | ([#198](https://github.com/fs/rails-base-api/pull/198))
22 | * Switch off static assets serve
23 | ([#192](https://github.com/fs/rails-base-api/pull/192))
24 | * Update Rails to 4.2.4 and Ruby to 2.2.3
25 | ([#193](https://github.com/fs/rails-base-api/pull/193))
26 | * Sync Rubocop rules with Rails-Base
27 | * Replace custom token authentication strategy with [simple_token_authentication](https://github.com/gonzalo-bulnes/simple_token_authentication)
28 | ([#184](https://github.com/fs/rails-base-api/pull/184))
29 | * Add id to error response
30 | ([#183](https://github.com/fs/rails-base-api/pull/183))
31 | * Upgrade Active Model Serializer to 0.10.0.rc2
32 | ([#182](https://github.com/fs/rails-base-api/pull/182))
33 | * Rename bin/bootstrap to bin/setup
34 | ([#180](https://github.com/fs/rails-base-api/pull/180))
35 | * Replace zeus with [Spring](https://github.com/rails/spring) for fast Rails actions via pre-loading
36 | * Provide full resource for all requests
37 | ([#176](https://github.com/fs/rails-base-api/pull/176))
38 | * Introduce `rails_api_format` gem. Currently it makes standard error responses,
39 | in the future all API format related changes will be made by this gem.
40 | ([#85](https://github.com/fs/rails-base-api/pull/85))
41 | * Filter headers in docs to make it less chatty
42 | ([#177](https://github.com/fs/rails-base-api/pull/177))
43 | * Move `sessions` resource to `v1` namespace
44 | ([#175](https://github.com/fs/rails-base-api/pull/175))
45 | * Replace unsupported [interactor-rails](https://github.com/collectiveidea/interactor-rails) with [interactor](https://github.com/collectiveidea/interactor)
46 | ([#151](https://github.com/fs/rails-base-api/pull/151))
47 | * Update Ruby to 2.2.2 and dependencies: rubocop
48 | ([#173](https://github.com/fs/rails-base-api/pull/173))
49 | * Update Rails API to 0.4.0
50 | ([#171](https://github.com/fs/rails-base-api/pull/171))
51 | * Update Rspec and dependencies: guard-rspec, rspec_api_documentation.
52 | Remove minitest from dependencies after update of shoulda-matchers.
53 | ([#170](https://github.com/fs/rails-base-api/pull/170))
54 | * Update Rails to 4.2.3 dependencies: ActiveModelSerializer, Devise, Bullet
55 | ([#169](https://github.com/fs/rails-base-api/pull/169))
56 | * Add `CHANGELOG.md` and `CONTRIBUTING.md`
57 | ([#167](https://github.com/fs/rails-base-api/pull/167))
58 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Skeleton for new Rails 5 application for REST API
2 |
3 | [](https://semaphoreci.com/fs/rails-base-api)
4 |
5 | This simple application includes Ruby/Rails technology which we use at Flatstack for new REST API projects. Application currently based on Rails 5 stable branch and Ruby 2.5.1
6 |
7 | ## What's included
8 |
9 | ### Application gems:
10 |
11 | * [active_model_serializers](https://github.com/rails-api/active_model_serializers) - resource serializers
12 | * [decent_exposure](https://github.com/voxdolo/decent_exposure) for DRY controllers
13 | * [health_check](https://github.com/ianheggie/health_check) - health check endpoint
14 | * [interactor](https://github.com/collectiveidea/interactor) – encapsulates business logic
15 | * [kaminari](https://github.com/amatsuda/kaminari) for pagination
16 | * [knock](https://github.com/nsarno/knock) – seamless JWT authentication
17 | * [puma](https://github.com/puma/puma) as Rails web server
18 | * [rack-cors](https://github.com/cyu/rack-cors) for [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)
19 | * [responders](https://github.com/plataformatec/responders) - DRY controllers
20 | * [rollbar](https://github.com/rollbar/rollbar-gem) for exception notification
21 |
22 | ### Development gems
23 |
24 | * [brakeman](https://github.com/presidentbeef/brakeman) - static analysis security vulnerability scanner
25 | * [bullet](https://github.com/flyerhzm/bullet) - kill n+1 queries and unused eager loading
26 | * [bundler-audit](https://github.com/rubysec/bundler-audit) - patch-level verification for gems
27 | * [dotenv](https://github.com/bkeepers/dotenv) - load environment variables from `.env`
28 | * [letter_opener](https://github.com/ryanb/letter_opener) - preview E-Mails in the browser instead of sending
29 | * [rails-erd](https://github.com/voormedia/rails-erd) - generate a diagram based on application's AR models
30 | * [seedbank](https://github.com/james2m/seedbank) - seeds on steroids
31 |
32 | ### Testing gems
33 |
34 | * [factory bot](https://github.com/thoughtbot/factory_bot) - create test data
35 | * [faker](https://github.com/stympy/faker) - generate fake data
36 | * [rspec api documentation](https://github.com/zipmark/rspec_api_documentation) - generate pretty API docs
37 | * [rspec](https://github.com/rspec/rspec) - awesome, readable isolation testing
38 | * [shoulda matchers](http://github.com/thoughtbot/shoulda-matchers) - frequently needed Rails and RSpec matchers
39 |
40 | ### Non standard initializes
41 |
42 | * `active_model_serializer.rb` - setup serializers for REST API
43 | * `bullet.rb` - setup Bullet to catch up N+1
44 | * `cors.rb` - setup whitelist of domains to allow cross-origin resource sharing
45 | * `health_check.rb` - setup Health Check endpoint
46 | * `rollbar.rb` - setup Rollbar
47 |
48 | ### Scripts
49 |
50 | * `bin/setup` - build Docker image and prepare DB
51 | * `bin/server` - to run server locally
52 | * `bin/ci` - runs RSpec tests and quality tools
53 | * `bin/doc` - generates API documentation
54 |
55 | ## Quick start
56 |
57 | Clone application as new project with original repository named "rails-base-api"
58 |
59 | ```bash
60 | git clone git://github.com/fs/rails-base-api.git --origin rails-base-api [MY-NEW-PROJECT]
61 | ```
62 |
63 | Create your new repo on GitHub and push master into it.
64 | Make sure master branch is tracking origin repo.
65 |
66 | ```bash
67 | git remote add origin git@github.com:[MY-GITHUB-ACCOUNT]/[MY-NEW-PROJECT].git
68 | git push -u origin master
69 | ```
70 |
71 | Run setup script
72 |
73 | ```bash
74 | bin/setup
75 | ```
76 |
77 | Make sure all test are green
78 |
79 | ```bash
80 | bin/ci
81 | ```
82 |
83 | **Do not forget to update this file!**
84 |
85 | ```bash
86 | mv doc/README_TEMPLATE.md README.md
87 | # update README.md
88 | git commit -am "Update README.md"
89 | ```
90 |
91 | [
](http://www.flatstack.com)
92 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # Eager load code on boot. This eager loads most of Rails and
8 | # your application in memory, allowing both threaded web servers
9 | # and those relying on copy on write to perform better.
10 | # Rake tasks automatically ignore this option for performance.
11 | config.eager_load = true
12 |
13 | # Full error reports are disabled and caching is turned on.
14 | config.consider_all_requests_local = false
15 | config.action_controller.perform_caching = true
16 |
17 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
18 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
19 | # config.require_master_key = true
20 |
21 | # Disable serving static files from the `/public` folder by default since
22 | # Apache or NGINX already handles this.
23 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
24 |
25 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
26 | if ENV["ASSET_HOST"]
27 | config.action_mailer.asset_host = ENV["ASSET_HOST"]
28 | # config.action_controller.asset_host = ENV["ASSET_HOST"]
29 | end
30 |
31 | # Specifies the header that your server uses for sending files.
32 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
33 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
34 |
35 | # Store uploaded files on the local file system (see config/storage.yml for options)
36 | config.active_storage.service = :local
37 |
38 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
39 | config.force_ssl = true
40 |
41 | # Use the lowest log level to ensure availability of diagnostic information
42 | # when problems arise.
43 | config.log_level = :debug
44 |
45 | # Prepend all log lines with the following tags.
46 | config.log_tags = [:request_id]
47 |
48 | # Use a different cache store in production.
49 | # config.cache_store = :mem_cache_store
50 |
51 | # Use a real queuing backend for Active Job (and separate queues per environment)
52 | # config.active_job.queue_adapter = :resque
53 | # config.active_job.queue_name_prefix = "rails_base_api_#{Rails.env}"
54 |
55 | config.action_mailer.perform_caching = false
56 |
57 | # Ignore bad email addresses and do not raise email delivery errors.
58 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
59 | # config.action_mailer.raise_delivery_errors = false
60 |
61 | # Enable Email delivery via custom SMTP server or via SendGrid by default
62 | if ENV["SMTP_USERNAME"] || ENV["SENDGRID_USERNAME"]
63 | config.action_mailer.delivery_method = :smtp
64 |
65 | config.action_mailer.smtp_settings = {
66 | authentication: :plain,
67 | enable_starttls_auto: true,
68 | openssl_verify_mode: ENV.fetch("SMTP_OPENSSL_VERIFY_MODE", nil),
69 | address: ENV.fetch("SMTP_ADDRESS", "smtp.sendgrid.net"),
70 | port: ENV.fetch("SMTP_PORT", 587),
71 | domain: ENV.fetch("SMTP_DOMAIN", "heroku.com"),
72 | user_name: ENV.fetch("SMTP_USERNAME") { ENV.fetch("SENDGRID_USERNAME") },
73 | password: ENV.fetch("SMTP_PASSWORD") { ENV.fetch("SENDGRID_PASSWORD") }
74 | }
75 | end
76 |
77 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
78 | # the I18n.default_locale when a translation cannot be found).
79 | config.i18n.fallbacks = true
80 |
81 | # Send deprecation notices to registered listeners.
82 | config.active_support.deprecation = :notify
83 |
84 | # Use default logging formatter so that PID and timestamp are not suppressed.
85 | config.log_formatter = ::Logger::Formatter.new
86 |
87 | # Use a different logger for distributed setups.
88 | # require "syslog/logger"
89 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
90 |
91 | if ENV["RAILS_LOG_TO_STDOUT"].present?
92 | logger = ActiveSupport::Logger.new(STDOUT)
93 | logger.formatter = config.log_formatter
94 | config.logger = ActiveSupport::TaggedLogging.new(logger)
95 | end
96 |
97 | # Do not dump schema after migrations.
98 | config.active_record.dump_schema_after_migration = false
99 | end
100 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | actioncable (5.2.2.1)
5 | actionpack (= 5.2.2.1)
6 | nio4r (~> 2.0)
7 | websocket-driver (>= 0.6.1)
8 | actionmailer (5.2.2.1)
9 | actionpack (= 5.2.2.1)
10 | actionview (= 5.2.2.1)
11 | activejob (= 5.2.2.1)
12 | mail (~> 2.5, >= 2.5.4)
13 | rails-dom-testing (~> 2.0)
14 | actionpack (5.2.2.1)
15 | actionview (= 5.2.2.1)
16 | activesupport (= 5.2.2.1)
17 | rack (~> 2.0)
18 | rack-test (>= 0.6.3)
19 | rails-dom-testing (~> 2.0)
20 | rails-html-sanitizer (~> 1.0, >= 1.0.2)
21 | actionview (5.2.2.1)
22 | activesupport (= 5.2.2.1)
23 | builder (~> 3.1)
24 | erubi (~> 1.4)
25 | rails-dom-testing (~> 2.0)
26 | rails-html-sanitizer (~> 1.0, >= 1.0.3)
27 | active_model_serializers (0.10.9)
28 | actionpack (>= 4.1, < 6)
29 | activemodel (>= 4.1, < 6)
30 | case_transform (>= 0.2)
31 | jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
32 | activejob (5.2.2.1)
33 | activesupport (= 5.2.2.1)
34 | globalid (>= 0.3.6)
35 | activemodel (5.2.2.1)
36 | activesupport (= 5.2.2.1)
37 | activerecord (5.2.2.1)
38 | activemodel (= 5.2.2.1)
39 | activesupport (= 5.2.2.1)
40 | arel (>= 9.0)
41 | activestorage (5.2.2.1)
42 | actionpack (= 5.2.2.1)
43 | activerecord (= 5.2.2.1)
44 | marcel (~> 0.3.1)
45 | activesupport (5.2.2.1)
46 | concurrent-ruby (~> 1.0, >= 1.0.2)
47 | i18n (>= 0.7, < 2)
48 | minitest (~> 5.1)
49 | tzinfo (~> 1.1)
50 | addressable (2.5.2)
51 | public_suffix (>= 2.0.2, < 4.0)
52 | arel (9.0.0)
53 | ast (2.4.0)
54 | bcrypt (3.1.12)
55 | bootsnap (1.3.1)
56 | msgpack (~> 1.0)
57 | brakeman (4.3.1)
58 | builder (3.2.3)
59 | bullet (5.7.6)
60 | activesupport (>= 3.0.0)
61 | uniform_notifier (~> 1.11.0)
62 | bundler-audit (0.6.0)
63 | bundler (~> 1.2)
64 | thor (~> 0.18)
65 | byebug (10.0.2)
66 | case_transform (0.2)
67 | activesupport
68 | choice (0.2.0)
69 | coderay (1.1.2)
70 | concurrent-ruby (1.1.5)
71 | crack (0.4.3)
72 | safe_yaml (~> 1.0.0)
73 | crass (1.0.4)
74 | decent_exposure (3.0.2)
75 | activesupport (>= 4.0)
76 | diff-lcs (1.3)
77 | email_spec (2.2.0)
78 | htmlentities (~> 4.3.3)
79 | launchy (~> 2.1)
80 | mail (~> 2.7)
81 | erubi (1.8.0)
82 | factory_bot (4.11.0)
83 | activesupport (>= 3.0.0)
84 | factory_bot_rails (4.11.0)
85 | factory_bot (~> 4.11.0)
86 | railties (>= 3.0.0)
87 | faker (1.9.3)
88 | i18n (>= 0.7)
89 | ffi (1.9.25)
90 | globalid (0.4.2)
91 | activesupport (>= 4.2.0)
92 | haml (5.0.4)
93 | temple (>= 0.8.0)
94 | tilt
95 | hashdiff (0.3.7)
96 | health_check (3.0.0)
97 | railties (>= 5.0)
98 | htmlentities (4.3.4)
99 | i18n (1.6.0)
100 | concurrent-ruby (~> 1.0)
101 | interactor (3.1.1)
102 | jaro_winkler (1.5.1)
103 | json (2.2.0)
104 | jsonapi-renderer (0.2.0)
105 | jwt (1.5.6)
106 | kaminari (1.1.1)
107 | activesupport (>= 4.1.0)
108 | kaminari-actionview (= 1.1.1)
109 | kaminari-activerecord (= 1.1.1)
110 | kaminari-core (= 1.1.1)
111 | kaminari-actionview (1.1.1)
112 | actionview
113 | kaminari-core (= 1.1.1)
114 | kaminari-activerecord (1.1.1)
115 | activerecord
116 | kaminari-core (= 1.1.1)
117 | kaminari-core (1.1.1)
118 | knock (2.1.1)
119 | bcrypt (~> 3.1)
120 | jwt (~> 1.5)
121 | rails (>= 4.2)
122 | launchy (2.4.3)
123 | addressable (~> 2.3)
124 | letter_opener (1.6.0)
125 | launchy (~> 2.2)
126 | listen (3.1.5)
127 | rb-fsevent (~> 0.9, >= 0.9.4)
128 | rb-inotify (~> 0.9, >= 0.9.7)
129 | ruby_dep (~> 1.2)
130 | loofah (2.2.3)
131 | crass (~> 1.0.2)
132 | nokogiri (>= 1.5.9)
133 | mail (2.7.1)
134 | mini_mime (>= 0.1.1)
135 | marcel (0.3.3)
136 | mimemagic (~> 0.3.2)
137 | method_source (0.9.2)
138 | mimemagic (0.3.3)
139 | mini_mime (1.0.1)
140 | mini_portile2 (2.4.0)
141 | minitest (5.11.3)
142 | msgpack (1.2.4)
143 | multi_json (1.13.1)
144 | mustache (1.0.5)
145 | mustermann (1.0.3)
146 | nio4r (2.3.1)
147 | nokogiri (1.10.4)
148 | mini_portile2 (~> 2.4.0)
149 | parallel (1.12.1)
150 | parser (2.5.1.2)
151 | ast (~> 2.4.0)
152 | pg (1.1.3)
153 | powerpack (0.1.2)
154 | pry (0.11.3)
155 | coderay (~> 1.1.0)
156 | method_source (~> 0.9.0)
157 | pry-rails (0.3.6)
158 | pry (>= 0.10.4)
159 | public_suffix (3.0.3)
160 | puma (3.12.0)
161 | rack (2.0.7)
162 | rack-cors (1.0.2)
163 | rack-protection (2.0.5)
164 | rack
165 | rack-test (1.1.0)
166 | rack (>= 1.0, < 3)
167 | raddocs (2.2.0)
168 | haml (>= 4.0)
169 | json
170 | sinatra (~> 2.0)
171 | rails (5.2.2.1)
172 | actioncable (= 5.2.2.1)
173 | actionmailer (= 5.2.2.1)
174 | actionpack (= 5.2.2.1)
175 | actionview (= 5.2.2.1)
176 | activejob (= 5.2.2.1)
177 | activemodel (= 5.2.2.1)
178 | activerecord (= 5.2.2.1)
179 | activestorage (= 5.2.2.1)
180 | activesupport (= 5.2.2.1)
181 | bundler (>= 1.3.0)
182 | railties (= 5.2.2.1)
183 | sprockets-rails (>= 2.0.0)
184 | rails-dom-testing (2.0.3)
185 | activesupport (>= 4.2.0)
186 | nokogiri (>= 1.6)
187 | rails-erd (1.5.2)
188 | activerecord (>= 3.2)
189 | activesupport (>= 3.2)
190 | choice (~> 0.2.0)
191 | ruby-graphviz (~> 1.2)
192 | rails-html-sanitizer (1.0.4)
193 | loofah (~> 2.2, >= 2.2.2)
194 | railties (5.2.2.1)
195 | actionpack (= 5.2.2.1)
196 | activesupport (= 5.2.2.1)
197 | method_source
198 | rake (>= 0.8.7)
199 | thor (>= 0.19.0, < 2.0)
200 | rainbow (3.0.0)
201 | rake (12.3.2)
202 | rb-fsevent (0.10.3)
203 | rb-inotify (0.9.10)
204 | ffi (>= 0.5.0, < 2)
205 | responders (2.4.0)
206 | actionpack (>= 4.2.0, < 5.3)
207 | railties (>= 4.2.0, < 5.3)
208 | rollbar (2.17.0)
209 | multi_json
210 | rspec (3.8.0)
211 | rspec-core (~> 3.8.0)
212 | rspec-expectations (~> 3.8.0)
213 | rspec-mocks (~> 3.8.0)
214 | rspec-core (3.8.0)
215 | rspec-support (~> 3.8.0)
216 | rspec-expectations (3.8.1)
217 | diff-lcs (>= 1.2.0, < 2.0)
218 | rspec-support (~> 3.8.0)
219 | rspec-mocks (3.8.0)
220 | diff-lcs (>= 1.2.0, < 2.0)
221 | rspec-support (~> 3.8.0)
222 | rspec-rails (3.8.0)
223 | actionpack (>= 3.0)
224 | activesupport (>= 3.0)
225 | railties (>= 3.0)
226 | rspec-core (~> 3.8.0)
227 | rspec-expectations (~> 3.8.0)
228 | rspec-mocks (~> 3.8.0)
229 | rspec-support (~> 3.8.0)
230 | rspec-support (3.8.0)
231 | rspec_api_documentation (6.0.0)
232 | activesupport (>= 3.0.0)
233 | mustache (~> 1.0, >= 0.99.4)
234 | rspec (~> 3.0)
235 | rubocop (0.58.2)
236 | jaro_winkler (~> 1.5.1)
237 | parallel (~> 1.10)
238 | parser (>= 2.5, != 2.5.1.1)
239 | powerpack (~> 0.1)
240 | rainbow (>= 2.2.2, < 4.0)
241 | ruby-progressbar (~> 1.7)
242 | unicode-display_width (~> 1.0, >= 1.0.1)
243 | rubocop-rspec (1.29.1)
244 | rubocop (>= 0.58.0)
245 | ruby-graphviz (1.2.3)
246 | ruby-progressbar (1.10.0)
247 | ruby_dep (1.5.0)
248 | safe_yaml (1.0.4)
249 | seedbank (0.4.0)
250 | shoulda-matchers (3.1.2)
251 | activesupport (>= 4.0.0)
252 | sinatra (2.0.5)
253 | mustermann (~> 1.0)
254 | rack (~> 2.0)
255 | rack-protection (= 2.0.5)
256 | tilt (~> 2.0)
257 | spring (2.0.2)
258 | activesupport (>= 4.2)
259 | spring-commands-rspec (1.0.4)
260 | spring (>= 0.9.1)
261 | spring-watcher-listen (2.0.1)
262 | listen (>= 2.7, < 4.0)
263 | spring (>= 1.2, < 3.0)
264 | sprockets (3.7.2)
265 | concurrent-ruby (~> 1.0)
266 | rack (> 1, < 3)
267 | sprockets-rails (3.2.1)
268 | actionpack (>= 4.0)
269 | activesupport (>= 4.0)
270 | sprockets (>= 3.0.0)
271 | temple (0.8.1)
272 | thor (0.20.3)
273 | thread_safe (0.3.6)
274 | tilt (2.0.9)
275 | timecop (0.9.1)
276 | tzinfo (1.2.5)
277 | thread_safe (~> 0.1)
278 | unicode-display_width (1.4.0)
279 | uniform_notifier (1.11.0)
280 | webmock (3.4.2)
281 | addressable (>= 2.3.6)
282 | crack (>= 0.3.2)
283 | hashdiff
284 | websocket-driver (0.7.0)
285 | websocket-extensions (>= 0.1.0)
286 | websocket-extensions (0.1.3)
287 |
288 | PLATFORMS
289 | ruby
290 |
291 | DEPENDENCIES
292 | active_model_serializers
293 | bcrypt
294 | bootsnap
295 | brakeman
296 | bullet
297 | bundler-audit
298 | byebug
299 | decent_exposure
300 | email_spec
301 | factory_bot_rails
302 | faker
303 | health_check
304 | interactor
305 | kaminari
306 | knock
307 | letter_opener
308 | pg
309 | pry-rails
310 | puma
311 | rack-cors
312 | raddocs
313 | rails (= 5.2.2.1)
314 | rails-erd
315 | responders
316 | rollbar
317 | rspec-rails
318 | rspec_api_documentation
319 | rubocop
320 | rubocop-rspec
321 | seedbank
322 | shoulda-matchers
323 | spring
324 | spring-commands-rspec
325 | spring-watcher-listen
326 | timecop
327 | webmock
328 |
329 | RUBY VERSION
330 | ruby 2.5.1p57
331 |
332 | BUNDLED WITH
333 | 1.16.6
334 |
--------------------------------------------------------------------------------
/public/stylesheets/apitome/application.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.0.0
3 | *
4 | * Copyright 2013 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world by @mdo and @fat.
9 | *//*! normalize.css v2.1.0 | MIT License | git.io/normalize */
10 | article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{margin:.67em 0;font-size:2em}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid #c0c0c0}legend{padding:0;border:0}button,input,select,textarea{margin:0;font-family:inherit;font-size:100%}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{padding:0;box-sizing:border-box}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:2cm .5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}button,input,select[multiple],textarea{background-image:none}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16.099999999999998px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:21px}}small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-warning{color:#c09853}.text-danger{color:#b94a48}.text-success{color:#468847}.text-info{color:#3a87ad}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:20px;margin-bottom:10px}h4,h5,h6{margin-top:10px;margin-bottom:10px}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}h1 small,.h1 small{font-size:24px}h2 small,.h2 small{font-size:18px}h3 small,.h3 small,h4 small,.h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small{display:block;line-height:1.428571429;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:1.428571429}code,pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;white-space:nowrap;background-color:#f9f2f4;border-radius:4px}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.row{margin-right:-15px;margin-left:-15px}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11{float:left}.col-xs-1{width:8.333333333333332%}.col-xs-2{width:16.666666666666664%}.col-xs-3{width:25%}.col-xs-4{width:33.33333333333333%}.col-xs-5{width:41.66666666666667%}.col-xs-6{width:50%}.col-xs-7{width:58.333333333333336%}.col-xs-8{width:66.66666666666666%}.col-xs-9{width:75%}.col-xs-10{width:83.33333333333334%}.col-xs-11{width:91.66666666666666%}.col-xs-12{width:100%}@media(min-width:768px){.container{max-width:750px}.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11{float:left}.col-sm-1{width:8.333333333333332%}.col-sm-2{width:16.666666666666664%}.col-sm-3{width:25%}.col-sm-4{width:33.33333333333333%}.col-sm-5{width:41.66666666666667%}.col-sm-6{width:50%}.col-sm-7{width:58.333333333333336%}.col-sm-8{width:66.66666666666666%}.col-sm-9{width:75%}.col-sm-10{width:83.33333333333334%}.col-sm-11{width:91.66666666666666%}.col-sm-12{width:100%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-11{left:91.66666666666666%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-11{margin-left:91.66666666666666%}}@media(min-width:992px){.container{max-width:970px}.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11{float:left}.col-md-1{width:8.333333333333332%}.col-md-2{width:16.666666666666664%}.col-md-3{width:25%}.col-md-4{width:33.33333333333333%}.col-md-5{width:41.66666666666667%}.col-md-6{width:50%}.col-md-7{width:58.333333333333336%}.col-md-8{width:66.66666666666666%}.col-md-9{width:75%}.col-md-10{width:83.33333333333334%}.col-md-11{width:91.66666666666666%}.col-md-12{width:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.333333333333332%}.col-md-push-2{left:16.666666666666664%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333333333333%}.col-md-push-5{left:41.66666666666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.333333333333336%}.col-md-push-8{left:66.66666666666666%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333333333334%}.col-md-push-11{left:91.66666666666666%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-11{right:91.66666666666666%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-11{margin-left:91.66666666666666%}}@media(min-width:1200px){.container{max-width:1170px}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11{float:left}.col-lg-1{width:8.333333333333332%}.col-lg-2{width:16.666666666666664%}.col-lg-3{width:25%}.col-lg-4{width:33.33333333333333%}.col-lg-5{width:41.66666666666667%}.col-lg-6{width:50%}.col-lg-7{width:58.333333333333336%}.col-lg-8{width:66.66666666666666%}.col-lg-9{width:75%}.col-lg-10{width:83.33333333333334%}.col-lg-11{width:91.66666666666666%}.col-lg-12{width:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-11{left:91.66666666666666%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-11{margin-left:91.66666666666666%}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table thead>tr>th,.table tbody>tr>th,.table tfoot>tr>th,.table thead>tr>td,.table tbody>tr>td,.table tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{display:table-column;float:none}table td[class*="col-"],table th[class*="col-"]{display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8;border-color:#d6e9c6}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td{background-color:#d0e9c6;border-color:#c9e2b3}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede;border-color:#eed3d7}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td{background-color:#ebcccc;border-color:#e6c1c7}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3;border-color:#fbeed5}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td{background-color:#faf2cc;border-color:#f8e5be}@media(max-width:768px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:scroll;overflow-y:hidden;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0;background-color:#fff}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>thead>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>thead>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-family:inherit;font-size:inherit;font-style:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;padding-left:20px;margin-top:10px;margin-bottom:10px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:normal;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:45px;line-height:45px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label{color:#c09853}.has-warning .form-control{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.has-warning .input-group-addon{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.has-error .help-block,.has-error .control-label{color:#b94a48}.has-error .form-control{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.has-error .input-group-addon{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.has-success .help-block,.has-success .control-label{color:#468847}.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.has-success .input-group-addon{color:#468847;background-color:#dff0d8;border-color:#468847}.form-control-static{padding-top:7px;margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline .radio,.form-inline .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-link{font-weight:normal;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;line-height:1}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-print:before{content:"\e045"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-briefcase:before{content:"\1f4bc"}.glyphicon-calendar:before{content:"\1f4c5"}.glyphicon-pushpin:before{content:"\1f4cc"}.glyphicon-paperclip:before{content:"\1f4ce"}.glyphicon-camera:before{content:"\1f4f7"}.glyphicon-lock:before{content:"\1f512"}.glyphicon-bell:before{content:"\1f514"}.glyphicon-bookmark:before{content:"\1f516"}.glyphicon-fire:before{content:"\1f525"}.glyphicon-wrench:before{content:"\1f527"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #000;border-right:4px solid transparent;border-bottom:0 dotted;border-left:4px solid transparent;content:""}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#fff;text-decoration:none;background-color:#428bca}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0 dotted;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}.btn-primary .caret,.btn-success .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret{border-top-color:#fff}.dropup .btn-default .caret{border-bottom-color:#333}.dropup .btn-primary .caret,.dropup .btn-success .caret,.dropup .btn-warning .caret,.dropup .btn-danger .caret,.dropup .btn-info .caret{border-bottom-color:#fff}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:5px 10px;padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:4px;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;border-collapse:separate;table-layout:fixed}.btn-group-justified .btn{display:table-cell;float:none;width:1%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group.col{float:none;padding-right:0;padding-left:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:45px;line-height:45px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}}.nav-tabs.nav-justified>li>a{margin-right:0;border-bottom:1px solid #ddd}.nav-tabs.nav-justified>.active>a{border-bottom-color:#fff}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:5px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-bottom:1px solid #ddd}.nav-tabs-justified>.active>a{border-bottom-color:#fff}.tabbable:before,.tabbable:after{display:table;content:" "}.tabbable:after{clear:both}.tabbable:before,.tabbable:after{display:table;content:" "}.tabbable:after{clear:both}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.nav .caret{border-top-color:#428bca;border-bottom-color:#428bca}.nav a:hover .caret{border-top-color:#2a6496;border-bottom-color:#2a6496}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;z-index:1000;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:4px}}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px}.navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px}.navbar-collapse .navbar-text:last-child{margin-right:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;border-width:0 0 1px}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;z-index:1030}.navbar-fixed-bottom{bottom:0;margin-bottom:0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;border:1px solid transparent;border-radius:4px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}@media(min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-text{float:left;margin-top:15px;margin-bottom:15px}@media(min-width:768px){.navbar-text{margin-right:15px;margin-left:15px}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e6e6e6}.navbar-default .navbar-nav>.dropdown>a:hover .caret,.navbar-default .navbar-nav>.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.open>a .caret,.navbar-default .navbar-nav>.open>a:hover .caret,.navbar-default .navbar-nav>.open>a:focus .caret{border-top-color:#555;border-bottom-color:#555}.navbar-default .navbar-nav>.dropdown>a .caret{border-top-color:#777;border-bottom-color:#777}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-nav>.dropdown>a .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .navbar-nav>.open>a .caret,.navbar-inverse .navbar-nav>.open>a:hover .caret,.navbar-inverse .navbar-nav>.open>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#999;border-radius:10px}.badge:empty{display:none}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.btn .badge{position:relative;top:-1px}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.jumbotron h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:6px}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1{font-size:63px}}.thumbnail{display:inline-block;display:block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img{display:block;height:auto;max-width:100%}a.thumbnail:hover,a.thumbnail:focus{border-color:#428bca}.thumbnail>img{margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#356635}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#2d6987}.alert-warning{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.alert-warning hr{border-top-color:#f8e5be}.alert-warning .alert-link{color:#a47e3c}.alert-danger{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger hr{border-top-color:#e6c1c7}.alert-danger .alert-link{color:#953b39}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table{margin-bottom:0}.panel>.panel-body+.table{border-top:1px solid #ddd}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-title{margin-top:0;margin-bottom:0;font-size:16px}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-group .panel{margin-bottom:0;overflow:hidden;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-warning{border-color:#fbeed5}.panel-warning>.panel-heading{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#fbeed5}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#fbeed5}.panel-danger{border-color:#eed3d7}.panel-danger>.panel-heading{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#eed3d7}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#eed3d7}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}body.modal-open,.modal-open .navbar-fixed-top,.modal-open .navbar-fixed-bottom{margin-right:15px}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:auto;overflow-y:scroll}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{z-index:1050;width:auto;padding:10px;margin-right:auto;margin-left:auto}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{min-height:16.428571429px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{padding:19px 20px 20px;margin-top:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{right:auto;left:50%;width:600px;padding-top:30px;padding-bottom:30px}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-bottom-color:#000;border-width:0 5px 5px}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0;content:" "}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0;content:" "}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0;content:" "}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0;content:" "}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;height:auto;max-width:100%;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);opacity:.5;filter:alpha(opacity=50)}.carousel-control.left{background-image:-webkit-gradient(linear,0 top,100% top,from(rgba(0,0,0,0.5)),to(rgba(0,0,0,0.0001)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{right:0;left:auto;background-image:-webkit-gradient(linear,0 top,100% top,from(rgba(0,0,0,0.0001)),to(rgba(0,0,0,0.5)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;left:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media screen and (max-width:400px){@-ms-viewport{width:320px}}.hidden{display:none!important;visibility:hidden!important}.visible-xs{display:none!important}tr.visible-xs{display:none!important}th.visible-xs,td.visible-xs{display:none!important}@media(max-width:767px){.visible-xs{display:block!important}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}tr.visible-xs.visible-sm{display:table-row!important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}tr.visible-xs.visible-md{display:table-row!important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block!important}tr.visible-xs.visible-lg{display:table-row!important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell!important}}.visible-sm{display:none!important}tr.visible-sm{display:none!important}th.visible-sm,td.visible-sm{display:none!important}@media(max-width:767px){.visible-sm.visible-xs{display:block!important}tr.visible-sm.visible-xs{display:table-row!important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block!important}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}tr.visible-sm.visible-md{display:table-row!important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block!important}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md{display:none!important}tr.visible-md{display:none!important}th.visible-md,td.visible-md{display:none!important}@media(max-width:767px){.visible-md.visible-xs{display:block!important}tr.visible-md.visible-xs{display:table-row!important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}tr.visible-md.visible-sm{display:table-row!important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block!important}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-md.visible-lg{display:block!important}tr.visible-md.visible-lg{display:table-row!important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell!important}}.visible-lg{display:none!important}tr.visible-lg{display:none!important}th.visible-lg,td.visible-lg{display:none!important}@media(max-width:767px){.visible-lg.visible-xs{display:block!important}tr.visible-lg.visible-xs{display:table-row!important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}tr.visible-lg.visible-sm{display:table-row!important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}tr.visible-lg.visible-md{display:table-row!important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-lg{display:block!important}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}.hidden-xs{display:block!important}tr.hidden-xs{display:table-row!important}th.hidden-xs,td.hidden-xs{display:table-cell!important}@media(max-width:767px){.hidden-xs{display:none!important}tr.hidden-xs{display:none!important}th.hidden-xs,td.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm{display:none!important}tr.hidden-xs.hidden-sm{display:none!important}th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md{display:none!important}tr.hidden-xs.hidden-md{display:none!important}th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-xs.hidden-lg{display:none!important}tr.hidden-xs.hidden-lg{display:none!important}th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none!important}}.hidden-sm{display:block!important}tr.hidden-sm{display:table-row!important}th.hidden-sm,td.hidden-sm{display:table-cell!important}@media(max-width:767px){.hidden-sm.hidden-xs{display:none!important}tr.hidden-sm.hidden-xs{display:none!important}th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}tr.hidden-sm{display:none!important}th.hidden-sm,td.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md{display:none!important}tr.hidden-sm.hidden-md{display:none!important}th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-sm.hidden-lg{display:none!important}tr.hidden-sm.hidden-lg{display:none!important}th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none!important}}.hidden-md{display:block!important}tr.hidden-md{display:table-row!important}th.hidden-md,td.hidden-md{display:table-cell!important}@media(max-width:767px){.hidden-md.hidden-xs{display:none!important}tr.hidden-md.hidden-xs{display:none!important}th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm{display:none!important}tr.hidden-md.hidden-sm{display:none!important}th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}tr.hidden-md{display:none!important}th.hidden-md,td.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-md.hidden-lg{display:none!important}tr.hidden-md.hidden-lg{display:none!important}th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none!important}}.hidden-lg{display:block!important}tr.hidden-lg{display:table-row!important}th.hidden-lg,td.hidden-lg{display:table-cell!important}@media(max-width:767px){.hidden-lg.hidden-xs{display:none!important}tr.hidden-lg.hidden-xs{display:none!important}th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm{display:none!important}tr.hidden-lg.hidden-sm{display:none!important}th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md{display:none!important}tr.hidden-lg.hidden-md{display:none!important}th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-lg{display:none!important}tr.hidden-lg{display:none!important}th.hidden-lg,td.hidden-lg{display:none!important}}.visible-print{display:none!important}tr.visible-print{display:none!important}th.visible-print,td.visible-print{display:none!important}@media print{.visible-print{display:block!important}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}.hidden-print{display:none!important}tr.hidden-print{display:none!important}th.hidden-print,td.hidden-print{display:none!important}}
11 | /*
12 |
13 | Original style from softwaremaniacs.org (c) Ivan Sagalaev
14 |
15 | */
16 |
17 |
18 | pre code {
19 | display: block; padding: 0.5em;
20 | background: #F0F0F0;
21 | }
22 |
23 | pre code,
24 | pre .subst,
25 | pre .tag .title,
26 | pre .lisp .title,
27 | pre .clojure .built_in,
28 | pre .nginx .title {
29 | color: black;
30 | }
31 |
32 | pre .string,
33 | pre .title,
34 | pre .constant,
35 | pre .parent,
36 | pre .tag .value,
37 | pre .rules .value,
38 | pre .rules .value .number,
39 | pre .preprocessor,
40 | pre .ruby .symbol,
41 | pre .ruby .symbol .string,
42 | pre .aggregate,
43 | pre .template_tag,
44 | pre .django .variable,
45 | pre .smalltalk .class,
46 | pre .addition,
47 | pre .flow,
48 | pre .stream,
49 | pre .bash .variable,
50 | pre .apache .tag,
51 | pre .apache .cbracket,
52 | pre .tex .command,
53 | pre .tex .special,
54 | pre .erlang_repl .function_or_atom,
55 | pre .markdown .header {
56 | color: #800;
57 | }
58 |
59 | pre .comment,
60 | pre .annotation,
61 | pre .template_comment,
62 | pre .diff .header,
63 | pre .chunk,
64 | pre .markdown .blockquote {
65 | color: #888;
66 | }
67 |
68 | pre .number,
69 | pre .date,
70 | pre .regexp,
71 | pre .literal,
72 | pre .smalltalk .symbol,
73 | pre .smalltalk .char,
74 | pre .go .constant,
75 | pre .change,
76 | pre .markdown .bullet,
77 | pre .markdown .link_url {
78 | color: #080;
79 | }
80 |
81 | pre .label,
82 | pre .javadoc,
83 | pre .ruby .string,
84 | pre .decorator,
85 | pre .filter .argument,
86 | pre .localvars,
87 | pre .array,
88 | pre .attr_selector,
89 | pre .important,
90 | pre .pseudo,
91 | pre .pi,
92 | pre .doctype,
93 | pre .deletion,
94 | pre .envvar,
95 | pre .shebang,
96 | pre .apache .sqbracket,
97 | pre .nginx .built_in,
98 | pre .tex .formula,
99 | pre .erlang_repl .reserved,
100 | pre .prompt,
101 | pre .markdown .link_label,
102 | pre .vhdl .attribute,
103 | pre .clojure .attribute,
104 | pre .coffeescript .property {
105 | color: #88F
106 | }
107 |
108 | pre .keyword,
109 | pre .id,
110 | pre .phpdoc,
111 | pre .title,
112 | pre .built_in,
113 | pre .aggregate,
114 | pre .css .tag,
115 | pre .javadoctag,
116 | pre .phpdoc,
117 | pre .yardoctag,
118 | pre .smalltalk .class,
119 | pre .winutils,
120 | pre .bash .variable,
121 | pre .apache .tag,
122 | pre .go .typename,
123 | pre .tex .command,
124 | pre .markdown .strong,
125 | pre .request,
126 | pre .status {
127 | font-weight: bold;
128 | }
129 |
130 | pre .markdown .emphasis {
131 | font-style: italic;
132 | }
133 |
134 | pre .nginx .built_in {
135 | font-weight: normal;
136 | }
137 |
138 | pre .coffeescript .javascript,
139 | pre .javascript .xml,
140 | pre .tex .formula,
141 | pre .xml .javascript,
142 | pre .xml .vbscript,
143 | pre .xml .css,
144 | pre .xml .cdata {
145 | opacity: 0.5;
146 | }
147 | /*
148 |
149 |
150 | */
151 |
152 |
153 | body {
154 | position: relative;
155 | padding-top: 50px;
156 | }
157 |
158 | h1,
159 | h2 {
160 | margin-top: 30px;
161 | }
162 | pre {
163 | background: #fcfbf9;
164 | }
165 | pre code {
166 | padding: 0;
167 | background: transparent;
168 | }
169 | .table code {
170 | font-size: 13px;
171 | font-weight: normal;
172 | }
173 |
174 | .docs-nav {
175 | background-color: #f4f3ee;
176 | border-color: #ddd;
177 | border-top: 3px solid #009dc4;
178 | box-shadow: 0 1px 0 rgba(255,255,255,.1);
179 | margin-bottom: 25px;
180 | }
181 | .docs-nav .navbar-brand {
182 | margin: 0;
183 | margin-left: 0 !important;
184 | }
185 | .docs-nav .navbar-brand a {
186 | color: #482b25;
187 | text-decoration: none;
188 | }
189 |
190 | .sidebar.affix {
191 | position: static;
192 | }
193 | .sidenav {
194 | margin-top: 30px;
195 | margin-bottom: 30px;
196 | padding-top: 10px;
197 | padding-bottom: 10px;
198 | background-color: #f4f3ee;
199 | border-radius: 5px;
200 | }
201 | .sidebar .nav > li > a {
202 | display: block;
203 | color: #716b7a;
204 | padding: 5px 20px;
205 | }
206 | .sidebar .nav > li > a:hover,
207 | .sidebar .nav > li > a:focus {
208 | text-decoration: none;
209 | background-color: #e9e4df;
210 | border-right: 1px solid #dbd8e0;
211 | }
212 | .sidebar .nav > .active > a,
213 | .sidebar .nav > .active:hover > a,
214 | .sidebar .nav > .active:focus > a {
215 | font-weight: bold;
216 | color: #716b7a;
217 | background-color: transparent;
218 | border-right: 1px solid #009dc4;
219 | }
220 | .sidebar .nav .nav {
221 | margin-bottom: 8px;
222 | }
223 | .sidebar .nav .nav > li > a {
224 | padding-top: 3px;
225 | padding-bottom: 3px;
226 | padding-left: 30px;
227 | font-size: 90%;
228 | }
229 |
230 | body.single-page .docs-section section.readme article {
231 | margin-top: -50px;
232 | margin-bottom: -20px;
233 | }
234 | body.single-page .docs-section section article {
235 | padding-top: 50px;
236 | }
237 |
238 | @media screen and (min-width: 992px) {
239 | .sidebar.affix {
240 | position: fixed;
241 | top: 80px;
242 | }
243 | .sidebar.affix,
244 | .sidebar.affix-bottom {
245 | width: 283px;
246 | }
247 | .sidebar.affix-bottom {
248 | position: absolute;
249 | }
250 | .sidebar.affix .sidenav,
251 | .sidebar.affix-bottom .sidenav {
252 | margin-top: 0;
253 | margin-bottom: 0;
254 | }
255 | body.single-page .sidebar .nav .nav {
256 | display: none;
257 | }
258 | body.single-page .sidebar .nav > .active > ul {
259 | display: block;
260 | }
261 | }
262 |
263 | @media screen and (min-width: 1200px) {
264 | .sidebar.affix,
265 | .sidebar.affix-bottom {
266 | width: 350px;
267 | }
268 | }
269 |
270 |
--------------------------------------------------------------------------------