Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ gem 'bcrypt', '~> 3.1.7'
gem 'bootsnap', '>= 1.4.2', require: false

gem 'state_machines-activerecord'
gem 'slim-rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
slim (4.1.0)
temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1)
slim-rails (3.2.0)
actionpack (>= 3.1)
railties (>= 3.1)
slim (>= 3.0, < 5.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -193,6 +200,7 @@ GEM
state_machines-activerecord (0.6.0)
activerecord (>= 4.1)
state_machines-activemodel (>= 0.5.0)
temple (0.8.2)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
Expand Down Expand Up @@ -236,6 +244,7 @@ DEPENDENCIES
rubocop
sass-rails (>= 6)
selenium-webdriver
slim-rails
state_machines-activerecord
web-console (>= 3.3.0)
webdrivers
Expand Down
34 changes: 19 additions & 15 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
//= require material-design-lite/material.min.css

body {
min-height: 100vh;
display: flex;
flex-direction: column;
}

#main {
flex: 1 0 auto;
}

.page-content {
padding: 20px;
}

.page-content .mdl-textfield {
display: block;
}
2 changes: 2 additions & 0 deletions app/controllers/web/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Web::ApplicationController < ApplicationController
end
4 changes: 4 additions & 0 deletions app/controllers/web/boards_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Web::BoardsController < Web::ApplicationController
def show
end
end
4 changes: 4 additions & 0 deletions app/controllers/web/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Web::SessionsController < Web::ApplicationController
def new
end
end
1 change: 1 addition & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require("@rails/ujs").start()
require("@rails/activestorage").start()
require("channels")

import 'material-design-lite/material.js';

// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
Expand Down
15 changes: 0 additions & 15 deletions app/views/layouts/application.html.erb

This file was deleted.

32 changes: 32 additions & 0 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
doctype html
html lang="en"
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"
meta name="viewport" content="width=device-width, initial-scale=1.0"
title= content_for?(:title) ? yield(:title) : "Task Manager"
link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"
= stylesheet_link_tag "application", media: "all"
= csrf_meta_tags
- if !Rails.env.development?
= stylesheet_packs_with_chunks_tag "application", media: "all"


body
= javascript_packs_with_chunks_tag 'application'
header.mdl-layout__header
.mdl-layout__header-row
.material-icons tab
label.mdl-button.mdl-js-button.mdl-button--icon
i.material-icons
span.mdl-layout-title
= "Task Manager"
.mdl-layout-spacer
nav.mdl-navigation
main#main.mdl-layout__content
.page-content
= yield
footer#footer.mdl-mini-footer
.mdl-mini-footer__left-section
.mdl-logo
| &copy; Dualboot Learn 2020
2 changes: 2 additions & 0 deletions app/views/web/boards/show.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
h1 Web::Boards#show
p Find me in app/views/web/boards/show.html.slim
2 changes: 2 additions & 0 deletions app/views/web/sessions/new.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
h1 Web::Sessions#new
p Find me in app/views/web/sessions/new.html.slim
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0

config.assets.paths << Rails.root.join('node_modules')
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
Expand Down
24 changes: 24 additions & 0 deletions config/initializers/simple_form_materialize.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.error_notification_class = 'alert alert-danger'
config.button_class = 'mdl-button mdl-js-button mdl-button--raised'
config.boolean_label_class = nil
config.boolean_style = :inline
config.item_wrapper_tag = :p

config.wrappers :materialize_form, tag: 'div', class: 'mdl-textfield mdl-js-textfield mdl-textfield--floating-label', error_class: 'is-invalid' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
b.optional :pattern
b.optional :min_max
b.optional :readonly
b.use :input, class: 'mdl-textfield__input'
b.use :label, class: 'mdl-textfield__label'
b.use :error, wrap_with: { tag: 'span', class: 'mdl-textfield__error' }
end

config.default_wrapper = :materialize_form
end
7 changes: 6 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root :to => "web/boards#show"

scope module: :web do
resource :board, only: :show
resource :session, only: :new
end
end
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"@rails/actioncable": "^6.0.0",
"@rails/activestorage": "^6.0.0",
"@rails/ujs": "^6.0.0",
"@rails/webpacker": "4.3.0"
"@rails/webpacker": "4.3.0",
"material-design-lite": "^1.3.0"
},
"version": "0.1.0",
"devDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions test/controllers/web/boards_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class Web::BoardsControllerTest < ActionController::TestCase
test 'should get new' do
get :show
assert_response :success
end
end
8 changes: 8 additions & 0 deletions test/controllers/web/sessions_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class Web::SessionsControllerTest < ActionController::TestCase
test 'should get new' do
get :new
assert_response :success
end
end
4 changes: 4 additions & 0 deletions test/factories/sequence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@
sequence :expired_at do |n|
"expired_at 2020-04-#{n}"
end

sequence :string do |n|
"string#{n}"
end
end
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4303,6 +4303,11 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"

material-design-lite@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/material-design-lite/-/material-design-lite-1.3.0.tgz#d004ce3fee99a1eeb74a78b8a325134a5f1171d3"
integrity sha1-0ATOP+6Zoe63Sni4oyUTSl8RcdM=

md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
Expand Down