diff --git a/app/assets/stylesheets/administrate/components/_attributes.scss b/app/assets/stylesheets/administrate/components/_attributes.scss index 669346caa4..9b4ac5e072 100644 --- a/app/assets/stylesheets/administrate/components/_attributes.scss +++ b/app/assets/stylesheets/administrate/components/_attributes.scss @@ -23,5 +23,14 @@ .attribute--nested { border: $base-border; + display: table; padding: $small-spacing; + width: 100%; +} + +.attribute--nested--legend { + background: $white; + display: inline; + position: relative; + top: -1.5em; } diff --git a/app/assets/stylesheets/administrate/components/_field-unit.scss b/app/assets/stylesheets/administrate/components/_field-unit.scss index 93a88fc3a3..8eeabc9aa5 100644 --- a/app/assets/stylesheets/administrate/components/_field-unit.scss +++ b/app/assets/stylesheets/administrate/components/_field-unit.scss @@ -54,3 +54,16 @@ content: " *"; } } + +section .field-unit--nested { + display: table; + margin-bottom: 1rem; + width: 90%; +} + +.field-unit--legend { + background: $white; + display: inline; + position: relative; + top: -1.5rem; +} diff --git a/app/views/administrate/application/show.html.erb b/app/views/administrate/application/show.html.erb index 7a7d26541f..34a26bce31 100644 --- a/app/views/administrate/application/show.html.erb +++ b/app/views/administrate/application/show.html.erb @@ -43,9 +43,13 @@ as well as a link to its edit page.
<% page.attributes.each do |title, attributes| %> -
"> +
"> <% if title.present? %> - <%= t "helpers.label.#{page.resource_name}.#{title}", default: title %> +

+ +

<% end %> <% attributes.each do |attribute| %> @@ -59,7 +63,7 @@ as well as a link to its edit page.
<%= render_field attribute, page: page %>
<% end %> -
+
<% end %> diff --git a/app/views/fields/has_one/_show.html.erb b/app/views/fields/has_one/_show.html.erb index b8636f6efa..970b088c7c 100644 --- a/app/views/fields/has_one/_show.html.erb +++ b/app/views/fields/has_one/_show.html.erb @@ -16,18 +16,24 @@ All show page attributes of has_one relationship would be rendered %> <% if field.linkable? %> -
- +
+

+ +

<% field.nested_show.attributes.each do |title, attributes| -%> -
"> +
"> <% if title.present? %> - <%= t "helpers.label.#{namespace}.#{title}", default: title %> +

+ +

<% end %> <% attributes.each do |attribute| %> @@ -41,7 +47,7 @@ All show page attributes of has_one relationship would be rendered <%= render_field attribute, { page: page } %> <% end %> -
+
<% end -%> -
+ <% end %>