Skip to content

Commit

Permalink
Iteration 1 (#24)
Browse files Browse the repository at this point in the history
* add model Tasks

* add tasks#index, close #1

* add devise

* add ru locale

* add models: role, user_role

* configure devise registrations

* add header

* changed models users, del user_roles

* add custom user controllers

* refactoring user controller and role model, close #2

* test for logout, close #3

* add gem cancancan

* add task views, locale activerecord, close #4

* add author in model tasks

* add method author_of to users

* add author in controller tasks, close #5

* fix number validation in task model

* update controller with ability, close #7

* add model comment

* add controller comments, close #6

* add 'user can update comment, if 5 min not left', close #8
  • Loading branch information
zakharoff committed May 27, 2019
1 parent f38c04b commit 0483fbb
Show file tree
Hide file tree
Showing 89 changed files with 5,217 additions and 57 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--require spec_helper
--format doc
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ gem 'jbuilder', '~> 2.5'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

gem 'bootstrap', '~> 4.3.1'
gem 'jquery-rails'
gem "slim-rails"
gem 'devise'
gem 'rails-i18n', '~> 5.1'
gem 'cancancan'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand All @@ -61,9 +63,11 @@ group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
#gem 'chromedriver-helper'
gem 'webdrivers', '~> 3.0'
gem 'shoulda-matchers'
gem 'rails-controller-testing'
gem 'launchy'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
35 changes: 28 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ GEM
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
archive-zip (0.12.0)
io-like (~> 0.3.0)
arel (9.0.0)
autoprefixer-rails (9.5.1.1)
execjs
bcrypt (3.1.12)
bindex (0.7.0)
bootsnap (1.4.4)
msgpack (~> 1.0)
Expand All @@ -58,6 +57,7 @@ GEM
sassc-rails (>= 2.0.0)
builder (3.2.3)
byebug (11.0.1)
cancancan (3.0.1)
capybara (3.19.1)
addressable
mini_mime (>= 0.1.3)
Expand All @@ -68,9 +68,6 @@ GEM
xpath (~> 3.2)
childprocess (1.0.1)
rake (< 13.0)
chromedriver-helper (2.1.1)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
Expand All @@ -80,6 +77,12 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
crass (1.0.4)
devise (4.6.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
diff-lcs (1.3)
erubi (1.8.0)
execjs (2.7.0)
Expand All @@ -93,14 +96,15 @@ GEM
activesupport (>= 4.2.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
io-like (0.3.0)
jbuilder (2.8.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -122,6 +126,7 @@ GEM
nio4r (2.3.1)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
pg (1.1.4)
popper_js (1.14.5)
public_suffix (3.0.3)
Expand Down Expand Up @@ -151,6 +156,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
railties (5.2.3)
actionpack (= 5.2.3)
activesupport (= 5.2.3)
Expand All @@ -162,6 +170,9 @@ GEM
rb-inotify (0.10.0)
ffi (~> 1.0)
regexp_parser (1.4.0)
responders (2.4.1)
actionpack (>= 4.2.0, < 6.0)
railties (>= 4.2.0, < 6.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.3)
Expand Down Expand Up @@ -236,11 +247,17 @@ GEM
thread_safe (~> 0.1)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
warden (1.2.8)
rack (>= 2.0.6)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webdrivers (3.9.1)
nokogiri (~> 1.6)
rubyzip (~> 1.0)
selenium-webdriver (~> 3.0)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
Expand All @@ -254,17 +271,20 @@ DEPENDENCIES
bootsnap (>= 1.1.0)
bootstrap (~> 4.3.1)
byebug
cancancan
capybara (>= 2.15)
chromedriver-helper
coffee-rails (~> 4.2)
devise
factory_bot_rails
jbuilder (~> 2.5)
jquery-rails
launchy
listen (>= 3.0.5, < 3.2)
pg (>= 0.18, < 2.0)
puma (~> 3.11)
rails (~> 5.2.3)
rails-controller-testing
rails-i18n (~> 5.1)
rspec-rails (~> 3.8)
sass-rails (~> 5.0)
selenium-webdriver
Expand All @@ -276,6 +296,7 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webdrivers (~> 3.0)

RUBY VERSION
ruby 2.6.3p62
Expand Down
8 changes: 8 additions & 0 deletions app/assets/javascripts/comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$(document).on('turbolinks:load', function () {
$('.comments-area.comments').on('click', '.edit-comment-link', function (e) {
e.preventDefault();
$(this).hide();
var commentId = $(this).data('commentId');
$('div#edit-comment-' + commentId).show();
})
});
23 changes: 23 additions & 0 deletions app/assets/javascripts/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$(function() {
"use strict";

var nav_offset_top = $('header').height() + 50;
/*-------------------------------------------------------------------------------
Navbar
-------------------------------------------------------------------------------*/

//* Navbar Fixed
function navbarFixed(){
if ( $('.header_area').length ){
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= nav_offset_top ) {
$(".header_area").addClass("navbar_fixed");
} else {
$(".header_area").removeClass("navbar_fixed");
}
});
};
};
navbarFixed();
});
3 changes: 3 additions & 0 deletions app/assets/javascripts/tasks.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
*/

@import "bootstrap";
@import "style";
@import "custom";
3 changes: 3 additions & 0 deletions app/assets/stylesheets/comments.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the comments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
7 changes: 7 additions & 0 deletions app/assets/stylesheets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ul.blog-info-link {
list-style-type: none;
}

.hide {
display: none;
}
Loading

0 comments on commit 0483fbb

Please sign in to comment.