-
Notifications
You must be signed in to change notification settings - Fork 2
/
header.php
66 lines (58 loc) · 2.17 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
namespace Wporg\TranslationEvents\Templates\Translations;
use Wporg\TranslationEvents\Event\Event;
use Wporg\TranslationEvents\Templates;
use Wporg\TranslationEvents\Urls;
/** @var Event $event */
/* translators: %s: Event title. */
gp_title( sprintf( __( 'Translation Events - %s' ), esc_html( $event->title() ) ) );
$breadcrumbs = array( '<a href="' . esc_url( Urls::event_details( $event->id() ) ) . '">' . esc_html( $event->title() ) . '</a>', __( 'Translations', 'glotpress' ), $locale->english_name );
Templates::part( 'breadcrumbs', array( 'extra_items' => $breadcrumbs ) );
gp_enqueue_scripts( array( 'gp-editor', 'gp-translations-page' ) );
wp_localize_script(
'gp-translations-page',
'$gp_translations_options',
array(
'sort' => __( 'Sort', 'glotpress' ),
'filter' => __( 'Filter', 'glotpress' ),
)
);
gp_tmpl_header();
?>
<div class="event-list-top-bar">
<h2 class="event-page-title">
<?php echo esc_html( $event->title() ); ?>
<?php if ( isset( $event ) && 'draft' === $event->status() ) : ?>
<span class="event-label-draft"><?php echo esc_html( $event->status() ); ?></span>
<?php endif; ?>
</h2>
</div>
<div class="event-page-wrapper">
<h4>
<?php
echo esc_html(
sprintf(
// Translators: %s is the locale name.
__( 'Translations to %s', 'glotpress' ),
$locale->english_name
)
);
?>
</h4>
<ul id="translation-links">
<?php foreach ( $translation_sets as $translation_set ) : ?>
<li id="translations_link_<?php echo esc_attr( $translation_set->translation_set_id ); ?>"><a href="#translations_<?php echo esc_attr( $translation_set->translation_set_id ); ?>"><?php echo esc_html( gp_project_names_from_root( $projects[ $translation_set->translation_set_id ] ) ); ?></a></li>
<?php endforeach; ?>
</ul>
<?php
if ( trim( $status, '/' ) !== 'waiting' ) {
?>
<a href="<?php echo esc_url( Urls::event_translations( $event->id(), $locale->slug, 'waiting' ) ); ?>"><?php esc_html_e( 'Show only waiting translations', 'glotpress' ); ?></a>
<?php
} else {
?>
<a href="<?php echo esc_url( Urls::event_translations( $event->id(), $locale->slug ) ); ?>"><?php esc_html_e( 'Show all contributed translations', 'glotpress' ); ?></a>
<?php
}
?>
<hr>