Fixed displaying of notes

This commit is contained in:
2026-01-20 21:40:17 -05:00
parent 72ec89292f
commit f741ce5dc9
4 changed files with 27 additions and 5 deletions

View File

@@ -38,8 +38,19 @@
<tr> <tr>
<th><%=t(:field_notes)%></th> <th><%=t(:field_notes)%></th>
<td><%= customer.notes %></td> <td>
<pre id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit;">
<%= customer.notes %>
</pre>
</td>
</tr> </tr>
<script>
const preElement = document.getElementById('note-display');
// This takes the text, trims the edges, and puts it back
preElement.textContent = preElement.textContent.trim();
</script>
</tbody> </tbody>
</table> </table>
<br/> <br/>

View File

@@ -36,8 +36,7 @@
<%=t(:field_notes)%>: <%=t(:field_notes)%>:
<div class="input"> <div class="input">
<p> <p>
<%= link_to_function content_tag(:span, l(:button_edit), :class => 'icon icon-edit'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @customer.new_record? %> <%= content_tag 'span', :id => "issue_description_and_toolbar" do %>
<%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@customer.new_record? ? nil : 'display:none') do %>
<%= f.text_area :notes, <%= f.text_area :notes,
:cols => 60, :cols => 60,
:rows => 10, :rows => 10,

View File

@@ -29,7 +29,11 @@
<div class="vehicle_notes attribute"> <div class="vehicle_notes attribute">
<div class="label"><span><%=t(:field_notes)%></span>:</div> <div class="label"><span><%=t(:field_notes)%></span>:</div>
<div class="value"><%=notes%></div> <div class="value">
<pre id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit; ">
<%=notes%>
</pre>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -32,9 +32,17 @@
<div class="splitcontentleft"> <div class="splitcontentleft">
<h4><%=t(:field_notes)%>:</h4> <h4><%=t(:field_notes)%>:</h4>
<td><%= vehicle.notes %></td> <pre id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit; ">
<td><%= vehicle.notes %></td>
</pre>
</tr> </tr>
<script>
const preElement = document.getElementById('note-display');
// This takes the text, trims the edges, and puts it back
preElement.textContent = preElement.textContent.trim();
</script>
</div> </div>
</div> </div>
</div> </div>