forked from oeco/ekuatorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-dataset.php
91 lines (85 loc) · 2.95 KB
/
single-dataset.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
<?php get_header(); ?>
<?php if(have_posts()) : the_post(); ?>
<article class="single-post">
<section id="stage" class="row">
<div class="container">
<div class="twelve columns">
<header class="post-header">
<h2><a href="<?php echo get_post_type_archive_link('dataset'); ?>"><?php _e('Datasets', 'ekuatorial'); ?></a></h2>
<h1 class="title"><?php the_title(); ?></h1>
</header>
</div>
</div>
</section>
<section id="content">
<div class="container row">
<div class="post-content">
<div class="eight columns">
<div class="post-description">
<?php the_content(); ?>
<?php
$preview = get_field('preview_url');
if($preview) :
?>
<div class="preview-container">
<h3><?php _e('Preview data', 'ekuatorial'); ?></h3>
<iframe class="data-preview" src="<?php echo $preview; ?>"></iframe>
</div>
<?php
endif;
?>
</div>
</div>
<div class="four columns">
<?php
$data = get_field('full_download');
if($data) :
?>
<div class="row">
<a href="<?php echo $data; ?>" class="button download"><?php _e('Download this data', 'ekuatorial'); ?></a>
</div>
<?php
endif;
$source_url = get_field('source_url');
if($source_url) :
?>
<div class="row">
<a href="<?php echo $source_url; ?>" class="button download" rel="external" target="_blank"><?php _e('Download from source', 'ekuatorial'); ?></a>
</div>
<?php
endif;
?>
<?php
$license = get_the_terms($post->ID, 'license');
if($license) :
$license = array_shift($license);
?>
<div class="row">
<h3><?php _e('License', 'ekuatorial'); ?></h3>
<p class="license-name"><a target="_blank" href="<?php echo get_field('url', 'license_' . $license->term_id); ?>"><?php echo $license->name; ?></a></p>
<p><a class="small" href="<?php echo get_term_link($license); ?>"><?php _e('More data on this license', 'ekuatorial'); ?></a></p>
</div>
<?php
endif;
?>
<?php
$source = get_the_terms($post->ID, 'source');
if($source) :
$source = array_shift($source);
?>
<div class="row">
<h3><?php _e('Source', 'ekuatorial'); ?></h3>
<p class="source-name"><a target="_blank" href="<?php echo get_field('url', 'source_' . $source->term_id); ?>"><?php echo $source->name; ?></a></p>
<p><a class="small" href="<?php echo get_term_link($source); ?>"><?php _e('More data from this source', 'ekuatorial'); ?></a></p>
</div>
<?php
endif;
?>
</div>
</div>
</div>
</section>
</article>
<?php endif; ?>
<?php get_template_part('section', 'main-widget'); ?>
<?php get_footer(); ?>