-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-worldwide.php
67 lines (59 loc) · 2.59 KB
/
page-worldwide.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
67
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*/
namespace App;
use App\Http\Controllers\Controller;
use Rareloop\Lumberjack\Http\Responses\TimberResponse;
use Rareloop\Lumberjack\Page;
use Timber\Timber;
class PageWorldwideController extends Controller
{
public function handle()
{
$context = Timber::get_context();
$page = new Page();
$context['content'] = $page->content;
// localise the script only *after* the scripts are queued up
add_action('wp_enqueue_scripts', function () use ($page) {
wp_localize_script('page-worldwide', 'content', [
'title' => $page->meta('heading'),
'content' => $page->meta('introduction'),
'table_view' => __('Table view', 'ocp'),
'map_view' => __('Map view', 'ocp'),
'map' => array(
'filter' => __('Filter Options', 'ocp'),
'close' => __('Close Filter', 'ocp'),
),
'filter' => array(
'all' => __('Active countries', 'ocp'),
'ocds' => __('Using the Open Contracting Data Standard', 'ocp'),
'ocds_status' => __('Status:', 'ocp'),
'ocds_ongoing' => __('Ongoing', 'ocp'),
'ocds_implementation' => __('Implementation', 'ocp'),
'ocds_historic' => __('Historic', 'ocp'),
'commitments' => __('With documented commitments', 'ocp'),
'contract' => __('With innovation in contracting monitoring & data use', 'ocp'),
),
'country' => array(
'ocds' => __('Using the Open Contracting Data Standard', 'ocp'),
'commitments' => __('Documented commitments', 'ocp'),
'contract' => __('Innovation in contract monitoring & data use', 'ocp'),
'impact_stories' => __('Impact Stories', 'ocp'),
'no_data' => __('No data available', 'ocp'),
'improve_data' => __('Improve this data', 'ocp'),
),
'search' => array(
'placeholder' => __('Find Country', 'ocp'),
'no_data' => __('(No data yet)', 'ocp')
)
]);
}, 11);
return new TimberResponse('templates/worldwide.twig', $context);
}
}