Finished basic commentaire/messages block for dossiers show

This commit is contained in:
JC 2016-11-25 12:20:08 +01:00
parent cab4e257cd
commit 87a8b68b36
6 changed files with 55 additions and 20 deletions

View file

@ -18,7 +18,7 @@ function init_default_data_block() {
function toggle_default_data_bloc(element, duration){
var block = $(element).parents('.show-block');
if (block.attr("id") == "messages") {
block.children(".last-message").toggle();
block.children(".last-commentaire").toggle();
}
block.children(".body").slideToggle(duration);

View file

@ -54,7 +54,6 @@
}
.body {
background-color: #FFFFFF;
height: 100px;
display: none;
}
}

View file

@ -1,10 +1,15 @@
#backoffice_dossier_show {
#messages {
.last-message {
.last-commentaire {
display: block;
background-color: #FFFFFF;
padding: 20px;
.content, .new-action {
margin-bottom: 20px;
}
}
.last-commentaire, .commentaire {
padding: 20px 0 0 20px;
.comment-header {
font-family: Arial;
font-size: 14px;
@ -13,12 +18,10 @@
color: #000000;
margin-bottom: 10px;
}
.content {
margin-bottom: 20px;
}
.new-action {
background-color: #E45B51;
text-align: center;
cursor: pointer;
color: #FFFFFF;
width: 253px;
height: 40px;
@ -28,6 +31,26 @@
font-weight: bold;
}
}
.split-hr {
margin: 20px 20px 0 20px;
border-bottom: 1px solid #979797;
}
#new-commentaire {
padding: 35px;
.btn-send {
background-color: #E45B51;
text-align: center;
color: #FFFFFF;
width: 150px;
height: 40px;
line-height: 28px;
font-family: Arial;
font-size: 16px;
font-weight: bold;
float: right;
border-radius: 0;
}
}
}
#infos {
}

View file

@ -0,0 +1,7 @@
%div.commentaire
.row
%div.col-lg-12.col-md-12.comment-header
= commentaire.header
.row
%div.col-lg-12.col-md-12.content
= commentaire.body.html_safe

View file

@ -4,23 +4,35 @@
.row.show-block#messages
%div.header
%div.col-lg-10.col-md-10.title
%div.carret-right
%div.carret-down
.carret-right
.carret-down
MESSAGES
%div.col-lg-2.col-md-2.count
- message_count = @facade.commentaires.count
= (message_count == 1) ? "1 message" : "#{message_count} messages"
%div.body
- @facade.commentaires.object.sort.each do |commentaire|
= render partial: commentaire
.row
.col-lg-12.col-md-12
%div.split-hr
.row
%div.col-lg-12.col-md-12#new-commentaire
= form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: @facade.dossier.id, champ_id: @facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
%textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Commentaire"}
%h4.text-primary{style: 'margin-top: 0px'} Ajouter un fichier
= file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px'
%input.form-control.btn.btn-send{ type: 'submit', value: 'ENVOYER' }
- if last_comment = @facade.commentaires.first
%div.last-message
%div.row
%div.last-commentaire
.row
%div.col-lg-12.col-md-12.comment-header
= "DERNIER MESSAGE (#{last_comment.header})"
%div.row
.row
%div.col-lg-12.col-md-12.content
= last_comment.body.html_safe
%div.row
%div.col-lg-12.col-md-12
.row
.col-lg-12.col-md-12
%div.new-action
ENVOYER UN MESSAGE

View file

@ -1,10 +1,4 @@
.content{id: ('commentaires_flux' + (@facade.champ_id.nil? ? '' : "_#{@facade.champ_id}")),style:'width:100%;'}
%div#commentaire_new{style: 'width:80%; margin-left:auto; margin-right:auto; margin-bottom:7%'}
= form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: @facade.dossier.id, champ_id: @facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
%textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Commentaire"}
%h4.text-primary{style: 'margin-top: 0px'} Ajout un fichier
= file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px'
%input.form-control.btn.btn-success{:type => 'submit', :value => 'Poster', style: 'float:right'}
-@facade.commentaires.each do |com|
%span.text-info#email_contact{style: 'font-weight:bold'}