negos_app/app/views/public/needs/show.html.haml
2015-12-08 17:40:07 +01:00

44 lines
1.5 KiB
Plaintext

.center.white
.show-need
%h1= @need.title.upcase
-if @need.author
%p.info=i(:"clock-o") + " Ajouté il y a #{time_ago_in_words(@need.created_at)} par #{@need.author.anonyme_nick}"
-else
%p.info=i(:"clock-o") + " Ajouté il y a #{time_ago_in_words(@need.created_at)}"
%p.info=i(:"tag") + " " + @need.category_path
%p.description= @need.description
.clear
.counters
-if(@need.wishes.length > 0)
.item=i(:"hand-paper-o") + " " + " #{pluralize(@need.wishes.length, 'Organisation')} #{"intéressé".pluralize(@need.wishes.length)} par ce besoin"
-else
.item=i(:"hand-paper-o") + " Aucune organisation n'est intéressé par ce besoin"
-if(@need.customers.include?(current_customer))
=link_to i(:"check") + " Intéressé", wish_public_need_path(@need) , :class => "btn btn-square btn-lg btn-success pull-right"
-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"
.clear
%hr
= semantic_form_for [:public, @need, @comment ], :html => {id: :message_form, :method => :post } do |f|
%h4 Poster un commentaire
= f.inputs do
= f.input :content, as: :text, label: false, rows: 5, :input_html => {:style => "height:100px;"}
=f.submit "Envoyer", :class => "btn btn-square btn-primary pull-right"
.clear
%h4= i(:"comment-o") + " #{pluralize(@need.messages.count, 'Commentaire')} pour ce besoin"
=render collection: @comments, partial: 'message'
.pagination= paginate @comments