-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-languages.php
135 lines (119 loc) · 5.4 KB
/
single-languages.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php get_header();
$language_name = get_field('standard_name');
$alternate_names = get_field('alternate_names');
$nations_of_origin = get_field('nations_of_origin');
$linguistic_genealogy = get_field('linguistic_genealogy');
// $language_description = get_field('language_description');
// $wikipedia_url = get_field('wikipedia_url');
$speakers_recorded = get_field('speakers_recorded');
$lexicon_source = get_field('lexicon_source'); ?>
<div class="wt_single-languages">
<!-- this should be made compatible with the page-intro tempalte -->
<div class="wt_single-languages__intro">
<div class="wt_page-intro wt_page-intro--short">
<div class="wt_single-languages__intro--names">
<h1><?php echo $language_name; ?></h1>
<p><?php echo $alternate_names; ?></p>
</div>
<div class="wt_single-languages__intro--origins">
<!-- can we start this with a/an depending on whether or not the family starts w a vowel? -->
<!-- we also need to thank about when to preceed the country name with "the" -->
<?php if ( $linguistic_genealogy || $nations_of_origin ): ?>
<p><?php
if ( $linguistic_genealogy ) :
if ( $linguistic_genealogy[0] === 'A' ||
$linguistic_genealogy[0] === 'E' ||
$linguistic_genealogy[0] === 'I' ||
$linguistic_genealogy[0] === 'O' ||
$linguistic_genealogy[0] === 'U' ): ?>
<span>An </span>
<?php else: ?>
<span>A </span><?php
endif; ?>
<?php echo $linguistic_genealogy; ?>
<?php endif; ?>
<span>language</span>
<?php if ( $nations_of_origin ): ?>
<span> of </span>
<?php echo $nations_of_origin; ?>
<?php endif; ?>
</p>
<?php endif; ?>
</div>
<!-- Ideally, we'll incorporate the Wikipedia description as a call-to-action for our user group -->
</div>
</div>
<div class="wt_single-languages__content">
<!-- video grid -->
<?php if( $speakers_recorded ): ?>
<h2>Videos</h2>
<p>The following samples were recorded by volunteers from around the world.</p>
<?php foreach( $speakers_recorded as $post ): setup_postdata( $post );
if ( get_field('video_title') ) {
$video_title = get_field('video_title');
} else {
$video_title = get_the_title($post);
}
$video_permalink = get_the_permalink();
$video_thumbnail = get_field('video_thumbnail');
$featured_languages = get_field('featured_languages');
$video_description = get_field('video_description');
$dropbox_link = get_field('dropbox_link');
$youtube_link = get_field('youtube_link');
$wikimedia_commons_link = get_field('wikimedia_commons_link');
$video_license = get_field('video_license');
$license_link = get_field('license_link');
$attribution_statement = get_field('attribution');
include( locate_template('components/video-preview.php') );
endforeach; wp_reset_postdata(); ?>
<div class="wt_single-languages__submit">
<a href="<?php bloginfo('url'); ?>/submit-a-video">Add a video</a>
</div>
<?php else: ?>
<div class="wt_single-languages__no-videos">
<p>We don't have a video for this language yet.</p>
<div class="wt_single-languages__submit">
<a href="<?php bloginfo('url'); ?>/submit-a-video">Add a video</a>
</div>
</div>
<?php endif; ?>
<!-- /video grid -->
<!-- lexicon -->
<h2>Lexicon</h2>
<?php if ( $lexicon_source ): ?>
<p>If you have a dictionary or other vocabulary materials for this language, please write to us at <a href="mailto:[email protected];">[email protected]</a>.</p>
<div class="wt_single-languages__lexicon">
<?php foreach ( $lexicon_source as $post ): setup_postdata( $post );
$lexicon_title = get_the_title($post);
$lexicon_permalink = get_the_permalink();
$source_languages = get_field('source_languages');
$target_languages = get_field('target_languages');
$dropbox_link = get_field('dropbox_link');
$external_link = get_field('external_link');
include( locate_template('components/lexicon-preview.php') );
endforeach; wp_reset_postdata(); ?>
</div><!-- /lexicon wrapper -->
<?php else: ?>
<p>No lexicon yet. If you have a dictionary or other vocabulary materials for this language, please write to us at <a href="mailto:[email protected];">[email protected]</a>.</p>
<?php endif; ?>
<!-- /lexicon -->
</div>
<!-- /content -->
<div class="clear"></div>
<!-- pagination -->
<div class="wt_single-languages__pagination pagination">
<a href="<?php bloginfo('url'); ?>/videos">Explore all videos</a> | <a href="<?php bloginfo('url'); ?>/languages">Explore all languages</a>
</div>
<!-- /pagination -->
<!-- archive donors -->
<?php include( locate_template('components/seedbank-donors.php') ); ?>
<!-- /archive donors -->
<!-- donate module -->
<?php
// $donate_module_header = 'While you\'re here...';
// $donate_module_text = 'To date, Wikitongues has archived 607 languages. Can you help us reach 150 more languages in 2021? <br> <br>On average, it costs $250—just $20.84/month—to safeguard materials in a new language.';
// $donate_module_code = '<script src="https://app.giveforms.com/install-popup-button.js" type="text/javascript" defer></script><link rel="stylesheet" href="https://app.giveforms.com/giveforms_embed.css"/><a class="giveforms-donation-button" href="https://wikitonguesorg.giveforms.com/default-giveform-2" data-multi-step="true">Donate</a>';
// include( locate_template('components/donate-module.php') ); ?>
<!-- /donate module -->
</div>
<?php get_footer(); ?>