<% category[:fields].each do |field| %>
- <% next if field[:value].empty? %>
-
(type: <%= field[:type] %>)
- <%= field[:value] %>
-
-
-
-
<%= link_to 'Edit', '#' %>
-
<%= link_to 'Revise', '#' %>
-
<%= link_to 'Change field type', '#' %>
-
+ <%=
+ case field[:type]
+ when 'name'
+ render partial: 'content/tailwind_components/fields/name', locals: { field: field }
+ when 'text_area', 'textarea'
+ render partial: 'content/tailwind_components/fields/text', locals: { field: field }
+ when 'link'
+ render partial: 'content/tailwind_components/fields/link', locals: { field: field }
+ when 'universe'
+ render partial: 'content/tailwind_components/fields/universe', locals: { field: field }
+ when 'tags'
+ render partial: 'content/tailwind_components/fields/tags', locals: { field: field }
+ end
+ %>
<% end %>
diff --git a/app/views/content/tailwind_components/_content_header.html.erb b/app/views/content/tailwind_components/_content_header.html.erb
index 8f905847..a8de3a9c 100644
--- a/app/views/content/tailwind_components/_content_header.html.erb
+++ b/app/views/content/tailwind_components/_content_header.html.erb
@@ -1,6 +1,6 @@
-
+
<%= content.name %>
@@ -10,6 +10,14 @@
+
+
+
\ No newline at end of file
diff --git a/app/views/content/tailwind_components/_content_image_header.html.erb b/app/views/content/tailwind_components/_content_image_header.html.erb
index 70f32dbf..417e96c2 100644
--- a/app/views/content/tailwind_components/_content_image_header.html.erb
+++ b/app/views/content/tailwind_components/_content_image_header.html.erb
@@ -1,3 +1,3 @@
-
- image banner
+
+
\ No newline at end of file
diff --git a/app/views/content/tailwind_components/fields/_link.html.erb b/app/views/content/tailwind_components/fields/_link.html.erb
new file mode 100644
index 00000000..ff93d6ae
--- /dev/null
+++ b/app/views/content/tailwind_components/fields/_link.html.erb
@@ -0,0 +1,35 @@
+<% field[:value].each do |link_code| %>
+ <%
+ klass, id = link_code.split('-')
+ %>
+
+ <%#
+ In most cases, a user will be seeing their own content most of the time.
+ This allows us to primarily rely on @current_user_content but fall back
+ on js-load-page-name to fetch & load in post-page-load if the content isn't ours.
+ %>
+ <%
+ content = if user_signed_in?
+ @current_user_content.fetch(klass, []).detect do |page|
+ page.page_type === klass && page.id === id.to_i
+ end
+ else
+ nil
+ end
+ %>
+
+
+ <%= link_to send("#{klass.downcase}_path", id) do %>
+
+
+ <%= content_class_from_name(klass).icon %>
+
+
+ <%= content.try(:name) || "Loading #{klass}".html_safe %>
+ <% end %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/content/tailwind_components/fields/_name.html.erb b/app/views/content/tailwind_components/fields/_name.html.erb
new file mode 100644
index 00000000..c11caeed
--- /dev/null
+++ b/app/views/content/tailwind_components/fields/_name.html.erb
@@ -0,0 +1,3 @@
+
+ <%= field[:value] %>
+
diff --git a/app/views/content/tailwind_components/fields/_tags.html.erb b/app/views/content/tailwind_components/fields/_tags.html.erb
new file mode 100644
index 00000000..f8744651
--- /dev/null
+++ b/app/views/content/tailwind_components/fields/_tags.html.erb
@@ -0,0 +1,11 @@
+<% field[:value].each do |tag| %>
+
+ <%= tag %>
+
+
+<% end %>
diff --git a/app/views/content/tailwind_components/fields/_text.html.erb b/app/views/content/tailwind_components/fields/_text.html.erb
new file mode 100644
index 00000000..c7f22883
--- /dev/null
+++ b/app/views/content/tailwind_components/fields/_text.html.erb
@@ -0,0 +1 @@
+<%= field[:value] %>
\ No newline at end of file
diff --git a/app/views/content/tailwind_components/fields/_universe.html.erb b/app/views/content/tailwind_components/fields/_universe.html.erb
new file mode 100644
index 00000000..a517ea03
--- /dev/null
+++ b/app/views/content/tailwind_components/fields/_universe.html.erb
@@ -0,0 +1,26 @@
+<% klass, id = "Universe", field[:value] %>
+
+<%
+ content = if user_signed_in?
+ @current_user_content.fetch(klass, []).detect do |page|
+ page.page_type === klass && page.id === id.to_i
+ end
+ else
+ nil
+ end
+%>
+
+
+ <%= link_to send("#{klass.downcase}_path", id) do %>
+
+
+ <%= content_class_from_name(klass).icon %>
+
+
+ <%= content.try(:name) || "Loading #{klass}".html_safe %>
+ <% end %>
+