Skip to content

Commit

Permalink
Document preview ✨ (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbldev authored Jul 2, 2024
1 parent 1c398d7 commit f605651
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions app/views/documents/_document.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<div id="<%= dom_id document %>">
<p class="my-5">
<strong class="block font-medium mb-1">Title:</strong>
<%= document.title %>
</p>
<p class="my-5">
<%= document.content&.first(100) %>
</p>
<h1 class="font-bold text-4xl"><%= document.title %></h1>
<object class="my-5" data="<%= url_for(document.file) %>" type="application/pdf" width="100%" height="600">
<embed src="<%= url_for(document.file) %>" type="application/pdf" />
</object>
</div>
2 changes: 1 addition & 1 deletion app/views/documents/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="mx-auto md:w-2/3 w-full flex">
<div class="w-full">
<div class="mx-auto">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
Expand Down

0 comments on commit f605651

Please sign in to comment.