From 817ffd0da32fcd2b77367ac2077573d381e727fe Mon Sep 17 00:00:00 2001 From: drusepth Date: Thu, 6 Oct 2022 22:49:30 -0700 Subject: [PATCH] wip restructuring dashboard --- .../_serendipitous_question.html.erb | 51 +++ app/views/main/dashboard.html.erb | 394 +++++++++--------- 2 files changed, 243 insertions(+), 202 deletions(-) create mode 100644 app/views/main/components/_serendipitous_question.html.erb diff --git a/app/views/main/components/_serendipitous_question.html.erb b/app/views/main/components/_serendipitous_question.html.erb new file mode 100644 index 00000000..a4ce3d7a --- /dev/null +++ b/app/views/main/components/_serendipitous_question.html.erb @@ -0,0 +1,51 @@ +
+
+ <%= image_tag @content.random_image_including_private(format: :original), class: 'w-full object-cover object-center max-h-48 rounded-t-md' %> +
+
+
+

+ Expand + <% if @universe_scope.present? %> + <%= link_to @universe_scope.name, @universe_scope, class: Universe.text_color %>, + <% else %> + your worlds, + <% end %> + one question at a time +

+ <%= + if @content && @attribute_field_to_question + render partial: 'cards/serendipitous/tailwind_content_question', locals: { + content: @content, + field: @attribute_field_to_question, + expand_by_default: true, + include_quick_reference: false + } + end + %> +

+ <%= @content.icon %> + Your answer will be automatically saved to your + <%= @content.name %> + <%= @content.page_type.downcase %> page. +

+ +
+
+ <%= link_to '#', class: "#{@content.color} text-white block rounded-lg p-2 mb-1" do %> + <%= @content.icon %> +
Quick-reference
+ <%= @content.name %> + <% end %> + + <%= link_to prompts_path, class: "bg-orange-500 text-white block rounded-lg p-2" do %> + lightbulb + See more prompts + <% if @universe_scope.present? %> + in this universe + <% end %> + arrow_right + <% end %> +
+
+
\ No newline at end of file diff --git a/app/views/main/dashboard.html.erb b/app/views/main/dashboard.html.erb index 63f27cc6..11ef382b 100644 --- a/app/views/main/dashboard.html.erb +++ b/app/views/main/dashboard.html.erb @@ -47,212 +47,202 @@ -
- - - -
-
-
-

- Expand - <% if @universe_scope.present? %> - <%= link_to @universe_scope.name, @universe_scope, class: Universe.text_color %>, - <% else %> - your worlds, - <% end %> - one question at a time -

- <%= - if @content && @attribute_field_to_question - render partial: 'cards/serendipitous/tailwind_content_question', locals: { - content: @content, - field: @attribute_field_to_question, - expand_by_default: true, - include_quick_reference: false - } - end - %> -
-
- <%= link_to '#', class: "#{@content.color} text-white block rounded-lg p-2 mb-1" do %> - <%= @content.icon %> -
Quick-reference
- <%= @content.name %> - <% end %> - - <%= link_to prompts_path, class: "bg-orange-500 text-white block rounded-lg p-2" do %> - lightbulb - See more prompts - <% if @universe_scope.present? %> - in this universe - <% end %> - arrow_right - <% end %> - -

- <%= @content.icon %> - Your answer will be automatically saved to your - <%= @content.name %> - <%= @content.page_type.downcase %> page. -

-
-
+
+ rhs
- -

- Pick up where you left off -

-
-
    - <% @recently_edited_pages.first(9).each do |page| %> - <% next if page.is_a?(Document) || page.is_a?(Timeline) %> - - <%= link_to page.edit_path do %> -
  • -
    -
    - <%= image_tag page.random_image_including_private, class: 'w-32 h-32 bg-notebook-blue rounded-lg flex-shrink-0' %> -
    -
    -
    -

    - <%= page.name %> -

    -
    -

    - word count -

    -

    - last edited <%= time_ago_in_words page.updated_at %> ago -

    -
    -
    -
  • - <% end %> - <% end %> -
-
- -

Or create a new...

-
-
    - <% (@activated_content_types + ["Timeline", "Document"]).each do |content_type| %> - <% klass = content_class_from_name(content_type) %> - <%= link_to send("new_#{content_type.downcase}_path") do %> -
  • -
    - <%= klass.icon %> -
    - <%= content_type %> -
    -
    -
  • - <% end %> - <% end %> -
-
-
+ + +
+
    + <% @recently_edited_pages.first(9).each do |page| %> + <% next if page.is_a?(Document) || page.is_a?(Timeline) %> + + <%= link_to page.edit_path do %> +
  • +
    +
    + <%= image_tag page.random_image_including_private, class: 'w-32 h-32 bg-notebook-blue rounded-lg flex-shrink-0' %> +
    +
    +
    +

    + <%= page.name %> +

    +
    +

    + word count +

    +

    + last edited <%= time_ago_in_words page.updated_at %> ago +

    +
    +
    +
  • + <% end %> + <% end %> +
+
+ + + +
+

Your writing activity

+
+
+
+
+
+ date_range +
+
+
+
Weekly average
+
+ words per day +
+
+
+
+
+ +
+ +
+
+
+
+ calendar_month +
+
+
+
Words written this month
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
Your active writing streak
+
+ <% 7.times.with_index do |i| %> + <%= link_to '#day-breakdown', class: 'group relative inline-block mt-2 mr-2' do %> + <%= 25 + i %> + + check_circle + + <% end %> + <% end %> +
+
+
+
+
+ +
+ +
+
+ +

+ Pick up where you left off +

+
+
    + <% @recently_edited_pages.first(9).each do |page| %> + <% next if page.is_a?(Document) || page.is_a?(Timeline) %> + + <%= link_to page.edit_path do %> +
  • +
    +
    + <%= image_tag page.random_image_including_private, class: 'w-32 h-32 bg-notebook-blue rounded-lg flex-shrink-0' %> +
    +
    +
    +

    + <%= page.name %> +

    +
    +

    + word count +

    +

    + last edited <%= time_ago_in_words page.updated_at %> ago +

    +
    +
    +
  • + <% end %> + <% end %> +
+
+ +

Or create a new...

+
+
    + <% (@activated_content_types + ["Timeline", "Document"]).each do |content_type| %> + <% klass = content_class_from_name(content_type) %> + <%= link_to send("new_#{content_type.downcase}_path") do %> +
  • +
    + <%= klass.icon %> +
    + <%= content_type %> +
    +
    +
  • + <% end %> + <% end %> +
+
+