Skip to content

Commit

Permalink
added video dropbox links
Browse files Browse the repository at this point in the history
  • Loading branch information
bogreudell committed Feb 16, 2021
1 parent c9283c4 commit ca08320
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 14 deletions.
245 changes: 245 additions & 0 deletions acf-json/group_5dbe918ed857e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
{
"key": "group_5dbe918ed857e",
"title": "Video Metadata",
"fields": [
{
"key": "field_5de0205e50c4f",
"label": "Video Title",
"name": "video_title",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5dbe91a574803",
"label": "Video Thumbnail",
"name": "video_thumbnail",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5dbe979474804",
"label": "Featured Languages",
"name": "featured_languages",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"languages"
],
"taxonomy": "",
"allow_null": 0,
"multiple": 1,
"return_format": "object",
"ui": 1
},
{
"key": "field_5dbe9891c33d2",
"label": "Video Description",
"name": "video_description",
"type": "textarea",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"maxlength": "",
"rows": "",
"new_lines": ""
},
{
"key": "field_5de81d1501ef1",
"label": "Youtube Publish Date",
"name": "youtube_publish_date",
"type": "number",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"min": "",
"max": "",
"step": ""
},
{
"key": "field_602b00373e14d",
"label": "Dropbox Link",
"name": "dropbox_link",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": ""
},
{
"key": "field_5dbe97f0fe51b",
"label": "YouTube Link",
"name": "youtube_link",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": ""
},
{
"key": "field_5dbe97f8fe51c",
"label": "Wikimedia Commons Link",
"name": "wikimedia_commons_link",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": ""
},
{
"key": "field_5dbe980afe51d",
"label": "Video License",
"name": "video_license",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5dbe9810fe51e",
"label": "License Link",
"name": "license_link",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": ""
},
{
"key": "field_5dbe9824fe51f",
"label": "Attribution",
"name": "attribution",
"type": "textarea",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"maxlength": "",
"rows": "",
"new_lines": ""
},
{
"key": "field_5de5db7fdb1b4",
"label": "Public Status",
"name": "public_status",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "videos"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": "",
"modified": 1613430864
}
26 changes: 16 additions & 10 deletions components/video-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
$video_thumbnail
$featured_languages
$video_description
$dropbox_link
$youtube_link
$wikimedia_commons_link
$video_license
Expand Down Expand Up @@ -37,24 +38,22 @@
</h2>

<!-- show language names -->
<strong class="wt_video-preview__text wt_video-preview__text--header">
<div class="wt_video-preview__text wt_video-preview__text--header">
Featured Languages
</strong>
</div>
<?php if( $featured_languages ): ?>
<p class="wt_video-preview__text wt_video-preview__text--p">
<?php foreach( $featured_languages as $post ):
setup_postdata( $post );

$ISO_code = get_the_title();
$language_name = get_field('standard_name');
$language_url = get_the_permalink(); ?>
<span>
<p class="wt_video-preview__text wt_video-preview__text--p">
<a class="wt_video-preview__link" href="<?php echo $language_url; ?>">
<?php echo $language_name; ?> [<?php echo $ISO_code; ?>]
</a>
</span>
</p>
<?php endforeach; wp_reset_postdata(); ?>
</p>
<?php else: ?>
<p class="wt_video-preview__text wt_video-preview__text--p">
Sorry, languages aren't loading right now.
Expand All @@ -63,15 +62,22 @@
<!-- /show language names -->

<!-- Show distribution links -->
<strong class="wt_video-preview__text wt_video-preview__text--header">
<div class="wt_video-preview__text wt_video-preview__text--header">
Distribution
</strong>
</div>
<?php if ( $public_status == 'Removed' || $public_status == 'Private' ): ?>
<p class="wt_video-preview__text wt_video-preview__text--p">
This video is not publicly available.
</p>
<?php else: ?>
<?php if ( $youtube_link != 'No ID' || $wikimedia_commons_link ): ?>
<?php if ( $dropbox_link ): ?>
<p class="wt_video-preview__text">
<a href="<?php echo $dropbox_link; ?>" class="wt_video-preview__link">
Dropbox
</a>
</p>
<?php endif; ?>
<?php if ( $youtube_link != 'No ID' ): ?>
<p class="wt_video-preview__text wt_video-preview__text--p">
<a class="wt_video-preview__link" href="<?php echo $youtube_link; ?>">
Expand Down Expand Up @@ -101,9 +107,9 @@ class="wt_video-preview__link wt_video-preview__link--inline"
<!-- /Show distribution links -->

<!-- Show Licensing -->
<strong class="wt_video-preview__text wt_video-preview__text--header">
<div class="wt_video-preview__text wt_video-preview__text--header">
Licensing
</strong>
</div>
<p class="wt_video-preview__text wt_video-preview__text--p">
<?php if ( $video_license == 'Standard' ) {
echo 'Protected';
Expand Down
1 change: 1 addition & 0 deletions single-languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
$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');
Expand Down
4 changes: 2 additions & 2 deletions stylus/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2292,10 +2292,10 @@ body.post-type-archive-projects .wt_section:last-of-type {
}
.wt_video-preview__text--header {
font-weight: 700;
margin-bottom: 0;
margin: 15px auto 0;
}
.wt_video-preview__text--p {
margin: 5px 0 15px;
margin: 5px 0;
}
.wt_video-preview__link {
color: #6eb0ff;
Expand Down
4 changes: 2 additions & 2 deletions stylus/require/components/video-preview.styl
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@

&--header
font-weight 700
margin-bottom 0
margin 15px auto 0

&--p
margin 5px 0 15px
margin 5px 0

&__link
color #6eb0ff
Expand Down

0 comments on commit ca08320

Please sign in to comment.