diff --git a/Gemfile b/Gemfile index 4aa8f6b..7b7be0b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use sqlite3 as the database for Active Record -gem 'sqlite3' +# gem 'sqlite3' # Use Puma as the app server gem 'puma', '~> 3.0' # Use SCSS for stylesheets @@ -16,6 +16,10 @@ gem 'coffee-rails', '~> 4.2' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby +platform :ruby do + gem 'pg' +end + # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks @@ -30,6 +34,14 @@ gem 'jbuilder', '~> 2.5' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development +gem 'devise' +gem 'devise_uid' +gem 'bcrypt', '~> 3.1.7' +gem 'simple_form' +gem 'kaminari' +gem 'to_csv-rails' +gem 'bootstrap-multiselect-rails' + group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri diff --git a/Gemfile.lock b/Gemfile.lock index 7626de3..7dc7332 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,9 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) arel (7.1.4) + bcrypt (3.1.11) + bootstrap-multiselect-rails (0.9.9) + rails (>= 4.0.0) builder (3.2.3) byebug (9.0.6) coffee-rails (4.2.1) @@ -50,6 +53,15 @@ GEM coffee-script-source (1.12.2) concurrent-ruby (1.0.4) debug_inspector (0.0.2) + devise (4.2.0) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 5.1) + responders + warden (~> 1.2.3) + devise_uid (0.1.1) + devise (>= 3.0.0) + railties (>= 3.0) erubis (2.7.0) execjs (2.7.0) ffi (1.9.17) @@ -63,6 +75,18 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + kaminari (1.0.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.0.1) + kaminari-activerecord (= 1.0.1) + kaminari-core (= 1.0.1) + kaminari-actionview (1.0.1) + actionview + kaminari-core (= 1.0.1) + kaminari-activerecord (1.0.1) + activerecord + kaminari-core (= 1.0.1) + kaminari-core (1.0.1) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -80,6 +104,8 @@ GEM nio4r (1.2.1) nokogiri (1.7.0.1) mini_portile2 (~> 2.1.0) + orm_adapter (0.5.0) + pg (0.19.0) puma (3.6.2) rack (2.0.1) rack-test (0.6.3) @@ -111,6 +137,8 @@ GEM rb-fsevent (0.9.8) rb-inotify (0.9.7) ffi (>= 0.5.0) + responders (2.3.0) + railties (>= 4.2.0, < 5.1) sass (3.4.23) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -118,6 +146,9 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + simple_form (3.4.0) + actionpack (> 4, < 5.1) + activemodel (> 4, < 5.1) spring (2.0.0) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -130,10 +161,10 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) thor (0.19.4) thread_safe (0.3.5) tilt (2.0.5) + to_csv-rails (0.1.5) turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.0) @@ -141,6 +172,8 @@ GEM thread_safe (~> 0.1) uglifier (3.0.4) execjs (>= 0.3.0, < 3) + warden (1.2.6) + rack (>= 1.0) web-console (3.4.0) actionview (>= 5.0) activemodel (>= 5.0) @@ -154,21 +187,28 @@ PLATFORMS ruby DEPENDENCIES + bcrypt (~> 3.1.7) + bootstrap-multiselect-rails byebug coffee-rails (~> 4.2) + devise + devise_uid jbuilder (~> 2.5) jquery-rails + kaminari listen (~> 3.0.5) + pg puma (~> 3.0) rails (~> 5.0.0, >= 5.0.0.1) sass-rails (~> 5.0) + simple_form spring spring-watcher-listen (~> 2.0.0) - sqlite3 + to_csv-rails turbolinks (~> 5) tzinfo-data uglifier (>= 1.3.0) web-console BUNDLED WITH - 1.13.6 + 1.13.7 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b12018d..29f4a47 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,4 +13,6 @@ //= require jquery //= require jquery_ujs //= require turbolinks +//= require bootstrap.v4a2.min +//= require bootstrap-multiselect //= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index 0ebd7fe..0000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS - * files in this directory. Styles in this file should be added after the last require_* statement. - * It is generally better to create a new file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1c07694..08b5105 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,21 @@ class ApplicationController < ActionController::Base - protect_from_forgery with: :exception + protect_from_forgery with: :exception + helper_method :current_member, :logged_in?, :resource_name, :resource, :devise_mapping + + def logged_in? + current_member + end + def after_sign_in_path_for(resource) + dashboard_path + end + def resource_name + :member + end + def resource + @resource ||= Member.new + end + + def devise_mapping + @devise_mapping ||= Devise.mappings[:member] + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8c79e3f..ce5d9db 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,14 +1,20 @@ - +
-