silverstripe-framework/admin/templates/Includes/LeftAndMain_SilverStripeNavigator.ss
Ingo Schommer 659634557d Use links for CMS preview states to allow open in new tab
Important to allow users to send around preview links,
open draft versions in new tabs, or find out which URL to
use to preview on mobile phones and other devices which
can't load the CMS preview panel directly.

Removed CSS animations since they complicated the component too much.

Removed input/label setup since its not contained in a form,
so has no relevance as far as server-side state goes.

This does mean there's no longer an indication that only one
state can be active at a given time (which the radio buttons communicated),
but that's no different from e.g. the CMS menu.

Not an API change since the Entwine JS and PHP interfaces stay the same.

Conflicts:
	admin/css/screen.css
2014-11-10 10:40:24 +13:00

46 lines
2.2 KiB
Scheme

<div class="cms-navigator">
<% include LeftAndMain_ViewModeSelector SelectID="preview-mode-dropdown-in-preview" %>
<span id="preview-size-dropdown" class="preview-size-selector preview-selector field dropdown">
<select title="<% _t('SilverStripeNavigator.ViewDeviceWidth', 'Select a preview width') %>" id="preview-size-dropdown-select" class="preview-dropdown dropdown nolabel" autocomplete="off" name="Action">
<option data-icon="icon-auto" data-description="<% _t('SilverStripeNavigator.Responsive', 'Responsive') %>" class="icon-auto icon-view first" value="auto">
<% _t('SilverStripeNavigator.Auto', 'Auto') %>
</option>
<option data-icon="icon-desktop" data-description="1024px <% _t('SilverStripeNavigator.Width', 'width') %>" class="icon-desktop icon-view" value="desktop">
<% _t('SilverStripeNavigator.Desktop', 'Desktop') %>
</option>
<option data-icon="icon-tablet" data-description="800px <% _t('SilverStripeNavigator.Width', 'width') %>" class="icon-tablet icon-view" value="tablet">
<% _t('SilverStripeNavigator.Tablet', 'Tablet') %>
</option>
<option data-icon="icon-mobile" data-description="400px <% _t('SilverStripeNavigator.Width', 'width') %>" class="icon-mobile icon-view last" value="mobile">
<% _t('SilverStripeNavigator.Mobile', 'Mobile') %>
</option>
</select>
</span>
<% if $Items %>
<% if $Items.Count < 5 %>
<div id="preview-states" class="cms-preview-states switch-states size_{$Items.Count}">
<div class="switch">
<% loop $Items %>
<a href="$Link" id="$Title" data-name="$Name" class="state-name $FirstLast<% if $isActive %> active<% end_if %>">
<span>$Title</span>
</a>
<% end_loop %>
</div>
</div>
<% else %>
<span id="preview-state-dropdown" class="cms-preview-states field dropdown">
<select title="<% _t('SilverStripeNavigator.PreviewState', 'Preview State') %>" id="preview-states" class="preview-state dropdown nolabel" autocomplete="off" name="preview-state">
<% loop $Items %>
<option name="$Name" data-name="$Name" data-link="$Link" class="state-name $FirstLast" value="$Link" <% if $isActive %>selected<% end_if %>>
$Title
</option>
<% end_loop %>
</select>
</span>
<% end_if %>
<% end_if %>
</div>