done page

This commit is contained in:
Benjamin Myara 2018-08-29 16:58:21 +01:00
parent 6dee298b44
commit 25c6c3aeb5
11 changed files with 41 additions and 11 deletions

View File

@ -16,6 +16,8 @@ gem 'sass-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'cloudinary'
gem 'carrierwave', '~> 1.2'
group :development do
gem 'web-console', '>= 3.3.0'
@ -28,5 +30,4 @@ group :development, :test do
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'dotenv-rails'
gem 'dotenv-rails', groups: [:development, :test]
end

View File

@ -45,6 +45,7 @@ GEM
arel (9.0.0)
autoprefixer-rails (9.1.3)
execjs
aws_cf_signer (0.1.3)
bcrypt (3.1.12)
bindex (0.5.0)
bootsnap (1.3.1)
@ -54,6 +55,13 @@ GEM
sass (>= 3.3.4)
builder (3.2.3)
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)
concurrent-ruby (1.0.5)
crass (1.0.4)
@ -63,6 +71,8 @@ GEM
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.5.0)
dotenv-rails (2.5.0)
dotenv (= 2.5.0)
@ -74,6 +84,8 @@ GEM
sassc (>= 1.11)
globalid (0.4.1)
activesupport (>= 4.2.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (1.1.0)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
@ -90,12 +102,16 @@ GEM
marcel (0.3.2)
mimemagic (~> 0.3.2)
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)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
netrc (0.11.0)
nio4r (2.3.1)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
@ -147,6 +163,10 @@ GEM
responders (2.4.0)
actionpack (>= 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-listen (~> 4.0.0)
sass-listen (4.0.0)
@ -183,6 +203,9 @@ GEM
thread_safe (~> 0.1)
uglifier (4.1.18)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
warden (1.2.7)
rack (>= 1.0)
web-console (3.6.2)
@ -205,6 +228,8 @@ DEPENDENCIES
autoprefixer-rails
bootsnap
bootstrap-sass (~> 3.3)
carrierwave (~> 1.2)
cloudinary
devise
dotenv-rails
font-awesome-sass (~> 5.0.9)

View File

@ -7,6 +7,8 @@ class User < ApplicationRecord
has_many :connections
mount_uploader :photo, PhotoUploader
def contacts
self.connections.map do |connection|
connection.contact

View File

@ -0,0 +1,3 @@
class PhotoUploader < CarrierWave::Uploader::Base
include Cloudinary::CarrierWave
end

View File

@ -5,7 +5,7 @@
<div class="right-align">
<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>
<div class="profile">
@ -14,10 +14,10 @@
<% else %>
<div class="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">
<% 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 %>
</div>
<ul class="dropdown-menu dropdown-menu-right">

View File

@ -5,8 +5,8 @@
<%= t.input :email %>
<%= t.input :first_name %>
<%= t.input :last_name %>
<%= t.input :photo %>
<%= t.input :password %>
<%= t.input :photo %>
<%= t.submit :Save, class: "btn btn-primary save-btn form-control" %>
<p></p>
@ -15,14 +15,14 @@
<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"%>
<% else %>
<%= cl_image_tag current_user.photo%>
<% end %>
<%= t.input_field :photo, onchange: 'this.form.submit();' %>
<%= t.input_field :photo, as: :hidden %>
<%#= t.input_field :photo, onchange: 'this.form.submit();' %>
<%#= t.input_field :photo, as: :hidden %>
</div>

View File

@ -4,7 +4,7 @@
<div class="user-container">
<div class="profile">
<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"%>
<% else %>
<%= cl_image_tag @user.photo, class: "img-circle"%>

BIN
boris_retreat_2017.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -1 +0,0 @@
c8f4c6e010b5d8a06c5df4d1923a973a

BIN
san_francisco.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB