Commit 0fcd6b9f authored by steven robert's avatar steven robert

affichage de la liste des messages en ticket

parent 46a0d508
......@@ -21,12 +21,12 @@
</div>
</div>
<% if !@ticket.id %>
<div class="field">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>
<%= f.text_area_tag(:message, "", :size => "100x20", class: "form-control", placeholder: "Sujet du ticket" ) %>
<div class="field">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>
<%= f.text_area_tag(:message, "", :size => "100x20", class: "form-control", placeholder: "Sujet du ticket" ) %>
</div>
</div>
</div>
<% end %>
<div class="actions" align="center">
<%= button_tag(class: "btn btn-primary") do %>
......
......@@ -8,51 +8,58 @@
</div>
<div class="panel-body">
<div class="row">
<p>
<strong>User:</strong>
<%= @ticket.user_id %>
</p>
<p>
<strong>Ticket status:</strong>
<%= @ticket.ticket_status %>
</p>
<p>
<strong>Ticket category:</strong>
<%= @ticket.ticket_category %>
</p>
<p>
<strong>Config module:</strong>
<%= @ticket.config_module %>
</p>
<%= button_to "Edition du ticket", edit_ticket_path(@ticket) %> |
<%= link_to 'Back', tickets_path %>
<div class="col-sm-3 col-md-4 col-md-offset-2 text-left">
<h3 class="border-bottom border-gray pb-2 mb-0">Information</h3>
<div class="field">
<div class="row">
<p class="lead">
<strong>User:</strong>
<%= @ticket.user.name %>
</p>
<p class="lead">
<strong>Ticket status:</strong>
<%= @ticket.ticket_status.libelle %>
</p>
<p class="lead">
<strong>Ticket category:</strong>
<%= @ticket.ticket_category.libelle %>
</p>
<p class="lead">
<strong>Config module:</strong>
<%= @ticket.config_module.title %>
<%= button_to "Edition du ticket", edit_ticket_path(@ticket) %> |
<%= link_to 'Back', tickets_path %>
</div>
</div>
</div>
<%= form_for(@message, url: "/tickets/#{@ticket.id}/new_message", method: "post") do |f| %>
<%= f.text_area_tag(:message, "", :size => "100x20", class: "form-control" ) %>
<%= button_tag(class: "btn btn-primary") do %>
Valider
<% end %>
<% end %>
<h2>Messages</h2>
<% @ticket_messages.each do |message| %>
<div class="col-md-6 col-sm-6 col-xs-8 col-md-offset-3 col-sm-offset-3 ">
<p class="stories-date"><%= "#{message.created_at.strftime("Le %d/%m/%Y ")} par #{message.user.name}" %></p>
<div class="">
<p class="stories-description"><%=raw message.message %></p>
<div class="clearfix"></div>
<div class="col-sm-6 col-md-6 text-left " >
<h3> Champs Nouveau message</h3>
<%= form_for(@message, url: "/tickets/#{@ticket.id}/new_message", method: "post") do |f| %>
<%= f.text_area_tag(:message, "", :size => "80x20" ) %>
<%= button_tag(class: "btn btn-primary") do %>
Valider
<% end %>
</div>
<div class="clearfix"></div>
<% end %>
</div>
<div>
<h3> Liste des messages</h3>
<% @ticket_messages.each do |message| %>
<div class="col-md-6 col-sm-6 col-xs-8 col-md-offset-3 col-sm-offset-3 text-left">
<div class="container">
<p class=""><%= "#{message.created_at.strftime("Le %d/%m/%Y ")} par #{message.user.name}" %></p>
<div class="jumbotron">
<p class="lead"><%=raw message.message %></p>
<div class="clearfix"></div>
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment