UI improvement

This commit is contained in:
Nicolas VARROT 2015-12-10 21:09:21 +01:00
parent 95b1c8b319
commit 78ef91c204
2 changed files with 106 additions and 38 deletions

View File

@ -15,6 +15,38 @@
.info{ .info{
color:rgb(163, 159, 159); color:rgb(163, 159, 159);
} }
.state{
position:absolute;
top:0px;
right:0px;
color:white;
padding:4px;
padding-left:8px;
padding-right:8px;
}
.state-success{
background-color:#5cb85c;
}
.state-danger{
background-color:#d9534f;
}
.state-info{
background-color:#428bca;
}
.state-warning{
background-color:#f0ad4e;
}
.offer{
display:block;
background: #eeeded;
padding:10px;
margin-bottom:5px;
.price{
font-size:25px;
font-weight:bold;
}
}
p.description{ p.description{
margin-bottom:30px; margin-bottom:30px;
@ -23,7 +55,10 @@
.message-item{ .message-item{
background: #eeeded; background: #eeeded;
} }
.content{
position:relative;
padding-bottom:50px;
}
.counters{ .counters{
position:absolute; position:absolute;
left:0px; left:0px;

View File

@ -1,5 +1,26 @@
.center.white .center.white.show-need
.show-need .top-left-info
-if @need.verified?
%span.state.state-info.pull-right
=@need.human_state
-elsif @need.negociating?
%span.state.state-warning.pull-right
=@need.human_state
-elsif @need.failed?
%span.state.state-danger.pull-right
=@need.human_state
-elsif @need.negociated?
%span.state.state-success.pull-right
-offers = @need.offers.order(price: :asc)
-if offers.size > 1
Négocié à partir de
%strong="#{number_to_currency(offers.first.price, locale: :fr)}"
-elsif offers.size == 1
Négocié à
%strong="#{number_to_currency(offers.first.price, locale: :fr)}"
-else
Négocié
.content
%h1= @need.title.upcase %h1= @need.title.upcase
-if @need.author -if @need.author
@ -30,7 +51,19 @@
=link_to i(:"check") + " Intéressé", wish_public_need_path(@need) , :class => "btn btn-square btn-lg btn-success pull-right" =link_to i(:"check") + " Intéressé", wish_public_need_path(@need) , :class => "btn btn-square btn-lg btn-success pull-right"
-else -else
=link_to i(:"hand-paper-o") + " Ça m'intéresse !", wish_public_need_path(@need) , :class => "btn btn-square btn-lg btn-primary pull-right" =link_to i(:"hand-paper-o") + " Ça m'intéresse !", wish_public_need_path(@need) , :class => "btn btn-square btn-lg btn-primary pull-right"
-elsif @need.negociated -elsif @need.negociated?
-if @need.offers.length > 0
%h2 Les offres négociées
-@need.offers.each do |offer|
.offer
.supplier
Négocié avec le fournisseur
%strong= offer.supplier
.price
=number_to_currency(offer.price, locale: :fr)
=link_to "Acheter", "", class: "btn btn-success pull-right"
.clear .clear