diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index 8b3e56abc4..3f5af0c916 100644 --- a/src/wp-admin/css/wp-admin.css +++ b/src/wp-admin/css/wp-admin.css @@ -7052,6 +7052,26 @@ body.folded .theme-overlay .theme-wrap { .theme-overlay .parent-theme strong { font-weight: 700; } +/** + * Single Theme Mode + * Displays detailed view inline when a user has no switch capabilities + */ +.single-theme .theme-overlay .theme-backdrop, +.single-theme .theme-overlay .theme-header, +.single-theme .theme { + display: none; +} +.single-theme .theme-overlay .theme-wrap { + clear: both; + position: static; +} +.single-theme .theme-overlay .theme-about { + padding: 30px; + position: static; +} +.single-theme .theme-overlay .theme-actions { + position: static; +} /** * Basic Responsive structure... diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 4e7841d5c1..d1e547a8bb 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -61,6 +61,11 @@ themes.view.Appearance = wp.Backbone.View.extend({ var view, self = this; + // Don't render the search if there is only one theme + if ( themes.data.themes.length === 1 ) { + return; + } + view = new themes.view.Search({ collection: self.collection }); // Render and append after screen title @@ -408,6 +413,22 @@ themes.view.Themes = wp.Backbone.View.extend({ // Clear the DOM, please this.$el.html( '' ); + // If the user doesn't have switch capabilities + // or there is only one theme in the collection + // render the detailed view of the active theme + if ( themes.data.themes.length === 1 ) { + + // Constructs the view + this.singleTheme = new themes.view.Details({ + model: this.collection.models[0] + }); + + // Render and apply a 'single-theme' class to our container + this.singleTheme.render(); + this.$el.addClass( 'single-theme' ); + this.$el.append( this.singleTheme.el ); + } + // Generate the themes // Using page instance this.renderThemes( this.parent.page );