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

@@ -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"%>