├── .browserslistrc ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── Procfile ├── README.md ├── Rakefile ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ └── .keep │ ├── javascripts │ │ └── application.js │ └── stylesheets │ │ ├── application.scss │ │ └── jumpstart │ │ ├── announcements.scss │ │ └── sticky-footer.scss ├── channels │ ├── application_cable │ │ ├── channel.rb │ │ └── connection.rb │ └── board_channel.rb ├── controllers │ ├── admin │ │ ├── announcements_controller.rb │ │ ├── application_controller.rb │ │ ├── notifications_controller.rb │ │ └── users_controller.rb │ ├── announcements_controller.rb │ ├── application_controller.rb │ ├── cards_controller.rb │ ├── concerns │ │ └── .keep │ ├── home_controller.rb │ ├── lists_controller.rb │ ├── notifications_controller.rb │ └── users │ │ └── omniauth_callbacks_controller.rb ├── dashboards │ ├── announcement_dashboard.rb │ ├── notification_dashboard.rb │ └── user_dashboard.rb ├── helpers │ ├── announcements_helper.rb │ ├── application_helper.rb │ ├── cards_helper.rb │ ├── devise_helper.rb │ └── lists_helper.rb ├── javascript │ ├── app.vue │ ├── channels │ │ ├── board_channel.js │ │ ├── consumer.js │ │ └── index.js │ ├── components │ │ ├── card.vue │ │ └── list.vue │ └── packs │ │ └── application.js ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── announcement.rb │ ├── application_record.rb │ ├── card.rb │ ├── concerns │ │ └── .keep │ ├── list.rb │ ├── notification.rb │ ├── service.rb │ └── user.rb └── views │ ├── admin │ └── users │ │ └── show.html.erb │ ├── announcements │ └── index.html.erb │ ├── cards │ ├── _card.json.jbuilder │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── devise │ ├── confirmations │ │ └── new.html.erb │ ├── mailer │ │ ├── confirmation_instructions.html.erb │ │ ├── password_change.html.erb │ │ ├── reset_password_instructions.html.erb │ │ └── unlock_instructions.html.erb │ ├── passwords │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── registrations │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── sessions │ │ └── new.html.erb │ ├── shared │ │ └── _links.html.erb │ └── unlocks │ │ └── new.html.erb │ ├── home │ ├── index.html.erb │ ├── privacy.html.erb │ └── terms.html.erb │ ├── layouts │ ├── application.html.erb │ ├── mailer.html.erb │ └── mailer.text.erb │ ├── lists │ ├── _form.html.erb │ ├── _list.json.jbuilder │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── notifications │ └── index.html.erb │ └── shared │ ├── _footer.html.erb │ ├── _head.html.erb │ ├── _navbar.html.erb │ └── _notices.html.erb ├── babel.config.js ├── bin ├── bundle ├── rails ├── rake ├── setup ├── update ├── webpack ├── webpack-dev-server └── yarn ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── cookies_serializer.rb │ ├── devise.rb │ ├── filter_parameter_logging.rb │ ├── gravatar.rb │ ├── inflections.rb │ ├── mime_types.rb │ └── wrap_parameters.rb ├── locales │ ├── devise.en.yml │ └── en.yml ├── puma.rb ├── routes.rb ├── secrets.yml ├── spring.rb ├── webpack │ ├── development.js │ ├── environment.js │ ├── loaders │ │ └── vue.js │ ├── production.js │ └── test.js └── webpacker.yml ├── db ├── migrate │ ├── 20171128191105_devise_create_users.rb │ ├── 20171128191126_create_announcements.rb │ ├── 20171128191128_create_notifications.rb │ ├── 20171128191412_create_lists.rb │ └── 20171128191446_create_cards.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── package.json ├── postcss.config.js ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico └── robots.txt ├── test ├── application_system_test_case.rb ├── channels │ └── board_channel_test.rb ├── controllers │ ├── .keep │ ├── cards_controller_test.rb │ └── lists_controller_test.rb ├── fixtures │ ├── .keep │ ├── announcements.yml │ ├── cards.yml │ ├── files │ │ └── .keep │ ├── lists.yml │ ├── notifications.yml │ └── users.yml ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── announcement_test.rb │ ├── card_test.rb │ ├── list_test.rb │ ├── notification_test.rb │ └── user_test.rb ├── system │ ├── .keep │ ├── cards_test.rb │ └── lists_test.rb └── test_helper.rb ├── tmp └── .keep ├── vendor └── .keep └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-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 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | /node_modules 21 | /yarn-error.log 22 | 23 | .byebug_history 24 | /public/packs 25 | /public/packs-test 26 | /node_modules 27 | /public/packs 28 | /public/packs-test 29 | /node_modules 30 | yarn-debug.log* 31 | .yarn-integrity 32 | 33 | /public/packs 34 | /public/packs-test 35 | /node_modules 36 | /yarn-error.log 37 | yarn-debug.log* 38 | .yarn-integrity 39 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | git_source(:github) do |repo_name| 4 | repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 5 | "https://github.com/#{repo_name}.git" 6 | end 7 | 8 | 9 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 10 | gem 'rails', '~> 6.0.0' 11 | # Use sqlite3 as the database for Active Record 12 | gem 'sqlite3' 13 | # Use Puma as the app server 14 | gem 'puma', '~> 4.3' 15 | # Use SCSS for stylesheets 16 | gem 'sass-rails', '>= 6' 17 | # Use Uglifier as compressor for JavaScript assets 18 | gem 'uglifier', '>= 1.3.0' 19 | # See https://github.com/rails/execjs#readme for more supported runtimes 20 | # gem 'therubyracer', platforms: :ruby 21 | 22 | # Use CoffeeScript for .coffee assets and views 23 | gem 'coffee-rails', '~> 4.2' 24 | # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 25 | gem 'turbolinks', '~> 5' 26 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 27 | gem 'jbuilder', '~> 2.10' 28 | # Use Redis adapter to run Action Cable in production 29 | # gem 'redis', '~> 3.0' 30 | # Use ActiveModel has_secure_password 31 | # gem 'bcrypt', '~> 3.1.7' 32 | 33 | # Use Capistrano for deployment 34 | # gem 'capistrano-rails', group: :development 35 | 36 | group :development, :test do 37 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 38 | gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 39 | # Adds support for Capybara system testing and selenium driver 40 | gem 'capybara', '~> 2.13' 41 | gem 'selenium-webdriver' 42 | end 43 | 44 | group :development do 45 | # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 46 | gem 'web-console', '>= 3.3.0' 47 | gem 'listen', '>= 3.2.0' 48 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 49 | gem 'spring' 50 | gem 'spring-watcher-listen', '~> 2.0.0' 51 | end 52 | 53 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 54 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 55 | 56 | gem 'administrate', github: 'excid3/administrate' 57 | gem 'bootstrap', '~> 4.4' 58 | gem 'devise', '~> 4.7.0' 59 | gem 'devise-bootstrapped', github: 'excid3/devise-bootstrapped', branch: 'bootstrap4' 60 | gem 'devise_masquerade', '~> 1.2', github: 'excid3/devise_masquerade' 61 | gem 'font-awesome-sass', '~> 4.7' 62 | gem 'gravatar_image_tag', github: 'mdeering/gravatar_image_tag' 63 | gem 'webpacker', '~> 4.2' 64 | gem 'sidekiq', '~> 6.0' 65 | gem 'omniauth-facebook', '~> 4.0' 66 | gem 'omniauth-twitter', '~> 1.4' 67 | gem 'omniauth-github', '~> 1.3' 68 | 69 | gem 'acts_as_list' 70 | 71 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/excid3/administrate.git 3 | revision: 3d71972a629692442e4dafd79765c18a074268d2 4 | specs: 5 | administrate (0.12.0) 6 | actionpack (>= 4.2) 7 | actionview (>= 4.2) 8 | activerecord (>= 4.2) 9 | autoprefixer-rails (>= 6.0) 10 | datetime_picker_rails (~> 0.0.7) 11 | jquery-rails (>= 4.0) 12 | kaminari (>= 1.0) 13 | momentjs-rails (~> 2.8) 14 | sassc-rails (~> 2.1) 15 | selectize-rails (~> 0.6) 16 | 17 | GIT 18 | remote: https://github.com/excid3/devise-bootstrapped.git 19 | revision: a963d93052ce0069d050e4615fb06e95dc30ac2b 20 | branch: bootstrap4 21 | specs: 22 | devise-bootstrapped (0.2.0) 23 | 24 | GIT 25 | remote: https://github.com/excid3/devise_masquerade.git 26 | revision: 7b76df52ae61c938cef48ec54dde5221e9cc8609 27 | specs: 28 | devise_masquerade (1.2.0) 29 | devise (>= 4.7.0) 30 | globalid (>= 0.3.6) 31 | railties (>= 5.2.0) 32 | 33 | GIT 34 | remote: https://github.com/mdeering/gravatar_image_tag.git 35 | revision: c02351f7d6649e2346394e33164a7154e671ec19 36 | specs: 37 | gravatar_image_tag (1.2.0) 38 | 39 | GEM 40 | remote: https://rubygems.org/ 41 | specs: 42 | actioncable (6.0.2.1) 43 | actionpack (= 6.0.2.1) 44 | nio4r (~> 2.0) 45 | websocket-driver (>= 0.6.1) 46 | actionmailbox (6.0.2.1) 47 | actionpack (= 6.0.2.1) 48 | activejob (= 6.0.2.1) 49 | activerecord (= 6.0.2.1) 50 | activestorage (= 6.0.2.1) 51 | activesupport (= 6.0.2.1) 52 | mail (>= 2.7.1) 53 | actionmailer (6.0.2.1) 54 | actionpack (= 6.0.2.1) 55 | actionview (= 6.0.2.1) 56 | activejob (= 6.0.2.1) 57 | mail (~> 2.5, >= 2.5.4) 58 | rails-dom-testing (~> 2.0) 59 | actionpack (6.0.2.1) 60 | actionview (= 6.0.2.1) 61 | activesupport (= 6.0.2.1) 62 | rack (~> 2.0, >= 2.0.8) 63 | rack-test (>= 0.6.3) 64 | rails-dom-testing (~> 2.0) 65 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 66 | actiontext (6.0.2.1) 67 | actionpack (= 6.0.2.1) 68 | activerecord (= 6.0.2.1) 69 | activestorage (= 6.0.2.1) 70 | activesupport (= 6.0.2.1) 71 | nokogiri (>= 1.8.5) 72 | actionview (6.0.2.1) 73 | activesupport (= 6.0.2.1) 74 | builder (~> 3.1) 75 | erubi (~> 1.4) 76 | rails-dom-testing (~> 2.0) 77 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 78 | activejob (6.0.2.1) 79 | activesupport (= 6.0.2.1) 80 | globalid (>= 0.3.6) 81 | activemodel (6.0.2.1) 82 | activesupport (= 6.0.2.1) 83 | activerecord (6.0.2.1) 84 | activemodel (= 6.0.2.1) 85 | activesupport (= 6.0.2.1) 86 | activestorage (6.0.2.1) 87 | actionpack (= 6.0.2.1) 88 | activejob (= 6.0.2.1) 89 | activerecord (= 6.0.2.1) 90 | marcel (~> 0.3.1) 91 | activesupport (6.0.2.1) 92 | concurrent-ruby (~> 1.0, >= 1.0.2) 93 | i18n (>= 0.7, < 2) 94 | minitest (~> 5.1) 95 | tzinfo (~> 1.1) 96 | zeitwerk (~> 2.2) 97 | acts_as_list (1.0.1) 98 | activerecord (>= 4.2) 99 | addressable (2.7.0) 100 | public_suffix (>= 2.0.2, < 5.0) 101 | autoprefixer-rails (9.7.4) 102 | execjs 103 | bcrypt (3.1.13) 104 | bindex (0.8.1) 105 | bootstrap (4.4.1) 106 | autoprefixer-rails (>= 9.1.0) 107 | popper_js (>= 1.14.3, < 2) 108 | sassc-rails (>= 2.0.0) 109 | builder (3.2.4) 110 | byebug (11.1.1) 111 | capybara (2.18.0) 112 | addressable 113 | mini_mime (>= 0.1.3) 114 | nokogiri (>= 1.3.3) 115 | rack (>= 1.0.0) 116 | rack-test (>= 0.5.4) 117 | xpath (>= 2.0, < 4.0) 118 | childprocess (3.0.0) 119 | coffee-rails (4.2.2) 120 | coffee-script (>= 2.2.0) 121 | railties (>= 4.0.0) 122 | coffee-script (2.4.1) 123 | coffee-script-source 124 | execjs 125 | coffee-script-source (1.12.2) 126 | concurrent-ruby (1.1.6) 127 | connection_pool (2.2.2) 128 | crass (1.0.6) 129 | datetime_picker_rails (0.0.7) 130 | momentjs-rails (>= 2.8.1) 131 | devise (4.7.1) 132 | bcrypt (~> 3.0) 133 | orm_adapter (~> 0.1) 134 | railties (>= 4.1.0) 135 | responders 136 | warden (~> 1.2.3) 137 | erubi (1.9.0) 138 | execjs (2.7.0) 139 | faraday (1.0.0) 140 | multipart-post (>= 1.2, < 3) 141 | ffi (1.12.2) 142 | font-awesome-sass (4.7.0) 143 | sass (>= 3.2) 144 | globalid (0.4.2) 145 | activesupport (>= 4.2.0) 146 | hashie (4.1.0) 147 | i18n (1.8.2) 148 | concurrent-ruby (~> 1.0) 149 | jbuilder (2.10.0) 150 | activesupport (>= 5.0.0) 151 | jquery-rails (4.3.5) 152 | rails-dom-testing (>= 1, < 3) 153 | railties (>= 4.2.0) 154 | thor (>= 0.14, < 2.0) 155 | jwt (2.2.1) 156 | kaminari (1.2.0) 157 | activesupport (>= 4.1.0) 158 | kaminari-actionview (= 1.2.0) 159 | kaminari-activerecord (= 1.2.0) 160 | kaminari-core (= 1.2.0) 161 | kaminari-actionview (1.2.0) 162 | actionview 163 | kaminari-core (= 1.2.0) 164 | kaminari-activerecord (1.2.0) 165 | activerecord 166 | kaminari-core (= 1.2.0) 167 | kaminari-core (1.2.0) 168 | listen (3.2.1) 169 | rb-fsevent (~> 0.10, >= 0.10.3) 170 | rb-inotify (~> 0.9, >= 0.9.10) 171 | loofah (2.4.0) 172 | crass (~> 1.0.2) 173 | nokogiri (>= 1.5.9) 174 | mail (2.7.1) 175 | mini_mime (>= 0.1.1) 176 | marcel (0.3.3) 177 | mimemagic (~> 0.3.2) 178 | method_source (0.9.2) 179 | mimemagic (0.3.4) 180 | mini_mime (1.0.2) 181 | mini_portile2 (2.4.0) 182 | minitest (5.14.0) 183 | momentjs-rails (2.20.1) 184 | railties (>= 3.1) 185 | multi_json (1.14.1) 186 | multi_xml (0.6.0) 187 | multipart-post (2.1.1) 188 | nio4r (2.5.2) 189 | nokogiri (1.10.9) 190 | mini_portile2 (~> 2.4.0) 191 | oauth (0.5.4) 192 | oauth2 (1.4.4) 193 | faraday (>= 0.8, < 2.0) 194 | jwt (>= 1.0, < 3.0) 195 | multi_json (~> 1.3) 196 | multi_xml (~> 0.5) 197 | rack (>= 1.2, < 3) 198 | omniauth (1.9.1) 199 | hashie (>= 3.4.6) 200 | rack (>= 1.6.2, < 3) 201 | omniauth-facebook (4.0.0) 202 | omniauth-oauth2 (~> 1.2) 203 | omniauth-github (1.4.0) 204 | omniauth (~> 1.5) 205 | omniauth-oauth2 (>= 1.4.0, < 2.0) 206 | omniauth-oauth (1.1.0) 207 | oauth 208 | omniauth (~> 1.0) 209 | omniauth-oauth2 (1.6.0) 210 | oauth2 (~> 1.1) 211 | omniauth (~> 1.9) 212 | omniauth-twitter (1.4.0) 213 | omniauth-oauth (~> 1.1) 214 | rack 215 | orm_adapter (0.5.0) 216 | popper_js (1.16.0) 217 | public_suffix (4.0.3) 218 | puma (4.3.3) 219 | nio4r (~> 2.0) 220 | rack (2.2.2) 221 | rack-protection (2.0.8.1) 222 | rack 223 | rack-proxy (0.6.5) 224 | rack 225 | rack-test (1.1.0) 226 | rack (>= 1.0, < 3) 227 | rails (6.0.2.1) 228 | actioncable (= 6.0.2.1) 229 | actionmailbox (= 6.0.2.1) 230 | actionmailer (= 6.0.2.1) 231 | actionpack (= 6.0.2.1) 232 | actiontext (= 6.0.2.1) 233 | actionview (= 6.0.2.1) 234 | activejob (= 6.0.2.1) 235 | activemodel (= 6.0.2.1) 236 | activerecord (= 6.0.2.1) 237 | activestorage (= 6.0.2.1) 238 | activesupport (= 6.0.2.1) 239 | bundler (>= 1.3.0) 240 | railties (= 6.0.2.1) 241 | sprockets-rails (>= 2.0.0) 242 | rails-dom-testing (2.0.3) 243 | activesupport (>= 4.2.0) 244 | nokogiri (>= 1.6) 245 | rails-html-sanitizer (1.3.0) 246 | loofah (~> 2.3) 247 | railties (6.0.2.1) 248 | actionpack (= 6.0.2.1) 249 | activesupport (= 6.0.2.1) 250 | method_source 251 | rake (>= 0.8.7) 252 | thor (>= 0.20.3, < 2.0) 253 | rake (13.0.1) 254 | rb-fsevent (0.10.3) 255 | rb-inotify (0.10.1) 256 | ffi (~> 1.0) 257 | redis (4.1.3) 258 | responders (3.0.0) 259 | actionpack (>= 5.0) 260 | railties (>= 5.0) 261 | rubyzip (2.2.0) 262 | sass (3.7.4) 263 | sass-listen (~> 4.0.0) 264 | sass-listen (4.0.0) 265 | rb-fsevent (~> 0.9, >= 0.9.4) 266 | rb-inotify (~> 0.9, >= 0.9.7) 267 | sass-rails (6.0.0) 268 | sassc-rails (~> 2.1, >= 2.1.1) 269 | sassc (2.2.1) 270 | ffi (~> 1.9) 271 | sassc-rails (2.1.2) 272 | railties (>= 4.0.0) 273 | sassc (>= 2.0) 274 | sprockets (> 3.0) 275 | sprockets-rails 276 | tilt 277 | selectize-rails (0.12.6) 278 | selenium-webdriver (3.142.7) 279 | childprocess (>= 0.5, < 4.0) 280 | rubyzip (>= 1.2.2) 281 | sidekiq (6.0.5) 282 | connection_pool (>= 2.2.2) 283 | rack (~> 2.0) 284 | rack-protection (>= 2.0.0) 285 | redis (>= 4.1.0) 286 | spring (2.1.0) 287 | spring-watcher-listen (2.0.1) 288 | listen (>= 2.7, < 4.0) 289 | spring (>= 1.2, < 3.0) 290 | sprockets (4.0.0) 291 | concurrent-ruby (~> 1.0) 292 | rack (> 1, < 3) 293 | sprockets-rails (3.2.1) 294 | actionpack (>= 4.0) 295 | activesupport (>= 4.0) 296 | sprockets (>= 3.0.0) 297 | sqlite3 (1.4.2) 298 | thor (1.0.1) 299 | thread_safe (0.3.6) 300 | tilt (2.0.10) 301 | turbolinks (5.2.1) 302 | turbolinks-source (~> 5.2) 303 | turbolinks-source (5.2.0) 304 | tzinfo (1.2.6) 305 | thread_safe (~> 0.1) 306 | uglifier (4.2.0) 307 | execjs (>= 0.3.0, < 3) 308 | warden (1.2.8) 309 | rack (>= 2.0.6) 310 | web-console (4.0.1) 311 | actionview (>= 6.0.0) 312 | activemodel (>= 6.0.0) 313 | bindex (>= 0.4.0) 314 | railties (>= 6.0.0) 315 | webpacker (4.2.2) 316 | activesupport (>= 4.2) 317 | rack-proxy (>= 0.6.1) 318 | railties (>= 4.2) 319 | websocket-driver (0.7.1) 320 | websocket-extensions (>= 0.1.0) 321 | websocket-extensions (0.1.4) 322 | xpath (3.2.0) 323 | nokogiri (~> 1.8) 324 | zeitwerk (2.3.0) 325 | 326 | PLATFORMS 327 | ruby 328 | 329 | DEPENDENCIES 330 | acts_as_list 331 | administrate! 332 | bootstrap (~> 4.4) 333 | byebug 334 | capybara (~> 2.13) 335 | coffee-rails (~> 4.2) 336 | devise (~> 4.7.0) 337 | devise-bootstrapped! 338 | devise_masquerade (~> 1.2)! 339 | font-awesome-sass (~> 4.7) 340 | gravatar_image_tag! 341 | jbuilder (~> 2.10) 342 | listen (>= 3.2.0) 343 | omniauth-facebook (~> 4.0) 344 | omniauth-github (~> 1.3) 345 | omniauth-twitter (~> 1.4) 346 | puma (~> 4.3) 347 | rails (~> 6.0.0) 348 | sass-rails (>= 6) 349 | selenium-webdriver 350 | sidekiq (~> 6.0) 351 | spring 352 | spring-watcher-listen (~> 2.0.0) 353 | sqlite3 354 | turbolinks (~> 5) 355 | tzinfo-data 356 | uglifier (>= 1.3.0) 357 | web-console (>= 3.3.0) 358 | webpacker (~> 4.2) 359 | 360 | BUNDLED WITH 361 | 2.1.4 362 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec rails server 2 | sidekiq: bundle exec sidekiq 3 | webpack: bin/webpack-dev-server 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | -------------------------------------------------------------------------------- /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_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's 5 | // vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. JavaScript code in this file should be added after the last require_* statement. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | // $navbar-default-bg: #312312; 2 | // $light-orange: #ff8c00; 3 | // $navbar-default-color: $light-orange; 4 | 5 | @import "font-awesome-sprockets"; 6 | @import "font-awesome"; 7 | @import "bootstrap"; 8 | @import "jumpstart/sticky-footer"; 9 | @import "jumpstart/announcements"; 10 | 11 | // Fixes bootstrap nav-brand container overlap 12 | @include media-breakpoint-down(xs) { 13 | .container { 14 | margin-left: 0; 15 | margin-right: 0; 16 | } 17 | } 18 | 19 | // Masquerade alert shouldn't have a bottom margin 20 | body > .alert { 21 | margin-bottom: 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /app/assets/stylesheets/jumpstart/announcements.scss: -------------------------------------------------------------------------------- 1 | .announcement { 2 | strong { 3 | color: $gray-700; 4 | font-weight: 900; 5 | } 6 | } 7 | 8 | .unread-announcements:before { 9 | -moz-border-radius: 50%; 10 | -webkit-border-radius: 50%; 11 | border-radius: 50%; 12 | -moz-background-clip: padding-box; 13 | -webkit-background-clip: padding-box; 14 | background-clip: padding-box; 15 | background: $red; 16 | content: ''; 17 | display: inline-block; 18 | height: 8px; 19 | width: 8px; 20 | margin-right: 6px; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /app/assets/stylesheets/jumpstart/sticky-footer.scss: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | /* Margin bottom by footer height */ 9 | margin-bottom: 60px; 10 | } 11 | .footer { 12 | position: absolute; 13 | bottom: 0; 14 | width: 100%; 15 | /* Set the fixed height of the footer here */ 16 | height: 60px; 17 | line-height: 60px; /* Vertically center the text there */ 18 | } 19 | 20 | 21 | /* Custom page CSS 22 | -------------------------------------------------- */ 23 | /* Not required for template or sticky footer method. */ 24 | 25 | body > .container { 26 | padding: 40px 15px 0; 27 | } 28 | 29 | .footer > .container { 30 | padding-right: 15px; 31 | padding-left: 15px; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | identified_by :current_user 4 | 5 | def connect 6 | self.current_user = find_verified_user 7 | logger.add_tags "ActionCable", "User #{current_user.id}" 8 | end 9 | 10 | protected 11 | 12 | def find_verified_user 13 | if current_user = env['warden'].user 14 | current_user 15 | else 16 | reject_unauthorized_connection 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/channels/board_channel.rb: -------------------------------------------------------------------------------- 1 | class BoardChannel < ApplicationCable::Channel 2 | def subscribed 3 | stream_from "board" 4 | end 5 | 6 | def unsubscribed 7 | stop_all_streams 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/admin/announcements_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class AnnouncementsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Announcement. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Announcement.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/application_controller.rb: -------------------------------------------------------------------------------- 1 | # All Administrate controllers inherit from this `Admin::ApplicationController`, 2 | # making it the ideal place to put authentication logic or other 3 | # before_actions. 4 | # 5 | # If you want to add pagination or other controller-level concerns, 6 | # you're free to overwrite the RESTful controller actions. 7 | module Admin 8 | class ApplicationController < Administrate::ApplicationController 9 | before_action :authenticate_admin 10 | before_action :default_params 11 | 12 | def authenticate_admin 13 | redirect_to '/', alert: 'Not authorized.' unless user_signed_in? && current_user.admin? 14 | end 15 | 16 | def default_params 17 | params[:order] ||= "created_at" 18 | params[:direction] ||= "desc" 19 | end 20 | 21 | # Override this value to specify the number of elements to display at a time 22 | # on index pages. Defaults to 20. 23 | # def records_per_page 24 | # params[:per_page] || 20 25 | # end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /app/controllers/admin/notifications_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class NotificationsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Notification. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Notification.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/users_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class UsersController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = User. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # User.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/announcements_controller.rb: -------------------------------------------------------------------------------- 1 | class AnnouncementsController < ApplicationController 2 | before_action :mark_as_read, if: :user_signed_in? 3 | 4 | def index 5 | @announcements = Announcement.order(published_at: :desc) 6 | end 7 | 8 | private 9 | 10 | def mark_as_read 11 | current_user.update(announcements_last_read_at: Time.zone.now) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | 4 | before_action :configure_permitted_parameters, if: :devise_controller? 5 | 6 | protected 7 | 8 | def configure_permitted_parameters 9 | devise_parameter_sanitizer.permit(:sign_up, keys: [:name]) 10 | devise_parameter_sanitizer.permit(:account_update, keys: [:name]) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/controllers/cards_controller.rb: -------------------------------------------------------------------------------- 1 | class CardsController < ApplicationController 2 | before_action :set_card, only: [:show, :edit, :update, :destroy, :move] 3 | 4 | # GET /cards 5 | # GET /cards.json 6 | def index 7 | @cards = Card.all 8 | end 9 | 10 | # GET /cards/1 11 | # GET /cards/1.json 12 | def show 13 | end 14 | 15 | # GET /cards/new 16 | def new 17 | @card = Card.new 18 | end 19 | 20 | # GET /cards/1/edit 21 | def edit 22 | end 23 | 24 | # POST /cards 25 | # POST /cards.json 26 | def create 27 | @card = Card.new(card_params) 28 | 29 | respond_to do |format| 30 | if @card.save 31 | 32 | ActionCable.server.broadcast "board", { commit: 'addCard', payload: render_to_string(:show, formats: [:json]) } 33 | 34 | format.html { redirect_to @card, notice: 'Card was successfully created.' } 35 | format.json { render :show, status: :created, location: @card } 36 | else 37 | format.html { render :new } 38 | format.json { render json: @card.errors, status: :unprocessable_entity } 39 | end 40 | end 41 | end 42 | 43 | # PATCH/PUT /cards/1 44 | # PATCH/PUT /cards/1.json 45 | def update 46 | respond_to do |format| 47 | if @card.update(card_params) 48 | 49 | ActionCable.server.broadcast "board", { commit: 'editCard', payload: render_to_string(:show, formats: [:json]) } 50 | 51 | format.html { redirect_to @card, notice: 'Card was successfully updated.' } 52 | format.json { render :show, status: :ok, location: @card } 53 | else 54 | format.html { render :edit } 55 | format.json { render json: @card.errors, status: :unprocessable_entity } 56 | end 57 | end 58 | end 59 | 60 | # DELETE /cards/1 61 | # DELETE /cards/1.json 62 | def destroy 63 | @card.destroy 64 | respond_to do |format| 65 | format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' } 66 | format.json { head :no_content } 67 | end 68 | end 69 | 70 | def move 71 | @card.update(card_params) 72 | ActionCable.server.broadcast "board", { commit: 'moveCard', payload: render_to_string(:show, formats: [:json]) } 73 | render action: :show 74 | end 75 | 76 | private 77 | # Use callbacks to share common setup or constraints between actions. 78 | def set_card 79 | @card = Card.find(params[:id]) 80 | end 81 | 82 | # Never trust parameters from the scary internet, only allow the white list through. 83 | def card_params 84 | params.require(:card).permit(:list_id, :name, :position) 85 | end 86 | end 87 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | 5 | def terms 6 | end 7 | 8 | def privacy 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/controllers/lists_controller.rb: -------------------------------------------------------------------------------- 1 | class ListsController < ApplicationController 2 | before_action :set_list, only: [:show, :edit, :update, :destroy, :move] 3 | 4 | # GET /lists 5 | # GET /lists.json 6 | def index 7 | @lists = List.sorted 8 | end 9 | 10 | # GET /lists/1 11 | # GET /lists/1.json 12 | def show 13 | end 14 | 15 | # GET /lists/new 16 | def new 17 | @list = List.new 18 | end 19 | 20 | # GET /lists/1/edit 21 | def edit 22 | end 23 | 24 | # POST /lists 25 | # POST /lists.json 26 | def create 27 | @list = List.new(list_params) 28 | 29 | respond_to do |format| 30 | if @list.save 31 | 32 | ActionCable.server.broadcast "board", { commit: 'addList', payload: render_to_string(:show, formats: [:json]) } 33 | 34 | format.html { redirect_to @list, notice: 'List was successfully created.' } 35 | format.json { render :show, status: :created, location: @list } 36 | else 37 | format.html { render :new } 38 | format.json { render json: @list.errors, status: :unprocessable_entity } 39 | end 40 | end 41 | end 42 | 43 | # PATCH/PUT /lists/1 44 | # PATCH/PUT /lists/1.json 45 | def update 46 | respond_to do |format| 47 | if @list.update(list_params) 48 | format.html { redirect_to @list, notice: 'List was successfully updated.' } 49 | format.json { render :show, status: :ok, location: @list } 50 | else 51 | format.html { render :edit } 52 | format.json { render json: @list.errors, status: :unprocessable_entity } 53 | end 54 | end 55 | end 56 | 57 | # DELETE /lists/1 58 | # DELETE /lists/1.json 59 | def destroy 60 | @list.destroy 61 | respond_to do |format| 62 | format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' } 63 | format.json { head :no_content } 64 | end 65 | end 66 | 67 | def move 68 | @list.insert_at(list_params[:position].to_i) 69 | ActionCable.server.broadcast "board", { commit: 'moveList', payload: render_to_string(:show, formats: [:json]) } 70 | render action: :show 71 | end 72 | 73 | private 74 | # Use callbacks to share common setup or constraints between actions. 75 | def set_list 76 | @list = List.find(params[:id]) 77 | end 78 | 79 | # Never trust parameters from the scary internet, only allow the white list through. 80 | def list_params 81 | params.require(:list).permit(:name, :position) 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /app/controllers/notifications_controller.rb: -------------------------------------------------------------------------------- 1 | class NotificationsController < ApplicationController 2 | before_action :authenticate_user! 3 | 4 | def index 5 | @notifications = current_user.notifications 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/controllers/users/omniauth_callbacks_controller.rb: -------------------------------------------------------------------------------- 1 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController 2 | before_action :set_service 3 | before_action :set_user 4 | 5 | attr_reader :service, :user 6 | 7 | def facebook 8 | handle_auth "Facebook" 9 | end 10 | 11 | def twitter 12 | handle_auth "Twitter" 13 | end 14 | 15 | def github 16 | handle_auth "Github" 17 | end 18 | 19 | private 20 | 21 | def handle_auth(kind) 22 | if service.present? 23 | service.update(service_attrs) 24 | else 25 | user.services.create(service_attrs) 26 | end 27 | 28 | if user_signed_in? 29 | flash[:notice] = "Your #{kind} account was connected." 30 | redirect_to edit_user_registration_path 31 | else 32 | sign_in_and_redirect user, event: :authentication 33 | set_flash_message :notice, :success, kind: kind 34 | end 35 | end 36 | 37 | def auth 38 | request.env['omniauth.auth'] 39 | end 40 | 41 | def set_service 42 | @service = Service.where(provider: auth.provider, uid: auth.uid).first 43 | end 44 | 45 | def set_user 46 | if user_signed_in? 47 | @user = current_user 48 | elsif service.present? 49 | @user = service.user 50 | elsif User.where(email: auth.info.email).any? 51 | # 5. User is logged out and they login to a new account which doesn't match their old one 52 | flash[:alert] = "An account with this email already exists. Please sign in with that account before connecting your #{auth.provider.titleize} account." 53 | redirect_to new_user_session_path 54 | else 55 | @user = create_user 56 | end 57 | end 58 | 59 | def service_attrs 60 | expires_at = auth.credentials.expires_at.present? ? Time.at(auth.credentials.expires_at) : nil 61 | { 62 | provider: auth.provider, 63 | uid: auth.uid, 64 | expires_at: expires_at, 65 | access_token: auth.credentials.token, 66 | access_token_secret: auth.credentials.secret, 67 | } 68 | end 69 | 70 | def create_user 71 | User.create( 72 | email: auth.info.email, 73 | #name: auth.info.name, 74 | password: Devise.friendly_token[0,20] 75 | ) 76 | end 77 | 78 | end -------------------------------------------------------------------------------- /app/dashboards/announcement_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class AnnouncementDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | id: Field::Number, 12 | published_at: Field::DateTime, 13 | announcement_type: Field::Select.with_options(collection: Announcement::TYPES), 14 | name: Field::String, 15 | description: Field::Text, 16 | created_at: Field::DateTime, 17 | updated_at: Field::DateTime, 18 | }.freeze 19 | 20 | # COLLECTION_ATTRIBUTES 21 | # an array of attributes that will be displayed on the model's index page. 22 | # 23 | # By default, it's limited to four items to reduce clutter on index pages. 24 | # Feel free to add, remove, or rearrange items. 25 | COLLECTION_ATTRIBUTES = [ 26 | :id, 27 | :published_at, 28 | :announcement_type, 29 | :name, 30 | ].freeze 31 | 32 | # SHOW_PAGE_ATTRIBUTES 33 | # an array of attributes that will be displayed on the model's show page. 34 | SHOW_PAGE_ATTRIBUTES = [ 35 | :id, 36 | :published_at, 37 | :announcement_type, 38 | :name, 39 | :description, 40 | :created_at, 41 | :updated_at, 42 | ].freeze 43 | 44 | # FORM_ATTRIBUTES 45 | # an array of attributes that will be displayed 46 | # on the model's form (`new` and `edit`) pages. 47 | FORM_ATTRIBUTES = [ 48 | :published_at, 49 | :announcement_type, 50 | :name, 51 | :description, 52 | ].freeze 53 | 54 | # Overwrite this method to customize how announcements are displayed 55 | # across all pages of the admin dashboard. 56 | # 57 | # def display_resource(announcement) 58 | # "Announcement ##{announcement.id}" 59 | # end 60 | end 61 | -------------------------------------------------------------------------------- /app/dashboards/notification_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class NotificationDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | recipient: Field::BelongsTo.with_options(class_name: "User"), 12 | actor: Field::BelongsTo.with_options(class_name: "User"), 13 | notifiable: Field::Polymorphic, 14 | id: Field::Number, 15 | recipient_id: Field::Number, 16 | actor_id: Field::Number, 17 | read_at: Field::DateTime, 18 | action: Field::String, 19 | created_at: Field::DateTime, 20 | updated_at: Field::DateTime, 21 | }.freeze 22 | 23 | # COLLECTION_ATTRIBUTES 24 | # an array of attributes that will be displayed on the model's index page. 25 | # 26 | # By default, it's limited to four items to reduce clutter on index pages. 27 | # Feel free to add, remove, or rearrange items. 28 | COLLECTION_ATTRIBUTES = [ 29 | :recipient, 30 | :actor, 31 | :notifiable, 32 | :id, 33 | ].freeze 34 | 35 | # SHOW_PAGE_ATTRIBUTES 36 | # an array of attributes that will be displayed on the model's show page. 37 | SHOW_PAGE_ATTRIBUTES = [ 38 | :recipient, 39 | :actor, 40 | :notifiable, 41 | :id, 42 | :recipient_id, 43 | :actor_id, 44 | :read_at, 45 | :action, 46 | :created_at, 47 | :updated_at, 48 | ].freeze 49 | 50 | # FORM_ATTRIBUTES 51 | # an array of attributes that will be displayed 52 | # on the model's form (`new` and `edit`) pages. 53 | FORM_ATTRIBUTES = [ 54 | :recipient, 55 | :actor, 56 | :notifiable, 57 | :recipient_id, 58 | :actor_id, 59 | :read_at, 60 | :action, 61 | ].freeze 62 | 63 | # Overwrite this method to customize how notifications are displayed 64 | # across all pages of the admin dashboard. 65 | # 66 | # def display_resource(notification) 67 | # "Notification ##{notification.id}" 68 | # end 69 | end 70 | -------------------------------------------------------------------------------- /app/dashboards/user_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class UserDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | notifications: Field::HasMany, 12 | services: Field::HasMany, 13 | id: Field::Number, 14 | email: Field::String, 15 | encrypted_password: Field::String, 16 | reset_password_token: Field::String, 17 | reset_password_sent_at: Field::DateTime, 18 | remember_created_at: Field::DateTime, 19 | sign_in_count: Field::Number, 20 | current_sign_in_at: Field::DateTime, 21 | last_sign_in_at: Field::DateTime, 22 | current_sign_in_ip: Field::String, 23 | last_sign_in_ip: Field::String, 24 | name: Field::String, 25 | announcements_last_read_at: Field::DateTime, 26 | admin: Field::Boolean, 27 | created_at: Field::DateTime, 28 | updated_at: Field::DateTime, 29 | }.freeze 30 | 31 | # COLLECTION_ATTRIBUTES 32 | # an array of attributes that will be displayed on the model's index page. 33 | # 34 | # By default, it's limited to four items to reduce clutter on index pages. 35 | # Feel free to add, remove, or rearrange items. 36 | COLLECTION_ATTRIBUTES = [ 37 | :notifications, 38 | :services, 39 | :id, 40 | :email, 41 | ].freeze 42 | 43 | # SHOW_PAGE_ATTRIBUTES 44 | # an array of attributes that will be displayed on the model's show page. 45 | SHOW_PAGE_ATTRIBUTES = [ 46 | :notifications, 47 | :services, 48 | :id, 49 | :email, 50 | :encrypted_password, 51 | :reset_password_token, 52 | :reset_password_sent_at, 53 | :remember_created_at, 54 | :sign_in_count, 55 | :current_sign_in_at, 56 | :last_sign_in_at, 57 | :current_sign_in_ip, 58 | :last_sign_in_ip, 59 | :name, 60 | :announcements_last_read_at, 61 | :admin, 62 | :created_at, 63 | :updated_at, 64 | ].freeze 65 | 66 | # FORM_ATTRIBUTES 67 | # an array of attributes that will be displayed 68 | # on the model's form (`new` and `edit`) pages. 69 | FORM_ATTRIBUTES = [ 70 | :notifications, 71 | :services, 72 | :email, 73 | :encrypted_password, 74 | :reset_password_token, 75 | :reset_password_sent_at, 76 | :remember_created_at, 77 | :sign_in_count, 78 | :current_sign_in_at, 79 | :last_sign_in_at, 80 | :current_sign_in_ip, 81 | :last_sign_in_ip, 82 | :name, 83 | :announcements_last_read_at, 84 | :admin, 85 | ].freeze 86 | 87 | # Overwrite this method to customize how users are displayed 88 | # across all pages of the admin dashboard. 89 | # 90 | # def display_resource(user) 91 | # "User ##{user.id}" 92 | # end 93 | end 94 | -------------------------------------------------------------------------------- /app/helpers/announcements_helper.rb: -------------------------------------------------------------------------------- 1 | module AnnouncementsHelper 2 | def unread_announcements(user) 3 | last_announcement = Announcement.order(published_at: :desc).first 4 | return if last_announcement.nil? 5 | 6 | # Highlight announcements for anyone not logged in, cuz tempting 7 | if user.nil? || user.announcements_last_read_at.nil? || user.announcements_last_read_at < last_announcement.published_at 8 | "unread-announcements" 9 | end 10 | end 11 | 12 | def announcement_class(type) 13 | { 14 | "new" => "text-success", 15 | "update" => "text-warning", 16 | "fix" => "text-danger", 17 | }.fetch(type, "text-success") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | def bootstrap_class_for(flash_type) 3 | { 4 | success: "alert-success", 5 | error: "alert-danger", 6 | alert: "alert-warning", 7 | notice: "alert-info" 8 | }.stringify_keys[flash_type.to_s] || flash_type.to_s 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/helpers/cards_helper.rb: -------------------------------------------------------------------------------- 1 | module CardsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/devise_helper.rb: -------------------------------------------------------------------------------- 1 | module DeviseHelper 2 | def devise_error_messages! 3 | return '' if resource.errors.empty? 4 | 5 | messages = resource.errors.full_messages.map { |msg| content_tag(:div, msg) }.join 6 | html = <<-HTML 7 |
8 | #{messages} 9 |
10 | HTML 11 | 12 | html.html_safe 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/helpers/lists_helper.rb: -------------------------------------------------------------------------------- 1 | module ListsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/javascript/app.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 79 | 80 | 100 | -------------------------------------------------------------------------------- /app/javascript/channels/board_channel.js: -------------------------------------------------------------------------------- 1 | import consumer from "./consumer" 2 | 3 | consumer.subscriptions.create("BoardChannel", { 4 | connected() { 5 | // Called when the subscription is ready for use on the server 6 | }, 7 | 8 | disconnected() { 9 | // Called when the subscription has been terminated by the server 10 | }, 11 | 12 | received(data) { 13 | if (data.commit) { 14 | return window.store.commit(data.commit, JSON.parse(data.payload)); 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /app/javascript/channels/consumer.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command. 3 | 4 | import { createConsumer } from "@rails/actioncable" 5 | 6 | export default createConsumer() 7 | -------------------------------------------------------------------------------- /app/javascript/channels/index.js: -------------------------------------------------------------------------------- 1 | // Load all the channels within this directory and all subdirectories. 2 | // Channel files must be named *_channel.js. 3 | 4 | const channels = require.context('.', true, /_channel\.js$/) 5 | channels.keys().forEach(channels) 6 | -------------------------------------------------------------------------------- /app/javascript/components/card.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 60 | 61 | 63 | -------------------------------------------------------------------------------- /app/javascript/components/list.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 81 | 82 | 88 | -------------------------------------------------------------------------------- /app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // This file is automatically compiled by Webpack, along with any other files 3 | // present in this directory. You're encouraged to place your actual application logic in 4 | // a relevant structure within app/javascript and only use these pack files to reference 5 | // that code so it'll be compiled. 6 | // 7 | // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate 8 | // layout file, like app/views/layouts/application.html.erb 9 | 10 | require("@rails/ujs") 11 | require("turbolinks").start() 12 | require("channels") 13 | 14 | import "bootstrap" 15 | 16 | Rails.start() 17 | 18 | document.addEventListener("turbolinks:load", () => { 19 | $('.tooltip').tooltip() 20 | $('[rel="tooltip"]').tooltip() 21 | $('[data-toggle="tooltip"]').tooltip() 22 | $('[data-toggle="popover"]').popover() 23 | $('[data-toggle="dropdown"]').dropdown() 24 | $('.toast').toast({ autohide: false }) 25 | $('#toast').toast('show') 26 | }) 27 | 28 | import Vue from 'vue/dist/vue.esm' 29 | import Vuex from 'vuex' 30 | import App from '../app.vue' 31 | import TurbolinksAdapter from 'vue-turbolinks' 32 | 33 | Vue.use(Vuex) 34 | Vue.use(TurbolinksAdapter) 35 | 36 | window.store = new Vuex.Store({ 37 | state: { 38 | lists: [] 39 | }, 40 | 41 | mutations: { 42 | addList(state, data) { 43 | state.lists.push(data) 44 | }, 45 | moveList(state, data) { 46 | const index = state.lists.findIndex(item => item.id == data.id) 47 | state.lists.splice(index, 1) 48 | state.lists.splice(data.position - 1, 0, data) 49 | }, 50 | addCard(state, data) { 51 | const index = state.lists.findIndex(item => item.id == data.list_id) 52 | state.lists[index].cards.push(data) 53 | }, 54 | editCard(state, data) { 55 | const list_index = state.lists.findIndex((item) => item.id == data.list_id) 56 | const card_index = state.lists[list_index].cards.findIndex((item) => item.id == data.id) 57 | state.lists[list_index].cards.splice(card_index, 1, data) 58 | }, 59 | 60 | moveCard(state, data) { 61 | const old_list_index = state.lists.findIndex((list) => { 62 | return list.cards.find((card) => { 63 | return card.id === data.id 64 | }) 65 | }) 66 | const old_card_index = state.lists[old_list_index].cards.findIndex((item) => item.id == data.id) 67 | const new_list_index = state.lists.findIndex((item) => item.id == data.list_id) 68 | 69 | if (old_list_index != new_list_index) { 70 | // Remove card from old list, add to new one 71 | state.lists[old_list_index].cards.splice(old_card_index, 1) 72 | state.lists[new_list_index].cards.splice(data.position - 1, 0, data) 73 | } else { 74 | state.lists[new_list_index].cards.splice(old_card_index, 1) 75 | state.lists[new_list_index].cards.splice(data.position - 1, 0, data) 76 | } 77 | } 78 | } 79 | }) 80 | 81 | document.addEventListener("turbolinks:load", function() { 82 | var element = document.querySelector("#boards") 83 | if (element != undefined) { 84 | window.store.state.lists = JSON.parse(element.dataset.lists) 85 | 86 | const app = new Vue({ 87 | el: element, 88 | store: window.store, 89 | template: "", 90 | components: { App } 91 | }) 92 | } 93 | }); 94 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/models/announcement.rb: -------------------------------------------------------------------------------- 1 | class Announcement < ApplicationRecord 2 | TYPES = %w{ new fix update } 3 | 4 | after_initialize :set_defaults 5 | 6 | validates :announcement_type, :description, :name, :published_at, presence: true 7 | validates :announcement_type, inclusion: { in: TYPES } 8 | 9 | def set_defaults 10 | self.published_at ||= Time.zone.now 11 | self.announcement_type ||= TYPES.first 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/card.rb: -------------------------------------------------------------------------------- 1 | class Card < ApplicationRecord 2 | acts_as_list scope: :list 3 | 4 | belongs_to :list 5 | 6 | validates :name, presence: true 7 | end 8 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/list.rb: -------------------------------------------------------------------------------- 1 | class List < ApplicationRecord 2 | acts_as_list 3 | 4 | has_many :cards, ->{ order(position: :asc) }, dependent: :destroy 5 | 6 | scope :sorted, ->{ order(position: :asc) } 7 | 8 | validates :name, presence: true 9 | end 10 | -------------------------------------------------------------------------------- /app/models/notification.rb: -------------------------------------------------------------------------------- 1 | class Notification < ApplicationRecord 2 | belongs_to :recipient, class_name: "User" 3 | belongs_to :actor, class_name: "User" 4 | belongs_to :notifiable, polymorphic: true 5 | 6 | def self.post(to:, from:, action:, notifiable:) 7 | recipients = Array.wrap(to) 8 | notifications = [] 9 | 10 | Notification.transaction do 11 | notifications = recipients.uniq.each do |recipient| 12 | Notification.create( 13 | notifiable: notifiable, 14 | action: action, 15 | recipient: recipient, 16 | actor: from 17 | ) 18 | end 19 | end 20 | notifications 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/models/service.rb: -------------------------------------------------------------------------------- 1 | class Service < ApplicationRecord 2 | belongs_to :user 3 | 4 | %w{ facebook twitter github }.each do |provider| 5 | scope provider, ->{ where(provider: provider) } 6 | end 7 | 8 | def client 9 | send("#{provider}_client") 10 | end 11 | 12 | def expired? 13 | expires_at? && expires_at <= Time.zone.now 14 | end 15 | 16 | def access_token 17 | send("#{provider}_refresh_token!", super) if expired? 18 | super 19 | end 20 | 21 | 22 | def twitter_client 23 | Twitter::REST::Client.new do |config| 24 | config.consumer_key = Rails.application.secrets.twitter_app_id 25 | config.consumer_secret = Rails.application.secrets.twitter_app_secret 26 | config.access_token = access_token 27 | config.access_token_secret = access_token_secret 28 | end 29 | end 30 | 31 | def twitter_refresh_token!(token); end 32 | end -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable and :omniauthable 4 | devise :masqueradable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable 5 | 6 | has_many :notifications, foreign_key: :recipient_id 7 | has_many :services 8 | end 9 | -------------------------------------------------------------------------------- /app/views/admin/users/show.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | # Show 3 | 4 | This view is the template for the show page. 5 | It renders the attributes of a resource, 6 | as well as a link to its edit page. 7 | 8 | ## Local variables: 9 | 10 | - `page`: 11 | An instance of [Administrate::Page::Show][1]. 12 | Contains methods for accessing the resource to be displayed on the page, 13 | as well as helpers for describing how each attribute of the resource 14 | should be displayed. 15 | 16 | [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show 17 | %> 18 | 19 | <% content_for(:title) { "#{t("administrate.actions.show")} #{page.page_title}" } %> 20 | 21 | 36 | 37 |
38 |
39 | <% page.attributes.each do |attribute| %> 40 |
41 | <%= t( 42 | "helpers.label.#{resource_name}.#{attribute.name}", 43 | default: attribute.name.titleize, 44 | ) %> 45 |
46 | 47 |
<%= render_field attribute %>
49 | <% end %> 50 |
51 |
52 | -------------------------------------------------------------------------------- /app/views/announcements/index.html.erb: -------------------------------------------------------------------------------- 1 |

What's New

2 | 3 |
4 |
5 | <% @announcements.each_with_index do |announcement, index| %> 6 | <% if index != 0 %> 7 |

8 | <% end %> 9 | 10 |
11 |
12 | <%= link_to announcements_path(anchor: dom_id(announcement)) do %> 13 | <%= announcement.published_at.strftime("%b %d") %> 14 | <% end %> 15 |
16 |
17 | <%= announcement.announcement_type.titleize %>: 18 | <%= announcement.name %> 19 | <%= simple_format announcement.description %> 20 |
21 |
22 | <% end %> 23 | 24 | <% if @announcements.empty? %> 25 |
Exciting stuff coming very soon!
26 | <% end %> 27 |
28 |
29 | -------------------------------------------------------------------------------- /app/views/cards/_card.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! card, :id, :list_id, :name, :position, :created_at, :updated_at 2 | json.url card_url(card, format: :json) 3 | -------------------------------------------------------------------------------- /app/views/cards/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with(model: card, local: true) do |form| %> 2 | <% if card.errors.any? %> 3 |
4 |

<%= pluralize(card.errors.count, "error") %> prohibited this card from being saved:

5 | 6 | 11 |
12 | <% end %> 13 | 14 |
15 | <%= form.label :list %> 16 | <%= form.text_field :list, id: :card_list %> 17 |
18 | 19 |
20 | <%= form.label :name %> 21 | <%= form.text_field :name, id: :card_name %> 22 |
23 | 24 |
25 | <%= form.label :position %> 26 | <%= form.number_field :position, id: :card_position %> 27 |
28 | 29 |
30 | <%= form.submit %> 31 |
32 | <% end %> 33 | -------------------------------------------------------------------------------- /app/views/cards/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editing Card

2 | 3 | <%= render 'form', card: @card %> 4 | 5 | <%= link_to 'Show', @card %> | 6 | <%= link_to 'Back', cards_path %> 7 | -------------------------------------------------------------------------------- /app/views/cards/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Cards

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <% @cards.each do |card| %> 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | <% end %> 26 | 27 |
ListNamePosition
<%= card.list %><%= card.name %><%= card.position %><%= link_to 'Show', card %><%= link_to 'Edit', edit_card_path(card) %><%= link_to 'Destroy', card, method: :delete, data: { confirm: 'Are you sure?' } %>
28 | 29 |
30 | 31 | <%= link_to 'New Card', new_card_path %> 32 | -------------------------------------------------------------------------------- /app/views/cards/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @cards, partial: 'cards/card', as: :card 2 | -------------------------------------------------------------------------------- /app/views/cards/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Card

2 | 3 | <%= render 'form', card: @card %> 4 | 5 | <%= link_to 'Back', cards_path %> 6 | -------------------------------------------------------------------------------- /app/views/cards/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

4 | List: 5 | <%= @card.list %> 6 |

7 | 8 |

9 | Name: 10 | <%= @card.name %> 11 |

12 | 13 |

14 | Position: 15 | <%= @card.position %> 16 |

17 | 18 | <%= link_to 'Edit', edit_card_path(@card) %> | 19 | <%= link_to 'Back', cards_path %> 20 | -------------------------------------------------------------------------------- /app/views/cards/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "cards/card", card: @card 2 | -------------------------------------------------------------------------------- /app/views/devise/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Resend confirmation instructions

4 | 5 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> 6 | <%= devise_error_messages! %> 7 | 8 |
9 | <%= f.label :email %>
10 | <%= f.email_field :email, autofocus: true, class: 'form-control', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> 11 |
12 | 13 |
14 | <%= f.submit "Resend confirmation instructions", class: 'btn btn-primary btn-lg btn-block' %> 15 |
16 | <% end %> 17 | 18 |
19 | <%= render "devise/shared/links" %> 20 |
21 | 22 |
23 |
24 | -------------------------------------------------------------------------------- /app/views/devise/mailer/confirmation_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome <%= @email %>!

2 | 3 |

You can confirm your account email through the link below:

4 | 5 |

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

6 | -------------------------------------------------------------------------------- /app/views/devise/mailer/password_change.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

We're contacting you to notify you that your password has been changed.

4 | -------------------------------------------------------------------------------- /app/views/devise/mailer/reset_password_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Someone has requested a link to change your password. You can do this through the link below.

4 | 5 |

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

6 | 7 |

If you didn't request this, please ignore this email.

8 |

Your password won't change until you access the link above and create a new one.

9 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

4 | 5 |

Click the link below to unlock your account:

6 | 7 |

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

8 | -------------------------------------------------------------------------------- /app/views/devise/passwords/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Change your password

4 | 5 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> 6 | <%= devise_error_messages! %> 7 | <%= f.hidden_field :reset_password_token %> 8 | 9 |
10 | <%= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control', placeholder: "Password" %> 11 | <% if @minimum_password_length %> 12 |

<%= @minimum_password_length %> characters minimum

13 | <% end %> 14 |
15 | 16 |
17 | <%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: "Confirm Password" %> 18 |
19 | 20 |
21 | <%= f.submit "Change my password", class: 'btn btn-primary btn-block btn-lg' %> 22 |
23 | <% end %> 24 | 25 |
26 | <%= render "devise/shared/links" %> 27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /app/views/devise/passwords/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Reset your password

4 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> 5 | <%= devise_error_messages! %> 6 |
7 |

Enter your email address below and we will send you a link to reset your password.

8 |
9 | <%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %> 10 |
11 | 12 |
13 | <%= f.submit "Send password reset email", class: 'btn btn-primary btn-block btn-lg' %> 14 |
15 | <% end %> 16 |
17 | <%= render "devise/shared/links" %> 18 |
19 |
20 |
21 | -------------------------------------------------------------------------------- /app/views/devise/registrations/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Account

4 | 5 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> 6 | <%= devise_error_messages! %> 7 | 8 |
9 | <%= f.text_field :name, autofocus: false, class: 'form-control', placeholder: "Full Name" %> 10 |
11 | 12 |
13 | <%= f.email_field :email, class: 'form-control', placeholder: 'Email Address' %> 14 |
15 | 16 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> 17 |
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
18 | <% end %> 19 | 20 |
21 | <%= f.password_field :password, autocomplete: "off", class: 'form-control', placeholder: 'Password' %> 22 |

Leave password blank if you don't want to change it

23 |
24 | 25 |
26 | <%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: 'Confirm Password' %> 27 |
28 | 29 |
30 | <%= f.password_field :current_password, autocomplete: "off", class: 'form-control', placeholder: 'Current Password' %> 31 |

We need your current password to confirm your changes

32 |
33 | 34 |
35 | <%= f.submit "Save Changes", class: 'btn btn-lg btn-block btn-primary' %> 36 |
37 | <% end %> 38 |
39 | 40 |

<%= link_to "Deactivate my account", registration_path(resource_name), data: { confirm: "Are you sure? You cannot undo this." }, method: :delete %>

41 |
42 |
43 | -------------------------------------------------------------------------------- /app/views/devise/registrations/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Sign Up

4 | 5 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> 6 | <%= devise_error_messages! %> 7 | 8 |
9 | <%= f.text_field :name, autofocus: true, class: 'form-control', placeholder: "Full Name" %> 10 |
11 | 12 |
13 | <%= f.email_field :email, autofocus: false, class: 'form-control', placeholder: "Email Address" %> 14 |
15 | 16 |
17 | <%= f.password_field :password, autocomplete: "off", class: 'form-control', placeholder: 'Password' %> 18 |
19 | 20 |
21 | <%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: 'Confirm Password' %> 22 |
23 | 24 |
25 | <%= f.submit "Sign up", class: "btn btn-primary btn-block btn-lg" %> 26 |
27 | <% end %> 28 | 29 |
30 | <%= render "devise/shared/links" %> 31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /app/views/devise/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Log in

4 | 5 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> 6 |
7 | <%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %> 8 |
9 | 10 |
11 | <%= f.password_field :password, autocomplete: "off", placeholder: 'Password', class: 'form-control' %> 12 |
13 | 14 | <% if devise_mapping.rememberable? -%> 15 |
16 | 20 |
21 | <% end -%> 22 | 23 |
24 | <%= f.submit "Log in", class: "btn btn-primary btn-block btn-lg" %> 25 |
26 | <% end %> 27 | 28 |
29 | <%= render "devise/shared/links" %> 30 |
31 |
32 |
33 | -------------------------------------------------------------------------------- /app/views/devise/shared/_links.html.erb: -------------------------------------------------------------------------------- 1 | <%- if controller_name != 'sessions' %> 2 | <%= link_to "Log in", new_session_path(resource_name) %>
3 | <% end -%> 4 | 5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %> 6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end -%> 8 | 9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> 10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end -%> 12 | 13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> 14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end -%> 16 | 17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> 18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end -%> 20 | 21 | <%- if devise_mapping.omniauthable? %> 22 | <%- resource_class.omniauth_providers.each do |provider| %> 23 | <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %>
24 | <% end -%> 25 | <% end -%> 26 | -------------------------------------------------------------------------------- /app/views/devise/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend unlock instructions

2 | 3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %> 9 |
10 | 11 |
12 | <%= f.submit "Resend unlock instructions" %> 13 |
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome to Spork!

2 |

Use this document as a way to quickly start any new project.
All you get is this text and a mostly barebones HTML document.

3 | -------------------------------------------------------------------------------- /app/views/home/privacy.html.erb: -------------------------------------------------------------------------------- 1 |

Privacy Policy

2 |

Use this for your Privacy Policy

3 | -------------------------------------------------------------------------------- /app/views/home/terms.html.erb: -------------------------------------------------------------------------------- 1 |

Terms of Service

2 |

Use this for your Terms of Service

3 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= render 'shared/head' %> 5 | 6 | 7 | 8 | <%= render 'shared/navbar' %> 9 | <%= render 'shared/notices' %> 10 | 11 |
12 | <%= yield %> 13 |
14 | 15 | <%= render 'shared/footer' %> 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/lists/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with(model: list, local: true) do |form| %> 2 | <% if list.errors.any? %> 3 |
4 |

<%= pluralize(list.errors.count, "error") %> prohibited this list from being saved:

5 | 6 | 11 |
12 | <% end %> 13 | 14 |
15 | <%= form.label :name %> 16 | <%= form.text_field :name, id: :list_name %> 17 |
18 | 19 |
20 | <%= form.submit %> 21 |
22 | <% end %> 23 | -------------------------------------------------------------------------------- /app/views/lists/_list.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! list, :id, :name, :position, :created_at, :updated_at, :cards 2 | json.url list_url(list, format: :json) 3 | -------------------------------------------------------------------------------- /app/views/lists/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editing List

2 | 3 | <%= render 'form', list: @list %> 4 | 5 | <%= link_to 'Show', @list %> | 6 | <%= link_to 'Back', lists_path %> 7 | -------------------------------------------------------------------------------- /app/views/lists/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= tag.div id: :boards, data: { lists: @lists.to_json(include: :cards) } %> 3 |
4 | -------------------------------------------------------------------------------- /app/views/lists/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @lists, partial: 'lists/list', as: :list 2 | -------------------------------------------------------------------------------- /app/views/lists/new.html.erb: -------------------------------------------------------------------------------- 1 |

New List

2 | 3 | <%= render 'form', list: @list %> 4 | 5 | <%= link_to 'Back', lists_path %> 6 | -------------------------------------------------------------------------------- /app/views/lists/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

4 | Name: 5 | <%= @list.name %> 6 |

7 | 8 |

9 | Position: 10 | <%= @list.position %> 11 |

12 | 13 | <%= link_to 'Edit', edit_list_path(@list) %> | 14 | <%= link_to 'Back', lists_path %> 15 | -------------------------------------------------------------------------------- /app/views/lists/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "lists/list", list: @list 2 | -------------------------------------------------------------------------------- /app/views/notifications/index.html.erb: -------------------------------------------------------------------------------- 1 |

Notifications

2 | 3 | 8 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /app/views/shared/_head.html.erb: -------------------------------------------------------------------------------- 1 | Spark 2 | 3 | 4 | 5 | <%= csrf_meta_tags %> 6 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 7 | <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 8 | <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> 9 | -------------------------------------------------------------------------------- /app/views/shared/_navbar.html.erb: -------------------------------------------------------------------------------- 1 | <% if user_masquerade? %> 2 |
3 | You're logged in as <%= current_user.name %> (<%= current_user.email %>) 4 | <%= link_to back_masquerade_path(current_user) do %><%= icon("times") %> Logout <% end %> 5 |
6 | <% end %> 7 | 8 | 52 | -------------------------------------------------------------------------------- /app/views/shared/_notices.html.erb: -------------------------------------------------------------------------------- 1 | <% flash.each do |msg_type, message| %> 2 |
3 |
4 | 5 | <%= message %> 6 |
7 |
8 | <% end %> 9 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | var validEnv = ['development', 'test', 'production'] 3 | var currentEnv = api.env() 4 | var isDevelopmentEnv = api.env('development') 5 | var isProductionEnv = api.env('production') 6 | var isTestEnv = api.env('test') 7 | 8 | if (!validEnv.includes(currentEnv)) { 9 | throw new Error( 10 | 'Please specify a valid `NODE_ENV` or ' + 11 | '`BABEL_ENV` environment variables. Valid values are "development", ' + 12 | '"test", and "production". Instead, received: ' + 13 | JSON.stringify(currentEnv) + 14 | '.' 15 | ) 16 | } 17 | 18 | return { 19 | presets: [ 20 | isTestEnv && [ 21 | '@babel/preset-env', 22 | { 23 | targets: { 24 | node: 'current' 25 | } 26 | } 27 | ], 28 | (isProductionEnv || isDevelopmentEnv) && [ 29 | '@babel/preset-env', 30 | { 31 | forceAllTransforms: true, 32 | useBuiltIns: 'entry', 33 | corejs: 3, 34 | modules: false, 35 | exclude: ['transform-typeof-symbol'] 36 | } 37 | ] 38 | ].filter(Boolean), 39 | plugins: [ 40 | 'babel-plugin-macros', 41 | '@babel/plugin-syntax-dynamic-import', 42 | isTestEnv && 'babel-plugin-dynamic-import-node', 43 | '@babel/plugin-transform-destructuring', 44 | [ 45 | '@babel/plugin-proposal-class-properties', 46 | { 47 | loose: true 48 | } 49 | ], 50 | [ 51 | '@babel/plugin-proposal-object-rest-spread', 52 | { 53 | useBuiltIns: true 54 | } 55 | ], 56 | [ 57 | '@babel/plugin-transform-runtime', 58 | { 59 | helpers: false, 60 | regenerator: true, 61 | corejs: false 62 | } 63 | ], 64 | [ 65 | '@babel/plugin-transform-regenerator', 66 | { 67 | async: false 68 | } 69 | ] 70 | ].filter(Boolean) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a starting point to setup your application. 15 | # Add necessary setup steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | # Install JavaScript dependencies if using Yarn 22 | # system('bin/yarn') 23 | 24 | 25 | # puts "\n== Copying sample files ==" 26 | # unless File.exist?('config/database.yml') 27 | # cp 'config/database.yml.sample', 'config/database.yml' 28 | # end 29 | 30 | puts "\n== Preparing database ==" 31 | system! 'bin/rails db:setup' 32 | 33 | puts "\n== Removing old logs and tempfiles ==" 34 | system! 'bin/rails log:clear tmp:clear' 35 | 36 | puts "\n== Restarting application server ==" 37 | system! 'bin/rails restart' 38 | end 39 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a way to update your development environment automatically. 15 | # Add necessary update steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | puts "\n== Updating database ==" 22 | system! 'bin/rails db:migrate' 23 | 24 | puts "\n== Removing old logs and tempfiles ==" 25 | system! 'bin/rails log:clear tmp:clear' 26 | 27 | puts "\n== Restarting application server ==" 28 | system! 'bin/rails restart' 29 | end 30 | -------------------------------------------------------------------------------- /bin/webpack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/webpack_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::WebpackRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /bin/webpack-dev-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/dev_server_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::DevServerRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | VENDOR_PATH = File.expand_path('..', __dir__) 3 | Dir.chdir(VENDOR_PATH) do 4 | begin 5 | exec "yarnpkg #{ARGV.join(" ")}" 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module TrelloClone 10 | class Application < Rails::Application 11 | config.active_job.queue_adapter = :sidekiq 12 | # Initialize configuration defaults for originally generated Rails version. 13 | config.load_defaults 5.1 14 | 15 | # Settings in config/environments/* take precedence over those specified here. 16 | # Application configuration should go into files in config/initializers 17 | # -- all .rb files in that directory are automatically loaded. 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: trello-clone_production 11 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Verifies that versions and hashed value of the package contents in the project's package.json 3 | config.webpacker.check_yarn_integrity = true 4 | 5 | config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 6 | # Settings specified here will take precedence over those in config/application.rb. 7 | 8 | # In the development environment your application's code is reloaded on 9 | # every request. This slows down response time but is perfect for development 10 | # since you don't have to restart the web server when you make code changes. 11 | config.cache_classes = false 12 | 13 | # Do not eager load code on boot. 14 | config.eager_load = false 15 | 16 | # Show full error reports. 17 | config.consider_all_requests_local = true 18 | 19 | # Enable/disable caching. By default caching is disabled. 20 | if Rails.root.join('tmp/caching-dev.txt').exist? 21 | config.action_controller.perform_caching = true 22 | 23 | config.cache_store = :memory_store 24 | config.public_file_server.headers = { 25 | 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" 26 | } 27 | else 28 | config.action_controller.perform_caching = false 29 | 30 | config.cache_store = :null_store 31 | end 32 | 33 | # Don't care if the mailer can't send. 34 | config.action_mailer.raise_delivery_errors = false 35 | 36 | config.action_mailer.perform_caching = false 37 | 38 | # Print deprecation notices to the Rails logger. 39 | config.active_support.deprecation = :log 40 | 41 | # Raise an error on page load if there are pending migrations. 42 | config.active_record.migration_error = :page_load 43 | 44 | # Debug mode disables concatenation and preprocessing of assets. 45 | # This option may cause significant delays in view rendering with a large 46 | # number of complex assets. 47 | config.assets.debug = true 48 | 49 | # Suppress logger output for asset requests. 50 | config.assets.quiet = true 51 | 52 | # Raises error for missing translations 53 | # config.action_view.raise_on_missing_translations = true 54 | 55 | # Use an evented file watcher to asynchronously detect changes in source code, 56 | # routes, locales, etc. This feature depends on the listen gem. 57 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 58 | end 59 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Verifies that versions and hashed value of the package contents in the project's package.json 3 | config.webpacker.check_yarn_integrity = false 4 | 5 | # Settings specified here will take precedence over those in config/application.rb. 6 | 7 | # Code is not reloaded between requests. 8 | config.cache_classes = true 9 | 10 | # Eager load code on boot. This eager loads most of Rails and 11 | # your application in memory, allowing both threaded web servers 12 | # and those relying on copy on write to perform better. 13 | # Rake tasks automatically ignore this option for performance. 14 | config.eager_load = true 15 | 16 | # Full error reports are disabled and caching is turned on. 17 | config.consider_all_requests_local = false 18 | config.action_controller.perform_caching = true 19 | 20 | # Attempt to read encrypted secrets from `config/secrets.yml.enc`. 21 | # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or 22 | # `config/secrets.yml.key`. 23 | config.read_encrypted_secrets = true 24 | 25 | # Disable serving static files from the `/public` folder by default since 26 | # Apache or NGINX already handles this. 27 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 28 | 29 | # Compress JavaScripts and CSS. 30 | config.assets.js_compressor = :uglifier 31 | # config.assets.css_compressor = :sass 32 | 33 | # Do not fallback to assets pipeline if a precompiled asset is missed. 34 | config.assets.compile = false 35 | 36 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 37 | 38 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 39 | # config.action_controller.asset_host = 'http://assets.example.com' 40 | 41 | # Specifies the header that your server uses for sending files. 42 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 43 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 44 | 45 | # Mount Action Cable outside main process or domain 46 | # config.action_cable.mount_path = nil 47 | # config.action_cable.url = 'wss://example.com/cable' 48 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 49 | 50 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 51 | # config.force_ssl = true 52 | 53 | # Use the lowest log level to ensure availability of diagnostic information 54 | # when problems arise. 55 | config.log_level = :debug 56 | 57 | # Prepend all log lines with the following tags. 58 | config.log_tags = [ :request_id ] 59 | 60 | # Use a different cache store in production. 61 | # config.cache_store = :mem_cache_store 62 | 63 | # Use a real queuing backend for Active Job (and separate queues per environment) 64 | # config.active_job.queue_adapter = :resque 65 | # config.active_job.queue_name_prefix = "trello-clone_#{Rails.env}" 66 | config.action_mailer.perform_caching = false 67 | 68 | # Ignore bad email addresses and do not raise email delivery errors. 69 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 70 | # config.action_mailer.raise_delivery_errors = false 71 | 72 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 73 | # the I18n.default_locale when a translation cannot be found). 74 | config.i18n.fallbacks = true 75 | 76 | # Send deprecation notices to registered listeners. 77 | config.active_support.deprecation = :notify 78 | 79 | # Use default logging formatter so that PID and timestamp are not suppressed. 80 | config.log_formatter = ::Logger::Formatter.new 81 | 82 | # Use a different logger for distributed setups. 83 | # require 'syslog/logger' 84 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 85 | 86 | if ENV["RAILS_LOG_TO_STDOUT"].present? 87 | logger = ActiveSupport::Logger.new(STDOUT) 88 | logger.formatter = config.log_formatter 89 | config.logger = ActiveSupport::TaggedLogging.new(logger) 90 | end 91 | 92 | # Do not dump schema after migrations. 93 | config.active_record.dump_schema_after_migration = false 94 | end 95 | -------------------------------------------------------------------------------- /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.seconds.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 | config.action_mailer.perform_caching = false 31 | 32 | # Tell Action Mailer not to deliver emails to the real world. 33 | # The :test delivery method accumulates sent emails in the 34 | # ActionMailer::Base.deliveries array. 35 | config.action_mailer.delivery_method = :test 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | # Use this hook to configure devise mailer, warden hooks and so forth. 2 | # Many of these configuration options can be set straight in your model. 3 | Devise.setup do |config| 4 | # The secret key used by Devise. Devise uses this key to generate 5 | # random tokens. Changing this key will render invalid all existing 6 | # confirmation, reset password and unlock tokens in the database. 7 | # Devise will use the `secret_key_base` as its `secret_key` 8 | # by default. You can change it below and use your own secret key. 9 | # config.secret_key = '9f2cf4c4cd3c2fef9e0647ca18a09829398565a15d45149ebad47f1e002862f78e71f4b1245bf0027a44d2dde927bdf861aaf520f12f491fd7d2fa5a5f591c12' 10 | 11 | # ==> Mailer Configuration 12 | # Configure the e-mail address which will be shown in Devise::Mailer, 13 | # note that it will be overwritten if you use your own mailer class 14 | # with default "from" parameter. 15 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' 16 | 17 | # Configure the class responsible to send e-mails. 18 | # config.mailer = 'Devise::Mailer' 19 | 20 | # Configure the parent class responsible to send e-mails. 21 | # config.parent_mailer = 'ActionMailer::Base' 22 | 23 | # ==> ORM configuration 24 | # Load and configure the ORM. Supports :active_record (default) and 25 | # :mongoid (bson_ext recommended) by default. Other ORMs may be 26 | # available as additional gems. 27 | require 'devise/orm/active_record' 28 | 29 | # ==> Configuration for any authentication mechanism 30 | # Configure which keys are used when authenticating a user. The default is 31 | # just :email. You can configure it to use [:username, :subdomain], so for 32 | # authenticating a user, both parameters are required. Remember that those 33 | # parameters are used only when authenticating and not when retrieving from 34 | # session. If you need permissions, you should implement that in a before filter. 35 | # You can also supply a hash where the value is a boolean determining whether 36 | # or not authentication should be aborted when the value is not present. 37 | # config.authentication_keys = [:email] 38 | 39 | # Configure parameters from the request object used for authentication. Each entry 40 | # given should be a request method and it will automatically be passed to the 41 | # find_for_authentication method and considered in your model lookup. For instance, 42 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. 43 | # The same considerations mentioned for authentication_keys also apply to request_keys. 44 | # config.request_keys = [] 45 | 46 | # Configure which authentication keys should be case-insensitive. 47 | # These keys will be downcased upon creating or modifying a user and when used 48 | # to authenticate or find a user. Default is :email. 49 | config.case_insensitive_keys = [:email] 50 | 51 | # Configure which authentication keys should have whitespace stripped. 52 | # These keys will have whitespace before and after removed upon creating or 53 | # modifying a user and when used to authenticate or find a user. Default is :email. 54 | config.strip_whitespace_keys = [:email] 55 | 56 | # Tell if authentication through request.params is enabled. True by default. 57 | # It can be set to an array that will enable params authentication only for the 58 | # given strategies, for example, `config.params_authenticatable = [:database]` will 59 | # enable it only for database (email + password) authentication. 60 | # config.params_authenticatable = true 61 | 62 | # Tell if authentication through HTTP Auth is enabled. False by default. 63 | # It can be set to an array that will enable http authentication only for the 64 | # given strategies, for example, `config.http_authenticatable = [:database]` will 65 | # enable it only for database authentication. The supported strategies are: 66 | # :database = Support basic authentication with authentication key + password 67 | # config.http_authenticatable = false 68 | 69 | # If 401 status code should be returned for AJAX requests. True by default. 70 | # config.http_authenticatable_on_xhr = true 71 | 72 | # The realm used in Http Basic Authentication. 'Application' by default. 73 | # config.http_authentication_realm = 'Application' 74 | 75 | # It will change confirmation, password recovery and other workflows 76 | # to behave the same regardless if the e-mail provided was right or wrong. 77 | # Does not affect registerable. 78 | # config.paranoid = true 79 | 80 | # By default Devise will store the user in session. You can skip storage for 81 | # particular strategies by setting this option. 82 | # Notice that if you are skipping storage for all authentication paths, you 83 | # may want to disable generating routes to Devise's sessions controller by 84 | # passing skip: :sessions to `devise_for` in your config/routes.rb 85 | config.skip_session_storage = [:http_auth] 86 | 87 | # By default, Devise cleans up the CSRF token on authentication to 88 | # avoid CSRF token fixation attacks. This means that, when using AJAX 89 | # requests for sign in and sign up, you need to get a new CSRF token 90 | # from the server. You can disable this option at your own risk. 91 | # config.clean_up_csrf_token_on_authentication = true 92 | 93 | # When false, Devise will not attempt to reload routes on eager load. 94 | # This can reduce the time taken to boot the app but if your application 95 | # requires the Devise mappings to be loaded during boot time the application 96 | # won't boot properly. 97 | # config.reload_routes = true 98 | 99 | # ==> Configuration for :database_authenticatable 100 | # For bcrypt, this is the cost for hashing the password and defaults to 11. If 101 | # using other algorithms, it sets how many times you want the password to be hashed. 102 | # 103 | # Limiting the stretches to just one in testing will increase the performance of 104 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use 105 | # a value less than 10 in other environments. Note that, for bcrypt (the default 106 | # algorithm), the cost increases exponentially with the number of stretches (e.g. 107 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). 108 | config.stretches = Rails.env.test? ? 1 : 11 109 | 110 | # Set up a pepper to generate the hashed password. 111 | # config.pepper = '63310c08bbd4d0c52af5ecc16e17e76c79df2325b89d0fe5b0234eabe14bf213cd487b676d0b2a243e9c468ab8b76b98f1120840a488b2ae5c5e33fc0fef32e0' 112 | 113 | # Send a notification to the original email when the user's email is changed. 114 | # config.send_email_changed_notification = false 115 | 116 | # Send a notification email when the user's password is changed. 117 | # config.send_password_change_notification = false 118 | 119 | # ==> Configuration for :confirmable 120 | # A period that the user is allowed to access the website even without 121 | # confirming their account. For instance, if set to 2.days, the user will be 122 | # able to access the website for two days without confirming their account, 123 | # access will be blocked just in the third day. Default is 0.days, meaning 124 | # the user cannot access the website without confirming their account. 125 | # config.allow_unconfirmed_access_for = 2.days 126 | 127 | # A period that the user is allowed to confirm their account before their 128 | # token becomes invalid. For example, if set to 3.days, the user can confirm 129 | # their account within 3 days after the mail was sent, but on the fourth day 130 | # their account can't be confirmed with the token any more. 131 | # Default is nil, meaning there is no restriction on how long a user can take 132 | # before confirming their account. 133 | # config.confirm_within = 3.days 134 | 135 | # If true, requires any email changes to be confirmed (exactly the same way as 136 | # initial account confirmation) to be applied. Requires additional unconfirmed_email 137 | # db field (see migrations). Until confirmed, new email is stored in 138 | # unconfirmed_email column, and copied to email column on successful confirmation. 139 | config.reconfirmable = true 140 | 141 | # Defines which key will be used when confirming an account 142 | # config.confirmation_keys = [:email] 143 | 144 | # ==> Configuration for :rememberable 145 | # The time the user will be remembered without asking for credentials again. 146 | # config.remember_for = 2.weeks 147 | 148 | # Invalidates all the remember me tokens when the user signs out. 149 | config.expire_all_remember_me_on_sign_out = true 150 | 151 | # If true, extends the user's remember period when remembered via cookie. 152 | # config.extend_remember_period = false 153 | 154 | # Options to be passed to the created cookie. For instance, you can set 155 | # secure: true in order to force SSL only cookies. 156 | # config.rememberable_options = {} 157 | 158 | # ==> Configuration for :validatable 159 | # Range for password length. 160 | config.password_length = 6..128 161 | 162 | # Email regex used to validate email formats. It simply asserts that 163 | # one (and only one) @ exists in the given string. This is mainly 164 | # to give user feedback and not to assert the e-mail validity. 165 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ 166 | 167 | # ==> Configuration for :timeoutable 168 | # The time you want to timeout the user session without activity. After this 169 | # time the user will be asked for credentials again. Default is 30 minutes. 170 | # config.timeout_in = 30.minutes 171 | 172 | # ==> Configuration for :lockable 173 | # Defines which strategy will be used to lock an account. 174 | # :failed_attempts = Locks an account after a number of failed attempts to sign in. 175 | # :none = No lock strategy. You should handle locking by yourself. 176 | # config.lock_strategy = :failed_attempts 177 | 178 | # Defines which key will be used when locking and unlocking an account 179 | # config.unlock_keys = [:email] 180 | 181 | # Defines which strategy will be used to unlock an account. 182 | # :email = Sends an unlock link to the user email 183 | # :time = Re-enables login after a certain amount of time (see :unlock_in below) 184 | # :both = Enables both strategies 185 | # :none = No unlock strategy. You should handle unlocking by yourself. 186 | # config.unlock_strategy = :both 187 | 188 | # Number of authentication tries before locking an account if lock_strategy 189 | # is failed attempts. 190 | # config.maximum_attempts = 20 191 | 192 | # Time interval to unlock the account if :time is enabled as unlock_strategy. 193 | # config.unlock_in = 1.hour 194 | 195 | # Warn on the last attempt before the account is locked. 196 | # config.last_attempt_warning = true 197 | 198 | # ==> Configuration for :recoverable 199 | # 200 | # Defines which key will be used when recovering the password for an account 201 | # config.reset_password_keys = [:email] 202 | 203 | # Time interval you can reset your password with a reset password key. 204 | # Don't put a too small interval or your users won't have the time to 205 | # change their passwords. 206 | config.reset_password_within = 6.hours 207 | 208 | # When set to false, does not sign a user in automatically after their password is 209 | # reset. Defaults to true, so a user is signed in automatically after a reset. 210 | # config.sign_in_after_reset_password = true 211 | 212 | # ==> Configuration for :encryptable 213 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default). 214 | # You can use :sha1, :sha512 or algorithms from others authentication tools as 215 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 216 | # for default behavior) and :restful_authentication_sha1 (then you should set 217 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). 218 | # 219 | # Require the `devise-encryptable` gem when using anything other than bcrypt 220 | # config.encryptor = :sha512 221 | 222 | # ==> Scopes configuration 223 | # Turn scoped views on. Before rendering "sessions/new", it will first check for 224 | # "users/sessions/new". It's turned off by default because it's slower if you 225 | # are using only default views. 226 | # config.scoped_views = false 227 | 228 | # Configure the default scope given to Warden. By default it's the first 229 | # devise role declared in your routes (usually :user). 230 | # config.default_scope = :user 231 | 232 | # Set this configuration to false if you want /users/sign_out to sign out 233 | # only the current scope. By default, Devise signs out all scopes. 234 | # config.sign_out_all_scopes = true 235 | 236 | # ==> Navigation configuration 237 | # Lists the formats that should be treated as navigational. Formats like 238 | # :html, should redirect to the sign in page when the user does not have 239 | # access, but formats like :xml or :json, should return 401. 240 | # 241 | # If you have any extra navigational formats, like :iphone or :mobile, you 242 | # should add them to the navigational formats lists. 243 | # 244 | # The "*/*" below is required to match Internet Explorer requests. 245 | # config.navigational_formats = ['*/*', :html] 246 | 247 | # The default HTTP method used to sign out a resource. Default is :delete. 248 | config.sign_out_via = :delete 249 | 250 | # ==> OmniAuth 251 | # Add a new OmniAuth provider. Check the wiki for more information on setting 252 | # up on your models and hooks. 253 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' 254 | 255 | if Rails.application.secrets.facebook_app_id.present? && Rails.application.secrets.facebook_app_secret.present? then (config.omniauth :facebook, Rails.application.secrets.facebook_app_id, Rails.application.secrets.facebook_app_secret, scope: 'email,user_posts') end 256 | 257 | if Rails.application.secrets.twitter_app_id.present? && Rails.application.secrets.twitter_app_secret.present? then (config.omniauth :twitter, Rails.application.secrets.twitter_app_id, Rails.application.secrets.twitter_app_secret) end 258 | 259 | if Rails.application.secrets.github_app_id.present? && Rails.application.secrets.github_app_secret.present? then (config.omniauth :github, Rails.application.secrets.github_app_id, Rails.application.secrets.github_app_secret) end 260 | # ==> Warden configuration 261 | # If you want to use other strategies, that are not supported by Devise, or 262 | # change the failure app, you can configure them inside the config.warden block. 263 | # 264 | # config.warden do |manager| 265 | # manager.intercept_401 = false 266 | # manager.default_strategies(scope: :user).unshift :some_external_strategy 267 | # end 268 | 269 | # ==> Mountable engine configurations 270 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine 271 | # is mountable, there are some extra configurations to be taken into account. 272 | # The following options are available, assuming the engine is mounted as: 273 | # 274 | # mount MyEngine, at: '/my_engine' 275 | # 276 | # The router that invoked `devise_for`, in the example above, would be: 277 | # config.router_name = :my_engine 278 | # 279 | # When using OmniAuth, Devise cannot automatically set OmniAuth path, 280 | # so you need to do it manually. For the users scope, it would be: 281 | # config.omniauth_path_prefix = '/my_engine/users/auth' 282 | end 283 | -------------------------------------------------------------------------------- /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 += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/gravatar.rb: -------------------------------------------------------------------------------- 1 | GravatarImageTag.configure do |config| 2 | config.default_image = "mm" 3 | config.secure = true 4 | end 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n 2 | 3 | en: 4 | devise: 5 | confirmations: 6 | confirmed: "Your email address has been successfully confirmed." 7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." 8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." 9 | failure: 10 | already_authenticated: "You are already signed in." 11 | inactive: "Your account is not activated yet." 12 | invalid: "Invalid %{authentication_keys} or password." 13 | locked: "Your account is locked." 14 | last_attempt: "You have one more attempt before your account is locked." 15 | not_found_in_database: "Invalid %{authentication_keys} or password." 16 | timeout: "Your session expired. Please sign in again to continue." 17 | unauthenticated: "You need to sign in or sign up before continuing." 18 | unconfirmed: "You have to confirm your email address before continuing." 19 | mailer: 20 | confirmation_instructions: 21 | subject: "Confirmation instructions" 22 | reset_password_instructions: 23 | subject: "Reset password instructions" 24 | unlock_instructions: 25 | subject: "Unlock instructions" 26 | email_changed: 27 | subject: "Email Changed" 28 | password_change: 29 | subject: "Password Changed" 30 | omniauth_callbacks: 31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." 32 | success: "Successfully authenticated from %{kind} account." 33 | passwords: 34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." 35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." 36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." 37 | updated: "Your password has been changed successfully. You are now signed in." 38 | updated_not_active: "Your password has been changed successfully." 39 | registrations: 40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." 41 | signed_up: "Welcome! You have signed up successfully." 42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." 43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." 44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." 45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address." 46 | updated: "Your account has been updated successfully." 47 | sessions: 48 | signed_in: "Signed in successfully." 49 | signed_out: "Signed out successfully." 50 | already_signed_out: "Signed out successfully." 51 | unlocks: 52 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." 53 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." 54 | unlocked: "Your account has been unlocked successfully. Please sign in to continue." 55 | errors: 56 | messages: 57 | already_confirmed: "was already confirmed, please try signing in" 58 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" 59 | expired: "has expired, please request a new one" 60 | not_found: "not found" 61 | not_locked: "was not locked" 62 | not_saved: 63 | one: "1 error prohibited this %{resource} from being saved:" 64 | other: "%{count} errors prohibited this %{resource} from being saved:" 65 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at http://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | threads threads_count, threads_count 9 | 10 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 11 | # 12 | port ENV.fetch("PORT") { 3000 } 13 | 14 | # Specifies the `environment` that Puma will run in. 15 | # 16 | environment ENV.fetch("RAILS_ENV") { "development" } 17 | 18 | # Specifies the number of `workers` to boot in clustered mode. 19 | # Workers are forked webserver processes. If using threads and workers together 20 | # the concurrency of the application would be max `threads` * `workers`. 21 | # Workers do not work on JRuby or Windows (both of which do not support 22 | # processes). 23 | # 24 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 25 | 26 | # Use the `preload_app!` method when specifying a `workers` number. 27 | # This directive tells Puma to first boot the application and load code 28 | # before forking the application. This takes advantage of Copy On Write 29 | # process behavior so workers use less memory. If you use this option 30 | # you need to make sure to reconnect any threads in the `on_worker_boot` 31 | # block. 32 | # 33 | # preload_app! 34 | 35 | # If you are preloading your application and using Active Record, it's 36 | # recommended that you close any connections to the database before workers 37 | # are forked to prevent connection leakage. 38 | # 39 | # before_fork do 40 | # ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) 41 | # end 42 | 43 | # The code in the `on_worker_boot` will be called if you are using 44 | # clustered mode by specifying a number of `workers`. After each worker 45 | # process is booted, this block will be run. If you are using the `preload_app!` 46 | # option, you will want to use this block to reconnect to any threads 47 | # or connections that may have been created at application boot, as Ruby 48 | # cannot share connections between processes. 49 | # 50 | # on_worker_boot do 51 | # ActiveRecord::Base.establish_connection if defined?(ActiveRecord) 52 | # end 53 | # 54 | 55 | # Allow puma to be restarted by `rails restart` command. 56 | plugin :tmp_restart 57 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | require 'sidekiq/web' 2 | 3 | Rails.application.routes.draw do 4 | namespace :admin do 5 | resources :users 6 | resources :announcements 7 | resources :notifications 8 | 9 | root to: "users#index" 10 | end 11 | 12 | get '/privacy', to: 'home#privacy' 13 | get '/terms', to: 'home#terms' 14 | resources :notifications, only: [:index] 15 | resources :announcements, only: [:index] 16 | authenticate :user, lambda { |u| u.admin? } do 17 | mount Sidekiq::Web => '/sidekiq' 18 | end 19 | 20 | devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" } 21 | 22 | resources :lists do 23 | member do 24 | patch :move 25 | end 26 | end 27 | resources :cards do 28 | member do 29 | patch :move 30 | end 31 | end 32 | 33 | root to: 'lists#index' 34 | end 35 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rails secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | # Shared secrets are available across all environments. 14 | 15 | # shared: 16 | # api_key: a1B2c3D4e5F6 17 | 18 | # Environmental secrets are only available for that specific environment. 19 | 20 | development: 21 | secret_key_base: 1e01ac016b4e352066fdffecdfeeb4e150ee8e83128c7ebaa801144ad6e9ff55eead4f2f6fac14deec6141b8b847cd773ab175006a0560067aa54da240695cfd 22 | 23 | test: 24 | secret_key_base: c4eca764141a774ab5899f37ccf419c40a17cf9069d517ea995bca57d787fdfcd28e0d31c89c86731175c3363ffdd01b416568aecaa166ed08ffffdce34a65ce 25 | 26 | # Do not keep production secrets in the unencrypted secrets file. 27 | # Instead, either read values from the environment. 28 | # Or, use `bin/rails secrets:setup` to configure encrypted secrets 29 | # and move the `production:` environment over there. 30 | 31 | production: 32 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/webpack/development.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/environment.js: -------------------------------------------------------------------------------- 1 | const { environment } = require('@rails/webpacker') 2 | const { VueLoaderPlugin } = require('vue-loader') 3 | const vue = require('./loaders/vue') 4 | const webpack = require('webpack') 5 | 6 | environment.plugins.append('Provide', new webpack.ProvidePlugin({ 7 | $: 'jquery', 8 | jQuery: 'jquery', 9 | Rails: '@rails/ujs' 10 | })) 11 | 12 | environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin()) 13 | environment.loaders.prepend('vue', vue) 14 | 15 | module.exports = environment 16 | -------------------------------------------------------------------------------- /config/webpack/loaders/vue.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | test: /\.vue(\.erb)?$/, 3 | use: [{ 4 | loader: 'vue-loader' 5 | }] 6 | } 7 | -------------------------------------------------------------------------------- /config/webpack/production.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'production' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/test.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpacker.yml: -------------------------------------------------------------------------------- 1 | # Note: You must restart bin/webpack-dev-server for changes to take effect 2 | 3 | default: &default 4 | source_path: app/javascript 5 | source_entry_path: packs 6 | public_root_path: public 7 | public_output_path: packs 8 | cache_path: tmp/cache/webpacker 9 | check_yarn_integrity: false 10 | webpack_compile_output: true 11 | 12 | # Additional paths webpack should lookup modules 13 | # ['app/assets', 'engine/foo/app/assets'] 14 | resolved_paths: [] 15 | 16 | # Reload manifest.json on all requests so we reload latest compiled packs 17 | cache_manifest: false 18 | 19 | # Extract and emit a css file 20 | extract_css: false 21 | 22 | static_assets_extensions: 23 | - .jpg 24 | - .jpeg 25 | - .png 26 | - .gif 27 | - .tiff 28 | - .ico 29 | - .svg 30 | - .eot 31 | - .otf 32 | - .ttf 33 | - .woff 34 | - .woff2 35 | 36 | extensions: 37 | - .vue 38 | - .mjs 39 | - .js 40 | - .sass 41 | - .scss 42 | - .css 43 | - .module.sass 44 | - .module.scss 45 | - .module.css 46 | - .png 47 | - .svg 48 | - .gif 49 | - .jpeg 50 | - .jpg 51 | 52 | development: 53 | <<: *default 54 | compile: true 55 | 56 | # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules 57 | check_yarn_integrity: true 58 | 59 | # Reference: https://webpack.js.org/configuration/dev-server/ 60 | dev_server: 61 | https: false 62 | host: localhost 63 | port: 3035 64 | public: localhost:3035 65 | hmr: false 66 | # Inline should be set to true if using HMR 67 | inline: true 68 | overlay: true 69 | compress: true 70 | disable_host_check: true 71 | use_local_ip: false 72 | quiet: false 73 | pretty: false 74 | headers: 75 | 'Access-Control-Allow-Origin': '*' 76 | watch_options: 77 | ignored: '**/node_modules/**' 78 | 79 | 80 | test: 81 | <<: *default 82 | compile: true 83 | 84 | # Compile test packs to a separate directory 85 | public_output_path: packs-test 86 | 87 | production: 88 | <<: *default 89 | 90 | # Production depends on precompilation of packs prior to booting for performance. 91 | compile: false 92 | 93 | # Extract and emit a css file 94 | extract_css: true 95 | 96 | # Cache manifest.json for performance 97 | cache_manifest: true 98 | -------------------------------------------------------------------------------- /db/migrate/20171128191105_devise_create_users.rb: -------------------------------------------------------------------------------- 1 | class DeviseCreateUsers < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :users do |t| 4 | ## Database authenticatable 5 | t.string :email, null: false, default: "" 6 | t.string :encrypted_password, null: false, default: "" 7 | 8 | ## Recoverable 9 | t.string :reset_password_token 10 | t.datetime :reset_password_sent_at 11 | 12 | ## Rememberable 13 | t.datetime :remember_created_at 14 | 15 | ## Trackable 16 | t.integer :sign_in_count, default: 0, null: false 17 | t.datetime :current_sign_in_at 18 | t.datetime :last_sign_in_at 19 | t.string :current_sign_in_ip 20 | t.string :last_sign_in_ip 21 | 22 | ## Confirmable 23 | # t.string :confirmation_token 24 | # t.datetime :confirmed_at 25 | # t.datetime :confirmation_sent_at 26 | # t.string :unconfirmed_email # Only if using reconfirmable 27 | 28 | ## Lockable 29 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts 30 | # t.string :unlock_token # Only if unlock strategy is :email or :both 31 | # t.datetime :locked_at 32 | 33 | t.string :name 34 | t.datetime :announcements_last_read_at 35 | t.boolean :admin, default: false 36 | 37 | t.timestamps null: false 38 | end 39 | 40 | add_index :users, :email, unique: true 41 | add_index :users, :reset_password_token, unique: true 42 | # add_index :users, :confirmation_token, unique: true 43 | # add_index :users, :unlock_token, unique: true 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /db/migrate/20171128191126_create_announcements.rb: -------------------------------------------------------------------------------- 1 | class CreateAnnouncements < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :announcements do |t| 4 | t.datetime :published_at 5 | t.string :announcement_type 6 | t.string :name 7 | t.text :description 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20171128191128_create_notifications.rb: -------------------------------------------------------------------------------- 1 | class CreateNotifications < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :notifications do |t| 4 | t.integer :recipient_id 5 | t.integer :actor_id 6 | t.datetime :read_at 7 | t.string :action 8 | t.integer :notifiable_id 9 | t.string :notifiable_type 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20171128191412_create_lists.rb: -------------------------------------------------------------------------------- 1 | class CreateLists < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :lists do |t| 4 | t.string :name 5 | t.integer :position 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20171128191446_create_cards.rb: -------------------------------------------------------------------------------- 1 | class CreateCards < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :cards do |t| 4 | t.references :list 5 | t.string :name 6 | t.integer :position 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /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: 20171128191446) do 14 | 15 | create_table "announcements", force: :cascade do |t| 16 | t.datetime "published_at" 17 | t.string "announcement_type" 18 | t.string "name" 19 | t.text "description" 20 | t.datetime "created_at", null: false 21 | t.datetime "updated_at", null: false 22 | end 23 | 24 | create_table "cards", force: :cascade do |t| 25 | t.integer "list_id" 26 | t.string "name" 27 | t.integer "position" 28 | t.datetime "created_at", null: false 29 | t.datetime "updated_at", null: false 30 | t.index ["list_id"], name: "index_cards_on_list_id" 31 | end 32 | 33 | create_table "lists", force: :cascade do |t| 34 | t.string "name" 35 | t.integer "position" 36 | t.datetime "created_at", null: false 37 | t.datetime "updated_at", null: false 38 | end 39 | 40 | create_table "notifications", force: :cascade do |t| 41 | t.integer "recipient_id" 42 | t.integer "actor_id" 43 | t.datetime "read_at" 44 | t.string "action" 45 | t.integer "notifiable_id" 46 | t.string "notifiable_type" 47 | t.datetime "created_at", null: false 48 | t.datetime "updated_at", null: false 49 | end 50 | 51 | create_table "users", force: :cascade do |t| 52 | t.string "email", default: "", null: false 53 | t.string "encrypted_password", default: "", null: false 54 | t.string "reset_password_token" 55 | t.datetime "reset_password_sent_at" 56 | t.datetime "remember_created_at" 57 | t.integer "sign_in_count", default: 0, null: false 58 | t.datetime "current_sign_in_at" 59 | t.datetime "last_sign_in_at" 60 | t.string "current_sign_in_ip" 61 | t.string "last_sign_in_ip" 62 | t.string "name" 63 | t.datetime "announcements_last_read_at" 64 | t.boolean "admin", default: false 65 | t.datetime "created_at", null: false 66 | t.datetime "updated_at", null: false 67 | t.index ["email"], name: "index_users_on_email", unique: true 68 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true 69 | end 70 | 71 | end 72 | -------------------------------------------------------------------------------- /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 rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/log/.keep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "trello-clone", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/actioncable": "^6.0.2-1", 6 | "@rails/activestorage": "^6.0.0", 7 | "@rails/ujs": "^6.0.0", 8 | "@rails/webpacker": "4.2.2", 9 | "bootstrap": "^4.4.1", 10 | "data-confirm-modal": "^1.6.2", 11 | "expose-loader": "^0.7.5", 12 | "jquery": "^3.4.1", 13 | "local-time": "^2.1.0", 14 | "popper.js": "^1.16.1", 15 | "turbolinks": "^5.2.0", 16 | "vue": "^2.6.11", 17 | "vue-loader": "^15.9.0", 18 | "vue-template-compiler": "^2.6.11", 19 | "vue-turbolinks": "^2.0.0", 20 | "vuedraggable": "^2.15.0", 21 | "vuex": "^3.0.1" 22 | }, 23 | "devDependencies": { 24 | "webpack-dev-server": "^3.10.3" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /test/channels/board_channel_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class BoardChannelTest < ActionCable::Channel::TestCase 4 | # test "subscribes" do 5 | # subscribe 6 | # assert subscription.confirmed? 7 | # end 8 | end 9 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/cards_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CardsControllerTest < ActionDispatch::IntegrationTest 4 | setup do 5 | @card = cards(:one) 6 | end 7 | 8 | test "should get index" do 9 | get cards_url 10 | assert_response :success 11 | end 12 | 13 | test "should get new" do 14 | get new_card_url 15 | assert_response :success 16 | end 17 | 18 | test "should create card" do 19 | assert_difference('Card.count') do 20 | post cards_url, params: { card: { list: @card.list, name: @card.name, position: @card.position } } 21 | end 22 | 23 | assert_redirected_to card_url(Card.last) 24 | end 25 | 26 | test "should show card" do 27 | get card_url(@card) 28 | assert_response :success 29 | end 30 | 31 | test "should get edit" do 32 | get edit_card_url(@card) 33 | assert_response :success 34 | end 35 | 36 | test "should update card" do 37 | patch card_url(@card), params: { card: { list: @card.list, name: @card.name, position: @card.position } } 38 | assert_redirected_to card_url(@card) 39 | end 40 | 41 | test "should destroy card" do 42 | assert_difference('Card.count', -1) do 43 | delete card_url(@card) 44 | end 45 | 46 | assert_redirected_to cards_url 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /test/controllers/lists_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ListsControllerTest < ActionDispatch::IntegrationTest 4 | setup do 5 | @list = lists(:one) 6 | end 7 | 8 | test "should get index" do 9 | get lists_url 10 | assert_response :success 11 | end 12 | 13 | test "should get new" do 14 | get new_list_url 15 | assert_response :success 16 | end 17 | 18 | test "should create list" do 19 | assert_difference('List.count') do 20 | post lists_url, params: { list: { name: @list.name, position: @list.position } } 21 | end 22 | 23 | assert_redirected_to list_url(List.last) 24 | end 25 | 26 | test "should show list" do 27 | get list_url(@list) 28 | assert_response :success 29 | end 30 | 31 | test "should get edit" do 32 | get edit_list_url(@list) 33 | assert_response :success 34 | end 35 | 36 | test "should update list" do 37 | patch list_url(@list), params: { list: { name: @list.name, position: @list.position } } 38 | assert_redirected_to list_url(@list) 39 | end 40 | 41 | test "should destroy list" do 42 | assert_difference('List.count', -1) do 43 | delete list_url(@list) 44 | end 45 | 46 | assert_redirected_to lists_url 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/announcements.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | published_at: 2017-11-28 13:11:26 5 | announcement_type: MyString 6 | name: MyString 7 | description: MyText 8 | 9 | two: 10 | published_at: 2017-11-28 13:11:26 11 | announcement_type: MyString 12 | name: MyString 13 | description: MyText 14 | -------------------------------------------------------------------------------- /test/fixtures/cards.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | list: 5 | name: MyString 6 | position: 1 7 | 8 | two: 9 | list: 10 | name: MyString 11 | position: 1 12 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/fixtures/files/.keep -------------------------------------------------------------------------------- /test/fixtures/lists.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | position: 1 6 | 7 | two: 8 | name: MyString 9 | position: 1 10 | -------------------------------------------------------------------------------- /test/fixtures/notifications.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | recipient_id: 1 5 | actor_id: 1 6 | read_at: 2017-11-28 13:11:28 7 | action: MyString 8 | notifiable_id: 1 9 | notifiable_type: MyString 10 | 11 | two: 12 | recipient_id: 1 13 | actor_id: 1 14 | read_at: 2017-11-28 13:11:28 15 | action: MyString 16 | notifiable_id: 1 17 | notifiable_type: MyString 18 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/models/.keep -------------------------------------------------------------------------------- /test/models/announcement_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AnnouncementTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/card_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CardTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/list_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ListTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/notification_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NotificationTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/test/system/.keep -------------------------------------------------------------------------------- /test/system/cards_test.rb: -------------------------------------------------------------------------------- 1 | require "application_system_test_case" 2 | 3 | class CardsTest < ApplicationSystemTestCase 4 | # test "visiting the index" do 5 | # visit cards_url 6 | # 7 | # assert_selector "h1", text: "Card" 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /test/system/lists_test.rb: -------------------------------------------------------------------------------- 1 | require "application_system_test_case" 2 | 3 | class ListsTest < ApplicationSystemTestCase 4 | # test "visiting the index" do 5 | # visit lists_url 6 | # 7 | # assert_selector "h1", text: "List" 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../config/environment', __FILE__) 2 | require 'rails/test_help' 3 | 4 | class ActiveSupport::TestCase 5 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 6 | fixtures :all 7 | 8 | # Add more helper methods to be used by all tests here... 9 | end 10 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/tmp/.keep -------------------------------------------------------------------------------- /vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gorails-screencasts/vuejs-trello-clone/7137c87647dd09c6dc58906ab28eaaae70f88c99/vendor/.keep --------------------------------------------------------------------------------