Skip to content
Snippets Groups Projects
Commit 92163d09 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

refactoring users views

parent 7c73bd16
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,13 @@ $background-grey: #e7e7e8; ...@@ -7,11 +7,13 @@ $background-grey: #e7e7e8;
height: 60px; height: 60px;
border-radius: 50%; border-radius: 50%;
} }
.user-image-small { .user-image-small {
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
} }
.user-image-tiny { .user-image-tiny {
width: 20px; width: 20px;
height: 20px; height: 20px;
...@@ -52,10 +54,18 @@ $background-grey: #e7e7e8; ...@@ -52,10 +54,18 @@ $background-grey: #e7e7e8;
} }
.user-files { .user-files {
margin-bottom: 100px;
} }
.user-biography { .user-biography {
padding-left: 85px !important; padding-left: 85px !important;
display: none; display: none;
}
.align-right {
text-align: right;
}
.user-page-subtitle {
margin-bottom: 30px;
} }
\ No newline at end of file
...@@ -10,6 +10,18 @@ class UsersController < ApplicationController ...@@ -10,6 +10,18 @@ class UsersController < ApplicationController
def me def me
@objects = learning_object_repository.all_from_offset_to_limit 0, 10 @objects = learning_object_repository.all_from_offset_to_limit 0, 10
@new_collection = Collection.new @new_collection = Collection.new
@new_collection.name = 'Favoritos'
@groups = [
CollectionsGroup.new(title: 'Coleções Automáticas',
collections: [
@new_collection
]),
CollectionsGroup.new(title: 'Coleções adicionadas',
collections: [
@new_collection
])
]
end end
......
module UsersHelper
def current_user_page?(user)
current_user.id == user.id
end
end
\ No newline at end of file
<div class="user-header">
<div class="col-md-6">
<div class="media">
<div class="media-left">
<% if current_user.id == user.id %>
<%= link_to edit_user_registration_path do
image_tag user.avatar.url(:thumb), class: 'user-image'
end %>
<% else %>
<%= image_tag user.avatar.url(:thumb), class: 'user-image' %>
<% end %>
</a>
</div>
<div class="media-body">
<h2 class="media-heading"><%= user.name %></h2>
<h3 class="header-sub">Universidade Federal do Paraná - UFPR</h3>
<div class="header-content">
<a href="#" class="showmore">
<span>ver mais</span>
<span style="display: none;">fechar</span>
</a>
</div>
</div>
</div>
</div>
<div class="col-md-6 right-column">
<% if current_user_page? user %>
<button type="button" class="btn btn-default">Editar perfil</button>
<% else %>
<button type="button" class="btn btn-default">Seguir</button>
<% end %>
<div class="col-md-12 user-biography">
<h3>Biografia</h3>
<p>asdasdsadasdas</p>
<a href="#" class="showmore">
<span style="display: none;">fechar</span>
<span>fechar</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
</div>
\ No newline at end of file
<div class="row"> <div class="row">
<div class="user-header"> <%= render 'users/header', user: current_user %>
<div class="col-md-6">
<div class="media">
<div class="media-left">
<%= link_to edit_user_registration_path do
image_tag current_user.avatar.url(:thumb), class: 'user-image'
end %>
</a>
</div>
<div class="media-body">
<h2 class="media-heading"><%= current_user.name %></h2>
<h3 class="header-sub">Universidade Federal do Paraná - UFPR</h3>
<div class="header-content">
<a href="#" class="showmore">
<span>ver mais</span>
<span style="display: none;">fechar</span>
</a>
</div>
</div>
</div>
</div>
<div class="col-md-6 right-column">
<button type="button" class="btn btn-default" onclick="window.location=<%= edit_user_registration_path %>">Editar perfil</button>
</div>
<div class="col-md-12 user-biography">
<h3>Biografia</h3>
<p>asdasdsadasdas</p>
<a href="#" class="showmore">
<span style="display: none;">fechar</span>
<span>fechar</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
<div class="user-files"> <div class="user-files">
<div class="row"> <div class="row user-page-subtitle"">
<div class="col-md-6"> <div class="col-md-6">
<div class="media"> <div class="media">
<div class="media-body"> <div class="media-body">
...@@ -70,7 +32,7 @@ ...@@ -70,7 +32,7 @@
</div> </div>
<div class="user-files"> <div class="user-files">
<div class="row"> <div class="row user-page-subtitle">
<div class="col-md-6"> <div class="col-md-6">
<div class="media"> <div class="media">
<div class="media-body"> <div class="media-body">
...@@ -79,17 +41,13 @@ ...@@ -79,17 +41,13 @@
</div> </div>
</div> </div>
<div class="col-md-6 right-column align-right"> <div class="col-md-6 right-column align-right">
<%= render 'collections/create', collection: @new_collection %> <%= render 'collections/create', collection: @new_collection, placement: 'left' %>
</div> </div>
</div> </div>
<div class="row learning-object-columns"> <% @groups.each do |group| %>
<%= render @objects[0], orientation: "vertical" %> <%= render 'collections/group', title: group.title, collections: group.collections %>
<%= render @objects[1], orientation: "vertical" %> <% end %>
<%= render @objects[2], orientation: "vertical" %>
<%= render @objects[0], orientation: "vertical" %>
<%= render @objects[1], orientation: "vertical" %>
<%= render @objects[2], orientation: "vertical" %>
</div>
</div> </div>
</div> </div>
\ No newline at end of file
<div class="row"> <div class="row">
<div class="user-header"> <%= render 'users/header', user: @user %>
<div class="col-md-6">
<div class="media">
<div class="media-left">
<a href="#">
<img class="user-image" src="<%= image_path("user-anon.png") %>" alt="Foto do usuário">
</a>
</div>
<div class="media-body">
<h2 class="media-heading">Usuário</h2>
<h3 class="header-sub">nome da instituição</h3>
<div class="header-content">
<a href="#" class="showmore">
<span>ver mais</span>
<span style="display: none;">fechar</span>
</a>
</div>
</div>
</div>
</div>
<div class="col-md-6 right-column">
<button type="button" class="btn btn-default">Seguir</button>
</div>
<div class="col-md-12 user-biography">
<h3>Biografia</h3>
<p>asdasdsadasdas</p>
<a href="#" class="showmore">
<span style="display: none;">fechar</span>
<span>fechar</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
<div class="user-files"> <div class="user-files">
<div class="row"> <div class="row">
...@@ -48,7 +12,9 @@ ...@@ -48,7 +12,9 @@
</div> </div>
</div> </div>
<div class="col-md-6 right-column align-right"> <div class="col-md-6 right-column align-right">
<button type="button" class="btn btn-primary">Enviar mensagem</button> <% if !current_user_page? user %>
<button type="button" class="btn btn-primary">Enviar mensagem</button>
<% end %>
</div> </div>
</div> </div>
...@@ -68,26 +34,24 @@ ...@@ -68,26 +34,24 @@
</div> </div>
<div class="user-files"> <div class="user-files">
<div class="row"> <div class="row user-page-subtitle">
<div class="col-md-6"> <div class="col-md-6">
<div class="media"> <div class="media">
<div class="media-body"> <div class="media-body">
<h2 class="media-heading">Minhas Coleções</h2> <h2 class="media-heading">Coleções do usuário</h2>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6 right-column align-right"> <div class="col-md-6 right-column align-right">
<% if current_user_page? user %>
<%= render 'collections/create', collection: @new_collection, placement: 'left' %>
<% end %>
</div> </div>
</div> </div>
<div class="row learning-object-columns"> <% @groups.each do |group| %>
<%= render @objects[0], orientation: "vertical" %> <%= render 'collections/group', title: group.title, collections: group.collections %>
<%= render @objects[1], orientation: "vertical" %> <% end %>
<%= render @objects[2], orientation: "vertical" %>
<%= render @objects[0], orientation: "vertical" %>
<%= render @objects[1], orientation: "vertical" %>
<%= render @objects[2], orientation: "vertical" %>
</div>
</div> </div>
</div> </div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment