Finished basic commentaire/messages block for dossiers show
This commit is contained in:
parent
cab4e257cd
commit
87a8b68b36
6 changed files with 55 additions and 20 deletions
|
@ -18,7 +18,7 @@ function init_default_data_block() {
|
||||||
function toggle_default_data_bloc(element, duration){
|
function toggle_default_data_bloc(element, duration){
|
||||||
var block = $(element).parents('.show-block');
|
var block = $(element).parents('.show-block');
|
||||||
if (block.attr("id") == "messages") {
|
if (block.attr("id") == "messages") {
|
||||||
block.children(".last-message").toggle();
|
block.children(".last-commentaire").toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
block.children(".body").slideToggle(duration);
|
block.children(".body").slideToggle(duration);
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
}
|
}
|
||||||
.body {
|
.body {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
height: 100px;
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
#backoffice_dossier_show {
|
#backoffice_dossier_show {
|
||||||
|
|
||||||
#messages {
|
#messages {
|
||||||
.last-message {
|
.last-commentaire {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
padding: 20px;
|
.content, .new-action {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.last-commentaire, .commentaire {
|
||||||
|
padding: 20px 0 0 20px;
|
||||||
.comment-header {
|
.comment-header {
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -13,12 +18,10 @@
|
||||||
color: #000000;
|
color: #000000;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.content {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.new-action {
|
.new-action {
|
||||||
background-color: #E45B51;
|
background-color: #E45B51;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
width: 253px;
|
width: 253px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
@ -28,6 +31,26 @@
|
||||||
font-weight: bold;
|
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 {
|
#infos {
|
||||||
}
|
}
|
||||||
|
|
7
app/views/backoffice/commentaires/_commentaire.html.haml
Normal file
7
app/views/backoffice/commentaires/_commentaire.html.haml
Normal 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
|
|
@ -4,23 +4,35 @@
|
||||||
.row.show-block#messages
|
.row.show-block#messages
|
||||||
%div.header
|
%div.header
|
||||||
%div.col-lg-10.col-md-10.title
|
%div.col-lg-10.col-md-10.title
|
||||||
%div.carret-right
|
.carret-right
|
||||||
%div.carret-down
|
.carret-down
|
||||||
MESSAGES
|
MESSAGES
|
||||||
%div.col-lg-2.col-md-2.count
|
%div.col-lg-2.col-md-2.count
|
||||||
- message_count = @facade.commentaires.count
|
- message_count = @facade.commentaires.count
|
||||||
= (message_count == 1) ? "1 message" : "#{message_count} messages"
|
= (message_count == 1) ? "1 message" : "#{message_count} messages"
|
||||||
%div.body
|
%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
|
- if last_comment = @facade.commentaires.first
|
||||||
%div.last-message
|
%div.last-commentaire
|
||||||
%div.row
|
.row
|
||||||
%div.col-lg-12.col-md-12.comment-header
|
%div.col-lg-12.col-md-12.comment-header
|
||||||
= "DERNIER MESSAGE (#{last_comment.header})"
|
= "DERNIER MESSAGE (#{last_comment.header})"
|
||||||
%div.row
|
.row
|
||||||
%div.col-lg-12.col-md-12.content
|
%div.col-lg-12.col-md-12.content
|
||||||
= last_comment.body.html_safe
|
= last_comment.body.html_safe
|
||||||
%div.row
|
.row
|
||||||
%div.col-lg-12.col-md-12
|
.col-lg-12.col-md-12
|
||||||
%div.new-action
|
%div.new-action
|
||||||
ENVOYER UN MESSAGE
|
ENVOYER UN MESSAGE
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
.content{id: ('commentaires_flux' + (@facade.champ_id.nil? ? '' : "_#{@facade.champ_id}")),style:'width:100%;'}
|
.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|
|
-@facade.commentaires.each do |com|
|
||||||
%span.text-info#email_contact{style: 'font-weight:bold'}
|
%span.text-info#email_contact{style: 'font-weight:bold'}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue