├── log
└── .keep
├── storage
└── .keep
├── tmp
└── .keep
├── vendor
└── .keep
├── lib
├── assets
│ └── .keep
└── tasks
│ └── .keep
├── public
├── favicon.ico
├── apple-touch-icon.png
├── apple-touch-icon-precomposed.png
├── robots.txt
├── 500.html
├── 422.html
└── 404.html
├── test
├── helpers
│ └── .keep
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── user_test.rb
│ ├── culture_test.rb
│ └── following_test.rb
├── system
│ └── .keep
├── controllers
│ ├── .keep
│ ├── cultures_controller_test.rb
│ └── fallowings_controllers_test.rb
├── fixtures
│ ├── .keep
│ ├── files
│ │ └── .keep
│ ├── followings.yml
│ └── users.yml
├── integration
│ └── .keep
├── application_system_test_case.rb
├── channels
│ └── application_cable
│ │ └── connection_test.rb
└── test_helper.rb
├── .ruby-version
├── app
├── assets
│ ├── images
│ │ ├── .keep
│ │ ├── cover-img.png
│ │ ├── user_profile.png
│ │ └── upload.svg
│ ├── config
│ │ └── manifest.js
│ └── stylesheets
│ │ ├── application.css
│ │ ├── sessions.scss
│ │ ├── main.scss
│ │ └── user_profile.scss
├── models
│ ├── concerns
│ │ └── .keep
│ ├── application_record.rb
│ ├── culture.rb
│ ├── following.rb
│ └── user.rb
├── controllers
│ ├── concerns
│ │ └── .keep
│ ├── followings_controller.rb
│ ├── application_controller.rb
│ └── cultures_controller.rb
├── views
│ ├── layouts
│ │ ├── mailer.text.erb
│ │ ├── mailer.html.erb
│ │ ├── _nav.html.erb
│ │ ├── _user_log.html.erb
│ │ ├── _head.html.erb
│ │ ├── _current_user.html.erb
│ │ └── application.html.erb
│ ├── devise
│ │ ├── mailer
│ │ │ ├── password_change.html.erb
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── unlock_instructions.html.erb
│ │ │ ├── email_changed.html.erb
│ │ │ └── reset_password_instructions.html.erb
│ │ ├── shared
│ │ │ ├── _error_messages.html.erb
│ │ │ └── _links.html.erb
│ │ ├── unlocks
│ │ │ └── new.html.erb
│ │ ├── passwords
│ │ │ ├── new.html.erb
│ │ │ └── edit.html.erb
│ │ ├── confirmations
│ │ │ └── new.html.erb
│ │ ├── sessions
│ │ │ └── new.html.erb
│ │ └── registrations
│ │ │ ├── new.html.erb
│ │ │ └── edit.html.erb
│ └── cultures
│ │ ├── index.html.erb
│ │ ├── show.html.erb
│ │ ├── _script.html.erb
│ │ ├── _users_content.html.erb
│ │ ├── _cover.html.erb
│ │ ├── _tweets.html.erb
│ │ ├── _user_list.html.erb
│ │ └── _profile.html.erb
├── helpers
│ ├── application_helper.rb
│ ├── following_helper.rb
│ └── cultures_helper.rb
├── channels
│ └── application_cable
│ │ ├── channel.rb
│ │ └── connection.rb
├── mailers
│ └── application_mailer.rb
├── javascript
│ ├── channels
│ │ ├── index.js
│ │ └── consumer.js
│ └── packs
│ │ └── application.js
└── jobs
│ └── application_job.rb
├── .browserslistrc
├── .rspec
├── config
├── webpack
│ ├── environment.js
│ ├── test.js
│ ├── production.js
│ └── development.js
├── spring.rb
├── environment.rb
├── initializers
│ ├── mime_types.rb
│ ├── filter_parameter_logging.rb
│ ├── application_controller_renderer.rb
│ ├── cookies_serializer.rb
│ ├── backtrace_silencers.rb
│ ├── wrap_parameters.rb
│ ├── assets.rb
│ ├── inflections.rb
│ ├── content_security_policy.rb
│ └── devise.rb
├── boot.rb
├── cable.yml
├── routes.rb
├── credentials.yml.enc
├── cloudinary.yml
├── database.yml
├── application.rb
├── locales
│ ├── en.yml
│ └── devise.en.yml
├── storage.yml
├── puma.rb
├── environments
│ ├── test.rb
│ ├── development.rb
│ └── production.rb
└── webpacker.yml
├── config.ru
├── spec
├── support
│ ├── controller_macros.rb
│ └── factory_bot.rb
├── controllers
│ ├── fallowings_controllers_spec.rb
│ └── cultures_controller_spec.rb
├── rails_helper.rb
└── spec_helper.rb
├── .erb-lint.yml
├── Rakefile
├── bin
├── rake
├── rails
├── yarn
├── webpack
├── webpack-dev-server
├── spring
├── setup
└── bundle
├── postcss.config.js
├── db
├── migrate
│ ├── 20200326221158_create_cultures.rb
│ ├── 20200326221417_create_followings.rb
│ ├── 20200327205656_create_active_storage_tables.active_storage.rb
│ └── 20200326214458_devise_create_users.rb
├── seeds.rb
└── schema.rb
├── package.json
├── .stickler.yml
├── .gitignore
├── .rubocop.yml
├── Gemfile
├── babel.config.js
├── README.md
├── css
├── cultures.css.map
├── sessions.css.map
├── cultures.css
├── sessions.css
├── main.css.map
├── main.css
└── user_profile.css.map
└── Gemfile.lock
/log/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/storage/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tmp/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/system/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.6.5
2 |
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.browserslistrc:
--------------------------------------------------------------------------------
1 | defaults
2 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/files/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.rspec:
--------------------------------------------------------------------------------
1 | --require spec_helper
2 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../stylesheets .css
3 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | self.abstract_class = true
3 | end
4 |
--------------------------------------------------------------------------------
/config/webpack/environment.js:
--------------------------------------------------------------------------------
1 | const { environment } = require('@rails/webpacker')
2 |
3 | module.exports = environment
4 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/app/assets/images/cover-img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dandush03/Microvers-RoR-Capstone/HEAD/app/assets/images/cover-img.png
--------------------------------------------------------------------------------
/app/assets/images/user_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dandush03/Microvers-RoR-Capstone/HEAD/app/assets/images/user_profile.png
--------------------------------------------------------------------------------
/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/config/spring.rb:
--------------------------------------------------------------------------------
1 | Spring.watch(
2 | ".ruby-version",
3 | ".rbenv-vars",
4 | "tmp/restart.txt",
5 | "tmp/caching-dev.txt"
6 | )
7 |
--------------------------------------------------------------------------------
/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | layout 'mailer'
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/culture.rb:
--------------------------------------------------------------------------------
1 | class Culture < ApplicationRecord
2 | belongs_to :user
3 | validates :text, presence: true, length: { maximum: 255 }
4 | end
5 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/models/following.rb:
--------------------------------------------------------------------------------
1 | class Following < ApplicationRecord
2 | belongs_to :follower, class_name: 'User'
3 | belongs_to :followed, class_name: 'User'
4 | end
5 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative 'application'
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/test/models/culture_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CultureTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/fixtures/followings.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | fallow_001:
4 | follower_id: 1
5 | followed_id: 2
--------------------------------------------------------------------------------
/test/models/following_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class FollowingTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/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/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/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/spec/support/controller_macros.rb:
--------------------------------------------------------------------------------
1 | module ControllerMacros
2 | def login_user
3 | @request.env['devise.mapping'] = Devise.mappings[:user]
4 | FactoryBot.create_list(:user, 3)
5 | user = User.first
6 | sign_in user
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/.erb-lint.yml:
--------------------------------------------------------------------------------
1 | EnableDefaultLinters: true
2 | linters:
3 | ErbSafety:
4 | enabled: true
5 | better_html_config: .better-html.yml
6 | Rubocop:
7 | enabled: true
8 | rubocop_config:
9 | inherit_from:
10 | - .rubocop.yml
--------------------------------------------------------------------------------
/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: cultures_production
11 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/helpers/following_helper.rb:
--------------------------------------------------------------------------------
1 | module FollowingHelper
2 | def followed?(id)
3 | current_user.followers.find_by(followed_id: id).nil?
4 | end
5 |
6 | def followers_counter(user)
7 | user.followeds.count
8 | end
9 |
10 | def followeds_counter(user)
11 | user.followers.count
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/spec/support/factory_bot.rb:
--------------------------------------------------------------------------------
1 | FactoryBot.define do
2 | factory :user do
3 | sequence(:username) { |n| "user#{n}" }
4 | sequence(:full_name) { |n| "User#{n}" }
5 | email { "#{full_name}@example.com".downcase }
6 | password { 'password' }
7 | password_confirmation { 'password' }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | root to: 'cultures#index'
3 | resources :cultures, only: [:show, :create, :destroy]
4 | resources :followings, only: [:create, :destroy]
5 | devise_for :users
6 | # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20200326221158_create_cultures.rb:
--------------------------------------------------------------------------------
1 | class CreateCultures < ActiveRecord::Migration[6.0]
2 | def change
3 | create_table :cultures do |t|
4 | t.string :text
5 |
6 | t.references :user, references: :users, foreign_key: { to_table: :users }
7 |
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/test/channels/application_cable/connection_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
4 | # test "connects with cookies" do
5 | # cookies.signed[:user_id] = 42
6 | #
7 | # connect
8 | #
9 | # assert_equal connection.user_id, "42"
10 | # end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/layouts/_nav.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= link_to root_path do %>
4 |
5 | HOME
6 | <% end %>
7 |
8 |
9 | <%= link_to culture_path(current_user) do %>
10 |
11 | PROFILE
12 | <% end %>
13 |
14 |
15 |
--------------------------------------------------------------------------------
/bin/yarn:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_ROOT = File.expand_path('..', __dir__)
3 | Dir.chdir(APP_ROOT) do
4 | begin
5 | exec "yarnpkg", *ARGV
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 |
--------------------------------------------------------------------------------
/db/migrate/20200326221417_create_followings.rb:
--------------------------------------------------------------------------------
1 | class CreateFollowings < ActiveRecord::Migration[6.0]
2 | def change
3 | create_table :followings do |t|
4 | t.references :follower, references: :users, foreign_key: { to_table: :users }
5 | t.references :followed, references: :users, foreign_key: { to_table: :users }
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/cultures/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | <%= render 'user_list', :users => @index %>
7 |
8 |
9 | <%= render 'users_content', :object => @tweets %>
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/email_changed.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @email %>!
2 |
3 | <% if @resource.try(:unconfirmed_email?) %>
4 | We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.
5 | <% else %>
6 | We're contacting you to notify you that your email has been changed to <%= @resource.email %>.
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/app/views/cultures/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= render 'profile', :object => @user %>
4 |
5 |
6 | <%= render 'cover', :object => @user %>
7 |
8 |
9 | <%= render 'users_content', :object => @user %>
10 |
11 |
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cultures",
3 | "private": true,
4 | "dependencies": {
5 | "@rails/actioncable": "^6.0.0",
6 | "@rails/activestorage": "^6.0.0",
7 | "@rails/ujs": "^6.0.0",
8 | "@rails/webpacker": "4.2.2",
9 | "turbolinks": "^5.2.0"
10 | },
11 | "version": "0.1.0",
12 | "devDependencies": {
13 | "webpack-dev-server": "^3.10.3"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/controllers/followings_controller.rb:
--------------------------------------------------------------------------------
1 | class FollowingsController < ApplicationController
2 | def create
3 | follow = current_user.followers.new(followed_id: params[:id])
4 | follow.save
5 | redirect_to request.referrer
6 | end
7 |
8 | def destroy
9 | current_user.followers.find_by(followed_id: params[:friend]).destroy
10 | redirect_to request.referrer
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | ZfvlHxaSnV3Gw6FpiF/q0bcgCYqF8uJk1UMAcTT3ij1QrCoxF6IVfKM1NtpV2KhQqRH3SL6xFE5g/0xda5marLwP5E6bbg79pqdHDbsLdAId/KG4ovReGBXehVGPLqr8Y+dyFaviB5adWPR+/7rfuSQFAlrSGk36X0JaAcLajmQGKFdQasZUpfmO9HFisYMPUHw5d5jFzrvHfjOxmnXNmDRlyMKX9pbp+6l+xjgS1GWEoCVWGul+IxoHs0bEDx6hAogrHseUDaV+m1DXSL2tL5ssWko+pSLeWlDFihZ3f/CsKEubjWTII/wjLuEqT/ALNvqYL2EJzTntLDNJzpS+2tYvcvCq89ZQbHU+ryd90N0IUh0GPgZ5X9kARry3tB2XOoNEeqzOtPRvPlb8QnnoWfpk7Qo2q6PHiA/0--WOfP03ygvQ3kEMrG--464a4TFtfKrVOVTk9Vixcw==
--------------------------------------------------------------------------------
/app/views/layouts/_user_log.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <% if user_signed_in? %>
4 | <%= link_to 'Edit profile', edit_user_registration_path, :class => 'link' %>
5 | <%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'link' %>
6 | <% else %>
7 | <%= link_to "Sign up", new_user_registration_path, :class => 'link' %>
8 | <%= link_to "Login", new_user_session_path, :class => 'link' %>
9 | <% end %>
10 |
11 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/spec/controllers/fallowings_controllers_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | describe FollowingsController, type: :controller do
4 | before do
5 | login_user
6 | end
7 |
8 | describe 'POST create' do
9 | it 'has to create a new Follow' do
10 | request.env['HTTP_REFERER'] = 'http://example.com'
11 | user = User.find(2)
12 | expect do
13 | post :create, params: { id: user.id }
14 | end.to change(Following, :count).by(1)
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/views/devise/shared/_error_messages.html.erb:
--------------------------------------------------------------------------------
1 | <% if resource.errors.any? %>
2 |
3 |
4 | <%= I18n.t("errors.messages.not_saved",
5 | count: resource.errors.count,
6 | resource: resource.class.model_name.human.downcase) %>
7 |
8 |
9 | <% resource.errors.full_messages.each_with_index do |message, index| %>
10 | <%= "#{index+1}) #{message}" %>
11 | <% end %>
12 |
13 |
14 | <% end %>
15 |
--------------------------------------------------------------------------------
/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 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.submit "Resend unlock instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/layouts/_head.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Cultures
3 |
4 |
5 |
6 | <%= csrf_meta_tags %>
7 | <%= csp_meta_tag %>
8 |
9 | <%= javascript_include_tag 'https://use.fontawesome.com/releases/v5.12.0/js/all.js', 'data-auto-replace-svg': 'nest' %>
10 |
11 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
12 | <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
13 |
14 |
--------------------------------------------------------------------------------
/config/cloudinary.yml:
--------------------------------------------------------------------------------
1 | development:
2 | cloud_name: dl-cultures
3 | api_key: '631164532291153'
4 | api_secret: wAZTwb_yyH4el7XFvh2lUvJtzZ4
5 | enhance_image_tag: true
6 | static_file_support: false
7 | production:
8 | cloud_name: dl-cultures
9 | api_key: '631164532291153'
10 | api_secret: wAZTwb_yyH4el7XFvh2lUvJtzZ4
11 | enhance_image_tag: true
12 | static_file_support: true
13 | test:
14 | cloud_name: dl-cultures
15 | api_key: '631164532291153'
16 | api_secret: wAZTwb_yyH4el7XFvh2lUvJtzZ4
17 | enhance_image_tag: true
18 | static_file_support: false
19 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads Spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11 | spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
12 | if spring
13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14 | gem 'spring', spring.version
15 | require 'spring/binstub'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/app/helpers/cultures_helper.rb:
--------------------------------------------------------------------------------
1 | module CulturesHelper
2 | def get_object(user, partial = nil)
3 | case partial
4 | when 'followings'
5 | list = user.followeds.select(:follower_id)
6 | User.all.where(id: list)
7 | when 'followers'
8 | list = user.followers.select(:followed_id)
9 | User.all.where(id: list)
10 | else
11 | Culture.all.order(:created_at).reverse_order
12 | end
13 | end
14 |
15 | def get_user_by_id(id)
16 | User.find(id)
17 | end
18 |
19 | def tweets_counter(user)
20 | user.cultures.count
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/app/views/devise/passwords/new.html.erb:
--------------------------------------------------------------------------------
1 | Forgot your password?
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :username %>
8 | <%= f.text_field :username, autofocus: true, autocomplete: "login" %>
9 |
10 |
11 |
12 | <%= f.submit "Send me reset password instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/devise/confirmations/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend confirmation instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9 |
10 |
11 |
12 | <%= f.submit "Resend confirmation instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/test/fixtures/users.yml:
--------------------------------------------------------------------------------
1 | user_001:
2 | id: 1
3 | username: 'test1'
4 | email: test1@test.com
5 | full_name: 'test 1'
6 | encrypted_password: <%= User.new.send(:password_digest, '123456') %>
7 | remember_created_at: <%= Time.now %>
8 |
9 | user_002:
10 | id: 2
11 | username: 'test2'
12 | email: test2@test.com
13 | full_name: 'test 2'
14 | encrypted_password: <%= User.new.send(:password_digest, '123456') %>
15 | remember_created_at: <%= Time.now %>
16 |
17 | user_003:
18 | id: 3
19 | username: 'test3'
20 | email: test3@test.com
21 | full_name: 'test 3'
22 | encrypted_password: <%= User.new.send(:password_digest, '123456') %>
23 | remember_created_at: <%= Time.now %>
--------------------------------------------------------------------------------
/.stickler.yml:
--------------------------------------------------------------------------------
1 | # add the linters you want stickler to use for this project
2 | linters:
3 | rubocop:
4 | display_cop_names: true
5 | # indicate where is the config file for stylelint
6 | config: './rubocop.yml'
7 |
8 | # add the files here you want to be ignored by stylelint
9 | files:
10 | ignore:
11 | - "bin/*"
12 | - "db/*"
13 | - "config/*"
14 | - "Guardfile"
15 | - "Rakefile"
16 | - "README.md"
17 | - "node_modules/**/*"
18 |
19 | # PLEASE DO NOT enable auto fixing options
20 | # if you need extra support from you linter - do it in your local env as described in README for this config
21 |
22 | # find full documentation here: https://stickler-ci.com/docs
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV['RAILS_ENV'] ||= 'test'
2 | require_relative '../config/environment'
3 | require 'rails/test_help'
4 |
5 | class ActiveSupport::TestCase
6 | # Run tests in parallel with specified workers
7 | parallelize(workers: :number_of_processors)
8 |
9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
10 | fixtures :all
11 |
12 | # Add more helper methods to be used by all tests here...
13 |
14 | include Devise::Test::IntegrationHelpers
15 | include Warden::Test::Helpers
16 |
17 | def log_in(user)
18 | if integration_test?
19 | login_as(user, scope: :user)
20 | else
21 | sing_in(user)
22 | end
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/app/views/layouts/_current_user.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <% unless current_user.profile_img.attached? %>
4 | <%= image_tag(url_for("user_profile.png")) %>
5 | <% else %>
6 | <%= image_tag(url_for(current_user.profile_img)) %>
7 | <% end %>
8 |
9 |
<%= current_user.full_name %>
10 |
11 |
12 |
13 |
17 |
18 |
<%= followeds_counter(current_user) %>
19 |
Followings
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite. Versions 3.8.0 and up are supported.
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/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 Cultures
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 6.0
13 |
14 | # Settings in config/environments/* take precedence over those specified here.
15 | # Application configuration can go into files in config/initializers
16 | # -- all .rb files in that directory are automatically loaded after loading
17 | # the framework and any gems in your application.
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6 | * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10 | * files in this directory. Styles in this file should be added after the last require_* statement.
11 | * It is generally better to create a new file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/spec/controllers/cultures_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | describe CulturesController, type: :controller do
4 | before do
5 | login_user
6 | end
7 |
8 | describe 'GET index' do
9 | it 'has a 200 status code' do
10 | get :index
11 | response.code.should eq('200')
12 | end
13 | end
14 |
15 | describe 'GET show' do
16 | it 'has a 200 status code' do
17 | get :show, params: { id: 1 }
18 | response.code.should eq('200')
19 | end
20 | end
21 |
22 | describe 'POST create' do
23 | it 'has a 200 status code' do
24 | request.env['HTTP_REFERER'] = 'http://example.com'
25 | post :create, params: { culture: { text: 'test' } }
26 | get :index
27 | response.code.should eq('200')
28 | end
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/app/views/cultures/_script.html.erb:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/test/controllers/cultures_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CulturesControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | get '/users/sign_in'
6 | sign_in users(:user_001)
7 | post user_session_url
8 | end
9 |
10 | test 'should get index' do
11 | get root_path
12 | assert_response :success
13 | end
14 |
15 | test 'should show' do
16 | user = users(:user_001)
17 | get culture_path(user)
18 | assert_response :success
19 | end
20 |
21 | test 'should post create' do
22 | text = 'this is a sample test'
23 | post cultures_path, params: { culture: { text: text } },
24 | headers: { 'HTTP_REFERER' => 'http://www.example.com/' }
25 | get root_path
26 | assert_response :success
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/app/views/cultures/_users_content.html.erb:
--------------------------------------------------------------------------------
1 |
8 |
13 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= render 'layouts/head' %>
4 |
5 | <% if current_page?(user_session_path) || current_page?(new_user_registration_path) || current_user.nil? %>
6 |
7 | <%= render 'layouts/user_log' %>
8 |
9 | <%= yield %>
10 | <% else %>
11 |
12 |
13 | <%= render 'layouts/user_log' %>
14 |
15 |
19 | <%= yield %>
20 |
21 | <% end %>
22 |
23 |
24 |
--------------------------------------------------------------------------------
/test/controllers/fallowings_controllers_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class FallowingsControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | get '/users/sign_in'
6 | sign_in users(:user_001)
7 | post user_session_url
8 | end
9 |
10 | test 'should post create' do
11 | user = users(:user_002)
12 | post followings_path, params: { followed_id: user.id },
13 | headers: { 'HTTP_REFERER' => 'http://www.example.com/' }
14 | get root_path
15 | assert_response :success
16 | end
17 |
18 | test 'should delete' do
19 | user = users(:user_002)
20 | delete following_path(user), params: { friend: user.id },
21 | headers: { 'HTTP_REFERER' => 'http://www.example.com/' }
22 | get root_path
23 | assert_response :success
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/app/views/cultures/_cover.html.erb:
--------------------------------------------------------------------------------
1 | <% if @user.id == current_user.id %>
2 |
3 | <%= form_for(current_user, url: registration_path(current_user), html: { method: :put, :id => 'form' }) do |f| %>
4 | <%= f.label :cover_img, :class => "uploader" %>
5 | <%= f.file_field :cover_img, direct_upload: true, :accept => "image/*", :onchange => "OnFileChange(this)" %>
6 | <% end %>
7 |
8 | <% if @user.cover_img.attached? %>
9 | <%= image_tag(url_for(@user.cover_img)) %>
10 | <% else %>
11 | <%= content_tag :div unless @user.cover_img.attached? %>
12 | <% end %>
13 |
14 |
15 | <%= render 'script' %>
16 | <% else %>
17 |
18 | <%= image_tag(url_for(@user.cover_img)) if @user.cover_img.attached? %>
19 | <%= content_tag :div unless @user.cover_img.attached? %>
20 |
21 | <% end %>
22 |
--------------------------------------------------------------------------------
/.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 | /db/*.sqlite3-*
14 |
15 | # Ignore all logfiles and tempfiles.
16 | /log/*
17 | /tmp/*
18 | !/log/.keep
19 | !/tmp/.keep
20 |
21 | # Ignore uploaded files in development.
22 | /storage/*
23 | !/storage/.keep
24 |
25 | /public/assets
26 | .byebug_history
27 |
28 | # Ignore master key for decrypting credentials and more.
29 | /config/master.key
30 |
31 | /public/packs
32 | /public/packs-test
33 | /node_modules
34 | /yarn-error.log
35 | yarn-debug.log*
36 | .yarn-integrity
37 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | before_action :authenticate_user!
3 |
4 | protect_from_forgery with: :exception
5 |
6 | before_action :configure_permitted_parameters, if: :devise_controller?
7 |
8 | protected
9 |
10 | def after_update_path_for(resource)
11 | culture_path(resource)
12 | end
13 |
14 | def after_sign_up_path_for(resource)
15 | culture_path(resource)
16 | end
17 |
18 | def user_root_path
19 | culture_path(current_user)
20 | end
21 |
22 | def configure_permitted_parameters
23 | att_create = %i[profile_img full_name username email password password_confirmation]
24 | att_update = %i[cover_img profile_img full_name username email password current_password]
25 | devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(att_create) }
26 | devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(att_update) }
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/app/javascript/packs/application.js:
--------------------------------------------------------------------------------
1 | // This file is automatically compiled by Webpack, along with any other files
2 | // present in this directory. You're encouraged to place your actual application logic in
3 | // a relevant structure within app/javascript and only use these pack files to reference
4 | // that code so it'll be compiled.
5 | //= require activestorage
6 | //= require jquery
7 | //= require jquery_ujs
8 | //= require bootstrap.min // Add it after jquery and jquery_ujs
9 |
10 | require("@rails/ujs").start()
11 | require("turbolinks").start()
12 | require("@rails/activestorage").start()
13 | require("channels")
14 |
15 |
16 | // Uncomment to copy all static images under ../images to the output folder and reference
17 | // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
18 | // or the `imagePath` JavaScript helper below.
19 | //
20 | // const images = require.context('../images', true)
21 | // const imagePath = (name) => images(name, true)
--------------------------------------------------------------------------------
/app/views/devise/passwords/edit.html.erb:
--------------------------------------------------------------------------------
1 | Change your password
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 | <%= f.hidden_field :reset_password_token %>
6 |
7 |
8 | <%= f.label :password, "New password" %>
9 | <% if @minimum_password_length %>
10 | (<%= @minimum_password_length %> characters minimum)
11 | <% end %>
12 | <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
13 |
14 |
15 |
16 | <%= f.label :password_confirmation, "Confirm new password" %>
17 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
18 |
19 |
20 |
21 | <%= f.submit "Change my password" %>
22 |
23 | <% end %>
24 |
25 | <%= render "devise/shared/links" %>
26 |
--------------------------------------------------------------------------------
/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 https://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/db/migrate/20200327205656_create_active_storage_tables.active_storage.rb:
--------------------------------------------------------------------------------
1 | # This migration comes from active_storage (originally 20170806125915)
2 | class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3 | def change
4 | create_table :active_storage_blobs do |t|
5 | t.string :key, null: false
6 | t.string :filename, null: false
7 | t.string :content_type
8 | t.text :metadata
9 | t.bigint :byte_size, null: false
10 | t.string :checksum, null: false
11 | t.datetime :created_at, null: false
12 |
13 | t.index [:key], unique: true
14 | end
15 |
16 | create_table :active_storage_attachments do |t|
17 | t.string :name, null: false
18 | t.references :record, null: false, polymorphic: true, index: false
19 | t.references :blob, null: false
20 |
21 | t.datetime :created_at, null: false
22 |
23 | t.index %i[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', unique: true
24 | t.foreign_key :active_storage_blobs, column: :blob_id
25 | end
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | AllCops:
2 | Exclude:
3 | - "db/schema.rb"
4 | - "bin/*"
5 | - "config/**/*"
6 | - "Guardfile"
7 | - "Rakefile"
8 | - "README.md"
9 | - "node_modules/**/*"
10 |
11 | DisplayCopNames: true
12 |
13 | Layout/LineLength:
14 | Max: 120
15 | Metrics/MethodLength:
16 | Include:
17 | - "app/controllers/*"
18 | - "app/models/*"
19 | Max: 20
20 | Metrics/AbcSize:
21 | Include:
22 | - "app/controllers/*"
23 | - "app/models/*"
24 | Max: 50
25 | Metrics/ClassLength:
26 | Max: 150
27 | Metrics/BlockLength:
28 | ExcludedMethods: ['describe']
29 | Max: 30
30 |
31 | Style/Documentation:
32 | Enabled: false
33 | Style/ClassAndModuleChildren:
34 | Enabled: false
35 | Style/EachForSimpleLoop:
36 | Enabled: false
37 | Style/AndOr:
38 | Enabled: false
39 | Style/DefWithParentheses:
40 | Enabled: false
41 | Style/FrozenStringLiteralComment:
42 | EnforcedStyle: never
43 |
44 | Layout/HashAlignment:
45 | EnforcedColonStyle: key
46 | Layout/ExtraSpacing:
47 | AllowForAlignment: false
48 | Layout/MultilineMethodCallIndentation:
49 | Enabled: true
50 | EnforcedStyle: indented
51 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3 |
4 | ruby '2.6.5'
5 |
6 | gem 'activestorage'
7 | gem 'bootsnap', require: false
8 | gem 'bootstrap-sass'
9 | gem 'bullet'
10 | gem 'cloudinary'
11 | gem 'devise'
12 | gem 'jbuilder'
13 | gem 'jquery-rails'
14 | gem 'puma'
15 | gem 'rails'
16 | gem 'sass-rails'
17 | gem 'turbolinks'
18 | gem 'webpacker'
19 |
20 | group :development, :test do
21 | gem 'byebug', platforms: %i[mri mingw x64_mingw]
22 | gem 'factory_bot_rails'
23 | gem 'rspec-rails'
24 | gem 'sqlite3'
25 | end
26 |
27 | group :development do
28 | gem 'listen'
29 | gem 'spring'
30 | gem 'spring-watcher-listen'
31 | gem 'web-console'
32 | end
33 |
34 | group :test do
35 | gem 'capybara'
36 | gem 'guard'
37 | gem 'guard-minitest'
38 | gem 'minitest'
39 | gem 'minitest-reporters'
40 | gem 'rails-controller-testing'
41 | gem 'selenium-webdriver'
42 | gem 'webdrivers'
43 | end
44 |
45 | group :production do
46 | gem 'pg'
47 | end
48 |
49 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
50 | gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
51 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'fileutils'
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path('..', __dir__)
6 |
7 | def system!(*args)
8 | system(*args) || abort("\n== Command #{args} failed ==")
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to setup or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
14 | # Add necessary setup steps to this file.
15 |
16 | puts '== Installing dependencies =='
17 | system! 'gem install bundler --conservative'
18 | system('bundle check') || system!('bundle install')
19 |
20 | # Install JavaScript dependencies
21 | # system('bin/yarn')
22 |
23 | # puts "\n== Copying sample files =="
24 | # unless File.exist?('config/database.yml')
25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
26 | # end
27 |
28 | puts "\n== Preparing database =="
29 | system! 'bin/rails db:prepare'
30 |
31 | puts "\n== Removing old logs and tempfiles =="
32 | system! 'bin/rails log:clear tmp:clear'
33 |
34 | puts "\n== Restarting application server =="
35 | system! 'bin/rails restart'
36 | end
37 |
--------------------------------------------------------------------------------
/app/controllers/cultures_controller.rb:
--------------------------------------------------------------------------------
1 | class CulturesController < ApplicationController
2 | def index
3 | @users = User.all
4 | @user = current_user
5 | @tweets = Culture.all
6 | @index = people_to_fallow
7 | commun_operation
8 | end
9 |
10 | def show
11 | @user = User.find(params[:id])
12 | follower_list = @user.followeds.select(:follower_id).limit(3)
13 | @followed_by ||= User.all.where(id: follower_list)
14 | @partial_name ||= params[:partial]
15 | commun_operation
16 | end
17 |
18 | def create
19 | user = current_user.cultures.new(form_parms)
20 | user.save
21 | redirect_to request.referrer
22 | end
23 |
24 | private
25 |
26 | def sub_menu(id = nil)
27 | case id
28 | when nil then 'tweets'
29 | else 'user_list'
30 | end
31 | end
32 |
33 | def form_parms
34 | params.require(:culture).permit(:text)
35 | end
36 |
37 | def people_to_fallow
38 | follower_list = @user.followers.select(:followed_id)
39 | User.all.order(:created_at).reverse_order.includes([:profile_img_attachment]).where.not(id: follower_list)
40 | end
41 |
42 | def commun_operation
43 | @partial ||= sub_menu(params[:menu])
44 | @culture = Culture.new
45 | end
46 | end
47 |
--------------------------------------------------------------------------------
/app/views/cultures/_tweets.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for @culture, url: { action: "create" } do |f| %>
2 |
3 | <%= f.label "tweet to #{@user.full_name}" unless current_page?(root_path) %>
4 | <%= f.label "tweet to something" if current_page?(root_path) %>
5 | <%= f.text_field :text, autofocus: true, autocomplete: "text" %>
6 |
7 | <%= f.submit "Tweet" %>
8 |
9 |
10 | <% end %>
11 |
34 |
--------------------------------------------------------------------------------
/app/views/devise/shared/_links.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%- if controller_name != 'sessions' %>
3 | <%= link_to "Log in", new_session_path(resource_name) %>
4 | <% end %>
5 |
6 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7 | <%= link_to "Sign up", new_registration_path(resource_name) %>
8 | <% end %>
9 |
10 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
11 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
12 | <% end %>
13 |
14 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
15 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
16 | <% end %>
17 |
18 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
19 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
20 | <% end %>
21 |
22 | <%- if devise_mapping.omniauthable? %>
23 | <%- resource_class.omniauth_providers.each do |provider| %>
24 | <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %>
25 | <% end %>
26 | <% end %>
27 |
28 |
--------------------------------------------------------------------------------
/app/views/devise/sessions/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Log in
5 |
6 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
7 |
8 |
9 | <% if notice %>
10 |
<%= notice %>
11 | <% end %>
12 | <% if alert %>
13 |
<%= alert %>
14 | <% end %>
15 |
16 |
17 |
18 | <%= f.label "#{:login}:" %>
19 | <%= f.text_field :login, autofocus: true, autocomplete: "login" %>
20 |
21 |
22 |
23 | <%= f.label "#{:password}:" %>
24 | <%= f.password_field :password, autocomplete: "current-password" %>
25 |
26 |
27 | <% if devise_mapping.rememberable? %>
28 |
29 | <%= f.check_box :remember_me %>
30 | <%= f.label :remember_me %>
31 |
32 | <% end %>
33 |
34 |
35 | <%= f.submit "Log in" %>
36 |
37 | <% end %>
38 |
39 | <%= render "devise/shared/links" %>
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket
16 |
17 | # adding Claudinary Services
18 | cloudinary:
19 | service: Cloudinary
20 |
21 | # Remember not to checkin your GCS keyfile to a repository
22 | # google:
23 | # service: GCS
24 | # project: your_project
25 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
26 | # bucket: your_own_bucket
27 |
28 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
29 | # microsoft:
30 | # service: AzureStorage
31 | # storage_account_name: your_account_name
32 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
33 | # container: your_container_name
34 |
35 | # mirror:
36 | # service: Mirror
37 | # primary: local
38 | # mirrors: [ amazon, google, microsoft ]
39 |
--------------------------------------------------------------------------------
/app/views/cultures/_user_list.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% users.each do |user| %>
3 | <% unless current_user == user && current_page?(root_path) %>
4 |
5 |
6 |
7 | <%= link_to culture_path(user) do %>
8 | <% unless user.profile_img.attached? %>
9 | <%= image_tag(url_for("user_profile.png")) %>
10 | <% else %>
11 | <%= image_tag(url_for(user.profile_img)) %>
12 | <% end %>
13 | <% end %>
14 |
15 |
16 |
17 |
<%= user.full_name %>
18 |
<%= "@#{user.username}" %>
19 |
20 | <% unless current_user == user %>
21 |
22 | <% if followed?(user.id) %>
23 | <%= button_to send('followings_path', :id => user.id), method: 'post', :data => { :disable_with => "" } do %>
24 |
25 | <% end %>
26 | <% else %>
27 | <%= button_to send('following_path',:friend => user.id), method: 'delete', :data => { :disable_with => "" } do %>
28 |
29 | <% end %>
30 | <% end %>
31 |
32 | <% end %>
33 |
34 | <% end %>
35 | <% end %>
36 |
37 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
Sign up
6 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
7 | <%= render "devise/shared/error_messages", resource: resource %>
8 |
9 |
10 | <%= f.label "#{:full_name}: " %>
11 | <%= f.text_field :full_name, autofocus: true, autocomplete: "full_name" %>
12 |
13 |
14 |
15 | <%= f.label "#{:username}: " %>
16 | <%= f.text_field :username, autofocus: true, autocomplete: "username" %>
17 |
18 |
19 |
20 | <%= f.label "#{:email}: " %>
21 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
22 |
23 |
24 |
25 | <%= f.label "#{:password}: " %>
26 | <%= f.password_field :password, autocomplete: "new-password" %>
27 |
28 |
29 |
30 | <%= f.label "Confirm: " %>
31 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
32 |
33 |
34 |
35 | <%= f.submit "Sign up" %>
36 |
37 | <% end %>
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy
4 | # For further information see the following documentation
5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6 |
7 | # Rails.application.config.content_security_policy do |policy|
8 | # policy.default_src :self, :https
9 | # policy.font_src :self, :https, :data
10 | # policy.img_src :self, :https, :data
11 | # policy.object_src :none
12 | # policy.script_src :self, :https
13 | # policy.style_src :self, :https
14 | # # If you are using webpack-dev-server then specify webpack-dev-server host
15 | # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
16 |
17 | # # Specify URI for violation reports
18 | # # policy.report_uri "/csp-violation-report-endpoint"
19 | # end
20 |
21 | # If you are using UJS then enable automatic nonce generation
22 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
23 |
24 | # Set the nonce only to specific directives
25 | # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
26 |
27 | # Report CSP violations to a specified URI
28 | # For further information see the following documentation:
29 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
30 | # Rails.application.config.content_security_policy_report_only = true
31 |
--------------------------------------------------------------------------------
/db/migrate/20200326214458_devise_create_users.rb:
--------------------------------------------------------------------------------
1 | class DeviseCreateUsers < ActiveRecord::Migration[6.0]
2 | def change
3 | create_table :users do |t|
4 | ## Database authenticatable
5 | t.string :username
6 | t.string :full_name
7 | t.string :profile_img
8 | t.string :cover_img
9 |
10 | t.string :email, null: false, default: ''
11 | t.string :encrypted_password, null: false, default: ''
12 |
13 | ## Recoverable
14 | t.string :reset_password_token
15 | t.datetime :reset_password_sent_at
16 |
17 | ## Rememberable
18 | t.datetime :remember_created_at
19 |
20 | ## Trackable
21 | t.integer :sign_in_count, default: 0, null: false
22 | t.datetime :current_sign_in_at
23 | t.datetime :last_sign_in_at
24 | t.string :current_sign_in_ip
25 | t.string :last_sign_in_ip
26 |
27 | ## Confirmable
28 | # t.string :confirmation_token
29 | # t.datetime :confirmed_at
30 | # t.datetime :confirmation_sent_at
31 | # t.string :unconfirmed_email # Only if using reconfirmable
32 |
33 | ## Lockable
34 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
35 | # t.string :unlock_token # Only if unlock strategy is :email or :both
36 | # t.datetime :locked_at
37 |
38 | t.timestamps null: false
39 | end
40 |
41 | add_index :users, :email, unique: true
42 | add_index :users, :reset_password_token, unique: true
43 | # add_index :users, :confirmation_token, unique: true
44 | # add_index :users, :unlock_token, unique: true
45 | end
46 | end
47 |
--------------------------------------------------------------------------------
/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 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9 | threads min_threads_count, max_threads_count
10 |
11 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
12 | #
13 | port ENV.fetch("PORT") { 3000 }
14 |
15 | # Specifies the `environment` that Puma will run in.
16 | #
17 | environment ENV.fetch("RAILS_ENV") { "development" }
18 |
19 | # Specifies the `pidfile` that Puma will use.
20 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
21 |
22 | # Specifies the number of `workers` to boot in clustered mode.
23 | # Workers are forked web server processes. If using threads and workers together
24 | # the concurrency of the application would be max `threads` * `workers`.
25 | # Workers do not work on JRuby or Windows (both of which do not support
26 | # processes).
27 | #
28 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
29 |
30 | # Use the `preload_app!` method when specifying a `workers` number.
31 | # This directive tells Puma to first boot the application and load code
32 | # before forking the application. This takes advantage of Copy On Write
33 | # process behavior so workers use less memory.
34 | #
35 | # preload_app!
36 |
37 | # Allow puma to be restarted by `rails restart` command.
38 | plugin :tmp_restart
39 |
--------------------------------------------------------------------------------
/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/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | # The test environment is used exclusively to run your application's
2 | # test suite. You never need to work with it otherwise. Remember that
3 | # your test database is "scratch space" for the test suite and is wiped
4 | # and recreated between test runs. Don't rely on the data there!
5 |
6 | Rails.application.configure do
7 | # Settings specified here will take precedence over those in config/application.rb.
8 |
9 | config.cache_classes = false
10 |
11 | # Do not eager load code on boot. This avoids loading your whole application
12 | # just for the purpose of running a single test. If you are using a tool that
13 | # preloads Rails for running tests, you may have to set it to true.
14 | config.eager_load = false
15 |
16 | # Configure public file server for tests with Cache-Control for performance.
17 | config.public_file_server.enabled = true
18 | config.public_file_server.headers = {
19 | "Cache-Control" => "public, max-age=#{1.hour.to_i}",
20 | }
21 |
22 | # Show full error reports and disable caching.
23 | config.consider_all_requests_local = true
24 | config.action_controller.perform_caching = false
25 | config.cache_store = :null_store
26 |
27 | # Raise exceptions instead of rendering exception templates.
28 | config.action_dispatch.show_exceptions = false
29 |
30 | # Disable request forgery protection in test environment.
31 | config.action_controller.allow_forgery_protection = false
32 |
33 | # Store uploaded files on the local file system in a temporary directory.
34 | config.active_storage.service = :test
35 |
36 | config.action_mailer.perform_caching = false
37 |
38 | # Tell Action Mailer not to deliver emails to the real world.
39 | # The :test delivery method accumulates sent emails in the
40 | # ActionMailer::Base.deliveries array.
41 | config.action_mailer.delivery_method = :test
42 |
43 | # Print deprecation notices to the stderr.
44 | config.active_support.deprecation = :stderr
45 |
46 | # Raises error for missing translations.
47 | # config.action_view.raise_on_missing_translations = true
48 |
49 | config.after_initialize do
50 | Bullet.enable = true
51 | Bullet.bullet_logger = true
52 | Bullet.raise = true # raise an error if an n+1 query occurs
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/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 | - .mjs
38 | - .js
39 | - .sass
40 | - .scss
41 | - .css
42 | - .module.sass
43 | - .module.scss
44 | - .module.css
45 | - .png
46 | - .svg
47 | - .gif
48 | - .jpeg
49 | - .jpg
50 |
51 | development:
52 | <<: *default
53 | compile: true
54 |
55 | # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
56 | check_yarn_integrity: true
57 |
58 | # Reference: https://webpack.js.org/configuration/dev-server/
59 | dev_server:
60 | https: false
61 | host: localhost
62 | port: 3035
63 | public: localhost:3035
64 | hmr: false
65 | # Inline should be set to true if using HMR
66 | inline: true
67 | overlay: true
68 | compress: true
69 | disable_host_check: true
70 | use_local_ip: false
71 | quiet: false
72 | pretty: false
73 | headers:
74 | 'Access-Control-Allow-Origin': '*'
75 | watch_options:
76 | ignored: '**/node_modules/**'
77 |
78 |
79 | test:
80 | <<: *default
81 | compile: true
82 |
83 | # Compile test packs to a separate directory
84 | public_output_path: packs-test
85 |
86 | production:
87 | <<: *default
88 |
89 | # Production depends on precompilation of packs prior to booting for performance.
90 | compile: false
91 |
92 | # Extract and emit a css file
93 | extract_css: true
94 |
95 | # Cache manifest.json for performance
96 | cache_manifest: true
97 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= resource_name.to_s.humanize %> Current Data
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label "#{:cover_img}: " %>
8 | <%= f.file_field :cover_img, direct_upload: true %>
9 |
10 |
11 |
12 | <%= f.label "#{:profile_img}: " %>
13 | <%= f.file_field :profile_img, direct_upload: true %>
14 |
15 |
16 |
17 | <%= f.label "#{:full_name}: " %>
18 | <%= f.text_field :full_name, autofocus: true, autocomplete: "username", placeholder: 'Full Name' %>
19 |
20 |
21 |
22 | <%= f.label "#{:username}: " %>
23 | <%= f.text_field :username, autofocus: true, autocomplete: "username", placeholder: 'Username' %>
24 |
25 |
26 |
27 | <%= f.label "#{:email}: " %>
28 | <%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: 'Email' %>
29 |
30 |
31 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
32 | Currently waiting confirmation for: <%= resource.unconfirmed_email %>
33 | <% end %>
34 |
35 |
36 | leave blank New Password if you don't want to change it
37 | <%= f.label "New #{:password}: " %>
38 | <%= f.password_field :password, autocomplete: "new-password", placeholder: 'New Password' %>
39 |
40 |
41 |
42 | <%= f.label "Confirm: " %>
43 | <%= f.password_field :password_confirmation, autocomplete: "new-password", placeholder: 'Confirm' %>
44 |
45 |
46 |
47 | we need your current password to confirm your changes
48 | <%= f.label "Current #{:password}: " %>
49 | <%= f.password_field :current_password, autocomplete: "current-password", placeholder: 'Current Password' %>
50 |
51 |
52 |
53 |
54 | <%= f.submit "Update" %>
55 |
56 | <% end %>
57 |
58 | Cancel my account
59 |
60 | Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
61 |
62 | <%= link_to "Back", :back %>
63 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Basic Rails Forms [](https://github.com/Dandush03/capstone-build-linter)
2 | []()
3 |
4 | ### Twitter Like App
5 | ###### Microverse Ruby on Rails Capstone Project
6 |
7 | This app behaves as a Twitter-lite app. It allows users to follow and unfollow other users
8 |
9 | 
10 |
11 | ---
12 |
13 | ## Table of Contents
14 |
15 | - [Built With](#Built-With)
16 | - [Live Link](#Active-Link-to-Website)
17 | - [Contributing](#Contributing)
18 | - [Acknowledgments](#Acknowledgments)
19 | - [Future Release](#Future-Release)
20 | - [License](#License)
21 | - [Author](#Authors)
22 |
23 | ---
24 |
25 | ## Built With
26 |
27 | - Rails
28 | - Heroku
29 | - GitHub
30 | - Vim
31 | - VSCode
32 |
33 | ---
34 |
35 | ## Active Link to Website
36 |
37 | Check out the page at this [live link](https://dl-cultures.herokuapp.com/)
38 |
39 | > This Website could be accessed with the following credentials:
40 |
41 | > User: admin
42 |
43 | > Pwd: admin123
44 |
45 | ---
46 |
47 | ## Contributing
48 |
49 | Contributions, issues, and feature requests are welcome!
50 |
51 | Feel free to check the [issues page](./issues/).
52 |
53 | ---
54 |
55 | ## Acknowledgments
56 |
57 | - Hat tip to anyone who's code was used
58 | - Special to Gregoire Vella for his [Awesome](https://www.behance.net/gallery/14286087/Twitter-Redesign-of-UI-details) Design
59 | - Thanks to Microverse for its Support!
60 | - Special thanks to learnenought.com
61 |
62 | ---
63 |
64 | ## Future Release
65 |
66 | - Direct messages between people.
67 | - Direct tweets between people.
68 | - Upgrade password security.
69 | - Ruby update to 3.0 from 2.6
70 |
71 | ---
72 |
73 | ## License
74 |
75 | []()
76 |
77 | - **[MIT license](http://opensource.org/licenses/mit-license.php)**
78 |
79 | ## Authors
80 |
81 | **Danie Laloush**
82 |
83 | - Portafolio: [dlaloush.me](https://dlaloush.me)
84 | - Linkedin: [Daniel Laloush](https://www.linkedin.com/in/daniel-laloush-0a7331a9)
85 | - Github: [@Dandush03](https://github.com/Dandush03)
86 | - Twitter: [@d_laloush](https://twitter.com/d_laloush)
87 |
88 | Give a ⭐️ if you like this project!
89 |
--------------------------------------------------------------------------------
/app/models/user.rb:
--------------------------------------------------------------------------------
1 | class User < ApplicationRecord
2 | attr_writer :login
3 |
4 | # Login With Username or email
5 | def login
6 | @login || username || email
7 | end
8 |
9 | def self.find_for_database_authentication(warden_conditions)
10 | conditions = warden_conditions.dup
11 | if (login = conditions.delete(:login))
12 | where(conditions.to_h).where(['lower(username) = :value OR lower(email) = :value',
13 | { value: login.downcase }]).first
14 | elsif conditions.key?(:username) || conditions.key?(:email)
15 | where(conditions.to_h).first
16 | end
17 | end
18 |
19 | # update without password
20 | def update_with_password(params, *options)
21 | current_password = params.delete(:current_password)
22 |
23 | if params[:password].blank?
24 | params.delete(:password)
25 | params.delete(:password_confirmation) if params[:password_confirmation].blank?
26 | end
27 |
28 | result = if params[:password].blank? || valid_password?(current_password)
29 | update_attributes(params, *options)
30 | else
31 | assign_attributes(params, *options)
32 | valid?
33 | errors.add(:current_password, current_password.blank? ? :blank : :invalid)
34 | false
35 | end
36 |
37 | clean_up_passwords
38 | result
39 | end
40 |
41 | # validate img upload
42 | def upload_is_image
43 | return false if cover_img =~ %r{^image/(jpeg|pjpeg|gif|png|bmp)$} || cover_img.nil?
44 | return false if profile_img =~ %r{^image/(jpeg|pjpeg|gif|png|bmp)$} || profile_img.nil?
45 |
46 | true
47 | end
48 |
49 | has_one_attached :profile_img
50 | has_one_attached :cover_img
51 |
52 | # Include default devise modules. Others available are:
53 | # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
54 | devise :database_authenticatable, :registerable,
55 | :recoverable, :rememberable, :trackable,
56 | :validatable, authentication_keys: [:login]
57 |
58 | validate :upload_is_image
59 | validates :full_name, presence: true, length: { maximum: 30 }
60 | validates :username, presence: true, uniqueness: { case_sensitive: false }, length: { maximum: 15 }
61 | # Cultures
62 | has_many :cultures
63 | # Followers
64 | has_many :followers, class_name: 'Following', foreign_key: 'follower_id'
65 | has_many :current_followers, through: :followers
66 | # Followeds
67 | has_many :followeds, class_name: 'Following', foreign_key: 'followed_id'
68 | has_many :current_followeds, through: :followeds
69 | end
70 |
--------------------------------------------------------------------------------
/app/views/cultures/_profile.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <% if followed?(@user.id) %>
6 | <%= button_to send("followings_path", :id => @user.id), method: "post", :data => { :disable_with => "" }, disabled: current_user == @user do %>
7 |
8 | <% end %>
9 | <% else %>
10 | <%= button_to send("following_path", :friend => @user.id), method: "delete", :data => { :disable_with => "" } do %>
11 |
12 | <% end %>
13 | <% end %>
14 |
15 |
41 |
42 |
43 |
44 |
45 |
<%= @user.full_name %>
46 |
<%= "@#{@user.username}" %>
47 |
48 |
49 |
50 |
54 |
55 |
<%= followeds_counter(@user) %>
56 |
Followings
57 |
58 |
59 |
<%= followers_counter(@user) %>
60 |
Followers
61 |
62 |
63 |
66 | <%= render "user_list", :users => @followed_by %>
67 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Using Claudinary
5 | config.active_storage.service = :cloudinary
6 | # In the development environment your application's code is reloaded on
7 | # every request. This slows down response time but is perfect for development
8 | # since you don't have to restart the web server when you make code changes.
9 | config.cache_classes = false
10 |
11 | # Do not eager load code on boot.
12 | config.eager_load = false
13 |
14 | # Show full error reports.
15 | config.consider_all_requests_local = true
16 |
17 | # Enable/disable caching. By default caching is disabled.
18 | # Run rails dev:cache to toggle caching.
19 | if Rails.root.join('tmp', 'caching-dev.txt').exist?
20 | config.action_controller.perform_caching = true
21 | config.action_controller.enable_fragment_cache_logging = true
22 |
23 | config.cache_store = :memory_store
24 | config.public_file_server.headers = {
25 | 'Cache-Control' => "public, max-age=#{2.days.to_i}"
26 | }
27 | else
28 | config.action_controller.perform_caching = false
29 |
30 | config.cache_store = :null_store
31 | end
32 |
33 | # Store uploaded files on the local file system (see config/storage.yml for options).
34 | # config.active_storage.service = :local
35 |
36 | # Don't care if the mailer can't send.
37 | config.action_mailer.raise_delivery_errors = false
38 |
39 | config.action_mailer.perform_caching = false
40 |
41 | # Print deprecation notices to the Rails logger.
42 | config.active_support.deprecation = :log
43 |
44 | # Raise an error on page load if there are pending migrations.
45 | config.active_record.migration_error = :page_load
46 |
47 | # Highlight code that triggered database queries in logs.
48 | config.active_record.verbose_query_logs = true
49 |
50 | # Devise gem SetUp
51 | config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
52 |
53 | # Debug mode disables concatenation and preprocessing of assets.
54 | # This option may cause significant delays in view rendering with a large
55 | # number of complex assets.
56 | config.assets.debug = true
57 |
58 | # Suppress logger output for asset requests.
59 | config.assets.quiet = true
60 |
61 | # Raises error for missing translations.
62 | # config.action_view.raise_on_missing_translations = true
63 |
64 | # Use an evented file watcher to asynchronously detect changes in source code,
65 | # routes, locales, etc. This feature depends on the listen gem.
66 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker
67 | end
68 |
--------------------------------------------------------------------------------
/css/cultures.css.map:
--------------------------------------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A0B;EAuGrC,gBAAgB,EAAE,wBAAmB;EACrC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAQ;EAC5B,aAAa,EAtGb,GAAG;CAuGJ;;AAKP,AAAA,MAAM,CAAC;EACL,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,MAAM;EAClB,aAAa,EAAE,IAAQ;CAsBxB;;AAzBD,AAMI,MANE,GAKF,YAAY,AACX,QAAQ,CAAC;EACR,OAAO,EAAE,EAAE;CACZ;;AARL,AAWE,MAXI,GAWF,CAAC,CAAC;EACF,MAAM,EAAE,IAAQ;EAChB,eAAe,EAAE,IAAI;EACrB,KAAK,EA3HkB,OAAqB;EA4H5C,QAAQ,EAAE,QAAQ;CASnB;;AAxBH,AAiBI,MAjBE,GAWF,CAAC,AAMA,QAAQ,CAAC;EACR,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,GAAG;EACZ,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,iBAAwB;CAChC;;AAKL,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EAGtC,AAAA,QAAQ,CAAC;IACP,KAAK,EAHM,KAAK;GAIjB",
4 | "sources": [
5 | "../app/assets/stylesheets/cultures.scss"
6 | ],
7 | "names": [],
8 | "file": "cultures.css"
9 | }
--------------------------------------------------------------------------------
/css/sessions.css.map:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "mappings": "AAcA,AAAA,UAAU,CAAC;EACT,MAAM,EAAE,IAAI;EACZ,SAAS,EAbC,KAAK;EAcf,MAAM,EAAE,IAAI;CACb;;AAED,AACE,QADM,GACJ,GAAG,CAAC;EACJ,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,CAAC;EACV,aAAa,EAAE,IAAQ;CACxB;;AAGH,AAAA,QAAQ,CAAC;EACP,KAAK,EAzBM,KAAK;EA0BhB,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,MAAM,EAAE,MAAM;EACd,gBAAgB,EA5BL,q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,GAWF,CAAC,CAAC;EACF,MAAM,EAAE,IAAQ;EAChB,eAAe,EAAE,IAAI;EACrB,KAAK,EAhIkB,OAAqB;EAiI5C,QAAQ,EAAE,QAAQ;CASnB;;AAxBH,AAiBI,MAjBE,GAWF,CAAC,AAMA,QAAQ,CAAC;EACR,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,GAAG;EACZ,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,iBAAwB;CAChC;;AAKL,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EAGtC,AAAA,QAAQ,CAAC;IACP,KAAK,EAHM,KAAK;GAIjB",
4 | "sources": [
5 | "../app/assets/stylesheets/sessions.scss"
6 | ],
7 | "names": [],
8 | "file": "sessions.css"
9 | }
--------------------------------------------------------------------------------
/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 | # This file is the source Rails uses to define your schema when running `rails
6 | # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7 | # be faster and is potentially less error prone than running all of your
8 | # migrations from scratch. Old migrations may fail to apply correctly if those
9 | # migrations use external dependencies or application code.
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema.define(version: 2020_03_27_205656) do
14 |
15 | create_table "active_storage_attachments", force: :cascade do |t|
16 | t.string "name", null: false
17 | t.string "record_type", null: false
18 | t.integer "record_id", null: false
19 | t.integer "blob_id", null: false
20 | t.datetime "created_at", null: false
21 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
22 | t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
23 | end
24 |
25 | create_table "active_storage_blobs", force: :cascade do |t|
26 | t.string "key", null: false
27 | t.string "filename", null: false
28 | t.string "content_type"
29 | t.text "metadata"
30 | t.bigint "byte_size", null: false
31 | t.string "checksum", null: false
32 | t.datetime "created_at", null: false
33 | t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
34 | end
35 |
36 | create_table "cultures", force: :cascade do |t|
37 | t.string "text"
38 | t.integer "user_id"
39 | t.datetime "created_at", precision: 6, null: false
40 | t.datetime "updated_at", precision: 6, null: false
41 | t.index ["user_id"], name: "index_cultures_on_user_id"
42 | end
43 |
44 | create_table "followings", force: :cascade do |t|
45 | t.integer "follower_id"
46 | t.integer "followed_id"
47 | t.index ["followed_id"], name: "index_followings_on_followed_id"
48 | t.index ["follower_id"], name: "index_followings_on_follower_id"
49 | end
50 |
51 | create_table "users", force: :cascade do |t|
52 | t.string "username"
53 | t.string "full_name"
54 | t.string "profile_img"
55 | t.string "cover_img"
56 | t.string "email", default: "", null: false
57 | t.string "encrypted_password", default: "", null: false
58 | t.string "reset_password_token"
59 | t.datetime "reset_password_sent_at"
60 | t.datetime "remember_created_at"
61 | t.integer "sign_in_count", default: 0, null: false
62 | t.datetime "current_sign_in_at"
63 | t.datetime "last_sign_in_at"
64 | t.string "current_sign_in_ip"
65 | t.string "last_sign_in_ip"
66 | t.datetime "created_at", precision: 6, null: false
67 | t.datetime "updated_at", precision: 6, null: false
68 | t.index ["email"], name: "index_users_on_email", unique: true
69 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
70 | end
71 |
72 | add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
73 | add_foreign_key "cultures", "users"
74 | add_foreign_key "followings", "users", column: "followed_id"
75 | add_foreign_key "followings", "users", column: "follower_id"
76 | end
77 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | #
5 | # This file was generated by Bundler.
6 | #
7 | # The application 'bundle' is installed as part of a gem, and
8 | # this file is here to facilitate running it.
9 | #
10 |
11 | require "rubygems"
12 |
13 | m = Module.new do
14 | module_function
15 |
16 | def invoked_as_script?
17 | File.expand_path($0) == File.expand_path(__FILE__)
18 | end
19 |
20 | def env_var_version
21 | ENV["BUNDLER_VERSION"]
22 | end
23 |
24 | def cli_arg_version
25 | return unless invoked_as_script? # don't want to hijack other binstubs
26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27 | bundler_version = nil
28 | update_index = nil
29 | ARGV.each_with_index do |a, i|
30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31 | bundler_version = a
32 | end
33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34 | bundler_version = $1
35 | update_index = i
36 | end
37 | bundler_version
38 | end
39 |
40 | def gemfile
41 | gemfile = ENV["BUNDLE_GEMFILE"]
42 | return gemfile if gemfile && !gemfile.empty?
43 |
44 | File.expand_path("../../Gemfile", __FILE__)
45 | end
46 |
47 | def lockfile
48 | lockfile =
49 | case File.basename(gemfile)
50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51 | else "#{gemfile}.lock"
52 | end
53 | File.expand_path(lockfile)
54 | end
55 |
56 | def lockfile_version
57 | return unless File.file?(lockfile)
58 | lockfile_contents = File.read(lockfile)
59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60 | Regexp.last_match(1)
61 | end
62 |
63 | def bundler_version
64 | @bundler_version ||=
65 | env_var_version || cli_arg_version ||
66 | lockfile_version
67 | end
68 |
69 | def bundler_requirement
70 | return "#{Gem::Requirement.default}.a" unless bundler_version
71 |
72 | bundler_gem_version = Gem::Version.new(bundler_version)
73 |
74 | requirement = bundler_gem_version.approximate_recommendation
75 |
76 | return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
77 |
78 | requirement += ".a" if bundler_gem_version.prerelease?
79 |
80 | requirement
81 | end
82 |
83 | def load_bundler!
84 | ENV["BUNDLE_GEMFILE"] ||= gemfile
85 |
86 | activate_bundler
87 | end
88 |
89 | def activate_bundler
90 | gem_error = activation_error_handling do
91 | gem "bundler", bundler_requirement
92 | end
93 | return if gem_error.nil?
94 | require_error = activation_error_handling do
95 | require "bundler/version"
96 | end
97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
99 | exit 42
100 | end
101 |
102 | def activation_error_handling
103 | yield
104 | nil
105 | rescue StandardError, LoadError => e
106 | e
107 | end
108 | end
109 |
110 | m.load_bundler!
111 |
112 | if m.invoked_as_script?
113 | load Gem.bin_path("bundler", "bundle")
114 | end
115 |
--------------------------------------------------------------------------------
/spec/rails_helper.rb:
--------------------------------------------------------------------------------
1 | # This file is copied to spec/ when you run 'rails generate rspec:install'
2 | require 'spec_helper'
3 | ENV['RAILS_ENV'] ||= 'test'
4 | require File.expand_path('../config/environment', __dir__)
5 | # Prevent database truncation if the environment is production
6 | abort('The Rails environment is running in production mode!') if Rails.env.production?
7 | require 'rspec/rails'
8 | # Add additional requires below this line. Rails is not loaded until this point!
9 | require 'devise'
10 | require 'support/controller_macros'
11 | require 'support/factory_bot'
12 | FactoryBot.find_definitions
13 | # Requires supporting ruby files with custom matchers and macros, etc, in
14 | # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
15 | # run as spec files by default. This means that files in spec/support that end
16 | # in _spec.rb will both be required and run as specs, causing the specs to be
17 | # run twice. It is recommended that you do not name files matching this glob to
18 | # end with _spec.rb. You can configure this pattern with the --pattern
19 | # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
20 | #
21 | # The following line is provided for convenience purposes. It has the downside
22 | # of increasing the boot-up time by auto-requiring all files in the support
23 | # directory. Alternatively, in the individual `*_spec.rb` files, manually
24 | # require only the support files necessary.
25 | #
26 | # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
27 |
28 | # Checks for pending migrations and applies them before tests are run.
29 | # If you are not using ActiveRecord, you can remove these lines.
30 | begin
31 | ActiveRecord::Migration.maintain_test_schema!
32 | rescue ActiveRecord::PendingMigrationError => e
33 | puts e.to_s.strip
34 | exit 1
35 | end
36 | RSpec.configure do |config|
37 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
38 | config.fixture_path = "#{::Rails.root}/spec/fixtures"
39 |
40 | # If you're not using ActiveRecord, or you'd prefer not to run each of your
41 | # examples within a transaction, remove the following line or assign false
42 | # instead of true.
43 | config.use_transactional_fixtures = true
44 |
45 | # You can uncomment this line to turn off ActiveRecord support entirely.
46 | # config.use_active_record = false
47 | config.include Devise::TestHelpers, type: :controller
48 | config.include ControllerMacros, type: :controller
49 | config.include FactoryBot::Syntax::Methods
50 |
51 | if Bullet.enable?
52 | config.before(:each) { Bullet.start_request }
53 | config.after(:each) { Bullet.end_request }
54 | end
55 | # RSpec Rails can automatically mix in different behaviours to your tests
56 | # based on their file location, for example enabling you to call `get` and
57 | # `post` in specs under `spec/controllers`.
58 | #
59 | # You can disable this behaviour by removing the line below, and instead
60 | # explicitly tag your specs with their type, e.g.:
61 | #
62 | # RSpec.describe UsersController, type: :controller do
63 | # # ...
64 | # end
65 | #
66 | # The different available types are documented in the features, such as in
67 | # https://relishapp.com/rspec/rspec-rails/docs
68 | config.infer_spec_type_from_file_location!
69 |
70 | # Filter lines from Rails gems in backtraces.
71 | config.filter_rails_from_backtrace!
72 | # arbitrary gems may also be filtered via:
73 | # config.filter_gems_from_backtrace("gem name")
74 | end
75 |
--------------------------------------------------------------------------------
/css/cultures.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin: auto;
3 | max-width: 768px;
4 | }
5 |
6 | .wrapper {
7 | height: 98vh;
8 | width: 100vw;
9 | top: 0;
10 | left: 0;
11 | display: -webkit-box;
12 | display: -ms-flexbox;
13 | display: flex;
14 | position: absolute;
15 | z-index: -1;
16 | }
17 |
18 | .session {
19 | width: 330px;
20 | display: -webkit-box;
21 | display: -ms-flexbox;
22 | display: flex;
23 | -webkit-box-orient: vertical;
24 | -webkit-box-direction: normal;
25 | -ms-flex-direction: column;
26 | flex-direction: column;
27 | margin: auto;
28 | background-color: rgba(36, 49, 71, 0.5);
29 | border-radius: 5px;
30 | }
31 |
32 | .session > h2 {
33 | color: rgba(249, 251, 255, 0.801);
34 | margin: 25px auto 0px auto;
35 | }
36 |
37 | .session > form > .errors {
38 | display: -webkit-box;
39 | display: -ms-flexbox;
40 | display: flex;
41 | -webkit-box-align: center;
42 | -ms-flex-align: center;
43 | align-items: center;
44 | -webkit-box-orient: vertical;
45 | -webkit-box-direction: normal;
46 | -ms-flex-direction: column;
47 | flex-direction: column;
48 | }
49 |
50 | .session > form > .errors > p {
51 | color: #ffb14d;
52 | }
53 |
54 | .session > form > .errors > ul {
55 | width: 90%;
56 | display: -webkit-box;
57 | display: -ms-flexbox;
58 | display: flex;
59 | -ms-flex-wrap: wrap;
60 | flex-wrap: wrap;
61 | list-style: none;
62 | margin: 0 25px;
63 | padding: 0;
64 | }
65 |
66 | .session > form > .errors > ul > li {
67 | color: #ff7979;
68 | padding: 0 10px;
69 | }
70 |
71 | .session > form .field_with_errors {
72 | width: 100%;
73 | }
74 |
75 | .session > form > .field {
76 | background-color: rgba(36, 49, 71, 0.7);
77 | display: -webkit-box;
78 | display: -ms-flexbox;
79 | display: flex;
80 | margin: 40px 30px;
81 | border: white solid 1px;
82 | border-radius: 5px;
83 | -webkit-box-align: start;
84 | -ms-flex-align: start;
85 | align-items: flex-start;
86 | position: relative;
87 | overflow: hidden;
88 | }
89 |
90 | .session > form > .field > label {
91 | position: absolute;
92 | padding: 5px;
93 | color: rgba(249, 251, 255, 0.5);
94 | }
95 |
96 | .session > form > .field input {
97 | width: 100%;
98 | padding: 25px 20px 10px 20px;
99 | font-size: 1.4em;
100 | border: none;
101 | background-color: transparent;
102 | color: rgba(249, 251, 255, 0.801);
103 | }
104 |
105 | .session > form > .remember {
106 | margin: 0 30px;
107 | color: rgba(249, 251, 255, 0.801);
108 | }
109 |
110 | .session > form > .actions {
111 | display: -webkit-box;
112 | display: -ms-flexbox;
113 | display: flex;
114 | margin: 40px 30px;
115 | }
116 |
117 | .session > form > .actions > input {
118 | padding: 10px;
119 | margin: auto;
120 | width: 100%;
121 | color: rgba(249, 251, 255, 0.801);
122 | background-color: rgba(108, 147, 213, 0.7);
123 | border: white solid 1px;
124 | border-radius: 5px;
125 | }
126 |
127 | .links {
128 | display: -webkit-box;
129 | display: -ms-flexbox;
130 | display: flex;
131 | -ms-flex-item-align: center;
132 | align-self: center;
133 | margin-bottom: 30px;
134 | }
135 |
136 | .links > :first-child::before {
137 | content: "";
138 | }
139 |
140 | .links > a {
141 | margin: 15px;
142 | text-decoration: none;
143 | color: #ffb14d;
144 | position: relative;
145 | }
146 |
147 | .links > a::before {
148 | position: absolute;
149 | content: "|";
150 | display: block;
151 | right: calc(100% + 15px);
152 | }
153 |
154 | @media only screen and (min-width: 768px) {
155 | .session {
156 | width: 450px;
157 | }
158 | }
159 | /*# sourceMappingURL=cultures.css.map */
--------------------------------------------------------------------------------
/css/sessions.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin: auto;
3 | max-width: 768px;
4 | height: 100%;
5 | }
6 |
7 | .wrapper > div {
8 | display: -webkit-box;
9 | display: -ms-flexbox;
10 | display: flex;
11 | z-index: 1;
12 | margin-bottom: 40px;
13 | }
14 |
15 | .session {
16 | width: 330px;
17 | display: -webkit-box;
18 | display: -ms-flexbox;
19 | display: flex;
20 | -webkit-box-orient: vertical;
21 | -webkit-box-direction: normal;
22 | -ms-flex-direction: column;
23 | flex-direction: column;
24 | margin: 0 auto;
25 | background-color: rgba(36, 49, 71, 0.5);
26 | border-radius: 5px;
27 | }
28 |
29 | .session > h2 {
30 | color: rgba(249, 251, 255, 0.801);
31 | margin: 25px auto 0px auto;
32 | }
33 |
34 | .session > form > .errors {
35 | display: -webkit-box;
36 | display: -ms-flexbox;
37 | display: flex;
38 | -webkit-box-align: center;
39 | -ms-flex-align: center;
40 | align-items: center;
41 | -webkit-box-orient: vertical;
42 | -webkit-box-direction: normal;
43 | -ms-flex-direction: column;
44 | flex-direction: column;
45 | }
46 |
47 | .session > form > .errors > p {
48 | color: #ffb14d;
49 | }
50 |
51 | .session > form > .errors > ul {
52 | width: 90%;
53 | display: -webkit-box;
54 | display: -ms-flexbox;
55 | display: flex;
56 | -ms-flex-wrap: wrap;
57 | flex-wrap: wrap;
58 | list-style: none;
59 | margin: 0 25px;
60 | padding: 0;
61 | }
62 |
63 | .session > form > .errors > ul > li {
64 | color: #ff7979;
65 | padding: 0 10px;
66 | }
67 |
68 | .session > form > .errors.login > p {
69 | margin-bottom: 0;
70 | }
71 |
72 | .session > form .field_with_errors {
73 | width: 100%;
74 | }
75 |
76 | .session > form > .field {
77 | background-color: rgba(36, 49, 71, 0.7);
78 | display: -webkit-box;
79 | display: -ms-flexbox;
80 | display: flex;
81 | margin: 40px 30px;
82 | border: white solid 1px;
83 | border-radius: 5px;
84 | -webkit-box-align: start;
85 | -ms-flex-align: start;
86 | align-items: flex-start;
87 | position: relative;
88 | overflow: hidden;
89 | }
90 |
91 | .session > form > .field > label {
92 | position: absolute;
93 | padding: 5px;
94 | color: rgba(249, 251, 255, 0.5);
95 | }
96 |
97 | .session > form > .field input {
98 | width: 100%;
99 | padding: 25px 20px 10px 20px;
100 | font-size: 1.4em;
101 | border: none;
102 | background-color: transparent;
103 | color: rgba(249, 251, 255, 0.801);
104 | }
105 |
106 | .session > form > .remember {
107 | margin: 0 30px;
108 | color: rgba(249, 251, 255, 0.801);
109 | }
110 |
111 | .session > form > .actions {
112 | display: -webkit-box;
113 | display: -ms-flexbox;
114 | display: flex;
115 | margin: 40px 30px 60px 30px;
116 | }
117 |
118 | .session > form > .actions > input {
119 | padding: 10px;
120 | margin: auto;
121 | width: 100%;
122 | color: rgba(249, 251, 255, 0.801);
123 | background-color: rgba(108, 147, 213, 0.7);
124 | border: white solid 1px;
125 | border-radius: 5px;
126 | }
127 |
128 | .links {
129 | display: -webkit-box;
130 | display: -ms-flexbox;
131 | display: flex;
132 | -ms-flex-item-align: center;
133 | align-self: center;
134 | margin-bottom: 30px;
135 | }
136 |
137 | .links > :first-child::before {
138 | content: "";
139 | }
140 |
141 | .links > a {
142 | margin: 15px;
143 | text-decoration: none;
144 | color: #ffb14d;
145 | position: relative;
146 | }
147 |
148 | .links > a::before {
149 | position: absolute;
150 | content: "|";
151 | display: block;
152 | right: calc(100% + 15px);
153 | }
154 |
155 | @media only screen and (min-width: 768px) {
156 | .session {
157 | width: 450px;
158 | }
159 | }
160 | /*# sourceMappingURL=sessions.css.map */
--------------------------------------------------------------------------------
/app/assets/stylesheets/sessions.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Cultures controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: https://sass-lang.com/
4 | $pad-width: 768px;
5 | $form-width: 330px;
6 | $form-color: rgba(36, 49, 71, 0.5);
7 | $form-field-color: rgba(36, 49, 71, 0.7);
8 | $form-lbl-color: rgba(249, 251, 255, 0.5);
9 | $form-input-color: rgba(249, 251, 255, 0.801);
10 | $form-warning-color: rgba(255, 121, 121, 1);
11 | $form-warning-title-color: rgba(255, 177, 77, 1);
12 | $space: 5px;
13 | $font-size:1em;
14 |
15 | .container {
16 | margin: auto;
17 | max-width: $pad-width;
18 | height: 100%;
19 | }
20 |
21 | .wrapper {
22 | &>div {
23 | display: flex;
24 | z-index: 1;
25 | margin-bottom: $space*8;
26 | }
27 | }
28 |
29 | .session {
30 | width: $form-width;
31 | display: flex;
32 | flex-direction: column;
33 | margin: 0 auto;
34 | background-color: $form-color;
35 | border-radius: $space;
36 |
37 | &>h2 {
38 | color: $form-input-color;
39 | margin: $space*5 auto $space*0 auto;
40 | }
41 |
42 | &>form {
43 | &>.errors {
44 | display: flex;
45 | align-items: center;
46 | flex-direction: column;
47 |
48 | &>p {
49 | color: $form-warning-title-color;
50 | }
51 |
52 | &>ul {
53 | width: 90%;
54 | display: flex;
55 | flex-wrap: wrap;
56 | list-style: none;
57 | margin: 0 $space*5;
58 | padding: 0;
59 |
60 | &>li {
61 | color: $form-warning-color;
62 | padding: 0 $space*2;
63 | }
64 | }
65 | }
66 |
67 | &>.errors.login {
68 | &>p {
69 | margin-bottom: 0;
70 | }
71 | }
72 |
73 | .field_with_errors {
74 | width: 100%;
75 | }
76 |
77 | &>.field {
78 | background-color: $form-field-color;
79 | display: flex;
80 | margin: $space*8 $space*6;
81 | border: white solid $space/5;
82 | border-radius: $space;
83 | align-items: flex-start;
84 | position: relative;
85 | overflow: hidden;
86 |
87 | &>label {
88 | position: absolute;
89 | padding: $space;
90 | color: $form-lbl-color;
91 | }
92 |
93 | input {
94 | width: 100%;
95 | padding: $space*5 $space*4 $space*2 $space*4;
96 | font-size: $font-size*1.4;
97 | border: none;
98 | background-color: transparent;
99 | color: $form-input-color;
100 | }
101 | }
102 |
103 | &>.remember {
104 | margin: 0 $space*6;
105 | color: $form-input-color;
106 | }
107 |
108 | &>.actions {
109 | display: flex;
110 | margin: $space*8 $space*6 $space*12 $space*6;
111 |
112 | &>input {
113 | padding: $space*2;
114 | margin: auto;
115 | width: 100%;
116 | color: $form-input-color;
117 | background-color: $form-field-color*3;
118 | border: white solid $space/5;
119 | border-radius: $space;
120 | }
121 | }
122 | }
123 | }
124 |
125 | .links {
126 | display: flex;
127 | align-self: center;
128 | margin-bottom: $space*6;
129 |
130 | &>:first-child {
131 | &::before {
132 | content: "";
133 | }
134 | }
135 |
136 | &>a {
137 | margin: $space*3;
138 | text-decoration: none;
139 | color: $form-warning-title-color;
140 | position: relative;
141 |
142 | &::before {
143 | position: absolute;
144 | content: "|";
145 | display: block;
146 | right: calc(100% + #{$space*3});
147 | }
148 |
149 | }
150 | }
151 |
152 | @media only screen and (min-width: $pad-width) {
153 | $form-width: 450px;
154 |
155 | .session {
156 | width: $form-width;
157 | }
158 | }
--------------------------------------------------------------------------------
/css/main.css.map:
--------------------------------------------------------------------------------
1 | {
2 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AjGH,AA6EI,IA7EA,AAAA,UAAU,GAwEV,EAAE,GAKA,EAAE,CAAC;EACH,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;CAiBpB;;AAhGL,AAiFM,IAjFF,AAAA,UAAU,GAwEV,EAAE,GAKA,EAAE,GAIA,CAAC,CAAC;EACF,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,KAAK,EA3KK,OAAsB;EA4KhC,eAAe,EAAE,IAAI;CAUtB;;AA/FP,AAuFQ,IAvFJ,AAAA,UAAU,GAwEV,EAAE,GAKA,EAAE,GAIA,CAAC,GAMC,YAAY,CAAC;EACb,UAAU,EAAE,MAAM;EAClB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAQ;CACnB;;AA1FT,AA4FQ,IA5FJ,AAAA,UAAU,GAwEV,EAAE,GAKA,EAAE,GAIA,CAAC,CAWD,IAAI,CAAA;EACF,IAAI,EApLI,OAAsB;CAqL/B;;AAMT,MAAM,MAAM,MAAM,MAAM,SAAS,EAAE,KAAK;EACtC,AAAA,aAAa,CAAC;IACZ,OAAO,EAAE,IAAI;IACb,qBAAqB,EAAE,OAAO;IAC9B,kBAAkB,EAAE,IAAS,CAAC,iBAAyB;IACvD,mBAAmB,EAAE,qCACH;IAClB,UAAU,EAAE,KAAK;GAClB;EAED,AAAA,IAAI,AAAA,UAAU,CAAC;IACb,SAAS,EAAE,IAAI;GAChB;EAED,AAAA,MAAM,AAAA,QAAQ,CAAC;IACb,SAAS,EAAE,MAAM;GAClB;EAED,AAAA,IAAI,AAAA,aAAa,CAAC;IAChB,SAAS,EAAE,IAAI;IACf,gBAAgB,EAAE,MAAM;GACzB",
4 | "sources": [
5 | "../app/assets/stylesheets/main.scss"
6 | ],
7 | "names": [],
8 | "file": "main.css"
9 | }
--------------------------------------------------------------------------------
/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 confirmation link to confirm your new email address."
46 | updated: "Your account has been updated successfully."
47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again"
48 | sessions:
49 | signed_in: "Signed in successfully."
50 | signed_out: "Signed out successfully."
51 | already_signed_out: "Signed out successfully."
52 | unlocks:
53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56 | errors:
57 | messages:
58 | already_confirmed: "was already confirmed, please try signing in"
59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60 | expired: "has expired, please request a new one"
61 | not_found: "not found"
62 | not_locked: "was not locked"
63 | not_saved:
64 | one: "1 error prohibited this %{resource} from being saved:"
65 | other: "%{count} errors prohibited this %{resource} from being saved:"
66 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/main.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Cultures controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: https://sass-lang.com/
4 | $pad-width: 768px;
5 | $space: 5px;
6 | $p-100: 100%;
7 | $font-size: 1em;
8 | $border-color: rgb(18, 26, 37);
9 | $profile-menu-color:rgba(29, 42, 62, 1);
10 | $font-menu-color: rgba(121, 142, 165, 1);
11 | $header-color: rgba(80, 164, 226, 1);
12 | $menu-color: rgba(36, 49, 71, 1);
13 | $body-color: linear-gradient(170deg, rgb(106, 175, 208), rgb(100, 129, 129));
14 | $link-btn-color: rgba(36, 49, 71, 0.7);
15 | $link-color: white;
16 |
17 | * {
18 | box-sizing: border-box;
19 | }
20 |
21 |
22 |
23 | html {
24 | min-height: 100%;
25 | }
26 |
27 | body {
28 | background: $body-color;
29 | position: relative;
30 | margin: 0;
31 | padding: 0;
32 | min-height: 100%;
33 | }
34 |
35 | button {
36 | cursor: pointer;
37 | }
38 |
39 | .navbar-user {
40 | align-self: center;
41 | display: flex;
42 | flex-direction: row;
43 |
44 | &>:nth-child(even) {
45 | background-color: $link-btn-color*2;
46 | color: $link-color;
47 | }
48 |
49 | &>:nth-child(odd) {
50 | background-color: $link-btn-color*3;
51 | color: $link-color;
52 | }
53 |
54 | &>:first-child {
55 | &::before {
56 | content: "";
57 | }
58 | }
59 |
60 | a {
61 | border: $space/5 solid $link-color;
62 | ;
63 | border-radius: $space;
64 | padding: $space*2;
65 | margin: $space*2;
66 | text-decoration: none;
67 | position: relative;
68 |
69 | &::before {
70 | font-size: $font-size*1.5;
71 | line-height: $font-size*.5;
72 | position: absolute;
73 | content: "|";
74 | color: $link-color;
75 | display: block;
76 | right: calc(100% + #{$space*1.5});
77 | }
78 | }
79 | }
80 |
81 | header.top-bar {
82 | background-color: $header-color;
83 | display: flex;
84 | justify-content: space-between;
85 |
86 | i {
87 | align-self: center;
88 | margin: $space*6;
89 | transform: scale(1.5);
90 |
91 | path {
92 | fill: white;
93 | }
94 | }
95 | }
96 |
97 | menu.left-menu {
98 | background-color: $menu-color;
99 | margin: 0;
100 | padding: 0;
101 |
102 | &>.current_user_pic {
103 | display: flex;
104 | background-color: $profile-menu-color;
105 | border-bottom: $space/5 solid $border-color;
106 | height: $space*15;
107 |
108 | figure {
109 | width: $space*14;
110 | height: $space*14;
111 | overflow: hidden;
112 | margin: 0;
113 | padding: $space*1;
114 |
115 | img {
116 | width: $p-100;
117 | height: $p-100;
118 | }
119 | }
120 |
121 | &>h4 {
122 | margin-left: $space;
123 | align-self: center;
124 | color: $font-menu-color;
125 | text-transform: uppercase;
126 | font-size: $p-100*1.2;
127 | }
128 | }
129 |
130 | &>.current_user_info {
131 | display: flex;
132 | background-color: $profile-menu-color;
133 | border-bottom: $space/5 solid $border-color;
134 | height: $space*15;
135 |
136 | &>div {
137 | display: flex;
138 | flex: 0 0 $p-100;
139 |
140 | &>div {
141 | align-self: center;
142 | flex: 0 0 $p-100/2;
143 | display: flex;
144 | flex-direction: column;
145 |
146 | p,
147 | span {
148 | align-self: center;
149 | text-align: center;
150 | width: $p-100;
151 | color: $font-menu-color;
152 | margin: 0;
153 | padding: 0;
154 | }
155 |
156 | p {
157 | font-weight: bolder;
158 | font-size: $p-100*1.2;
159 | }
160 |
161 | }
162 |
163 | &>:first-child {
164 | border-right: $space/5 solid $border-color;
165 | }
166 | }
167 | }
168 |
169 | &>ul {
170 | list-style: none;
171 | display: flex;
172 | flex-direction: column;
173 |
174 | &>li {
175 | display: flex;
176 | flex-direction: row;
177 |
178 | &>a {
179 | display: flex;
180 | flex-direction: row;
181 | color: $font-menu-color;
182 | text-decoration: none;
183 |
184 | &>:first-child {
185 | align-self: center;
186 | flex: 0 0 $space*5
187 | }
188 |
189 | path{
190 | fill: $font-menu-color;
191 | }
192 | }
193 | }
194 | }
195 | }
196 |
197 | @media only screen and (min-width: $pad-width) {
198 | .grid-layouts {
199 | display: grid;
200 | grid-template-columns: 1fr 5fr;
201 | grid-template-rows: $space*15 calc(100% - #{$space*15});
202 | grid-template-areas: 'menu header header'
203 | 'menu main main';
204 | min-height: 100vh;
205 | }
206 |
207 | menu.left-menu {
208 | grid-area: menu;
209 | }
210 |
211 | header.top-bar {
212 | grid-area: header;
213 | }
214 |
215 | main.main-content {
216 | grid-area: main;
217 | background-color: violet;
218 | }
219 | }
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3 | # The generated `.rspec` file contains `--require spec_helper` which will cause
4 | # this file to always be loaded, without a need to explicitly require it in any
5 | # files.
6 | #
7 | # Given that it is always loaded, you are encouraged to keep this file as
8 | # light-weight as possible. Requiring heavyweight dependencies from this file
9 | # will add to the boot time of your test suite on EVERY test run, even for an
10 | # individual file that may not need all of that loaded. Instead, consider making
11 | # a separate helper file that requires the additional dependencies and performs
12 | # the additional setup, and require it from the spec files that actually need
13 | # it.
14 | #
15 | # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16 | RSpec.configure do |config|
17 | # rspec-expectations config goes here. You can use an alternate
18 | # assertion/expectation library such as wrong or the stdlib/minitest
19 | # assertions if you prefer.
20 | config.expect_with :rspec do |expectations|
21 | # This option will default to `true` in RSpec 4. It makes the `description`
22 | # and `failure_message` of custom matchers include text for helper methods
23 | # defined using `chain`, e.g.:
24 | # be_bigger_than(2).and_smaller_than(4).description
25 | # # => "be bigger than 2 and smaller than 4"
26 | # ...rather than:
27 | # # => "be bigger than 2"
28 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true
29 | end
30 |
31 | # rspec-mocks config goes here. You can use an alternate test double
32 | # library (such as bogus or mocha) by changing the `mock_with` option here.
33 | config.mock_with :rspec do |mocks|
34 | # Prevents you from mocking or stubbing a method that does not exist on
35 | # a real object. This is generally recommended, and will default to
36 | # `true` in RSpec 4.
37 | mocks.verify_partial_doubles = true
38 | end
39 |
40 | # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
41 | # have no way to turn it off -- the option exists only for backwards
42 | # compatibility in RSpec 3). It causes shared context metadata to be
43 | # inherited by the metadata hash of host groups and examples, rather than
44 | # triggering implicit auto-inclusion in groups with matching metadata.
45 | config.shared_context_metadata_behavior = :apply_to_host_groups
46 | # The settings below are suggested to provide a good initial experience
47 | # with RSpec, but feel free to customize to your heart's content.
48 | # # This allows you to limit a spec run to individual examples or groups
49 | # # you care about by tagging them with `:focus` metadata. When nothing
50 | # # is tagged with `:focus`, all examples get run. RSpec also provides
51 | # # aliases for `it`, `describe`, and `context` that include `:focus`
52 | # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
53 | # config.filter_run_when_matching :focus
54 | #
55 | # # Allows RSpec to persist some state between runs in order to support
56 | # # the `--only-failures` and `--next-failure` CLI options. We recommend
57 | # # you configure your source control system to ignore this file.
58 | # config.example_status_persistence_file_path = "spec/examples.txt"
59 | #
60 | # # Limits the available syntax to the non-monkey patched syntax that is
61 | # # recommended. For more details, see:
62 | # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
63 | # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
64 | # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
65 | # config.disable_monkey_patching!
66 | #
67 | # # Many RSpec users commonly either run the entire suite or an individual
68 | # # file, and it's useful to allow more verbose output when running an
69 | # # individual spec file.
70 | # if config.files_to_run.one?
71 | # # Use the documentation formatter for detailed output,
72 | # # unless a formatter has already been configured
73 | # # (e.g. via a command-line flag).
74 | # config.default_formatter = "doc"
75 | # end
76 | #
77 | # # Print the 10 slowest examples and example groups at the
78 | # # end of the spec run, to help surface which specs are running
79 | # # particularly slow.
80 | # config.profile_examples = 10
81 | #
82 | # # Run specs in random order to surface order dependencies. If you find an
83 | # # order dependency and want to debug it, you can fix the order by providing
84 | # # the seed, which is printed after each run.
85 | # # --seed 1234
86 | # config.order = :random
87 | #
88 | # # Seed global randomization in this process using the `--seed` CLI option.
89 | # # Setting this allows you to use `--seed` to deterministically reproduce
90 | # # test failures related to randomization by passing the same `--seed` value
91 | # # as the one that triggered the failure.
92 | # Kernel.srand config.seed
93 | end
94 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Using Claudinary
5 | config.active_storage.service = :cloudinary
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 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
21 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
22 | # config.require_master_key = true
23 |
24 | # Disable serving static files from the `/public` folder by default since
25 | # Apache or NGINX already handles this.
26 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
27 |
28 | # Compress CSS using a preprocessor.
29 | # config.assets.css_compressor = :sass
30 |
31 | # Do not fallback to assets pipeline if a precompiled asset is missed.
32 | config.assets.compile = false
33 |
34 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
35 | # config.action_controller.asset_host = 'http://assets.example.com'
36 |
37 | # Specifies the header that your server uses for sending files.
38 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
39 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
40 |
41 | # Store uploaded files on the local file system (see config/storage.yml for options).
42 | # config.active_storage.service = :local
43 |
44 | # Mount Action Cable outside main process or domain.
45 | # config.action_cable.mount_path = nil
46 | # config.action_cable.url = 'wss://example.com/cable'
47 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
48 |
49 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
50 | # config.force_ssl = true
51 |
52 | # Use the lowest log level to ensure availability of diagnostic information
53 | # when problems arise.
54 | config.log_level = :debug
55 |
56 | # Prepend all log lines with the following tags.
57 | config.log_tags = [ :request_id ]
58 |
59 | # Use a different cache store in production.
60 | # config.cache_store = :mem_cache_store
61 |
62 | # Use a real queuing backend for Active Job (and separate queues per environment).
63 | # config.active_job.queue_adapter = :resque
64 | # config.active_job.queue_name_prefix = "cultures_production"
65 |
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 |
95 | # Inserts middleware to perform automatic connection switching.
96 | # The `database_selector` hash is used to pass options to the DatabaseSelector
97 | # middleware. The `delay` is used to determine how long to wait after a write
98 | # to send a subsequent read to the primary.
99 | #
100 | # The `database_resolver` class is used by the middleware to determine which
101 | # database is appropriate to use based on the time delay.
102 | #
103 | # The `database_resolver_context` class is used by the middleware to set
104 | # timestamps for the last write to the primary. The resolver uses the context
105 | # class timestamps to determine how long to wait before reading from the
106 | # replica.
107 | #
108 | # By default Rails will store a last write timestamp in the session. The
109 | # DatabaseSelector middleware is designed as such you can define your own
110 | # strategy for connection switching and pass that into the middleware through
111 | # these configuration options.
112 | # config.active_record.database_selector = { delay: 2.seconds }
113 | # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
114 | # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
115 | end
116 |
--------------------------------------------------------------------------------
/css/main.css:
--------------------------------------------------------------------------------
1 | * {
2 | -webkit-box-sizing: border-box;
3 | box-sizing: border-box;
4 | }
5 |
6 | html {
7 | min-height: 100%;
8 | }
9 |
10 | body {
11 | background: linear-gradient(170deg, #6aafd0, #648181);
12 | position: relative;
13 | margin: 0;
14 | padding: 0;
15 | min-height: 100%;
16 | }
17 |
18 | button {
19 | cursor: pointer;
20 | }
21 |
22 | .navbar-user {
23 | -ms-flex-item-align: center;
24 | align-self: center;
25 | display: -webkit-box;
26 | display: -ms-flexbox;
27 | display: flex;
28 | -webkit-box-orient: horizontal;
29 | -webkit-box-direction: normal;
30 | -ms-flex-direction: row;
31 | flex-direction: row;
32 | }
33 |
34 | .navbar-user > :nth-child(even) {
35 | background-color: rgba(72, 98, 142, 0.7);
36 | color: white;
37 | }
38 |
39 | .navbar-user > :nth-child(odd) {
40 | background-color: rgba(108, 147, 213, 0.7);
41 | color: white;
42 | }
43 |
44 | .navbar-user > :first-child::before {
45 | content: "";
46 | }
47 |
48 | .navbar-user a {
49 | border: 1px solid white;
50 | border-radius: 5px;
51 | padding: 10px;
52 | margin: 10px;
53 | text-decoration: none;
54 | position: relative;
55 | }
56 |
57 | .navbar-user a::before {
58 | font-size: 1.5em;
59 | line-height: 0.5em;
60 | position: absolute;
61 | content: "|";
62 | color: white;
63 | display: block;
64 | right: calc(100% + 7.5px);
65 | }
66 |
67 | header.top-bar {
68 | background-color: #50a4e2;
69 | display: -webkit-box;
70 | display: -ms-flexbox;
71 | display: flex;
72 | -webkit-box-pack: justify;
73 | -ms-flex-pack: justify;
74 | justify-content: space-between;
75 | }
76 |
77 | header.top-bar i {
78 | -ms-flex-item-align: center;
79 | -ms-grid-row-align: center;
80 | align-self: center;
81 | margin: 30px;
82 | -webkit-transform: scale(1.5);
83 | transform: scale(1.5);
84 | }
85 |
86 | header.top-bar i path {
87 | fill: white;
88 | }
89 |
90 | menu.left-menu {
91 | background-color: #243147;
92 | margin: 0;
93 | padding: 0;
94 | }
95 |
96 | menu.left-menu > .current_user_pic {
97 | display: -webkit-box;
98 | display: -ms-flexbox;
99 | display: flex;
100 | background-color: #1d2a3e;
101 | border-bottom: 1px solid #121a25;
102 | height: 75px;
103 | }
104 |
105 | menu.left-menu > .current_user_pic figure {
106 | width: 70px;
107 | height: 70px;
108 | overflow: hidden;
109 | margin: 0;
110 | padding: 5px;
111 | }
112 |
113 | menu.left-menu > .current_user_pic figure img {
114 | width: 100%;
115 | height: 100%;
116 | }
117 |
118 | menu.left-menu > .current_user_pic > h4 {
119 | margin-left: 5px;
120 | -ms-flex-item-align: center;
121 | -ms-grid-row-align: center;
122 | align-self: center;
123 | color: #798ea5;
124 | text-transform: uppercase;
125 | font-size: 120%;
126 | }
127 |
128 | menu.left-menu > .current_user_info {
129 | display: -webkit-box;
130 | display: -ms-flexbox;
131 | display: flex;
132 | background-color: #1d2a3e;
133 | border-bottom: 1px solid #121a25;
134 | height: 75px;
135 | }
136 |
137 | menu.left-menu > .current_user_info > div {
138 | display: -webkit-box;
139 | display: -ms-flexbox;
140 | display: flex;
141 | -webkit-box-flex: 0;
142 | -ms-flex: 0 0 100%;
143 | flex: 0 0 100%;
144 | }
145 |
146 | menu.left-menu > .current_user_info > div > div {
147 | -ms-flex-item-align: center;
148 | align-self: center;
149 | -webkit-box-flex: 0;
150 | -ms-flex: 0 0 50%;
151 | flex: 0 0 50%;
152 | display: -webkit-box;
153 | display: -ms-flexbox;
154 | display: flex;
155 | -webkit-box-orient: vertical;
156 | -webkit-box-direction: normal;
157 | -ms-flex-direction: column;
158 | flex-direction: column;
159 | }
160 |
161 | menu.left-menu > .current_user_info > div > div p,
162 | menu.left-menu > .current_user_info > div > div span {
163 | -ms-flex-item-align: center;
164 | -ms-grid-row-align: center;
165 | align-self: center;
166 | text-align: center;
167 | width: 100%;
168 | color: #798ea5;
169 | margin: 0;
170 | padding: 0;
171 | }
172 |
173 | menu.left-menu > .current_user_info > div > div p {
174 | font-weight: bolder;
175 | font-size: 120%;
176 | }
177 |
178 | menu.left-menu > .current_user_info > div > :first-child {
179 | border-right: 1px solid #121a25;
180 | }
181 |
182 | menu.left-menu > ul {
183 | list-style: none;
184 | display: -webkit-box;
185 | display: -ms-flexbox;
186 | display: flex;
187 | -webkit-box-orient: vertical;
188 | -webkit-box-direction: normal;
189 | -ms-flex-direction: column;
190 | flex-direction: column;
191 | }
192 |
193 | menu.left-menu > ul > li {
194 | display: -webkit-box;
195 | display: -ms-flexbox;
196 | display: flex;
197 | -webkit-box-orient: horizontal;
198 | -webkit-box-direction: normal;
199 | -ms-flex-direction: row;
200 | flex-direction: row;
201 | }
202 |
203 | menu.left-menu > ul > li > a {
204 | display: -webkit-box;
205 | display: -ms-flexbox;
206 | display: flex;
207 | -webkit-box-orient: horizontal;
208 | -webkit-box-direction: normal;
209 | -ms-flex-direction: row;
210 | flex-direction: row;
211 | color: #798ea5;
212 | text-decoration: none;
213 | }
214 |
215 | menu.left-menu > ul > li > a > :first-child {
216 | -ms-flex-item-align: center;
217 | -ms-grid-row-align: center;
218 | align-self: center;
219 | -webkit-box-flex: 0;
220 | -ms-flex: 0 0 25px;
221 | flex: 0 0 25px;
222 | }
223 |
224 | menu.left-menu > ul > li > a path {
225 | fill: #798ea5;
226 | }
227 |
228 | @media only screen and (min-width: 768px) {
229 | .grid-layouts {
230 | display: -ms-grid;
231 | display: grid;
232 | -ms-grid-columns: 1fr 5fr;
233 | grid-template-columns: 1fr 5fr;
234 | -ms-grid-rows: 75px calc(100% - 75px);
235 | grid-template-rows: 75px calc(100% - 75px);
236 | grid-template-areas: 'menu header header' 'menu main main';
237 | min-height: 100vh;
238 | }
239 | menu.left-menu {
240 | -ms-grid-row: 1;
241 | -ms-grid-row-span: 2;
242 | -ms-grid-column: 1;
243 | grid-area: menu;
244 | }
245 | header.top-bar {
246 | -ms-grid-row: 1;
247 | -ms-grid-column: 2;
248 | -ms-grid-column-span: 2;
249 | grid-area: header;
250 | }
251 | main.main-content {
252 | -ms-grid-row: 2;
253 | -ms-grid-column: 2;
254 | -ms-grid-column-span: 2;
255 | grid-area: main;
256 | background-color: violet;
257 | }
258 | }
259 | /*# sourceMappingURL=main.css.map */
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | actioncable (6.0.2.2)
5 | actionpack (= 6.0.2.2)
6 | nio4r (~> 2.0)
7 | websocket-driver (>= 0.6.1)
8 | actionmailbox (6.0.2.2)
9 | actionpack (= 6.0.2.2)
10 | activejob (= 6.0.2.2)
11 | activerecord (= 6.0.2.2)
12 | activestorage (= 6.0.2.2)
13 | activesupport (= 6.0.2.2)
14 | mail (>= 2.7.1)
15 | actionmailer (6.0.2.2)
16 | actionpack (= 6.0.2.2)
17 | actionview (= 6.0.2.2)
18 | activejob (= 6.0.2.2)
19 | mail (~> 2.5, >= 2.5.4)
20 | rails-dom-testing (~> 2.0)
21 | actionpack (6.0.2.2)
22 | actionview (= 6.0.2.2)
23 | activesupport (= 6.0.2.2)
24 | rack (~> 2.0, >= 2.0.8)
25 | rack-test (>= 0.6.3)
26 | rails-dom-testing (~> 2.0)
27 | rails-html-sanitizer (~> 1.0, >= 1.2.0)
28 | actiontext (6.0.2.2)
29 | actionpack (= 6.0.2.2)
30 | activerecord (= 6.0.2.2)
31 | activestorage (= 6.0.2.2)
32 | activesupport (= 6.0.2.2)
33 | nokogiri (>= 1.8.5)
34 | actionview (6.0.2.2)
35 | activesupport (= 6.0.2.2)
36 | builder (~> 3.1)
37 | erubi (~> 1.4)
38 | rails-dom-testing (~> 2.0)
39 | rails-html-sanitizer (~> 1.1, >= 1.2.0)
40 | activejob (6.0.2.2)
41 | activesupport (= 6.0.2.2)
42 | globalid (>= 0.3.6)
43 | activemodel (6.0.2.2)
44 | activesupport (= 6.0.2.2)
45 | activerecord (6.0.2.2)
46 | activemodel (= 6.0.2.2)
47 | activesupport (= 6.0.2.2)
48 | activestorage (6.0.2.2)
49 | actionpack (= 6.0.2.2)
50 | activejob (= 6.0.2.2)
51 | activerecord (= 6.0.2.2)
52 | marcel (~> 0.3.1)
53 | activesupport (6.0.2.2)
54 | concurrent-ruby (~> 1.0, >= 1.0.2)
55 | i18n (>= 0.7, < 2)
56 | minitest (~> 5.1)
57 | tzinfo (~> 1.1)
58 | zeitwerk (~> 2.2)
59 | addressable (2.7.0)
60 | public_suffix (>= 2.0.2, < 5.0)
61 | ansi (1.5.0)
62 | autoprefixer-rails (9.7.5)
63 | execjs
64 | aws_cf_signer (0.1.3)
65 | bcrypt (3.1.13)
66 | bindex (0.8.1)
67 | bootsnap (1.4.6)
68 | msgpack (~> 1.0)
69 | bootstrap-sass (3.4.1)
70 | autoprefixer-rails (>= 5.2.1)
71 | sassc (>= 2.0.0)
72 | builder (3.2.4)
73 | bullet (6.1.0)
74 | activesupport (>= 3.0.0)
75 | uniform_notifier (~> 1.11)
76 | byebug (11.1.1)
77 | capybara (3.31.0)
78 | addressable
79 | mini_mime (>= 0.1.3)
80 | nokogiri (~> 1.8)
81 | rack (>= 1.6.0)
82 | rack-test (>= 0.6.3)
83 | regexp_parser (~> 1.5)
84 | xpath (~> 3.2)
85 | childprocess (3.0.0)
86 | cloudinary (1.13.2)
87 | aws_cf_signer
88 | rest-client
89 | coderay (1.1.2)
90 | concurrent-ruby (1.1.6)
91 | crass (1.0.6)
92 | devise (4.7.1)
93 | bcrypt (~> 3.0)
94 | orm_adapter (~> 0.1)
95 | railties (>= 4.1.0)
96 | responders
97 | warden (~> 1.2.3)
98 | diff-lcs (1.3)
99 | domain_name (0.5.20190701)
100 | unf (>= 0.0.5, < 1.0.0)
101 | erubi (1.9.0)
102 | execjs (2.7.0)
103 | factory_bot (5.1.2)
104 | activesupport (>= 4.2.0)
105 | factory_bot_rails (5.1.1)
106 | factory_bot (~> 5.1.0)
107 | railties (>= 4.2.0)
108 | ffi (1.12.2)
109 | formatador (0.2.5)
110 | globalid (0.4.2)
111 | activesupport (>= 4.2.0)
112 | guard (2.16.2)
113 | formatador (>= 0.2.4)
114 | listen (>= 2.7, < 4.0)
115 | lumberjack (>= 1.0.12, < 2.0)
116 | nenv (~> 0.1)
117 | notiffany (~> 0.0)
118 | pry (>= 0.9.12)
119 | shellany (~> 0.0)
120 | thor (>= 0.18.1)
121 | guard-compat (1.2.1)
122 | guard-minitest (2.4.6)
123 | guard-compat (~> 1.2)
124 | minitest (>= 3.0)
125 | http-accept (1.7.0)
126 | http-cookie (1.0.3)
127 | domain_name (~> 0.5)
128 | i18n (1.8.2)
129 | concurrent-ruby (~> 1.0)
130 | jbuilder (2.10.0)
131 | activesupport (>= 5.0.0)
132 | jquery-rails (4.3.5)
133 | rails-dom-testing (>= 1, < 3)
134 | railties (>= 4.2.0)
135 | thor (>= 0.14, < 2.0)
136 | listen (3.2.1)
137 | rb-fsevent (~> 0.10, >= 0.10.3)
138 | rb-inotify (~> 0.9, >= 0.9.10)
139 | loofah (2.4.0)
140 | crass (~> 1.0.2)
141 | nokogiri (>= 1.5.9)
142 | lumberjack (1.2.4)
143 | mail (2.7.1)
144 | mini_mime (>= 0.1.1)
145 | marcel (0.3.3)
146 | mimemagic (~> 0.3.2)
147 | method_source (1.0.0)
148 | mime-types (3.3.1)
149 | mime-types-data (~> 3.2015)
150 | mime-types-data (3.2019.1009)
151 | mimemagic (0.3.4)
152 | mini_mime (1.0.2)
153 | mini_portile2 (2.4.0)
154 | minitest (5.14.0)
155 | minitest-reporters (1.4.2)
156 | ansi
157 | builder
158 | minitest (>= 5.0)
159 | ruby-progressbar
160 | msgpack (1.3.3)
161 | nenv (0.3.0)
162 | netrc (0.11.0)
163 | nio4r (2.5.2)
164 | nokogiri (1.10.9)
165 | mini_portile2 (~> 2.4.0)
166 | notiffany (0.1.3)
167 | nenv (~> 0.1)
168 | shellany (~> 0.0)
169 | orm_adapter (0.5.0)
170 | pg (1.2.3)
171 | pry (0.13.0)
172 | coderay (~> 1.1)
173 | method_source (~> 1.0)
174 | public_suffix (4.0.3)
175 | puma (4.3.3)
176 | nio4r (~> 2.0)
177 | rack (2.2.2)
178 | rack-proxy (0.6.5)
179 | rack
180 | rack-test (1.1.0)
181 | rack (>= 1.0, < 3)
182 | rails (6.0.2.2)
183 | actioncable (= 6.0.2.2)
184 | actionmailbox (= 6.0.2.2)
185 | actionmailer (= 6.0.2.2)
186 | actionpack (= 6.0.2.2)
187 | actiontext (= 6.0.2.2)
188 | actionview (= 6.0.2.2)
189 | activejob (= 6.0.2.2)
190 | activemodel (= 6.0.2.2)
191 | activerecord (= 6.0.2.2)
192 | activestorage (= 6.0.2.2)
193 | activesupport (= 6.0.2.2)
194 | bundler (>= 1.3.0)
195 | railties (= 6.0.2.2)
196 | sprockets-rails (>= 2.0.0)
197 | rails-controller-testing (1.0.4)
198 | actionpack (>= 5.0.1.x)
199 | actionview (>= 5.0.1.x)
200 | activesupport (>= 5.0.1.x)
201 | rails-dom-testing (2.0.3)
202 | activesupport (>= 4.2.0)
203 | nokogiri (>= 1.6)
204 | rails-html-sanitizer (1.3.0)
205 | loofah (~> 2.3)
206 | railties (6.0.2.2)
207 | actionpack (= 6.0.2.2)
208 | activesupport (= 6.0.2.2)
209 | method_source
210 | rake (>= 0.8.7)
211 | thor (>= 0.20.3, < 2.0)
212 | rake (13.0.1)
213 | rb-fsevent (0.10.3)
214 | rb-inotify (0.10.1)
215 | ffi (~> 1.0)
216 | regexp_parser (1.7.0)
217 | responders (3.0.0)
218 | actionpack (>= 5.0)
219 | railties (>= 5.0)
220 | rest-client (2.1.0)
221 | http-accept (>= 1.7.0, < 2.0)
222 | http-cookie (>= 1.0.2, < 2.0)
223 | mime-types (>= 1.16, < 4.0)
224 | netrc (~> 0.8)
225 | rspec-core (3.9.1)
226 | rspec-support (~> 3.9.1)
227 | rspec-expectations (3.9.1)
228 | diff-lcs (>= 1.2.0, < 2.0)
229 | rspec-support (~> 3.9.0)
230 | rspec-mocks (3.9.1)
231 | diff-lcs (>= 1.2.0, < 2.0)
232 | rspec-support (~> 3.9.0)
233 | rspec-rails (4.0.0)
234 | actionpack (>= 4.2)
235 | activesupport (>= 4.2)
236 | railties (>= 4.2)
237 | rspec-core (~> 3.9)
238 | rspec-expectations (~> 3.9)
239 | rspec-mocks (~> 3.9)
240 | rspec-support (~> 3.9)
241 | rspec-support (3.9.2)
242 | ruby-progressbar (1.10.1)
243 | rubyzip (2.3.0)
244 | sass-rails (6.0.0)
245 | sassc-rails (~> 2.1, >= 2.1.1)
246 | sassc (2.2.1)
247 | ffi (~> 1.9)
248 | sassc-rails (2.1.2)
249 | railties (>= 4.0.0)
250 | sassc (>= 2.0)
251 | sprockets (> 3.0)
252 | sprockets-rails
253 | tilt
254 | selenium-webdriver (3.142.7)
255 | childprocess (>= 0.5, < 4.0)
256 | rubyzip (>= 1.2.2)
257 | semantic_range (2.3.0)
258 | shellany (0.0.1)
259 | spring (2.1.0)
260 | spring-watcher-listen (2.0.1)
261 | listen (>= 2.7, < 4.0)
262 | spring (>= 1.2, < 3.0)
263 | sprockets (4.0.0)
264 | concurrent-ruby (~> 1.0)
265 | rack (> 1, < 3)
266 | sprockets-rails (3.2.1)
267 | actionpack (>= 4.0)
268 | activesupport (>= 4.0)
269 | sprockets (>= 3.0.0)
270 | sqlite3 (1.4.2)
271 | thor (1.0.1)
272 | thread_safe (0.3.6)
273 | tilt (2.0.10)
274 | turbolinks (5.2.1)
275 | turbolinks-source (~> 5.2)
276 | turbolinks-source (5.2.0)
277 | tzinfo (1.2.6)
278 | thread_safe (~> 0.1)
279 | unf (0.1.4)
280 | unf_ext
281 | unf_ext (0.0.7.6)
282 | uniform_notifier (1.13.0)
283 | warden (1.2.8)
284 | rack (>= 2.0.6)
285 | web-console (4.0.1)
286 | actionview (>= 6.0.0)
287 | activemodel (>= 6.0.0)
288 | bindex (>= 0.4.0)
289 | railties (>= 6.0.0)
290 | webdrivers (4.2.0)
291 | nokogiri (~> 1.6)
292 | rubyzip (>= 1.3.0)
293 | selenium-webdriver (>= 3.0, < 4.0)
294 | webpacker (5.0.1)
295 | activesupport (>= 5.2)
296 | rack-proxy (>= 0.6.1)
297 | railties (>= 5.2)
298 | semantic_range (>= 2.3.0)
299 | websocket-driver (0.7.1)
300 | websocket-extensions (>= 0.1.0)
301 | websocket-extensions (0.1.4)
302 | xpath (3.2.0)
303 | nokogiri (~> 1.8)
304 | zeitwerk (2.3.0)
305 |
306 | PLATFORMS
307 | ruby
308 |
309 | DEPENDENCIES
310 | activestorage
311 | bootsnap
312 | bootstrap-sass
313 | bullet
314 | byebug
315 | capybara
316 | cloudinary
317 | devise
318 | factory_bot_rails
319 | guard
320 | guard-minitest
321 | jbuilder
322 | jquery-rails
323 | listen
324 | minitest
325 | minitest-reporters
326 | pg
327 | puma
328 | rails
329 | rails-controller-testing
330 | rspec-rails
331 | sass-rails
332 | selenium-webdriver
333 | spring
334 | spring-watcher-listen
335 | sqlite3
336 | turbolinks
337 | tzinfo-data
338 | web-console
339 | webdrivers
340 | webpacker
341 |
342 | RUBY VERSION
343 | ruby 2.6.5p114
344 |
345 | BUNDLED WITH
346 | 2.1.4
347 |
--------------------------------------------------------------------------------
/css/user_profile.css.map:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "mappings": "AAMA,AAAA,UAAU,CAAC;EACT,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;CACvB;;AAED,AAAA,MAAM,CAAC;EACL,SAAS,EAAE,OAAO;EAClB,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,MAAM;EAChB,KAAK,EAXC,IAAI;EAYV,MAAM,EAAE,KAAS;EACjB,KAAK,EAAE,CAAC;CA0FT;;AAhGD,AAQE,MARI,GAQF,MAAM,CAAC;EACP,KAAK,EAhBD,IAAI;EAiBR,MAAM,EAjBF,IAAI;EAkBR,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,QAAQ,EAAE,QAAQ;CACnB;;AAdH,AAsBM,MAtBA,GAgBF,MAAM,AAAA,WAAW,GAGf,IAAI,CAGJ,KAAK,CAAA,AAAA,IAAC,CAAK,MAAM,AAAX,EAAa;EACjB,OAAO,EAAE,IAAI;EACb,MAAM,EA/BN,IAAI;CAgCL;;AAzBP,AA2BM,MA3BA,GAgBF,MAAM,AAAA,WAAW,GAGf,IAAI,CAQJ,SAAS,CAAC;EACR,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,WAAW;EAClB,OAAO,EAAE,CAAC;EACV,KAAK,EAtCL,IAAI;EAuCJ,MAAM,EAvCN,IAAI;EAwCJ,gBAAgB,EAAE,WAAW;CAiB9B;;AAlDP,AAmCQ,MAnCF,GAgBF,MAAM,AAAA,WAAW,GAGf,IAAI,CAQJ,SAAS,AAQ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BAAmB,EAAE,+CACM;IAC3B,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,UAAU;GAC7B;EAED,AAAA,MAAM,CAAC;IACL,OAAO,EAAE,IAAI;IACb,qBAAqB,EAAE,WAAW;IAClC,kBAAkB,EAAE,KAAW,CAAC,kBAAgC;IAChE,mBAAmB,EAAE,mDACM;IAC3B,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,UAAU;GAC7B;IAEC,AAAF,KAAO,CAAA,AAAA,IAAC,CAAD,IAAC,AAAA,EAAW;IACjB,MAAM,EAAE,KAAK,CAAC,GAAQ,CAAC,0BAAkB;IACzC,aAAa,EAzgBT,GAAG;IA0gBP,MAAM,EAAE,GAAG;GACZ;EAED,AAAA,QAAQ,CAAC;IACP,SAAS,EAAE,OAAO;GACnB;EAED,AAAA,QAAQ,CAAC;IACP,SAAS,EAAE,OAAO;GACnB;EAED,AAAA,MAAM,CAAC;IACL,SAAS,EAAE,KAAK;GACjB",
4 | "sources": [
5 | "../app/assets/stylesheets/user_profile.scss"
6 | ],
7 | "names": [],
8 | "file": "user_profile.css"
9 | }
--------------------------------------------------------------------------------
/app/assets/images/upload.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
22 |
23 |
25 | image/svg+xml
26 |
28 |
29 |
30 |
31 |
32 |
34 |
54 |
156 |
161 |
162 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/user_profile.scss:
--------------------------------------------------------------------------------
1 | $pad-width: 768px;
2 | $buttons-color: rgba(122, 122, 122, 0.685);
3 | $space: 5px;
4 | $font-size: 1em;
5 | $p-100: 100%;
6 | $header-color: rgba(80, 164, 226, 1);
7 |
8 | .user-show {
9 | display: flex;
10 | flex-direction: column;
11 | }
12 |
13 | .cover {
14 | grid-area: wrapper;
15 | display: flex;
16 | overflow: hidden;
17 | width: $p-100;
18 | height: $space*59;
19 | order: 1;
20 |
21 | &>figure {
22 | width: $p-100;
23 | height: $p-100;
24 | margin: 0;
25 | padding: 0;
26 | position: relative;
27 | }
28 |
29 | &>figure.self-cover {
30 |
31 |
32 | &>form {
33 |
34 | //display: none;
35 | input[type="file"] {
36 | display: none;
37 | height: $p-100;
38 | }
39 |
40 | .uploader {
41 | position: absolute;
42 | color: transparent;
43 | z-index: 2;
44 | width: $p-100;
45 | height: $p-100;
46 | background-color: transparent;
47 |
48 | &:hover::before {
49 | content: "";
50 | position: absolute;
51 | top: 0;
52 | left: 0;
53 | width: $p-100;
54 | height: $p-100;
55 | background: image-url('upload.svg');
56 | background-position: center;
57 | background-repeat: no-repeat;
58 | background-size: cover;
59 | opacity: 0.5;
60 | z-index: 1;
61 | cursor: pointer;
62 | }
63 | }
64 | }
65 |
66 | &>a {
67 | width: $p-100;
68 | height: $p-100;
69 | position: relative;
70 | display: block;
71 |
72 | &>img {
73 | width: $p-100;
74 | height: $p-100;
75 | ;
76 | position: absolute;
77 | }
78 | }
79 | }
80 |
81 | &>figure.viewer-cover {
82 | width: $p-100;
83 | height: $p-100;
84 | position: relative;
85 | display: block;
86 |
87 | &>img {
88 | width: $p-100;
89 | height: $p-100;
90 | ;
91 | position: absolute;
92 | }
93 | }
94 |
95 | figure div {
96 | content: "";
97 | position: absolute;
98 | top: 0;
99 | left: 0;
100 | width: $p-100;
101 | height: $p-100;
102 | background: image-url('upload.svg');
103 | background-position: center;
104 | background-repeat: no-repeat;
105 | background-size: cover;
106 | opacity: 0.5;
107 | z-index: 1;
108 | }
109 | }
110 |
111 | .current-follow {
112 | border-bottom: $space/5 solid $buttons-color*1.5;
113 | margin: $space*2;
114 | padding: $space*2;
115 | height: $space*8;
116 | overflow: hidden;
117 |
118 | p {
119 | margin: 0;
120 | text-transform: uppercase;
121 | color: $buttons-color*.5;
122 | }
123 | }
124 |
125 | .profile {
126 | order: 2;
127 | border-left: solid $space/3 $buttons-color*1.5;
128 | display: flex;
129 | flex-direction: column;
130 |
131 | .profile-data {
132 | .profile-btns {
133 | height: $space*35;
134 | justify-content: center;
135 | display: flex;
136 | flex-wrap: wrap-reverse;
137 |
138 | &>div {
139 | display: flex;
140 | justify-content: center;
141 | height: $space*28;
142 | align-self: baseline;
143 |
144 | .follow-btn {
145 | display: flex;
146 | justify-content: center;
147 | align-self: center;
148 | margin: $space*2;
149 | border: solid $buttons-color $space/2;
150 | border-radius: $p-100*2;
151 | width: $space*10;
152 | height: $space*10;
153 |
154 | i {
155 | align-self: center;
156 | }
157 |
158 | form {
159 | display: flex;
160 |
161 | button {
162 | align-self: center;
163 | background-color: transparent;
164 | border: none;
165 | }
166 | }
167 |
168 | path {
169 | fill: $buttons-color;
170 | }
171 | }
172 |
173 | .profile-img {
174 | grid-area: wrapper;
175 | display: flex;
176 | overflow: hidden;
177 | justify-content: center;
178 |
179 | &>figure {
180 | align-self: center;
181 | width: $space*28;
182 | height: $space*28;
183 | border: solid $space/5 transparent;
184 | border-radius: $p-100/2;
185 | margin: 0;
186 | padding: 0;
187 | position: relative;
188 | overflow: hidden;
189 | }
190 |
191 | &>figure.self-profile {
192 |
193 | &>form {
194 |
195 | input[type="file"] {
196 | display: none;
197 | height: $p-100;
198 | }
199 |
200 | .uploader {
201 | position: absolute;
202 | color: transparent;
203 | z-index: 2;
204 | width: $p-100;
205 | height: $p-100;
206 | background-color: transparent;
207 |
208 | &:hover::before {
209 | content: "";
210 | position: absolute;
211 | top: 0;
212 | left: 0;
213 | width: $p-100;
214 | height: $p-100;
215 | background: image-url('upload.svg');
216 | background-position: center;
217 | background-repeat: no-repeat;
218 | background-size: cover;
219 | opacity: 0.5;
220 | z-index: 1;
221 | cursor: pointer;
222 | }
223 | }
224 | }
225 |
226 | &>a {
227 | width: $p-100;
228 | height: $p-100;
229 | position: relative;
230 | display: block;
231 |
232 | &>img {
233 | width: $p-100;
234 | height: $p-100;
235 | position: absolute;
236 | }
237 | }
238 | }
239 |
240 | &>figure.viewer-profile {
241 |
242 | &>img {
243 | width: $p-100;
244 | height: $p-100;
245 | }
246 |
247 | }
248 |
249 | figure div {
250 | content: "";
251 | position: absolute;
252 | top: 0;
253 | left: 0;
254 | height: $p-100;
255 | width: $p-100;
256 | background: image-url('upload.svg');
257 | background-position: center;
258 | background-repeat: no-repeat;
259 | background-color: white;
260 | opacity: 0.5;
261 | z-index: 1;
262 | }
263 | }
264 | }
265 | }
266 |
267 | .profile-info {
268 | text-align: center;
269 | padding: $space;
270 |
271 | &>p {
272 | margin-bottom: 0;
273 | }
274 |
275 | &>span {
276 | color: $buttons-color*.5;
277 | }
278 | }
279 | }
280 |
281 | .followers-data {
282 | display: flex;
283 | flex-direction: row;
284 |
285 | &>div {
286 | width: $p-100/3;
287 | display: flex;
288 | justify-content: center;
289 | padding: $space*1.5;
290 | border: solid $buttons-color*1.8 $space/5;
291 | flex-direction: column;
292 | text-align: center;
293 |
294 | p {
295 | margin: 0;
296 | font-weight: bold;
297 | text-transform: uppercase;
298 | }
299 |
300 | span {
301 | color: $buttons-color*1;
302 | }
303 | }
304 | }
305 | }
306 |
307 | .followers {
308 | display: flex;
309 |
310 | figure {
311 | justify-self: center;
312 | position: relative;
313 | border: solid $space/5 transparent;
314 | margin: $space*2;
315 | border-radius: $p-100/2;
316 | height: $space*15;
317 | width: $space*15;
318 | overflow: hidden;
319 |
320 | img {
321 | width: 100%;
322 | height: 100%;
323 | }
324 | }
325 |
326 | .profile-info {
327 | align-self: center;
328 | flex: 0 0 $space*30;
329 |
330 | p {
331 | margin: 0;
332 | font-weight: bold;
333 | text-transform: uppercase;
334 | }
335 |
336 | span {
337 | color: $buttons-color*1;
338 | }
339 | }
340 |
341 | .profile-btns {
342 | display: flex;
343 | justify-content: center;
344 | align-self: center;
345 | margin: $space*2;
346 | border: solid $buttons-color $space/2;
347 | border-radius: $p-100*2;
348 | width: $space*5;
349 | height: $space*5;
350 |
351 | i {
352 | align-self: center;
353 | }
354 |
355 | form {
356 | display: flex;
357 |
358 | button {
359 | align-self: center;
360 | background-color: transparent;
361 | border: none;
362 | }
363 | }
364 |
365 | path {
366 | fill: $buttons-color;
367 | }
368 | }
369 | }
370 |
371 | .user-menu {
372 | &>nav {
373 | display: flex;
374 | justify-content: flex-start;
375 | flex-direction: row;
376 | overflow: hidden;
377 | height: $space*10.4;
378 | align-content: center;
379 | border-bottom: $space/5 solid $buttons-color*1.5;
380 |
381 | a {
382 | align-self: center;
383 | padding: $space*3 $space*4;
384 | text-transform: capitalize;
385 | text-decoration: none;
386 | color: $buttons-color*.5;
387 | }
388 |
389 | .active {
390 | border-bottom: $space/3 solid blue;
391 | }
392 | }
393 | }
394 |
395 | .user-menu-info {
396 | &>div {
397 | &>.users {
398 | margin: $space*6;
399 | padding-left: $space*3;
400 | background-color: white;
401 | border: solid $space/5 $buttons-color*1.5;
402 | border-radius: $space;
403 |
404 | .profile-img {
405 | order: 2;
406 | padding-left: 0;
407 | }
408 |
409 | .profile-info {
410 | order: 3;
411 | }
412 |
413 | .profile-btns {
414 | order: 1;
415 | }
416 |
417 | form {
418 | margin: 0;
419 | border: none;
420 | background: transparent;
421 |
422 | button {
423 | padding-top: $space/2;
424 | }
425 | }
426 | }
427 | }
428 |
429 | form {
430 | display: flex;
431 | flex-direction: column;
432 | background-color: white;
433 | margin: $space*6;
434 | border: solid $space/5 $buttons-color*1.5;
435 | border-radius: $space;
436 |
437 | &>div {
438 | display: flex;
439 | flex-direction: column;
440 | padding: $space*5;
441 |
442 | &>input[type=text] {
443 | border: solid $space/5 $buttons-color*1.5;
444 | border-radius: $space;
445 | height: $space*8;
446 | padding-left: $space*2;
447 | font-size: $p-100*1.2;
448 | }
449 |
450 | label {
451 | text-transform: uppercase;
452 | padding: $space 0;
453 | color: $buttons-color;
454 | }
455 | }
456 | }
457 |
458 | .tweets {
459 | margin: $space*3 $space*6;
460 | background-color: white;
461 | border: solid $space/5 $buttons-color*1.5;
462 | border-radius: $space;
463 | overflow: hidden;
464 |
465 | h4 {
466 | margin: $space*5;
467 | padding-bottom: $space*5;
468 | border-bottom: solid $space/5 $buttons-color*1.5;
469 |
470 | &>:first-child {
471 | color: blue;
472 | }
473 | }
474 | }
475 |
476 | .profile-img {
477 | padding: 0 $space*5;
478 | display: flex;
479 | flex-wrap: nowrap;
480 |
481 | figure {
482 | border-radius: 0;
483 | }
484 | }
485 |
486 | .profile-info {
487 | width: $p-100;
488 | flex: auto;
489 |
490 | p {
491 | text-transform: capitalize;
492 | width: $p-100;
493 | }
494 |
495 | span {
496 | width: $p-100;
497 | }
498 | }
499 | }
500 |
501 | .new_culture {
502 | .actions {
503 | input {
504 | float: right;
505 | margin-top: $space*4;
506 | padding: $space*1.5;
507 | border-radius: $space;
508 | background-color: $header-color;
509 | color: white;
510 | }
511 | }
512 | }
513 |
514 |
515 | @media only screen and (min-width: $pad-width) {
516 | .user-show {
517 | display: grid;
518 | grid-template-columns: 2fr 1fr 1fr;
519 | grid-template-rows: $space*58.8 calc(#{$p-100} - #{$space*58.8});
520 | grid-template-areas: 'cover cover profile'
521 | 'content content profile';
522 | min-height: 100vh;
523 | background-color: whitesmoke;
524 | }
525 |
526 | .index {
527 | display: grid;
528 | grid-template-columns: 2fr 1fr 1fr;
529 | grid-template-rows: $space*58.8 calc(#{$p-100} - #{$space*58.8});
530 | grid-template-areas: 'content content profile'
531 | 'content content profile';
532 | min-height: 100vh;
533 | background-color: whitesmoke;
534 | }
535 |
536 | &>input[type=text] {
537 | border: solid $space/5 $buttons-color*1.5;
538 | border-radius: $space;
539 | height: 2em;
540 | }
541 |
542 | .profile {
543 | grid-area: profile;
544 | }
545 |
546 | .content {
547 | grid-area: content;
548 | }
549 |
550 | .cover {
551 | grid-area: cover;
552 | }
553 | }
--------------------------------------------------------------------------------
/config/initializers/devise.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Use this hook to configure devise mailer, warden hooks and so forth.
4 | # Many of these configuration options can be set straight in your model.
5 | Devise.setup do |config|
6 | # The secret key used by Devise. Devise uses this key to generate
7 | # random tokens. Changing this key will render invalid all existing
8 | # confirmation, reset password and unlock tokens in the database.
9 | # Devise will use the `secret_key_base` as its `secret_key`
10 | # by default. You can change it below and use your own secret key.
11 | # config.secret_key = 'aebb60e59610444c5e25d4c42057835a25ce26a0cd38fb960c304d57c61916e97f69c50de763badf2b18f8ea289e36672d32deecfe768ffb1382e52a426a5675'
12 |
13 | # ==> Controller configuration
14 | # Configure the parent class to the devise controllers.
15 | # config.parent_controller = 'DeviseController'
16 |
17 | # ==> Mailer Configuration
18 | # Configure the e-mail address which will be shown in Devise::Mailer,
19 | # note that it will be overwritten if you use your own mailer class
20 | # with default "from" parameter.
21 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
22 |
23 | # Configure the class responsible to send e-mails.
24 | # config.mailer = 'Devise::Mailer'
25 |
26 | # Configure the parent class responsible to send e-mails.
27 | # config.parent_mailer = 'ActionMailer::Base'
28 |
29 | # ==> ORM configuration
30 | # Load and configure the ORM. Supports :active_record (default) and
31 | # :mongoid (bson_ext recommended) by default. Other ORMs may be
32 | # available as additional gems.
33 | require 'devise/orm/active_record'
34 |
35 | # ==> Configuration for any authentication mechanism
36 | # Configure which keys are used when authenticating a user. The default is
37 | # just :email. You can configure it to use [:username, :subdomain], so for
38 | # authenticating a user, both parameters are required. Remember that those
39 | # parameters are used only when authenticating and not when retrieving from
40 | # session. If you need permissions, you should implement that in a before filter.
41 | # You can also supply a hash where the value is a boolean determining whether
42 | # or not authentication should be aborted when the value is not present.
43 | # config.authentication_keys = [:email]
44 |
45 | # Configure parameters from the request object used for authentication. Each entry
46 | # given should be a request method and it will automatically be passed to the
47 | # find_for_authentication method and considered in your model lookup. For instance,
48 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
49 | # The same considerations mentioned for authentication_keys also apply to request_keys.
50 | # config.request_keys = []
51 | config.authentication_keys = [ :login ]
52 | # Configure which authentication keys should be case-insensitive.
53 | # These keys will be downcased upon creating or modifying a user and when used
54 | # to authenticate or find a user. Default is :email.
55 | config.case_insensitive_keys = [:email]
56 |
57 | # Configure which authentication keys should have whitespace stripped.
58 | # These keys will have whitespace before and after removed upon creating or
59 | # modifying a user and when used to authenticate or find a user. Default is :email.
60 | config.strip_whitespace_keys = [:email]
61 |
62 | # Tell if authentication through request.params is enabled. True by default.
63 | # It can be set to an array that will enable params authentication only for the
64 | # given strategies, for example, `config.params_authenticatable = [:database]` will
65 | # enable it only for database (email + password) authentication.
66 | # config.params_authenticatable = true
67 |
68 | # Tell if authentication through HTTP Auth is enabled. False by default.
69 | # It can be set to an array that will enable http authentication only for the
70 | # given strategies, for example, `config.http_authenticatable = [:database]` will
71 | # enable it only for database authentication. The supported strategies are:
72 | # :database = Support basic authentication with authentication key + password
73 | # config.http_authenticatable = false
74 |
75 | # If 401 status code should be returned for AJAX requests. True by default.
76 | # config.http_authenticatable_on_xhr = true
77 |
78 | # The realm used in Http Basic Authentication. 'Application' by default.
79 | # config.http_authentication_realm = 'Application'
80 |
81 | # It will change confirmation, password recovery and other workflows
82 | # to behave the same regardless if the e-mail provided was right or wrong.
83 | # Does not affect registerable.
84 | # config.paranoid = true
85 |
86 | # By default Devise will store the user in session. You can skip storage for
87 | # particular strategies by setting this option.
88 | # Notice that if you are skipping storage for all authentication paths, you
89 | # may want to disable generating routes to Devise's sessions controller by
90 | # passing skip: :sessions to `devise_for` in your config/routes.rb
91 | config.skip_session_storage = [:http_auth]
92 |
93 | # By default, Devise cleans up the CSRF token on authentication to
94 | # avoid CSRF token fixation attacks. This means that, when using AJAX
95 | # requests for sign in and sign up, you need to get a new CSRF token
96 | # from the server. You can disable this option at your own risk.
97 | # config.clean_up_csrf_token_on_authentication = true
98 |
99 | # When false, Devise will not attempt to reload routes on eager load.
100 | # This can reduce the time taken to boot the app but if your application
101 | # requires the Devise mappings to be loaded during boot time the application
102 | # won't boot properly.
103 | # config.reload_routes = true
104 |
105 | # ==> Configuration for :database_authenticatable
106 | # For bcrypt, this is the cost for hashing the password and defaults to 11. If
107 | # using other algorithms, it sets how many times you want the password to be hashed.
108 | #
109 | # Limiting the stretches to just one in testing will increase the performance of
110 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
111 | # a value less than 10 in other environments. Note that, for bcrypt (the default
112 | # algorithm), the cost increases exponentially with the number of stretches (e.g.
113 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
114 | config.stretches = Rails.env.test? ? 1 : 11
115 |
116 | # Set up a pepper to generate the hashed password.
117 | # config.pepper = '57e7111059369edaef0fb4b9f2410e06f0b0698d329759d0cdf6439b9e77b0220d6cbc887631340a255f977604c9203eb8bb688e05a17e0fa2cd22508cd128e3'
118 |
119 | # Send a notification to the original email when the user's email is changed.
120 | # config.send_email_changed_notification = false
121 |
122 | # Send a notification email when the user's password is changed.
123 | # config.send_password_change_notification = false
124 |
125 | # ==> Configuration for :confirmable
126 | # A period that the user is allowed to access the website even without
127 | # confirming their account. For instance, if set to 2.days, the user will be
128 | # able to access the website for two days without confirming their account,
129 | # access will be blocked just in the third day.
130 | # You can also set it to nil, which will allow the user to access the website
131 | # without confirming their account.
132 | # Default is 0.days, meaning the user cannot access the website without
133 | # confirming their account.
134 | # config.allow_unconfirmed_access_for = 2.days
135 |
136 | # A period that the user is allowed to confirm their account before their
137 | # token becomes invalid. For example, if set to 3.days, the user can confirm
138 | # their account within 3 days after the mail was sent, but on the fourth day
139 | # their account can't be confirmed with the token any more.
140 | # Default is nil, meaning there is no restriction on how long a user can take
141 | # before confirming their account.
142 | # config.confirm_within = 3.days
143 |
144 | # If true, requires any email changes to be confirmed (exactly the same way as
145 | # initial account confirmation) to be applied. Requires additional unconfirmed_email
146 | # db field (see migrations). Until confirmed, new email is stored in
147 | # unconfirmed_email column, and copied to email column on successful confirmation.
148 | config.reconfirmable = true
149 |
150 | # Defines which key will be used when confirming an account
151 | # config.confirmation_keys = [:email]
152 | config.reset_password_keys = [ :username ]
153 | config.confirmation_keys = [ :username ]
154 | # ==> Configuration for :rememberable
155 | # The time the user will be remembered without asking for credentials again.
156 | # config.remember_for = 2.weeks
157 |
158 | # Invalidates all the remember me tokens when the user signs out.
159 | config.expire_all_remember_me_on_sign_out = true
160 |
161 | # If true, extends the user's remember period when remembered via cookie.
162 | # config.extend_remember_period = false
163 |
164 | # Options to be passed to the created cookie. For instance, you can set
165 | # secure: true in order to force SSL only cookies.
166 | # config.rememberable_options = {}
167 |
168 | # ==> Configuration for :validatable
169 | # Range for password length.
170 | config.password_length = 6..128
171 |
172 | # Email regex used to validate email formats. It simply asserts that
173 | # one (and only one) @ exists in the given string. This is mainly
174 | # to give user feedback and not to assert the e-mail validity.
175 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
176 |
177 | # ==> Configuration for :timeoutable
178 | # The time you want to timeout the user session without activity. After this
179 | # time the user will be asked for credentials again. Default is 30 minutes.
180 | # config.timeout_in = 30.minutes
181 |
182 | # ==> Configuration for :lockable
183 | # Defines which strategy will be used to lock an account.
184 | # :failed_attempts = Locks an account after a number of failed attempts to sign in.
185 | # :none = No lock strategy. You should handle locking by yourself.
186 | # config.lock_strategy = :failed_attempts
187 |
188 | # Defines which key will be used when locking and unlocking an account
189 | # config.unlock_keys = [:email]
190 |
191 | # Defines which strategy will be used to unlock an account.
192 | # :email = Sends an unlock link to the user email
193 | # :time = Re-enables login after a certain amount of time (see :unlock_in below)
194 | # :both = Enables both strategies
195 | # :none = No unlock strategy. You should handle unlocking by yourself.
196 | # config.unlock_strategy = :both
197 |
198 | # Number of authentication tries before locking an account if lock_strategy
199 | # is failed attempts.
200 | # config.maximum_attempts = 20
201 |
202 | # Time interval to unlock the account if :time is enabled as unlock_strategy.
203 | # config.unlock_in = 1.hour
204 |
205 | # Warn on the last attempt before the account is locked.
206 | # config.last_attempt_warning = true
207 |
208 | # ==> Configuration for :recoverable
209 | #
210 | # Defines which key will be used when recovering the password for an account
211 | # config.reset_password_keys = [:email]
212 |
213 | # Time interval you can reset your password with a reset password key.
214 | # Don't put a too small interval or your users won't have the time to
215 | # change their passwords.
216 | config.reset_password_within = 6.hours
217 |
218 | # When set to false, does not sign a user in automatically after their password is
219 | # reset. Defaults to true, so a user is signed in automatically after a reset.
220 | # config.sign_in_after_reset_password = true
221 |
222 | # ==> Configuration for :encryptable
223 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
224 | # You can use :sha1, :sha512 or algorithms from others authentication tools as
225 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
226 | # for default behavior) and :restful_authentication_sha1 (then you should set
227 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
228 | #
229 | # Require the `devise-encryptable` gem when using anything other than bcrypt
230 | # config.encryptor = :sha512
231 |
232 | # ==> Scopes configuration
233 | # Turn scoped views on. Before rendering "sessions/new", it will first check for
234 | # "users/sessions/new". It's turned off by default because it's slower if you
235 | # are using only default views.
236 | # config.scoped_views = false
237 |
238 | # Configure the default scope given to Warden. By default it's the first
239 | # devise role declared in your routes (usually :user).
240 | # config.default_scope = :user
241 |
242 | # Set this configuration to false if you want /users/sign_out to sign out
243 | # only the current scope. By default, Devise signs out all scopes.
244 | # config.sign_out_all_scopes = true
245 |
246 | # ==> Navigation configuration
247 | # Lists the formats that should be treated as navigational. Formats like
248 | # :html, should redirect to the sign in page when the user does not have
249 | # access, but formats like :xml or :json, should return 401.
250 | #
251 | # If you have any extra navigational formats, like :iphone or :mobile, you
252 | # should add them to the navigational formats lists.
253 | #
254 | # The "*/*" below is required to match Internet Explorer requests.
255 | # config.navigational_formats = ['*/*', :html]
256 |
257 | # The default HTTP method used to sign out a resource. Default is :delete.
258 | config.sign_out_via = :delete
259 |
260 | # ==> OmniAuth
261 | # Add a new OmniAuth provider. Check the wiki for more information on setting
262 | # up on your models and hooks.
263 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
264 |
265 | # ==> Warden configuration
266 | # If you want to use other strategies, that are not supported by Devise, or
267 | # change the failure app, you can configure them inside the config.warden block.
268 | #
269 | # config.warden do |manager|
270 | # manager.intercept_401 = false
271 | # manager.default_strategies(scope: :user).unshift :some_external_strategy
272 | # end
273 |
274 | # ==> Mountable engine configurations
275 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine
276 | # is mountable, there are some extra configurations to be taken into account.
277 | # The following options are available, assuming the engine is mounted as:
278 | #
279 | # mount MyEngine, at: '/my_engine'
280 | #
281 | # The router that invoked `devise_for`, in the example above, would be:
282 | # config.router_name = :my_engine
283 | #
284 | # When using OmniAuth, Devise cannot automatically set OmniAuth path,
285 | # so you need to do it manually. For the users scope, it would be:
286 | # config.omniauth_path_prefix = '/my_engine/users/auth'
287 |
288 | # ==> Turbolinks configuration
289 | # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
290 | #
291 | # ActiveSupport.on_load(:devise_failure_app) do
292 | # include Turbolinks::Controller
293 | # end
294 |
295 | # ==> Configuration for :registerable
296 |
297 | # When set to false, does not sign a user in automatically after their password is
298 | # changed. Defaults to true, so a user is signed in automatically after changing a password.
299 | # config.sign_in_after_change_password = true
300 | end
301 |
--------------------------------------------------------------------------------