wp/wp-admin/includes/revision.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
   376 		<div class="revisions-next">
   376 		<div class="revisions-next">
   377 			<input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
   377 			<input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
   378 		</div>
   378 		</div>
   379 	</script>
   379 	</script>
   380 
   380 
       
   381 	<script id="tmpl-revisions-slider-hidden-help" type="text/html">
       
   382 		<h2 class="screen-reader-text"><?php esc_html_e( 'Select a revision' ); ?></h2>
       
   383 		<p id="revisions-slider-hidden-help" hidden><?php esc_html_e( 'Change revision by using the left and right arrow keys' ); ?></p>
       
   384 	</script>
       
   385 
   381 	<script id="tmpl-revisions-checkbox" type="text/html">
   386 	<script id="tmpl-revisions-checkbox" type="text/html">
   382 		<div class="revision-toggle-compare-mode">
   387 		<div class="revision-toggle-compare-mode">
   383 			<label>
   388 			<label>
   384 				<input type="checkbox" class="compare-two-revisions"
   389 				<input type="checkbox" class="compare-two-revisions"
   385 				<#
   390 				<#
   395 
   400 
   396 	<script id="tmpl-revisions-meta" type="text/html">
   401 	<script id="tmpl-revisions-meta" type="text/html">
   397 		<# if ( ! _.isUndefined( data.attributes ) ) { #>
   402 		<# if ( ! _.isUndefined( data.attributes ) ) { #>
   398 			<div class="diff-title">
   403 			<div class="diff-title">
   399 				<# if ( 'from' === data.type ) { #>
   404 				<# if ( 'from' === data.type ) { #>
   400 					<strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
   405 					<strong id="diff-title-from"><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
   401 				<# } else if ( 'to' === data.type ) { #>
   406 				<# } else if ( 'to' === data.type ) { #>
   402 					<strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
   407 					<strong id="diff-title-to"><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
   403 				<# } #>
   408 				<# } #>
   404 				<div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
   409 				<div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
   405 					{{{ data.attributes.author.avatar }}}
   410 					<div>
   406 					<div class="author-info">
   411 						{{{ data.attributes.author.avatar }}}
   407 					<# if ( data.attributes.autosave ) { #>
   412 						<div class="author-info" id="diff-title-author">
   408 						<span class="byline">
   413 						<# if ( data.attributes.autosave ) { #>
   409 						<?php
   414 							<span class="byline">
   410 						printf(
   415 							<?php
   411 							/* translators: %s: User's display name. */
   416 							printf(
   412 							__( 'Autosave by %s' ),
   417 								/* translators: %s: User's display name. */
   413 							'<span class="author-name">{{ data.attributes.author.name }}</span>'
   418 								__( 'Autosave by %s' ),
   414 						);
   419 								'<span class="author-name">{{ data.attributes.author.name }}</span>'
   415 						?>
   420 							);
   416 							</span>
   421 							?>
   417 					<# } else if ( data.attributes.current ) { #>
   422 								</span>
   418 						<span class="byline">
   423 						<# } else if ( data.attributes.current ) { #>
   419 						<?php
   424 							<span class="byline">
   420 						printf(
   425 							<?php
   421 							/* translators: %s: User's display name. */
   426 							printf(
   422 							__( 'Current Revision by %s' ),
   427 								/* translators: %s: User's display name. */
   423 							'<span class="author-name">{{ data.attributes.author.name }}</span>'
   428 								__( 'Current Revision by %s' ),
   424 						);
   429 								'<span class="author-name">{{ data.attributes.author.name }}</span>'
   425 						?>
   430 							);
   426 							</span>
   431 							?>
   427 					<# } else { #>
   432 								</span>
   428 						<span class="byline">
   433 						<# } else { #>
   429 						<?php
   434 							<span class="byline">
   430 						printf(
   435 							<?php
   431 							/* translators: %s: User's display name. */
   436 							printf(
   432 							__( 'Revision by %s' ),
   437 								/* translators: %s: User's display name. */
   433 							'<span class="author-name">{{ data.attributes.author.name }}</span>'
   438 								__( 'Revision by %s' ),
   434 						);
   439 								'<span class="author-name">{{ data.attributes.author.name }}</span>'
   435 						?>
   440 							);
   436 							</span>
   441 							?>
   437 					<# } #>
   442 								</span>
   438 						<span class="time-ago">{{ data.attributes.timeAgo }}</span>
   443 						<# } #>
   439 						<span class="date">({{ data.attributes.dateShort }})</span>
   444 							<span class="time-ago">{{ data.attributes.timeAgo }}</span>
       
   445 							<span class="date">({{ data.attributes.dateShort }})</span>
       
   446 						</div>
   440 					</div>
   447 					</div>
   441 				<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
   448 				<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
   442 					<input  <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
   449 					<input  <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
   443 						disabled="disabled"
   450 						disabled="disabled"
   444 					<?php } else { ?>
   451 					<?php } else { ?>
   459 	<# } #>
   466 	<# } #>
   460 	</script>
   467 	</script>
   461 
   468 
   462 	<script id="tmpl-revisions-diff" type="text/html">
   469 	<script id="tmpl-revisions-diff" type="text/html">
   463 		<div class="loading-indicator"><span class="spinner"></span></div>
   470 		<div class="loading-indicator"><span class="spinner"></span></div>
   464 		<div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
   471 		<div class="diff-error"><?php _e( 'An error occurred while loading the comparison. Please refresh the page and try again.' ); ?></div>
   465 		<div class="diff">
   472 		<div class="diff">
   466 		<# _.each( data.fields, function( field ) { #>
   473 		<# _.each( data.fields, function( field ) { #>
   467 			<h3>{{ field.name }}</h3>
   474 			<h2>{{ field.name }}</h2>
   468 			{{{ field.diff }}}
   475 			{{{ field.diff }}}
   469 		<# }); #>
   476 		<# }); #>
   470 		</div>
   477 		</div>
   471 	</script>
   478 	</script>
   472 	<?php
   479 	<?php