Skip to content

Commit

Permalink
Add textile_content partial
Browse files Browse the repository at this point in the history
  • Loading branch information
aapomm committed Jun 13, 2024
1 parent 3cfd946 commit 1c77ace
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
4 changes: 1 addition & 3 deletions app/views/evidence/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
<%= render partial: 'shared/liquid_loading' %>
<%= render partial: 'actions' %>
</h4>
<div class="content-textile" data-behavior="content-textile liquid-async" data-path="<%= preview_project_node_evidence_path(current_project, @evidence.node, @evidence) %>" data-content="<%= @evidence.content %>" >
<%= markup(@evidence.content) %>
</div>
<%= render partial: 'shared/textile_content', locals: { record: @evidence, preview_path: preview_project_node_evidence_path(current_project, @evidence.node, @evidence) } %>
<div class="author-info">
<span class="ms-auto">Author: <%= @evidence.author || 'n/a' %></span>
</div>
Expand Down
4 changes: 1 addition & 3 deletions app/views/issues/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
<%= render partial: 'shared/liquid_loading' %>
<%= render partial: 'actions' %>
</h4>
<div class="content-textile" data-behavior="content-textile liquid-async" data-path="<%= preview_project_issue_path(current_project, @issue) %>" data-content="<%= @issue.text %>" >
<%= markup(@issue.text) %>
</div>
<%= render partial: 'shared/textile_content', locals: { record: @issue, preview_path: preview_project_issue_path(current_project, @issue) } %>
<div class="author-info">
<span class="ms-auto">Author: <%= @issue.author || 'n/a' %></span>
</div>
Expand Down
4 changes: 1 addition & 3 deletions app/views/notes/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
<%= render partial: 'shared/liquid_loading' %>
<%= render partial: 'actions' %>
</h4>
<div class="content-textile" data-behavior="content-textile liquid-async" data-path="<%= preview_project_node_note_path(current_project, @note.node, @note) %>" data-content="<%= @note.text %>" >
<%= markup(@note.text) %>
</div>
<%= render partial: 'shared/textile_content', locals: { record: @note, preview_path: preview_project_node_note_path(current_project, @note.node, @note) } %>
<div class="author-info">
<span class="ms-auto">Author: <%= @note.author || 'n/a' %></span>
</div>
Expand Down
4 changes: 1 addition & 3 deletions app/views/qa/issues/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
</span>
</span>
</h4>
<div class="content-textile" data-behavior="content-textile liquid-async" data-path="<%= preview_project_issue_path(current_project, @issue) %>" data-content="<%= @issue.text %>" >
<%= markup(@issue.text) %>
</div>
<%= render partial: 'shared/textile_content', locals: { record: @issue, preview_path: preview_project_issue_path(current_project, @issue) } %>
<div class="author-info">
<span class="ms-auto">Author: <%= @issue.author || 'n/a' %></span>
</div>
Expand Down
5 changes: 5 additions & 0 deletions app/views/shared/_textile_content.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% content = record.is_a?(Note) ? record.text : record.content %>
<%= content_tag :div, class: 'content-textile', data: { behavior: 'content-textile liquid-async', path: preview_path, content: content } do %>
<%= markup(content) %>
<% end %>

0 comments on commit 1c77ace

Please sign in to comment.