document#show design

This commit is contained in:
drusepth 2022-09-09 16:01:29 -07:00
parent 8ad054760d
commit 86ff9e5477
3 changed files with 54 additions and 9 deletions

View File

@ -1,5 +1,5 @@
class DocumentsController < ApplicationController
layout 'tailwind', only: [:index]
layout 'tailwind', only: [:index, :show]
# layout 'editor', only: [:edit]
before_action :authenticate_user!, except: [:show, :analysis]

View File

@ -66,10 +66,6 @@
</td>
</tr>
<% end %>
<!-- More people... -->
</tbody>
</table>
</div>

View File

@ -1,6 +1,55 @@
<% set_meta_tags title: @document.title, description: truncate(@document.body) %>
<%= content_for :full_width_page_header do %>
<%= render partial: 'documents/components/document_name_bar', locals: { document: @document } %>
<div id="editor"><%= ContentFormatterService.substitute_content_links(clean_links(@document.body.try(:html_safe)) || "", current_user).html_safe %></div>
<% end %>
<div class="relative max-w-4xl mx-auto py-16 bg-white shadow-lg overflow-hidden">
<div class="hidden lg:block lg:absolute lg:inset-y-0 lg:h-full lg:w-full">
<div class="relative h-full text-lg max-w-prose mx-auto" aria-hidden="true">
<svg class="absolute top-12 left-full transform translate-x-32" width="404" height="384" fill="none" viewBox="0 0 404 384">
<defs>
<pattern id="74b3fd99-0a6f-4271-bef2-e80eeafdf357" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
</pattern>
</defs>
<rect width="404" height="384" fill="url(#74b3fd99-0a6f-4271-bef2-e80eeafdf357)" />
</svg>
<svg class="absolute top-1/2 right-full transform -translate-y-1/2 -translate-x-32" width="404" height="384" fill="none" viewBox="0 0 404 384">
<defs>
<pattern id="f210dbf6-a58d-4871-961e-36d5016a0f49" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
</pattern>
</defs>
<rect width="404" height="384" fill="url(#f210dbf6-a58d-4871-961e-36d5016a0f49)" />
</svg>
<svg class="absolute bottom-12 left-full transform translate-x-32" width="404" height="384" fill="none" viewBox="0 0 404 384">
<defs>
<pattern id="d3eb07ae-5182-43e6-857d-35c643af9034" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
</pattern>
</defs>
<rect width="404" height="384" fill="url(#d3eb07ae-5182-43e6-857d-35c643af9034)" />
</svg>
</div>
</div>
<div class="relative px-4 sm:px-6 lg:px-8">
<div class="text-lg max-w-prose mx-auto pb-96">
<h1 class="mb-16 pt-16">
<span class="mt-2 block text-3xl leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl">
<%= @document.title %>
</span>
<span class="block text-base text-gray-400 font-semibold tracking-wide">
by
<%= link_to @document.user.display_name, @document.user, class: User.text_color %>
</span>
</h1>
<div class="leading-8 text-base text-gray-600">
<%= ContentFormatterService.substitute_content_links(clean_links(@document.body.try(:html_safe)) || "", current_user).html_safe %>
</div>
</div>
</div>
</div>
<%# content_for :full_width_page_header do %>
<%# render partial: 'documents/components/document_name_bar', locals: { document: @document } %>
<!-- <div id="editor"><%= ContentFormatterService.substitute_content_links(clean_links(@document.body.try(:html_safe)) || "", current_user).html_safe %></div> -->
<%# end %>