done page
This commit is contained in:
parent
6dee298b44
commit
25c6c3aeb5
3
Gemfile
3
Gemfile
|
@ -16,6 +16,8 @@ gem 'sass-rails'
|
||||||
gem 'simple_form'
|
gem 'simple_form'
|
||||||
gem 'uglifier'
|
gem 'uglifier'
|
||||||
gem 'webpacker'
|
gem 'webpacker'
|
||||||
|
gem 'cloudinary'
|
||||||
|
gem 'carrierwave', '~> 1.2'
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'web-console', '>= 3.3.0'
|
gem 'web-console', '>= 3.3.0'
|
||||||
|
@ -28,5 +30,4 @@ group :development, :test do
|
||||||
gem 'spring'
|
gem 'spring'
|
||||||
gem 'spring-watcher-listen', '~> 2.0.0'
|
gem 'spring-watcher-listen', '~> 2.0.0'
|
||||||
gem 'dotenv-rails'
|
gem 'dotenv-rails'
|
||||||
gem 'dotenv-rails', groups: [:development, :test]
|
|
||||||
end
|
end
|
||||||
|
|
25
Gemfile.lock
25
Gemfile.lock
|
@ -45,6 +45,7 @@ GEM
|
||||||
arel (9.0.0)
|
arel (9.0.0)
|
||||||
autoprefixer-rails (9.1.3)
|
autoprefixer-rails (9.1.3)
|
||||||
execjs
|
execjs
|
||||||
|
aws_cf_signer (0.1.3)
|
||||||
bcrypt (3.1.12)
|
bcrypt (3.1.12)
|
||||||
bindex (0.5.0)
|
bindex (0.5.0)
|
||||||
bootsnap (1.3.1)
|
bootsnap (1.3.1)
|
||||||
|
@ -54,6 +55,13 @@ GEM
|
||||||
sass (>= 3.3.4)
|
sass (>= 3.3.4)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
byebug (10.0.2)
|
byebug (10.0.2)
|
||||||
|
carrierwave (1.2.3)
|
||||||
|
activemodel (>= 4.0.0)
|
||||||
|
activesupport (>= 4.0.0)
|
||||||
|
mime-types (>= 1.16)
|
||||||
|
cloudinary (1.9.1)
|
||||||
|
aws_cf_signer
|
||||||
|
rest-client
|
||||||
coderay (1.1.2)
|
coderay (1.1.2)
|
||||||
concurrent-ruby (1.0.5)
|
concurrent-ruby (1.0.5)
|
||||||
crass (1.0.4)
|
crass (1.0.4)
|
||||||
|
@ -63,6 +71,8 @@ GEM
|
||||||
railties (>= 4.1.0, < 6.0)
|
railties (>= 4.1.0, < 6.0)
|
||||||
responders
|
responders
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
|
domain_name (0.5.20180417)
|
||||||
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
dotenv (2.5.0)
|
dotenv (2.5.0)
|
||||||
dotenv-rails (2.5.0)
|
dotenv-rails (2.5.0)
|
||||||
dotenv (= 2.5.0)
|
dotenv (= 2.5.0)
|
||||||
|
@ -74,6 +84,8 @@ GEM
|
||||||
sassc (>= 1.11)
|
sassc (>= 1.11)
|
||||||
globalid (0.4.1)
|
globalid (0.4.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
|
http-cookie (1.0.3)
|
||||||
|
domain_name (~> 0.5)
|
||||||
i18n (1.1.0)
|
i18n (1.1.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jbuilder (2.7.0)
|
jbuilder (2.7.0)
|
||||||
|
@ -90,12 +102,16 @@ GEM
|
||||||
marcel (0.3.2)
|
marcel (0.3.2)
|
||||||
mimemagic (~> 0.3.2)
|
mimemagic (~> 0.3.2)
|
||||||
method_source (0.9.0)
|
method_source (0.9.0)
|
||||||
|
mime-types (3.2.2)
|
||||||
|
mime-types-data (~> 3.2015)
|
||||||
|
mime-types-data (3.2018.0812)
|
||||||
mimemagic (0.3.2)
|
mimemagic (0.3.2)
|
||||||
mini_mime (1.0.1)
|
mini_mime (1.0.1)
|
||||||
mini_portile2 (2.3.0)
|
mini_portile2 (2.3.0)
|
||||||
minitest (5.11.3)
|
minitest (5.11.3)
|
||||||
msgpack (1.2.4)
|
msgpack (1.2.4)
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
|
netrc (0.11.0)
|
||||||
nio4r (2.3.1)
|
nio4r (2.3.1)
|
||||||
nokogiri (1.8.4)
|
nokogiri (1.8.4)
|
||||||
mini_portile2 (~> 2.3.0)
|
mini_portile2 (~> 2.3.0)
|
||||||
|
@ -147,6 +163,10 @@ GEM
|
||||||
responders (2.4.0)
|
responders (2.4.0)
|
||||||
actionpack (>= 4.2.0, < 5.3)
|
actionpack (>= 4.2.0, < 5.3)
|
||||||
railties (>= 4.2.0, < 5.3)
|
railties (>= 4.2.0, < 5.3)
|
||||||
|
rest-client (2.0.2)
|
||||||
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
|
mime-types (>= 1.16, < 4.0)
|
||||||
|
netrc (~> 0.8)
|
||||||
sass (3.5.7)
|
sass (3.5.7)
|
||||||
sass-listen (~> 4.0.0)
|
sass-listen (~> 4.0.0)
|
||||||
sass-listen (4.0.0)
|
sass-listen (4.0.0)
|
||||||
|
@ -183,6 +203,9 @@ GEM
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.1.18)
|
uglifier (4.1.18)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
|
unf (0.1.4)
|
||||||
|
unf_ext
|
||||||
|
unf_ext (0.0.7.5)
|
||||||
warden (1.2.7)
|
warden (1.2.7)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
web-console (3.6.2)
|
web-console (3.6.2)
|
||||||
|
@ -205,6 +228,8 @@ DEPENDENCIES
|
||||||
autoprefixer-rails
|
autoprefixer-rails
|
||||||
bootsnap
|
bootsnap
|
||||||
bootstrap-sass (~> 3.3)
|
bootstrap-sass (~> 3.3)
|
||||||
|
carrierwave (~> 1.2)
|
||||||
|
cloudinary
|
||||||
devise
|
devise
|
||||||
dotenv-rails
|
dotenv-rails
|
||||||
font-awesome-sass (~> 5.0.9)
|
font-awesome-sass (~> 5.0.9)
|
||||||
|
|
|
@ -7,6 +7,8 @@ class User < ApplicationRecord
|
||||||
|
|
||||||
has_many :connections
|
has_many :connections
|
||||||
|
|
||||||
|
mount_uploader :photo, PhotoUploader
|
||||||
|
|
||||||
def contacts
|
def contacts
|
||||||
self.connections.map do |connection|
|
self.connections.map do |connection|
|
||||||
connection.contact
|
connection.contact
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
class PhotoUploader < CarrierWave::Uploader::Base
|
||||||
|
include Cloudinary::CarrierWave
|
||||||
|
end
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
<div class="right-align">
|
<div class="right-align">
|
||||||
<div class="links">
|
<div class="links">
|
||||||
<div class="active"><%= link_to "Dashboard", "#" %></div>
|
<div class="active"><%= link_to "Dashboard", contacts_path %></div>
|
||||||
<div><%= link_to "Settings", "#" %></div>
|
<div><%= link_to "Settings", "#" %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="profile">
|
<div class="profile">
|
||||||
|
@ -14,10 +14,10 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<div data-toggle="dropdown">
|
<div data-toggle="dropdown">
|
||||||
<% if current_user&.photo.nil? %>
|
<% if current_user.photo.url.nil? %>
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png" class="avatar dropdown-toggle img-circle">
|
<img src="https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png" class="avatar dropdown-toggle img-circle">
|
||||||
<% else %>
|
<% else %>
|
||||||
<%#= cl_image_tag current_user.photo, class: "avatar dropdown-toggle img-circle"%>
|
<%= cl_image_tag current_user.photo, class: "avatar dropdown-toggle img-circle"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<ul class="dropdown-menu dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-right">
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<%= t.input :email %>
|
<%= t.input :email %>
|
||||||
<%= t.input :first_name %>
|
<%= t.input :first_name %>
|
||||||
<%= t.input :last_name %>
|
<%= t.input :last_name %>
|
||||||
<%= t.input :photo %>
|
|
||||||
<%= t.input :password %>
|
<%= t.input :password %>
|
||||||
|
<%= t.input :photo %>
|
||||||
|
|
||||||
<%= t.submit :Save, class: "btn btn-primary save-btn form-control" %>
|
<%= t.submit :Save, class: "btn btn-primary save-btn form-control" %>
|
||||||
<p></p>
|
<p></p>
|
||||||
|
@ -15,14 +15,14 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="profile-pic">
|
<div class="profile-pic">
|
||||||
<% if @user.photo.nil? %>
|
<% if @user.photo.url.nil? %>
|
||||||
<%= image_tag "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png"%>
|
<%= image_tag "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= cl_image_tag current_user.photo%>
|
<%= cl_image_tag current_user.photo%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= t.input_field :photo, onchange: 'this.form.submit();' %>
|
<%#= t.input_field :photo, onchange: 'this.form.submit();' %>
|
||||||
<%= t.input_field :photo, as: :hidden %>
|
<%#= t.input_field :photo, as: :hidden %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="user-container">
|
<div class="user-container">
|
||||||
<div class="profile">
|
<div class="profile">
|
||||||
<div class="profile-pic">
|
<div class="profile-pic">
|
||||||
<% if @user&.photo&.url.nil? %>
|
<% if @user.photo.url.nil? %>
|
||||||
<%= image_tag "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png", class: "img-circle"%>
|
<%= image_tag "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png", class: "img-circle"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= cl_image_tag @user.photo, class: "img-circle"%>
|
<%= cl_image_tag @user.photo, class: "img-circle"%>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
|
@ -1 +0,0 @@
|
||||||
c8f4c6e010b5d8a06c5df4d1923a973a
|
|
Binary file not shown.
After Width: | Height: | Size: 263 KiB |
Loading…
Reference in New Issue