Skip to content

Commit

Permalink
Add small changes to image sizes, trying to add so user can change av…
Browse files Browse the repository at this point in the history
…atar
  • Loading branch information
Alexander Munck af Rosenschöld authored and Alexander Munck af Rosenschöld committed Sep 5, 2016
1 parent 1b717e0 commit 2b20eec
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions app/assets/stylesheets/sections/_navbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
color: $black
border-left: 1px solid rgba(0,0,0,0.1)

.logout
a
color: #fff

Expand All @@ -56,6 +55,9 @@
&:hover
background-color: lighten($dark-blue, 10%)
border-radius: 4px

.logout

a,span
text-decoration: none
display: inline-block
Expand All @@ -69,7 +71,6 @@
content: '/'
margin: 0px 5px


img
height: 24px
width: 24px
Expand Down
4 changes: 3 additions & 1 deletion app/assets/stylesheets/sections/_user-show.sass
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
box-shadow: 0px 0px 1px rgba(0,0,0,1)
max-width: 160px
max-height: 160px
width: 160px
height: 160px

@media (max-width: 750px)
bottom: 10px
Expand Down Expand Up @@ -132,7 +134,7 @@
display: inline-block

&:hover
background-color: #3b5998
background-color: #3b5998

&:hover .edit-user
opacity: 1
Expand Down
2 changes: 1 addition & 1 deletion app/uploaders/avatar_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create_slider_version

# Create different versions of your uploaded files:
version :avatar do
process :resize_to_fit => [160, 160]
process :resize_to_fill => [160, 160]
end

version :mini do
Expand Down
2 changes: 1 addition & 1 deletion app/views/posts/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<hr>
<div class=" content-area">
<div class="content-profile-img">

<%= image_tag current_user.avatar.mini %>
</div>
<div class="content-text">
<%= f.text_area :content, placeholder: "What are you doing right now?" %>
Expand Down
11 changes: 4 additions & 7 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<nav class="navbar">
<div class="container">

<!-- <a class="logo three columns">Fakebook</a> -->
<%= link_to 'Fakebook', root_path, class: 'logo three columns' %>

<div class="search">
<input type="search" placeholder="Sök efter personer, platser och saker"class="five columns">
<input type="submit" class="button-primary" value="Go">
Expand All @@ -13,17 +10,17 @@
<%= link_to current_user do %>
<% if user_signed_in? %>
<span>
<%= image_tag (current_user.avatar.mini) %>
<%= image_tag (current_user.avatar.mini) %>
<%= current_user.username %>
</span>
<% else %>
<%= link_to 'Login', new_user_session_path, class: 'login' %> <%= link_to 'Sign up', new_user_registration_path %>
<% end %>
<% end %>
</div>
<% end %>
</div>
<div class="user-edit logout">
<% if user_signed_in? %>
<span><%= link_to('Logout', destroy_user_session_path, :method => :delete) %></span>
<span><%= link_to('Logout', destroy_user_session_path, :method => :delete) %></span>
<% end %>
</div>

Expand Down
5 changes: 5 additions & 0 deletions app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<%= f.label :email %><br>
<%= f.text_field :email,class: "form-control", autofocus: true %>
</div>
<div class="field">
<%= f.label :cover_photo %><br>
<%= image_tag(@user.cover_photo) if @user.cover_photo? %>
<%= f.file_field :cover_photo %>
</div>
<div class="actions">
<%= f.submit "Submit", class: "btn btn-default" %>
</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b20eec

Please sign in to comment.