eod forums work from yesterday

This commit is contained in:
drusepth 2022-12-07 15:52:30 -08:00
parent 5da39f8b17
commit 1677861cfe
6 changed files with 128 additions and 121 deletions

View File

@ -28,4 +28,8 @@
.thredded--post--content {
font-size: 12pt;
}
.thredded--post {
margin-bottom: 1em !important;
}

View File

@ -150,130 +150,132 @@
<!-- sidebar -->
<!-- todo put this in shared partial with real design -->
<nav x-show="showSidebar" class="notebook--sidebar fixed top-0 pt-16 flex flex-col left-0 z-20 h-screen overflow-x-hidden transition origin-left transform bg-white border-r w-56 md:translate-x-0" :class="{ '-translate-x-full' : !showSidebar, 'translate-x-0' : showSidebar }" <%# @click.away="showSidebar = false" %>>
<nav class="notebook--sidebar text-sm font-medium text-gray-600 pt-1 overflow-y-auto flex-grow border-b border-gray-300 shadow" aria-label="Main Navigation">
<!--
<%= link_to main_app.table_of_contents_path, class: 'flex items-center px-2 py-3 transition cursor-pointer group hover:bg-gray-100' do %>
<i class="material-icons text-gray-400 shrink-0 w-6 h-6 mr-2 <%= Universe.text_color %>">dashboard</i>
<span class="group-hover:text-gray-900">Table of Contents</span>
<% end %>
-->
<% if user_signed_in? %>
<nav x-show="showSidebar" class="notebook--sidebar fixed top-0 pt-16 flex flex-col left-0 z-20 h-screen overflow-x-hidden transition origin-left transform bg-white border-r w-56 md:translate-x-0" :class="{ '-translate-x-full' : !showSidebar, 'translate-x-0' : showSidebar }" <%# @click.away="showSidebar = false" %>>
<nav class="notebook--sidebar text-sm font-medium text-gray-600 pt-1 overflow-y-auto flex-grow border-b border-gray-300 shadow" aria-label="Main Navigation">
<!--
<%= link_to main_app.table_of_contents_path, class: 'flex items-center px-2 py-3 transition cursor-pointer group hover:bg-gray-100' do %>
<i class="material-icons text-gray-400 shrink-0 w-6 h-6 mr-2 <%= Universe.text_color %>">dashboard</i>
<span class="group-hover:text-gray-900">Table of Contents</span>
<% end %>
-->
<div x-data="{ expandedWorldbuildingSidebar: false }">
<div class="flex items-center justify-between px-2 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900" role="button" @click="expandedWorldbuildingSidebar = !expandedWorldbuildingSidebar" >
<div class="flex items-center">
<i class="material-icons text-notebook-blue shrink-0 w-6 h-6 mr-2">book</i>
<span>Worldbuilding</span>
<div x-data="{ expandedWorldbuildingSidebar: false }">
<div class="flex items-center justify-between px-2 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900" role="button" @click="expandedWorldbuildingSidebar = !expandedWorldbuildingSidebar" >
<div class="flex items-center">
<i class="material-icons text-notebook-blue shrink-0 w-6 h-6 mr-2">book</i>
<span>Worldbuilding</span>
</div>
<svg :class="{ 'rotate-90': expandedWorldbuildingSidebar }" class="shrink-0 w-4 h-4 ml-2 transition transform" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</div>
<div x-show="expandedWorldbuildingSidebar" x-cloak class="mb-1 pl-1">
<% @activated_content_types.each do |content_type| %>
<% content_type_klass = content_class_from_name(content_type) %>
<%= link_to main_app.polymorphic_path(content_type_klass), class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= content_type_klass.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= content_type_klass.icon %></i>
<span class="flex-grow text-sm"><%= content_type.pluralize %></span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
<%= number_with_delimiter @current_user_content.fetch(content_type, []).count %>
</span>
<% end %>
<% end %>
</div>
<svg :class="{ 'rotate-90': expandedWorldbuildingSidebar }" class="shrink-0 w-4 h-4 ml-2 transition transform" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</div>
<div x-show="expandedWorldbuildingSidebar" x-cloak class="mb-1 pl-1">
<% @activated_content_types.each do |content_type| %>
<% content_type_klass = content_class_from_name(content_type) %>
<%= link_to main_app.polymorphic_path(content_type_klass), class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= content_type_klass.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= content_type_klass.icon %></i>
<span class="flex-grow text-sm"><%= content_type.pluralize %></span>
<div x-data="{ expandedWritingSidebar: false }">
<div class="flex items-center justify-between px-2 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900" role="button" @click="expandedWritingSidebar = !expandedWritingSidebar" >
<div class="flex items-center">
<i class="material-icons text-notebook-blue shrink-0 w-6 h-6 mr-2">book</i>
<span>Writing</span>
</div>
<svg :class="{ 'rotate-90': expandedWritingSidebar }" class="shrink-0 w-4 h-4 ml-2 transition transform" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</div>
<div x-show="expandedWritingSidebar" x-cloak class="pl-1 mb-2">
<%= link_to main_app.prompts_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons text-orange-400 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full">lightbulb</i>
<span class="flex-grow text-sm">Prompts</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
<%= number_with_delimiter @current_user_content.fetch(content_type, []).count %>
0
</span>
<% end %>
<% end %>
</div>
</div>
<div x-data="{ expandedWritingSidebar: false }">
<div class="flex items-center justify-between px-2 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900" role="button" @click="expandedWritingSidebar = !expandedWritingSidebar" >
<div class="flex items-center">
<i class="material-icons text-notebook-blue shrink-0 w-6 h-6 mr-2">book</i>
<span>Writing</span>
<%= link_to main_app.timelines_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= Timeline.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= Timeline.icon %></i>
<span class="flex-grow text-sm">Timelines</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.documents_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= Document.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= Document.icon %></i>
<span class="flex-grow text-sm">Documents</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to '#new-analysis-onboarding', class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= DocumentAnalysis.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= DocumentAnalysis.icon %></i>
<span class="flex-grow text-sm">Analysis</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
</div>
<svg :class="{ 'rotate-90': expandedWritingSidebar }" class="shrink-0 w-4 h-4 ml-2 transition transform" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</div>
<div x-show="expandedWritingSidebar" x-cloak class="pl-1 mb-2">
<%= link_to main_app.prompts_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons text-orange-400 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full">lightbulb</i>
<span class="flex-grow text-sm">Prompts</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.timelines_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= Timeline.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= Timeline.icon %></i>
<span class="flex-grow text-sm">Timelines</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.documents_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= Document.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= Document.icon %></i>
<span class="flex-grow text-sm">Documents</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to '#new-analysis-onboarding', class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= DocumentAnalysis.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= DocumentAnalysis.icon %></i>
<span class="flex-grow text-sm">Analysis</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
</div>
</div>
<div x-data="{ expandedWritingSidebar: false }">
<div class="flex items-center justify-between px-2 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900" role="button" @click="expandedWritingSidebar = !expandedWritingSidebar" >
<div class="flex items-center">
<i class="material-icons text-notebook-blue shrink-0 w-6 h-6 mr-2">book</i>
<span>Community</span>
<div x-data="{ expandedWritingSidebar: false }">
<div class="flex items-center justify-between px-2 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900" role="button" @click="expandedWritingSidebar = !expandedWritingSidebar" >
<div class="flex items-center">
<i class="material-icons text-notebook-blue shrink-0 w-6 h-6 mr-2">book</i>
<span>Community</span>
</div>
<svg :class="{ 'rotate-90': expandedWritingSidebar }" class="shrink-0 w-4 h-4 ml-2 transition transform" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</div>
<svg :class="{ 'rotate-90': expandedWritingSidebar }" class="shrink-0 w-4 h-4 ml-2 transition transform" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</div>
<div x-show="expandedWritingSidebar" x-cloak class="pl-1 mb-2">
<%= link_to main_app.stream_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons text-purple-400 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full">ballot</i>
<span class="flex-grow text-sm">Activity</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<div x-show="expandedWritingSidebar" x-cloak class="pl-1 mb-2">
<%= link_to main_app.stream_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons text-purple-400 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full">ballot</i>
<span class="flex-grow text-sm">Activity</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.page_collections_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= PageCollection.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= PageCollection.icon %></i>
<span class="flex-grow text-sm">Collections</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.page_collections_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons <%= PageCollection.text_color %> shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full"><%= PageCollection.icon %></i>
<span class="flex-grow text-sm">Collections</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.thredded_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons text-blue-500 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full">forum</i>
<span class="flex-grow text-sm">Discussions</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
<%= link_to main_app.thredded_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %>
<i class="material-icons text-blue-500 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full">forum</i>
<span class="flex-grow text-sm">Discussions</span>
<span class="bg-gray-100 rounded px-1 text-xs group-hover:bg-notebook-blue">
0
</span>
<% end %>
</div>
</div>
</nav>
<div @click="showSidebar = false" class="flex items-center px-4 py-1 cursor-pointer group hover:bg-notebook-blue hover:text-white">
<i class="material-icons text-blue-500 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full p-1">arrow_left</i>
<span class="flex-grow text-sm">Hide Sidebar</span>
</div>
</nav>
<div @click="showSidebar = false" class="flex items-center px-4 py-1 cursor-pointer group hover:bg-notebook-blue hover:text-white">
<i class="material-icons text-blue-500 shrink-0 w-6 h-6 lg:w-8 lg:h-8 lg:p-1 mr-2 bg-white rounded-full p-1">arrow_left</i>
<span class="flex-grow text-sm">Hide Sidebar</span>
</div>
</nav>
<% end %>
<!-- forum navigation & breadcrumbs -->
<nav class="thredded-nav bg-white border-b border-gray-200 flex">
<nav class="thredded-nav bg-white border-b border-gray-200 flex ">
<ol role="list" class="max-w-screen-xl w-full mx-auto flex space-x-4 pl-40">
<%= render('thredded/redesigned/breadcrumbs') %>
</ol>
@ -288,7 +290,7 @@
<!-- sidebar backdrop on mobile -->
<div class="fixed inset-0 z-10 w-screen h-screen bg-black bg-opacity-25 md:hidden" x-show.transition="showSidebar" x-cloak></div>
<main :class="{ 'ml-56': showSidebar }">
<main <% if user_signed_in? %>:class="{ 'ml-56': showSidebar }"<% end %>>
<%= yield %>
</main>

View File

@ -6,7 +6,8 @@
<div class="line-clamp-1"><%= topic.title %></div>
<div>
<small>
<%= pluralize (topic.posts.count - 1), 'reply' %>
<%= number_with_delimiter (topic.posts.count - 1) %>
<%= 'reply'.pluralize(topic.posts.count - 1) %>
</small>
<small>
in <strong><%= topic.messageboard.name %></strong>

View File

@ -18,13 +18,17 @@
<div class="flex space-x-4">
<div>
<span class="inline-block relative">
<%= image_tag post.user.image_url(120), class: 'h-16 w-16 rounded-full border border-gray-200' %>
<% if post.user.favorite_page_type? %>
<span class="absolute bottom-2 right-2 transform translate-y-1/2 translate-x-1/2 block border-2 border-white rounded-full">
<span class="block h-6 w-6 rounded-full text-center <%= content_class_from_name(post.user.favorite_page_type).color %>">
<i class="material-icons text-sm text-white"><%= content_class_from_name(post.user.favorite_page_type).icon %></i>
</span>
</span>
<% if post.user %>
<%= image_tag post.user.image_url(120), class: 'h-16 w-16 rounded-full border border-gray-200' %>
<% if post.user.favorite_page_type? %>
<%= link_to main_app.send("#{post.user.favorite_page_type.downcase.pluralize}_user_path", { id: post.user.id }) do %>
<span class="absolute bottom-2 right-2 transform translate-y-1/2 translate-x-1/2 block border-2 border-white rounded-full">
<span class="block h-6 w-6 rounded-full text-center <%= content_class_from_name(post.user.favorite_page_type).color %>">
<i class="material-icons text-sm text-white"><%= content_class_from_name(post.user.favorite_page_type).icon %></i>
</span>
</span>
<% end %>
<% end %>
<% end %>
</span>
</div>
@ -35,7 +39,7 @@
<%= user_link post.user %>
</h2>
<% if post.user.forum_moderator? %>
<% if post.user&.forum_moderator? %>
<i class="material-icons float-left text-notebook-blue mr-1">
health_and_safety
</i>

View File

@ -18,10 +18,6 @@
<%= content_tag :section,
id: dom_id(topic),
class: ['thredded--main-section', 'thredded--topic', *topic_css_classes(topic)] do %>
<%= view_hooks.posts_common.pagination_top.render(self, posts: @posts) do %>
<footer class="thredded--pagination-top"><%= paginate @posts %></footer>
<% end %>
<%= render_posts @posts,
partial: 'thredded/posts/post',
content_partial: 'thredded/posts/content',

View File

@ -21,6 +21,6 @@
<%= badge_text.presence || 'Premium Supporter' %>
</span>
<% else %>
<%= favorite_link %>
<!-- No badge -->
<% end %>
<% end %>