From a92e7f9a8a02e1159d65c53d02732bceae99f3e0 Mon Sep 17 00:00:00 2001
From: Zee <50284+zspencer@users.noreply.github.com>
Date: Thu, 7 Mar 2024 09:36:27 -0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B8=20`DesignLibrary`:=20Layout=20is?=
=?UTF-8?q?=20responsible=20for....=20Layout...=20(#2281)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- https://github.com/zinc-collective/convene/issues/1187
- https://github.com/zinc-collective/convene/issues/2271
- https://github.com/zinc-collective/convene/issues/2253
One of the things we've kept bumping into is that each page has to
decide how wide it wants to be. That doesn't really seem sustainable or
particularly necessary; so now the Layout takes care of:
- Providing a Max-Width on every page
- Ensuring the Layout is centered horizontally
- Ensuring there is appropriate margin from the top
of the screen
---
.../journal/journals/_journal.html.erb | 17 ++++-----
app/furniture/layouts/marketplace.html.erb | 37 +++++++++----------
.../marketplace/orders/index.html.erb | 7 ++--
.../marketplace/orders/show.html.erb | 5 +--
app/views/authenticated_sessions/new.html.erb | 4 +-
app/views/layouts/application.html.erb | 3 +-
app/views/neighborhoods/show.html.erb | 22 +++++------
app/views/rooms/_room.html.erb | 11 +++---
.../space/agreements/_agreement.html.erb | 2 +-
9 files changed, 51 insertions(+), 57 deletions(-)
diff --git a/app/furniture/journal/journals/_journal.html.erb b/app/furniture/journal/journals/_journal.html.erb
index 2b37d4016..b9e325396 100644
--- a/app/furniture/journal/journals/_journal.html.erb
+++ b/app/furniture/journal/journals/_journal.html.erb
@@ -1,13 +1,12 @@
-
- <%= render Journal::NewEntryButtonComponent.new(journal: journal) %>
-
- <%- @pagy, @entries = pagy(policy_scope(journal.entries.recent)) %>
+<%= render Journal::NewEntryButtonComponent.new(journal: journal) %>
- <%= render Journal::EntryComponent.with_collection(@entries) %>
-
+
+ <%- @pagy, @entries = pagy(policy_scope(journal.entries.recent)) %>
- <%== pagy_nav(@pagy) %>
+ <%= render Journal::EntryComponent.with_collection(@entries) %>
+
- <%= render Journal::NewEntryButtonComponent.new(journal: journal) %>
-
+<%== pagy_nav(@pagy) %>
+
+<%= render Journal::NewEntryButtonComponent.new(journal: journal) %>
diff --git a/app/furniture/layouts/marketplace.html.erb b/app/furniture/layouts/marketplace.html.erb
index 8dadf9bec..4e8595cc9 100644
--- a/app/furniture/layouts/marketplace.html.erb
+++ b/app/furniture/layouts/marketplace.html.erb
@@ -1,25 +1,24 @@
<%- content_for :content do %>
-
-
- <%= turbo_frame_tag(marketplace, data: { turbo_action: :advance }) do %>
- <%- if policy(marketplace).edit? %>
- <%= render Marketplace::ManagementComponent.new(marketplace: marketplace) do %>
- <%= yield %>
- <%- end %>
- <%- else %>
-
-
-
- <%= t('.header', space: marketplace.space.name, room: marketplace.room.name) %>
-
-
-
- <%= yield %>
-
-
+
+ <%= turbo_frame_tag(marketplace, data: { turbo_action: :advance }) do %>
+ <%- if policy(marketplace).edit? %>
+ <%= render Marketplace::ManagementComponent.new(marketplace: marketplace) do %>
+ <%= yield %>
<%- end %>
+ <%- else %>
+
+
+
+ <%= t('.header', space: marketplace.space.name, room: marketplace.room.name) %>
+
+
+
+ <%= yield %>
+
+
<%- end %>
<%- end %>
-
+ <%- end %>
+
<%= render template: "layouts/application" %>
diff --git a/app/furniture/marketplace/orders/index.html.erb b/app/furniture/marketplace/orders/index.html.erb
index bfad34999..e43d72d3d 100644
--- a/app/furniture/marketplace/orders/index.html.erb
+++ b/app/furniture/marketplace/orders/index.html.erb
@@ -1,6 +1,5 @@
<%- breadcrumb :marketplace_orders, marketplace %>
<%- @pagy, @records = pagy(orders.paid) %>
-
- <%= render @records %>
- <%== pagy_nav(@pagy) if @pagy.pages > 1 %>
-
+
+<%= render @records %>
+<%== pagy_nav(@pagy) if @pagy.pages > 1 %>
diff --git a/app/furniture/marketplace/orders/show.html.erb b/app/furniture/marketplace/orders/show.html.erb
index 9e0d331e1..da22fa28b 100644
--- a/app/furniture/marketplace/orders/show.html.erb
+++ b/app/furniture/marketplace/orders/show.html.erb
@@ -1,4 +1,3 @@
<%- breadcrumb :marketplace_order, order%>
-
- <%= render order %>
-
+
+<%= render order %>
diff --git a/app/views/authenticated_sessions/new.html.erb b/app/views/authenticated_sessions/new.html.erb
index a05607cea..9bb76d10a 100644
--- a/app/views/authenticated_sessions/new.html.erb
+++ b/app/views/authenticated_sessions/new.html.erb
@@ -1,3 +1 @@
-
- <%= render partial: 'form', locals: { authenticated_session: authenticated_session } %>
-
+<%= render partial: 'form', locals: { authenticated_session: authenticated_session } %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index ee4bfa50d..ecccf470a 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -5,7 +5,8 @@
<%= render 'layouts/header' %>
-
+
<%= content_for?(:content) ? yield(:content) : yield %>
diff --git a/app/views/neighborhoods/show.html.erb b/app/views/neighborhoods/show.html.erb
index 2afbedbd0..fc24c1ab5 100644
--- a/app/views/neighborhoods/show.html.erb
+++ b/app/views/neighborhoods/show.html.erb
@@ -1,18 +1,18 @@
<%- @pagy, @records = pagy(policy_scope(neighborhood.spaces)) %>
-
-
- <%= render @records %>
-
- <%== pagy_nav(@pagy) %>
+
+ <%= render @records %>
+
+
+<%== pagy_nav(@pagy) %>
+
+<%- if policy(Space).new? %>
+
+ <%= link_to "Add a Space",[:new, :space] %>
+
+<%- end %>
- <%- if policy(Space).new? %>
-
- <%= link_to "Add a Space",[:new, :space] %>
-
- <%- end %>
-
<%- if !neighborhood.email_configured? %>
It looks like you haven't configured Convene to send email. Check the .env.example
file for variables named with SMTP
and make sure each is set with your email providers configuration.
diff --git a/app/views/rooms/_room.html.erb b/app/views/rooms/_room.html.erb
index 74e76616d..e1ace6dcf 100644
--- a/app/views/rooms/_room.html.erb
+++ b/app/views/rooms/_room.html.erb
@@ -1,10 +1,9 @@
<%- if room.hero_image&.upload.present? %>
<%= image_tag room.hero_image&.upload&.variant(resize_to_fill: Media::FULL_WIDTH_SHORT), class: "w-full" %>
<%- end %>
-
-
-
- <%= render room.gizmos.rank(:slot) %>
-
-
+
+
+
+ <%= render room.gizmos.rank(:slot) %>
+
diff --git a/app/views/space/agreements/_agreement.html.erb b/app/views/space/agreements/_agreement.html.erb
index da9ada150..faaf6ef14 100644
--- a/app/views/space/agreements/_agreement.html.erb
+++ b/app/views/space/agreements/_agreement.html.erb
@@ -1,4 +1,4 @@
-<%= render CardComponent.new(dom_id: dom_id(agreement), classes: "mx-auto mt-2 max-w-prose w-full") do %>
+<%= render CardComponent.new(dom_id: dom_id(agreement)) do %>
<%= agreement.name %>