mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
style multiverse universe picker page + add a few blank placeholder pages
This commit is contained in:
parent
66bc408283
commit
3312a30d5e
@ -36,6 +36,9 @@ class MainController < ApplicationController
|
||||
set_questionable_content # for questions
|
||||
end
|
||||
|
||||
def table_of_contents
|
||||
end
|
||||
|
||||
def infostack
|
||||
end
|
||||
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
class UniversesController < ContentController
|
||||
layout 'tailwind', only: [:hub]
|
||||
|
||||
def hub
|
||||
|
||||
end
|
||||
|
||||
# TODO: pull list of content types out from some centralized list somewhere
|
||||
(Rails.application.config.content_types[:all_non_universe] + [Timeline]).each do |content_type|
|
||||
|
||||
@ -7,7 +7,9 @@
|
||||
<div class="-mt-12 sm:-mt-16 sm:flex sm:items-end sm:space-x-5">
|
||||
<div class="flex">
|
||||
<% if @universe_scope %>
|
||||
<%= image_tag @universe_scope.random_image_including_private, class: 'h-24 w-24 rounded-full ring-4 ring-purple-800 sm:h-32 sm:w-32' %>
|
||||
<%= link_to @universe_scope do %>
|
||||
<%= image_tag @universe_scope.random_image_including_private, class: 'h-24 w-24 rounded-full ring-4 ring-purple-800 sm:h-32 sm:w-32' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= image_tag current_user.image_url, class: 'h-24 w-24 rounded-full ring-4 ring-green-800 sm:h-32 sm:w-32' %>
|
||||
<% end %>
|
||||
@ -15,7 +17,7 @@
|
||||
<div class="mt-6 sm:flex-1 sm:min-w-0 sm:flex sm:items-center sm:justify-end sm:space-x-6 sm:pb-1">
|
||||
<div class="sm:hidden md:block mt-6 min-w-0 flex-1">
|
||||
<h1 class="text-2xl font-bold text-gray-900 truncate">
|
||||
My <%= pluralize @content.count, @content_type_name.downcase %>
|
||||
Showing <%= pluralize @content.count, @content_type_name.downcase %>
|
||||
</h1>
|
||||
<% if @universe_scope %>
|
||||
<div class="text-gray-400 text-sm">
|
||||
|
||||
@ -42,12 +42,20 @@
|
||||
</div>
|
||||
|
||||
<!-- left-hand side of navbar -->
|
||||
<div class="flex-grow pt-3.5 pl-1">
|
||||
<div class="flex-grow pt-2.5 pl-1">
|
||||
<% if @universe_scope %>
|
||||
<%= link_to @universe_scope, class: "px-3 py-2 #{Universe.text_color} bg-purple-50 hover:bg-purple-200 rounded" do %>
|
||||
<i class="material-icons text-sm mr-1"><%= Universe.icon %></i>
|
||||
<%= @universe_scope.name %>
|
||||
<% end %>
|
||||
<div class="inline-flex rounded-md shadow-sm" role="group">
|
||||
<%= link_to multiverse_path do %>
|
||||
<button type="button" class="px-2 h-9 text-white <%= Universe.color %> rounded-l-lg border border-purple-800 hover:bg-purple-500 focus:z-10 focus:ring-2 focus:ring-purple-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white">
|
||||
<i class="material-icons text-2xl"><%= Universe.icon %></i>
|
||||
</button>
|
||||
<% end %>
|
||||
<%= link_to @universe_scope do %>
|
||||
<button type="button" class="py-2 h-9 px-4 text-sm font-medium <%= Universe.text_color %> bg-white rounded-r-md border border-gray-200 hover:bg-gray-100 hover:text-purple-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white">
|
||||
<%= @universe_scope.name %>
|
||||
</button>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= link_to 'Choose a universe', '#', class: "px-3 py-2 text-lg #{Universe.text_color} bg-purple-50 hover:bg-purple-200 rounded" %>
|
||||
<% end %>
|
||||
|
||||
1
app/views/main/table_of_contents.html.erb
Normal file
1
app/views/main/table_of_contents.html.erb
Normal file
@ -0,0 +1 @@
|
||||
wee
|
||||
71
app/views/universes/hub.html.erb
Normal file
71
app/views/universes/hub.html.erb
Normal file
@ -0,0 +1,71 @@
|
||||
<div class="relative bg-purple-900">
|
||||
<div class="h-56 bg-indigo-600 sm:h-72 md:absolute md:left-0 md:h-full md:w-1/2">
|
||||
<%= image_tag asset_path("card-headers/universes.webp"), class: 'w-full h-full object-cover' %>
|
||||
</div>
|
||||
<div class="relative max-w-7xl mx-auto px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
|
||||
<div class="md:ml-auto md:w-1/2 md:pl-10">
|
||||
<h2 class="text-base font-semibold uppercase tracking-wider text-gray-300">
|
||||
Filter your notebook
|
||||
</h2>
|
||||
<p class="mt-2 text-white text-3xl font-extrabold tracking-tight sm:text-4xl">
|
||||
Welcome to your own personal multiverse.
|
||||
</p>
|
||||
<p class="mt-3 text-lg text-gray-300">
|
||||
Universes are a convenient way to organize your notebook pages into separate worlds.
|
||||
You can click <strong>EXPAND</strong> on any universe below to filter your notebook to just that universe —
|
||||
and focus on just the world you're working on.
|
||||
</p>
|
||||
<div class="mt-8">
|
||||
<div class="inline-flex rounded-md shadow">
|
||||
<a href="#" class="inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-gray-900 bg-white hover:bg-gray-50">
|
||||
Learn more about universes
|
||||
<!-- Heroicon name: solid/external-link -->
|
||||
<svg class="-mr-1 ml-3 h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z" />
|
||||
<path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="container mx-auto mt-8">
|
||||
<ul role="list" class="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
|
||||
<% @current_user_content.fetch('Universe', []).each do |universe| %>
|
||||
<li class="col-span-1 flex flex-col text-center bg-white rounded-lg shadow divide-y divide-gray-200">
|
||||
<div class="flex-1 flex flex-col p-8">
|
||||
<%= image_tag universe.random_image_including_private, class: 'w-64 h-64 flex-shrink-0 mx-auto rounded-full border-2 border-purple-800' %>
|
||||
<h3 class="mt-6 text-gray-900 text-sm font-medium"><%= universe.name %></h3>
|
||||
<dl class="mt-1 flex-grow flex flex-col justify-between">
|
||||
<dd class="text-gray-500 text-sm"><%= universe.description %></dd>
|
||||
<dd class="mt-3">
|
||||
<% if universe.user_id == current_user.id %>
|
||||
<span class="px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full">Owner</span>
|
||||
<% else %>
|
||||
<span class="px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full">Collaborator</span>
|
||||
<% end %>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<div class="-mt-px flex divide-x divide-gray-200">
|
||||
<div class="w-0 flex-1 flex hover:shadow-lg">
|
||||
<%= link_to table_of_contents_path(universe: universe.id), class: 'relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm text-gray-700 font-medium border border-transparent rounded-bl-lg hover:text-gray-500' do %>
|
||||
<i class="material-icons">fullscreen</i>
|
||||
<span class="ml-3">Expand</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="-ml-px w-0 flex-1 flex hover:shadow-lg">
|
||||
<%= link_to universe_path(universe), class: 'relative w-0 flex-1 inline-flex items-center justify-center py-4 text-sm text-gray-700 font-medium border border-transparent rounded-br-lg hover:text-gray-500' do %>
|
||||
<i class="material-icons"><%= Universe.icon %></i>
|
||||
<span class="ml-3">View</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</section>
|
||||
@ -92,11 +92,14 @@ Rails.application.routes.draw do
|
||||
resources :folders, only: [:create, :update, :destroy, :show]
|
||||
|
||||
scope '/my' do
|
||||
get '/content', to: 'main#dashboard', as: :dashboard
|
||||
get '/dashboard', to: 'main#dashboard', as: :dashboard
|
||||
get '/content', to: 'main#table_of_contents', as: :table_of_contents
|
||||
get '/content/recent', to: 'main#recent_content', as: :recent_content
|
||||
get '/content/deleted', to: 'content#deleted', as: :recently_deleted_content
|
||||
get '/prompts', to: 'main#prompts', as: :prompts
|
||||
|
||||
get '/multiverse', to: 'universes#hub', as: :multiverse
|
||||
|
||||
get '/scratchpad', to: 'main#notes', as: :notes
|
||||
|
||||
get 'tag/remove', to: 'page_tags#remove'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user