From 3312a30d5eaddf61f18f8a4f3aefc5fefbbb68bd Mon Sep 17 00:00:00 2001 From: drusepth Date: Fri, 15 Apr 2022 23:53:47 -0700 Subject: [PATCH] style multiverse universe picker page + add a few blank placeholder pages --- app/controllers/main_controller.rb | 3 + app/controllers/universes_controller.rb | 5 ++ app/views/content/index.html.erb | 6 +- app/views/layouts/tailwind.html.erb | 18 ++++-- app/views/main/table_of_contents.html.erb | 1 + app/views/universes/hub.html.erb | 71 +++++++++++++++++++++++ config/routes.rb | 5 +- 7 files changed, 101 insertions(+), 8 deletions(-) create mode 100644 app/views/main/table_of_contents.html.erb create mode 100644 app/views/universes/hub.html.erb diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 78479049..67a1336c 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -36,6 +36,9 @@ class MainController < ApplicationController set_questionable_content # for questions end + def table_of_contents + end + def infostack end diff --git a/app/controllers/universes_controller.rb b/app/controllers/universes_controller.rb index ca1484fe..bc4c2fba 100644 --- a/app/controllers/universes_controller.rb +++ b/app/controllers/universes_controller.rb @@ -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| diff --git a/app/views/content/index.html.erb b/app/views/content/index.html.erb index 0e597df4..d4417ca6 100644 --- a/app/views/content/index.html.erb +++ b/app/views/content/index.html.erb @@ -7,7 +7,9 @@
<% 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 @@

- My <%= pluralize @content.count, @content_type_name.downcase %> + Showing <%= pluralize @content.count, @content_type_name.downcase %>

<% if @universe_scope %>
diff --git a/app/views/layouts/tailwind.html.erb b/app/views/layouts/tailwind.html.erb index 8d27a685..5895417c 100644 --- a/app/views/layouts/tailwind.html.erb +++ b/app/views/layouts/tailwind.html.erb @@ -42,12 +42,20 @@
-
+
<% if @universe_scope %> - <%= link_to @universe_scope, class: "px-3 py-2 #{Universe.text_color} bg-purple-50 hover:bg-purple-200 rounded" do %> - <%= Universe.icon %> - <%= @universe_scope.name %> - <% end %> +
+ <%= link_to multiverse_path do %> + + <% end %> + <%= link_to @universe_scope do %> + + <% end %> +
<% 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 %> diff --git a/app/views/main/table_of_contents.html.erb b/app/views/main/table_of_contents.html.erb new file mode 100644 index 00000000..3d518f9c --- /dev/null +++ b/app/views/main/table_of_contents.html.erb @@ -0,0 +1 @@ +wee \ No newline at end of file diff --git a/app/views/universes/hub.html.erb b/app/views/universes/hub.html.erb new file mode 100644 index 00000000..266e6d18 --- /dev/null +++ b/app/views/universes/hub.html.erb @@ -0,0 +1,71 @@ +
+
+ <%= image_tag asset_path("card-headers/universes.webp"), class: 'w-full h-full object-cover' %> +
+
+
+

+ Filter your notebook +

+

+ Welcome to your own personal multiverse. +

+

+ Universes are a convenient way to organize your notebook pages into separate worlds. + You can click EXPAND on any universe below to filter your notebook to just that universe — + and focus on just the world you're working on. +

+ +
+
+
+ +
+
    + <% @current_user_content.fetch('Universe', []).each do |universe| %> +
  • +
    + <%= image_tag universe.random_image_including_private, class: 'w-64 h-64 flex-shrink-0 mx-auto rounded-full border-2 border-purple-800' %> +

    <%= universe.name %>

    +
    +
    <%= universe.description %>
    +
    + <% if universe.user_id == current_user.id %> + Owner + <% else %> + Collaborator + <% end %> +
    +
    +
    +
    +
    +
    + <%= 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 %> + fullscreen + Expand + <% end %> +
    +
    + <%= 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 %> + <%= Universe.icon %> + View + <% end %> +
    +
    +
    +
  • + <% end %> +
+
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3da255e5..00861b83 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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'