Change some styling
This commit is contained in:
parent
c505f1b665
commit
7014201510
3 changed files with 100 additions and 37 deletions
53
;w
Normal file
53
;w
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<%= render partial: 'flash' %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<h2>
|
||||||
|
<%= @user.nickname %>
|
||||||
|
<%= link_to content_tag(:small, content_tag(:span, "", class: "glyphicon glyphicon-cog")), edit_user_path(@user) %>
|
||||||
|
</h2>
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item text-muted">Orders</li>
|
||||||
|
<li class="list-group-item"><strong>Amount</strong><span class="badge"><%= @user.orders_count %></span></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item text-muted">
|
||||||
|
Huidige dagschotel
|
||||||
|
<%= image_tag @user.dagschotel.avatar %>
|
||||||
|
<%= link_to "Change dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<% if can? :edit, @user %>
|
||||||
|
<h5>
|
||||||
|
</h5>
|
||||||
|
<% end %>
|
||||||
|
<div class="actions">
|
||||||
|
<%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %>
|
||||||
|
<span>DEBT: <%= euro(@user.debt) %></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% if @orders.any? %>
|
||||||
|
<div class="stats">
|
||||||
|
<h4>Total products</h4>
|
||||||
|
Total:
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
Specifics:
|
||||||
|
<%= content_tag :ul do %>
|
||||||
|
<% @products.each do |p| %>
|
||||||
|
<%= content_tag :li, pluralize(p.count, p.name) %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<h4>All orders (<%= @user.orders_count %>)</h4>
|
||||||
|
<table class="orders"><%= render @orders %></table>
|
||||||
|
<%= will_paginate @orders %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -58,25 +58,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats{
|
#user_info {
|
||||||
width: 60%;
|
h4 {
|
||||||
margin: auto;
|
text-transform: uppercase;
|
||||||
}
|
font-family: monospace;
|
||||||
|
background-color: #333;
|
||||||
|
color: white;
|
||||||
|
padding: 5px 10px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.stats h4 {
|
ul {
|
||||||
text-transform: uppercase;
|
list-style-type: none;
|
||||||
font-family: monospace;
|
padding: 0 0 0 15px;
|
||||||
background-color: #333;
|
margin: 0px;
|
||||||
color: white;
|
}
|
||||||
padding: 5px 10px;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats ul {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0 0 0 15px;
|
|
||||||
margin: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats li {
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,50 @@
|
||||||
<%= render partial: 'flash' %>
|
<%= render partial: 'flash' %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="user_info">
|
<div class="col-sm-3">
|
||||||
|
<h2>
|
||||||
|
<%= @user.nickname %>
|
||||||
|
<% if can? :edit, @user %>
|
||||||
|
<%= link_to content_tag(:small, content_tag(:span, "", class: "glyphicon glyphicon-cog")), edit_user_path(@user) %>
|
||||||
|
<% end %>
|
||||||
|
</h2>
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item text-muted">Orders</li>
|
||||||
|
<li class="list-group-item"><strong>Orders placed</strong><span class="badge"><%= @user.orders_count %></span></li>
|
||||||
|
<li class="list-group-item"><strong>Products ordered</strong><span class="badge"><%= 17 %></span></li>
|
||||||
|
<% if can? :create, @user.orders.build %>
|
||||||
|
<li class="list-group-item"><%= link_to "Place new order", new_user_order_path(@user), class: "btn btn-default btn-block" %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
<% if can? :edit, @user %>
|
<% if can? :edit, @user %>
|
||||||
<h5>
|
<ul class="list-group">
|
||||||
<%= link_to "[Edit dagschotel]" , user_edit_dagschotel_path(@user) %>
|
<li class="list-group-item text-muted">
|
||||||
<%= link_to "[Edit profile]" , edit_user_path(@user) %>
|
<% if @user.dagschotel %>
|
||||||
</h5>
|
Huidige dagschotel
|
||||||
|
<%= image_tag @user.dagschotel.avatar %>
|
||||||
|
<%= link_to "Change dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "Set dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
<h2><%= @user.nickname %></h2>
|
|
||||||
<div class="actions">
|
|
||||||
<%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %>
|
|
||||||
<span>DEBT: <%= euro(@user.debt) %></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id="user_info" class="col-sm-9">
|
||||||
<% if @orders.any? %>
|
<% if @orders.any? %>
|
||||||
<div class="stats">
|
<h4>Previously ordered</h4>
|
||||||
<h4>Total products</h4>
|
|
||||||
Total:
|
Total:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
|
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Specifics:
|
Specifics:
|
||||||
<%= content_tag :ul do %>
|
<%= content_tag :ul do %>
|
||||||
<% @products.each do |p| %>
|
<% @products.each do |p| %>
|
||||||
<%= content_tag :li, pluralize(p.count, p.name) %>
|
<%= content_tag :li, pluralize(p.count, p.name) %>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<h4>All orders (<%= @user.orders_count %>)</h4>
|
<h4>All orders (<%= @user.orders_count %>)</h4>
|
||||||
<table class="orders"><%= render @orders %></table>
|
<table class="orders"><%= render @orders %></table>
|
||||||
|
@ -37,3 +52,4 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue