diff --git a/app/assets/images/placeholder-user.jpg b/app/assets/images/placeholder-user.jpg new file mode 100644 index 00000000..a1ec3424 Binary files /dev/null and b/app/assets/images/placeholder-user.jpg differ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 0ba8de4b..a212757b 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -68,6 +68,19 @@ html, body { background-color: $rule-color; } +.thumbnail { + height: 60%; + width: auto; +} + +.client-icon { + height: 100px; + width: 100px; + display: flex; + align-items: center; + justify-content: center; +} + .container-fluid { height: 100%; } diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c33a1c9a..46e3b05b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,9 +17,14 @@ class UsersController < ApplicationController end end + # GET /settings + def settings + redirect_to root_path unless current_user + end + private def user_params params.require(:user).permit(:name, :email, :username, :password, :password_confirmation) end -end \ No newline at end of file +end diff --git a/app/models/user.rb b/app/models/user.rb index 585e8a15..520c43be 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,7 +26,7 @@ class User < ApplicationRecord user.name = send("#{auth['provider']}_name", auth) user.username = send("#{auth['provider']}_username", auth) user.email = send("#{auth['provider']}_email", auth) - + user.image = send("#{auth['provider']}_image", auth) user.save! user end @@ -51,6 +51,10 @@ class User < ApplicationRecord auth['info']['email'] end + def twitter_image(auth) + auth['info']['image'] + end + def google_name(auth) auth['info']['name'] end @@ -62,6 +66,19 @@ class User < ApplicationRecord def google_email(auth) auth['info']['email'] end + + def google_image(auth) + auth['info']['picture'] + end + end + + def subtitle + case provider + when "greenlight", "google", "twitter" + "User" + else + "Unknown" + end end private diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index a4644d5f..7ed62eb0 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -9,7 +9,7 @@ <%= render "shared/features" %> -<%= render "shared/video_modal" %> +<%= render "shared/modals/video_modal" %>